1 Linux Standard Base Specification 2.0 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 67 II. Base Libraries 68 69 6. Libraries 70 71 Program Interpreter 72 Interfaces for libc 73 Data Definitions for libc 74 Interface Definitions for libc 75 Interfaces for libm 76 Data Definitions for libm 77 Interfaces for libpthread 78 Data Definitions for libpthread 79 Interface Definitions for libpthread 80 Interfaces for libgcc_s 81 Data Definitions for libgcc_s 82 Interfaces for libdl 83 Data Definitions for libdl 84 Interface Definitions for libdl 85 Interfaces for libcrypt 86 Interfaces for libpam 87 Data Definitions for libpam 88 Interface Definitions for libpam 89 90 III. Utility Libraries 91 92 7. Libraries 93 94 Interfaces for libz 95 Data Definitions for libz 96 Interfaces for libncurses 97 Data Definitions for libncurses 98 Interfaces for libutil 99 Interface Definitions for libutil 100 101 IV. Commands and Utilities 102 103 8. Commands and Utilities 104 105 Commands and Utilities 106 Command Behavior 107 108 V. Execution Environment 109 110 9. File System Hierarchy 111 112 /dev 113 114 10. Additional Recommendations 115 116 Minimal granted Directory and File permissions 117 Recommendations for applications on ownership and permissions 118 119 11. Additional Behaviors 120 121 Mandatory Optional Behaviors 122 123 12. Localization 124 125 Regular Expressions 126 Filename Globbing 127 128 VI. System Initialization 129 130 13. System Initialization 131 132 Cron Jobs 133 Init Script Actions 134 Comment Conventions for Init Scripts 135 Installation and Removal of init.d Files 136 Run Levels 137 Facility Names 138 Script Names 139 Init Script Functions 140 141 VII. Users & Groups 142 143 14. Users & Groups 144 145 User and Group Database 146 User & Group Names 147 UID Ranges 148 Rationale 149 150 List of Tables 151 2-1. Normative References 152 3-1. Standard Library Names 153 3-2. Standard Library Names defined in the Architecture Specific Supplement 154 6-1. libc Definition 155 6-2. libc - RPC Function Interfaces 156 6-3. libc - System Calls Function Interfaces 157 6-4. libc - Standard I/O Function Interfaces 158 6-5. libc - Standard I/O Data Interfaces 159 6-6. libc - Signal Handling Function Interfaces 160 6-7. libc - Signal Handling Data Interfaces 161 6-8. libc - Localization Functions Function Interfaces 162 6-9. libc - Localization Functions Data Interfaces 163 6-10. libc - Socket Interface Function Interfaces 164 6-11. libc - Socket Interface Deprecated Function Interfaces 165 6-12. libc - Wide Characters Function Interfaces 166 6-13. libc - String Functions Function Interfaces 167 6-14. libc - IPC Functions Function Interfaces 168 6-15. libc - Regular Expressions Function Interfaces 169 6-16. libc - Regular Expressions Deprecated Function Interfaces 170 6-17. libc - Regular Expressions Deprecated Data Interfaces 171 6-18. libc - Character Type Functions Function Interfaces 172 6-19. libc - Time Manipulation Function Interfaces 173 6-20. libc - Time Manipulation Deprecated Function Interfaces 174 6-21. libc - Time Manipulation Data Interfaces 175 6-22. libc - Terminal Interface Functions Function Interfaces 176 6-23. libc - System Database Interface Function Interfaces 177 6-24. libc - Language Support Function Interfaces 178 6-25. libc - Large File Support Function Interfaces 179 6-26. libc - Standard Library Function Interfaces 180 6-27. libc - Standard Library Data Interfaces 181 6-28. libm Definition 182 6-29. libm - Math Function Interfaces 183 6-30. libm - Math Data Interfaces 184 6-31. libpthread Definition 185 6-32. libpthread - Posix Threads Function Interfaces 186 6-33. libgcc_s Definition 187 6-34. libdl Definition 188 6-35. libdl - Dynamic Loader Function Interfaces 189 6-36. libcrypt Definition 190 6-37. libcrypt - Encryption Function Interfaces 191 6-38. libpam Definition 192 6-39. libpam - Pluggable Authentication API Function Interfaces 193 7-1. libz Definition 194 7-2. libz - Compression Library Function Interfaces 195 7-3. libncurses Definition 196 7-4. libncurses - Curses Function Interfaces 197 7-5. libncurses - Curses Data Interfaces 198 7-6. libutil Definition 199 7-7. libutil - Utility Functions Function Interfaces 200 8-1. Commands and Utilities 201 14-1. Required User & Group Names 202 14-2. Optional User & Group Names 203 204 ------------------------------------------------------------------------------- 205 206 Foreword 207 208 This is version 2.0 of the Linux Standard Base Specification. An implementation 209 of this version of the specification may not claim to be an implementation of 210 the Linux Standard Base unless it has successfully completed the compliance 211 process as defined by the Free Standards Group. 212 213 ------------------------------------------------------------------------------- 214 215 Introduction 216 217 The LSB defines a binary interface for application programs that are compiled 218 and packaged for LSB-conforming implementations on many different hardware 219 architectures. Since a binary specification shall include information specific 220 to the computer processor architecture for which it is intended, it is not 221 possible for a single document to specify the interface for all possible 222 LSB-conforming implementations. Therefore, the LSB is a family of 223 specifications, rather than a single one. 224 225 This document should be used in conjunction with the documents it references. 226 This document enumerates the system components it includes, but descriptions of 227 those components may be included entirely or partly in this document, partly in 228 other documents, or entirely in other reference documents. For example, the 229 section that describes system service routines includes a list of the system 230 routines supported in this interface, formal declarations of the data 231 structures they use that are visible to applications, and a pointer to the 232 underlying referenced specification for information about the syntax and 233 semantics of each call. Only those routines not described in standards 234 referenced by this document, or extensions to those standards, are described in 235 the detail. Information referenced in this way is as much a part of this 236 document as is the information explicitly included here. 237 238 I. Introductory Elements 239 240 Table of Contents 241 1. Scope 242 2. Normative References 243 3. Requirements 244 4. Definitions 245 5. Terminology 246 247 ------------------------------------------------------------------------------- 248 249 Chapter 1. Scope 250 251 General 252 253 The Linux Standard Base (LSB) defines a system interface for compiled 254 applications and a minimal environment for support of installation scripts. Its 255 purpose is to enable a uniform industry standard environment for high-volume 256 applications conforming to the LSB. 257 258 These specifications are composed of two basic parts: A common specification 259 ("LSB-generic") describing those parts of the interface that remain constant 260 across all implementations of the LSB, and an architecture-specific 261 specification ("LSB-arch") describing the parts of the interface that vary by 262 processor architecture. Together, the LSB-generic and the architecture-specific 263 supplement for a single hardware architecture provide a complete interface 264 specification for compiled application programs on systems that share a common 265 hardware architecture. 266 267 The LSB-generic document shall be used in conjunction with an 268 architecture-specific supplement. Whenever a section of the LSB-generic 269 specification shall be supplemented by architecture-specific information, the 270 LSB-generic document includes a reference to the architecture supplement. 271 Architecture supplements may also contain additional information that is not 272 referenced in the LSB-generic document. 273 274 The LSB contains both a set of Application Program Interfaces (APIs) and 275 Application Binary Interfaces (ABIs). APIs may appear in the source code of 276 portable applications, while the compiled binary of that application may use 277 the larger set of ABIs. A conforming implementation shall provide all of the 278 ABIs listed here. The compilation system may replace (e.g. by macro definition) 279 certain APIs with calls to one or more of the underlying binary interfaces, and 280 may insert calls to binary interfaces as needed. 281 282 The LSB is primarily a binary interface definition. Not all of the source level 283 APIs available to applications may be contained in this specification. 284 285 ------------------------------------------------------------------------------- 286 287 Module Specific Scope 288 289 This is the Core module of the Linux Standards Base (LSB). This module provides 290 the fundemental system interfaces, libraries, and runtime environment upon 291 which all conforming applications and libraries depend. 292 293 Interfaces described in this module are mandatory except where explicitly 294 listed otherwise. Core interfaces may be supplemented by other modules; all 295 modules are built upon the core. 296 297 ------------------------------------------------------------------------------- 298 299 Chapter 2. Normative References 300 301 The specifications listed below are referenced in whole or in part by the Linux 302 Standard Base. In this specification, where only a particular section of one of 303 these references is identified, then the normative reference is to that section 304 alone, and the rest of the referenced document is informative. 305 306 Table 2-1. Normative References 307 308 +-----------------------------------------------------------------------------+ 309 |System V Application Binary Interface - DRAFT - |http://www.caldera.com/ | 310 |17 December 2003 |developers/gabi/2003-12-17/ | 311 | |contents.html | 312 |------------------------------------------------+----------------------------| 313 |DWARF Debugging Information Format, Revision |http://www.eagercon.com/ | 314 |2.0.0 (July 27, 1993) |dwarf/dwarf-2.0.0.pdf | 315 |------------------------------------------------+----------------------------| 316 |Filesystem Hierarchy Standard (FHS) 2.3 |http://www.pathname.com/fhs/| 317 |------------------------------------------------+----------------------------| 318 |IEEE Standard 754 for Binary Floating-Point |http://www.ieee.org/ | 319 |Arithmetic | | 320 |------------------------------------------------+----------------------------| 321 |System V Application Binary Interface, Edition |http://www.caldera.com/ | 322 |4.1 |developers/devspecs/ | 323 | |gabi41.pdf | 324 |------------------------------------------------+----------------------------| 325 |ISO/IEC 9899: 1999, Programming Languages --C | | 326 |------------------------------------------------+----------------------------| 327 |Linux Assigned Names And Numbers Authority |http://www.lanana.org/ | 328 |------------------------------------------------+----------------------------| 329 | |http://www.UNIX-systems.org/| 330 |Large File Support |version2/whatsnew/ | 331 | |lfs20mar.html | 332 |------------------------------------------------+----------------------------| 333 |LI18NUX 2000 Globalization Specification, |http://www.li18nux.org/docs/| 334 |Version 1.0 with Amendment 4 |html/LI18NUX-2000-amd4.htm | 335 |------------------------------------------------+----------------------------| 336 |Linux Standard Base |http://www.linuxbase.org/ | 337 | |spec/ | 338 |------------------------------------------------+----------------------------| 339 | |http://www.opengroup.org/ | 340 |OSF-RFC 86.0 |tech/rfc/mirror-rfc/ | 341 | |rfc86.0.txt | 342 |------------------------------------------------+----------------------------| 343 |RFC 1833: Binding Protocols for ONC RPC Version |http://www.ietf.org/rfc/ | 344 |2 |rfc1833.txt | 345 |------------------------------------------------+----------------------------| 346 |RFC 1952: GZIP file format specification version|http://www.ietf.org/rfc/ | 347 |4.3 |rfc1952.txt | 348 |------------------------------------------------+----------------------------| 349 |RFC 2440: OpenPGP Message Format |http://www.ietf.org/rfc/ | 350 | |rfc2440.txt | 351 |------------------------------------------------+----------------------------| 352 |CAE Specification, May 1996, X/Open Curses, |http://www.opengroup.org/ | 353 |Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), |publications/catalog/un.htm | 354 |plus Corrigendum U018 | | 355 |------------------------------------------------+----------------------------| 356 |The Single UNIX Specification(SUS) Version 2, |http://www.opengroup.org/ | 357 |Commands and Utilities (XCU), Issue 5 (ISBN: |publications/catalog/un.htm | 358 |1-85912-191-8, C604) | | 359 |------------------------------------------------+----------------------------| 360 |CAE Specification, January 1997, System |http://www.opengroup.org/ | 361 |Interfaces and Headers (XSH),Issue 5 (ISBN: |publications/catalog/un.htm | 362 |1-85912-181-0, C606) | | 363 |------------------------------------------------+----------------------------| 364 |ISO/IEC 9945:2003 Portable Operating System |http://www.unix.org/version3| 365 |(POSIX)and The Single UNIX Specification(SUS) |/ | 366 |V3 | | 367 |------------------------------------------------+----------------------------| 368 |System V Interface Definition, Issue 3 (ISBN | | 369 |0201566524) | | 370 |------------------------------------------------+----------------------------| 371 |System V Interface Definition,Fourth Edition | | 372 |------------------------------------------------+----------------------------| 373 |zlib 1.2 Manual |http://www.gzip.org/zlib/ | 374 +-----------------------------------------------------------------------------+ 375 ------------------------------------------------------------------------------- 376 377 Chapter 3. Requirements 378 379 Relevant Libraries 380 381 The libraries listed in Table 3-1 shall be available on a Linux Standard Base 382 system, with the specified runtime names. The libraries listed in Table 3-2 are 383 architecture specific, but shall be available on all LSB conforming systems. 384 This list may be supplemented or amended by the architecture-specific 385 specification. 386 387 Table 3-1. Standard Library Names 388 389 +---------------------------+ 390 | Library | Runtime Name | 391 |----------+----------------| 392 |libdl |libdl.so.2 | 393 |----------+----------------| 394 |libcrypt |libcrypt.so.1 | 395 |----------+----------------| 396 |libz |libz.so.1 | 397 |----------+----------------| 398 |libncurses|libncurses.so.5 | 399 |----------+----------------| 400 |libutil |libutil.so.1 | 401 |----------+----------------| 402 |libpthread|libpthread.so.0 | 403 |----------+----------------| 404 |libpam |libpam.so.0 | 405 |----------+----------------| 406 |libgcc_s |libgcc_s.so.1 | 407 +---------------------------+ 408 409 Table 3-2. Standard Library Names defined in the Architecture Specific 410 Supplement 411 412 +------------------------+ 413 | Library |Runtime Name | 414 |----------+-------------| 415 |libm |See archLSB | 416 |----------+-------------| 417 |libc |See archLSB | 418 |----------+-------------| 419 |proginterp|See archLSB | 420 +------------------------+ 421 422 These libraries will be in an implementation-defined directory which the 423 dynamic linker shall search by default. 424 425 ------------------------------------------------------------------------------- 426 427 LSB Implementation Conformance 428 429 An implementation shall satisfy the following requirements: 430 431 * The implementation shall implement fully the architecture described in the 432 hardware manual for the target processor architecture. 433 434 * The implementation shall be capable of executing compiled applications 435 having the format and using the system interfaces described in this 436 document. 437 438 * The implementation shall provide libraries containing the interfaces 439 specified by this document, and shall provide a dynamic linking mechanism 440 that allows these interfaces to be attached to applications at runtime. All 441 the interfaces shall behave as specified in this document. 442 443 * The map of virtual memory provided by the implementation shall conform to 444 the requirements of this document. 445 446 * The implementation's low-level behavior with respect to function call 447 linkage, system traps, signals, and other such activities shall conform to 448 the formats described in this document. 449 450 * The implementation shall provide all of the mandatory interfaces in their 451 entirety. 452 453 * The implementation may provide one or more of the optional interfaces. Each 454 optional interface that is provided shall be provided in its entirety. The 455 product documentation shall state which optional interfaces are provided. 456 457 * The implementation shall provide all files and utilities specified as part 458 of this document in the format defined here and in other referenced 459 documents. All commands and utilities shall behave as required by this 460 document. The implementation shall also provide all mandatory components of 461 an application's runtime environment that are included or referenced in 462 this document. 463 464 * The implementation, when provided with standard data formats and values at 465 a named interface, shall provide the behavior defined for those values and 466 data formats at that interface. However, a conforming implementation may 467 consist of components which are separately packaged and/or sold. For 468 example, a vendor of a conforming implementation might sell the hardware, 469 operating system, and windowing system as separately packaged items. 470 471 * The implementation may provide additional interfaces with different names. 472 It may also provide additional behavior corresponding to data values 473 outside the standard ranges, for standard named interfaces. 474 475 476 477 ------------------------------------------------------------------------------- 478 479 LSB Application Conformance 480 481 An application shall satisfy the following requirements: 482 483 484 485 * Its executable files are either shell scripts or object files in the format 486 defined for the Object File Format system interface. 487 488 * Its object files participate in dynamic linking as defined in the Program 489 Loading and Linking System interface. 490 491 * It employs only the instructions, traps, and other low-level facilities 492 defined in the Low-Level System interface as being for use by applications. 493 494 * If it requires any optional interface defined in this document in order to 495 be installed or to execute successfully, the requirement for that optional 496 interface is stated in the application's documentation. 497 498 * It does not use any interface or data format that is not required to be 499 provided by a conforming implementation, unless: 500 501 + If such an interface or data format is supplied by another application 502 through direct invocation of that application during execution, that 503 application is in turn an LSB conforming application. 504 505 + The use of that interface or data format, as well as its source, is 506 identified in the documentation of the application. 507 508 * It shall not use any values for a named interface that are reserved for 509 vendor extensions. 510 511 A strictly conforming application does not require or use any interface, 512 facility, or implementation-defined extension that is not defined in this 513 document in order to be installed or to execute successfully. 514 515 ------------------------------------------------------------------------------- 516 517 Chapter 4. Definitions 518 519 For the purposes of this document, the following definitions, as specified in 520 the ISO/IEC Directives, Part 2, 2001, 4th Edition, apply: 521 522 can 523 524 be able to; there is a possibility of; it is possible to 525 526 cannot 527 528 be unable to; there is no possibilty of; it is not possible to 529 530 may 531 532 is permitted; is allowed; is permissible 533 534 need not 535 536 it is not required that; no...is required 537 538 shall 539 540 is to; is required to; it is required that; has to; only...is permitted; it 541 is necessary 542 543 shall not 544 545 is not allowed [permitted] [acceptable] [permissible]; is required to be 546 not; is required that...be not; is not to be 547 548 should 549 550 it is recommended that; ought to 551 552 should not 553 554 it is not recommended that; ought not to 555 556 ------------------------------------------------------------------------------- 557 558 Chapter 5. Terminology 559 560 For the purposes of this document, the following terms apply: 561 562 archLSB 563 564 The architectural part of the LSB Specification which describes the 565 specific parts of the interface that are platform specific. The archLSB is 566 complementary to the gLSB. 567 568 Binary Standard 569 570 The total set of interfaces that are available to be used in the compiled 571 binary code of a conforming application. 572 573 gLSB 574 575 The common part of the LSB Specification that describes those parts of the 576 interface that remain constant across all hardware implementations of the 577 LSB. 578 579 implementation-defined 580 581 Describes a value or behavior that is not defined by this document but is 582 selected by an implementor. The value or behavior may vary among 583 implementations that conform to this document. An application should not 584 rely on the existence of the value or behavior. An application that relies 585 on such a value or behavior cannot be assured to be portable across 586 conforming implementations. The implementor shall document such a value or 587 behavior so that it can be used correctly by an application. 588 589 Shell Script 590 591 A file that is read by an interpreter (e.g., awk). The first line of the 592 shell script includes a reference to its interpreter binary. 593 594 Source Standard 595 596 The set of interfaces that are available to be used in the source code of a 597 conforming application. 598 599 undefined 600 601 Describes the nature of a value or behavior not defined by this document 602 which results from use of an invalid program construct or invalid data 603 input. The value or behavior may vary among implementations that conform to 604 this document. An application should not rely on the existence or validity 605 of the value or behavior. An application that relies on any particular 606 value or behavior cannot be assured to be portable across conforming 607 implementations. 608 609 unspecified 610 611 Describes the nature of a value or behavior not specified by this document 612 which results from use of a valid program construct or valid data input. 613 The value or behavior may vary among implementations that conform to this 614 document. An application should not rely on the existence or validity of 615 the value or behavior. An application that relies on any particular value 616 or behavior cannot be assured to be portable across conforming 617 implementations. 618 619 II. Base Libraries 620 621 Table of Contents 622 6. Libraries 623 624 ------------------------------------------------------------------------------- 625 626 Chapter 6. Libraries 627 628 An LSB-conforming implementation shall support some base libraries which 629 provide interfaces for accessing the operating system, processor and other 630 hardware in the system. 631 632 ------------------------------------------------------------------------------- 633 634 Program Interpreter 635 636 The Program Interpreter is specified in the appropriate architecture-specific 637 LSB specification. 638 639 ------------------------------------------------------------------------------- 640 641 Interfaces for libc 642 643 Table 6-1 defines the library name and shared object name for the libc library 644 645 Table 6-1. libc Definition 646 647 +----------------------+ 648 |Library:|libc | 649 |--------+-------------| 650 |SONAME: |See archLSB. | 651 +----------------------+ 652 653 The behavior of the interfaces in this library is specified by the following 654 specifications: 655 656 Large File Support 657 Linux Standard Base 658 CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 5 659 (ISBN: 1-85912-181-0, C606) 660 ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 661 Specification(SUS) V3 662 System V Interface Definition, Issue 3 (ISBN 0201566524) 663 System V Interface Definition,Fourth Edition 664 665 ------------------------------------------------------------------------------- 666 667 RPC 668 669 ------------------------------------------------------------------------------- 670 671 Interfaces for RPC 672 673 An LSB conforming implementation shall provide the generic functions for RPC 674 specified in Table 6-2, with the full functionality as described in the 675 referenced underlying specification. 676 677 Table 6-2. libc - RPC Function Interfaces 678 679 +----------------------------------------------------------------------------------------+ 680 |authnone_create |pmap_unset [2] |svcerr_weakauth |xdr_float [3] |xdr_u_char [3]| 681 |[1] | |[3] | | | 682 |------------------+----------------+------------------+------------------+--------------| 683 |clnt_create [1] |setdomainname |svctcp_create [2] |xdr_free [3] |xdr_u_int [2] | 684 | |[2] | | | | 685 |------------------+----------------+------------------+------------------+--------------| 686 |clnt_pcreateerror |svc_getreqset |svcudp_create [2] |xdr_int [3] |xdr_u_long [3]| 687 |[1] |[3] | | | | 688 |------------------+----------------+------------------+------------------+--------------| 689 |clnt_perrno [1] |svc_register [2]|xdr_accepted_reply|xdr_long [3] |xdr_u_short | 690 | | |[3] | |[3] | 691 |------------------+----------------+------------------+------------------+--------------| 692 |clnt_perror [1] |svc_run [2] |xdr_array [3] |xdr_opaque [3] |xdr_union [3] | 693 |------------------+----------------+------------------+------------------+--------------| 694 |clnt_spcreateerror|svc_sendreply |xdr_bool [3] |xdr_opaque_auth |xdr_vector [3]| 695 |[1] |[2] | |[3] | | 696 |------------------+----------------+------------------+------------------+--------------| 697 |clnt_sperrno [1] |svcerr_auth [3] |xdr_bytes [3] |xdr_pointer [3] |xdr_void [3] | 698 |------------------+----------------+------------------+------------------+--------------| 699 |clnt_sperror [1] |svcerr_decode |xdr_callhdr [3] |xdr_reference [3] |xdr_wrapstring| 700 | |[3] | | |[3] | 701 |------------------+----------------+------------------+------------------+--------------| 702 |getdomainname [2] |svcerr_noproc |xdr_callmsg [3] |xdr_rejected_reply|xdrmem_create | 703 | |[3] | |[3] |[3] | 704 |------------------+----------------+------------------+------------------+--------------| 705 |key_decryptsession|svcerr_noprog |xdr_char [3] |xdr_replymsg [3] |xdrrec_create | 706 |[3] |[3] | | |[3] | 707 |------------------+----------------+------------------+------------------+--------------| 708 |pmap_getport [2] |svcerr_progvers |xdr_double [3] |xdr_short [3] |xdrrec_eof [3]| 709 | |[3] | | | | 710 |------------------+----------------+------------------+------------------+--------------| 711 |pmap_set [2] |svcerr_systemerr|xdr_enum [3] |xdr_string [3] | | 712 | |[3] | | | | 713 +----------------------------------------------------------------------------------------+ 714 715 Referenced Specification(s) 716 717 [1]. System V Interface Definition,Fourth Edition 718 719 [2]. Linux Standard Base 720 721 [3]. System V Interface Definition, Issue 3 (ISBN 0201566524) 722 723 ------------------------------------------------------------------------------- 724 725 System Calls 726 727 ------------------------------------------------------------------------------- 728 729 Interfaces for System Calls 730 731 An LSB conforming implementation shall provide the generic functions for System 732 Calls specified in Table 6-3, with the full functionality as described in the 733 referenced underlying specification. 734 735 Table 6-3. libc - System Calls Function Interfaces 736 737 +-----------------------------------------------------------------------------+ 738 |__fxstat [1]|fchmod [2] |getwd [2] |read [2] |setrlimit [2]| 739 |------------+-------------+------------+-----------------------+-------------| 740 |__getpgid |fchown [2] |initgroups |readdir [2] |setrlimit64 | 741 |[1] | |[1] | |[3] | 742 |------------+-------------+------------+-----------------------+-------------| 743 |__lxstat [1]|fcntl [1] |ioctl [1] |readdir_r [2] |setsid [2] | 744 |------------+-------------+------------+-----------------------+-------------| 745 |__xmknod [1]|fdatasync [2]|kill [1] |readlink [2] |setuid [2] | 746 |------------+-------------+------------+-----------------------+-------------| 747 |__xstat [1] |flock [1] |killpg [2] |readv [2] |sleep [2] | 748 |------------+-------------+------------+-----------------------+-------------| 749 |access [2] |fork [2] |lchown [2] |rename [2] |statvfs [2] | 750 |------------+-------------+------------+-----------------------+-------------| 751 |acct [1] |fstatvfs [2] |link [2] |rmdir [2] |stime [1] | 752 |------------+-------------+------------+-----------------------+-------------| 753 |alarm [2] |fsync [2] |lockf [2] |sbrk [4] |symlink [2] | 754 |------------+-------------+------------+-----------------------+-------------| 755 |brk [4] |ftime [2] |lseek [2] |sched_get_priority_max |sync [2] | 756 | | | |[2] | | 757 |------------+-------------+------------+-----------------------+-------------| 758 |chdir [2] |ftruncate [2]|mkdir [2] |sched_get_priority_min |sysconf [2] | 759 | | | |[2] | | 760 |------------+-------------+------------+-----------------------+-------------| 761 |chmod [2] |getcontext |mkfifo [2] |sched_getparam [2] |time [2] | 762 | |[2] | | | | 763 |------------+-------------+------------+-----------------------+-------------| 764 |chown [2] |getegid [2] |mlock [2] |sched_getscheduler [2] |times [2] | 765 |------------+-------------+------------+-----------------------+-------------| 766 |chroot [4] |geteuid [2] |mlockall [2]|sched_rr_get_interval |truncate [2] | 767 | | | |[2] | | 768 |------------+-------------+------------+-----------------------+-------------| 769 |clock [2] |getgid [2] |mmap [2] |sched_setparam [2] |ulimit [2] | 770 |------------+-------------+------------+-----------------------+-------------| 771 |close [2] |getgroups [2]|mprotect [2]|sched_setscheduler [2] |umask [2] | 772 |------------+-------------+------------+-----------------------+-------------| 773 |closedir [2]|getitimer [2]|msync [2] |sched_yield [2] |uname [2] | 774 |------------+-------------+------------+-----------------------+-------------| 775 |creat [1] |getloadavg |munlock [2] |select [2] |unlink [1] | 776 | |[1] | | | | 777 |------------+-------------+------------+-----------------------+-------------| 778 |dup [2] |getpagesize |munlockall |setcontext [2] |utime [2] | 779 | |[4] |[2] | | | 780 |------------+-------------+------------+-----------------------+-------------| 781 |dup2 [2] |getpgid [2] |munmap [2] |setegid [2] |utimes [2] | 782 |------------+-------------+------------+-----------------------+-------------| 783 |execl [2] |getpgrp [2] |nanosleep |seteuid [2] |vfork [2] | 784 | | |[2] | | | 785 |------------+-------------+------------+-----------------------+-------------| 786 |execle [2] |getpid [2] |nice [2] |setgid [2] |wait [2] | 787 |------------+-------------+------------+-----------------------+-------------| 788 |execlp [2] |getppid [2] |open [1] |setitimer [2] |wait3 [1] | 789 |------------+-------------+------------+-----------------------+-------------| 790 |execv [2] |getpriority |opendir [2] |setpgid [2] |wait4 [1] | 791 | |[2] | | | | 792 |------------+-------------+------------+-----------------------+-------------| 793 |execve [2] |getrlimit [2]|pathconf [2]|setpgrp [2] |waitpid [1] | 794 |------------+-------------+------------+-----------------------+-------------| 795 |execvp [2] |getrusage [2]|pause [2] |setpriority [2] |write [2] | 796 |------------+-------------+------------+-----------------------+-------------| 797 |exit [2] |getsid [2] |pipe [2] |setregid [2] |writev [2] | 798 |------------+-------------+------------+-----------------------+-------------| 799 |fchdir [2] |getuid [2] |poll [2] |setreuid [2] | | 800 +-----------------------------------------------------------------------------+ 801 802 Referenced Specification(s) 803 804 [1]. Linux Standard Base 805 806 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 807 Specification(SUS) V3 808 809 [3]. Large File Support 810 811 [4]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 812 5 (ISBN: 1-85912-181-0, C606) 813 814 ------------------------------------------------------------------------------- 815 816 Standard I/O 817 818 ------------------------------------------------------------------------------- 819 820 Interfaces for Standard I/O 821 822 An LSB conforming implementation shall provide the generic functions for 823 Standard I/O specified in Table 6-4, with the full functionality as described 824 in the referenced underlying specification. 825 826 Table 6-4. libc - Standard I/O Function Interfaces 827 828 +-----------------------------------------------------------------------------+ 829 |_IO_feof [1] |fgetpos [2] |fsetpos [2] |putchar [2] |sscanf [2] | 830 |---------------+---------------+----------------+----------------+-----------| 831 |_IO_getc [1] |fgets [2] |ftell [2] |putchar_unlocked|telldir [2]| 832 | | | |[2] | | 833 |---------------+---------------+----------------+----------------+-----------| 834 |_IO_putc [1] |fgetwc_unlocked|ftello [2] |puts [2] |tempnam [2]| 835 | |[1] | | | | 836 |---------------+---------------+----------------+----------------+-----------| 837 |_IO_puts [1] |fileno [2] |fwrite [2] |putw [3] |ungetc [2] | 838 |---------------+---------------+----------------+----------------+-----------| 839 |asprintf [1] |flockfile [2] |getc [2] |remove [2] |vasprintf | 840 | | | | |[1] | 841 |---------------+---------------+----------------+----------------+-----------| 842 |clearerr [2] |fopen [1] |getc_unlocked |rewind [2] |vdprintf | 843 | | |[2] | |[1] | 844 |---------------+---------------+----------------+----------------+-----------| 845 |ctermid [2] |fprintf [2] |getchar [2] |rewinddir [2] |vfprintf | 846 | | | | |[2] | 847 |---------------+---------------+----------------+----------------+-----------| 848 |fclose [2] |fputc [2] |getchar_unlocked|scanf [2] |vprintf [2]| 849 | | |[2] | | | 850 |---------------+---------------+----------------+----------------+-----------| 851 |fdopen [2] |fputs [2] |getw [3] |seekdir [2] |vsnprintf | 852 | | | | |[2] | 853 |---------------+---------------+----------------+----------------+-----------| 854 |feof [2] |fread [2] |pclose [2] |setbuf [2] |vsprintf | 855 | | | | |[2] | 856 |---------------+---------------+----------------+----------------+-----------| 857 |ferror [2] |freopen [1] |popen [2] |setbuffer [1] | | 858 |---------------+---------------+----------------+----------------+-----------| 859 |fflush [2] |fscanf [2] |printf [2] |setvbuf [2] | | 860 |---------------+---------------+----------------+----------------+-----------| 861 |fflush_unlocked|fseek [2] |putc [2] |snprintf [2] | | 862 |[1] | | | | | 863 |---------------+---------------+----------------+----------------+-----------| 864 |fgetc [2] |fseeko [2] |putc_unlocked |sprintf [2] | | 865 | | |[2] | | | 866 +-----------------------------------------------------------------------------+ 867 868 Referenced Specification(s) 869 870 [1]. Linux Standard Base 871 872 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 873 Specification(SUS) V3 874 875 [3]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 876 5 (ISBN: 1-85912-181-0, C606) 877 878 An LSB conforming implementation shall provide the generic data interfaces for 879 Standard I/O specified in Table 6-5, with the full functionality as described 880 in the referenced underlying specification. 881 882 Table 6-5. libc - Standard I/O Data Interfaces 883 884 +-----------------------------------+ 885 |stderr [1]|stdin [1]|stdout [1]| | | 886 +-----------------------------------+ 887 888 Referenced Specification(s) 889 890 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 891 Specification(SUS) V3 892 893 ------------------------------------------------------------------------------- 894 895 Signal Handling 896 897 ------------------------------------------------------------------------------- 898 899 Interfaces for Signal Handling 900 901 An LSB conforming implementation shall provide the generic functions for Signal 902 Handling specified in Table 6-6, with the full functionality as described in 903 the referenced underlying specification. 904 905 Table 6-6. libc - Signal Handling Function Interfaces 906 907 +-----------------------------------------------------------------------------+ 908 |__libc_current_sigrtmax|sigaddset |sighold [2] |sigpause [2]|sigsuspend | 909 |[1] |[2] | | |[2] | 910 |-----------------------+------------+-------------+------------+-------------| 911 |__libc_current_sigrtmin|sigaltstack |sigignore [2]|sigpending |sigtimedwait | 912 |[1] |[2] | |[2] |[2] | 913 |-----------------------+------------+-------------+------------+-------------| 914 |__sigsetjmp [1] |sigandset |siginterrupt |sigprocmask |sigwait [2] | 915 | |[1] |[2] |[2] | | 916 |-----------------------+------------+-------------+------------+-------------| 917 |__sysv_signal [1] |sigblock [1]|sigisemptyset|sigqueue [2]|sigwaitinfo | 918 | | |[1] | |[2] | 919 |-----------------------+------------+-------------+------------+-------------| 920 |bsd_signal [2] |sigdelset |sigismember |sigrelse [2]| | 921 | |[2] |[2] | | | 922 |-----------------------+------------+-------------+------------+-------------| 923 |psignal [1] |sigemptyset |siglongjmp |sigreturn | | 924 | |[2] |[2] |[1] | | 925 |-----------------------+------------+-------------+------------+-------------| 926 |raise [2] |sigfillset |signal [2] |sigset [2] | | 927 | |[2] | | | | 928 |-----------------------+------------+-------------+------------+-------------| 929 |sigaction [2] |siggetmask |sigorset [1] |sigstack [3]| | 930 | |[1] | | | | 931 +-----------------------------------------------------------------------------+ 932 933 Referenced Specification(s) 934 935 [1]. Linux Standard Base 936 937 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 938 Specification(SUS) V3 939 940 [3]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 941 5 (ISBN: 1-85912-181-0, C606) 942 943 An LSB conforming implementation shall provide the generic data interfaces for 944 Signal Handling specified in Table 6-7, with the full functionality as 945 described in the referenced underlying specification. 946 947 Table 6-7. libc - Signal Handling Data Interfaces 948 949 +-------------------------+ 950 |_sys_siglist [1] | | | | | 951 +-------------------------+ 952 953 Referenced Specification(s) 954 955 [1]. Linux Standard Base 956 957 ------------------------------------------------------------------------------- 958 959 Localization Functions 960 961 ------------------------------------------------------------------------------- 962 963 Interfaces for Localization Functions 964 965 An LSB conforming implementation shall provide the generic functions for 966 Localization Functions specified in Table 6-8, with the full functionality as 967 described in the referenced underlying specification. 968 969 Table 6-8. libc - Localization Functions Function Interfaces 970 971 +-----------------------------------------------------------------------------+ 972 |bind_textdomain_codeset|catopen [2] |dngettext [1]|iconv_open |setlocale | 973 |[1] | | |[2] |[2] | 974 |-----------------------+------------+-------------+-------------+------------| 975 |bindtextdomain [1] |dcgettext |gettext [1] |localeconv |textdomain | 976 | |[1] | |[2] |[1] | 977 |-----------------------+------------+-------------+-------------+------------| 978 |catclose [2] |dcngettext |iconv [2] |ngettext [1] | | 979 | |[1] | | | | 980 |-----------------------+------------+-------------+-------------+------------| 981 |catgets [2] |dgettext [1]|iconv_close |nl_langinfo | | 982 | | |[2] |[2] | | 983 +-----------------------------------------------------------------------------+ 984 985 Referenced Specification(s) 986 987 [1]. Linux Standard Base 988 989 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 990 Specification(SUS) V3 991 992 An LSB conforming implementation shall provide the generic data interfaces for 993 Localization Functions specified in Table 6-9, with the full functionality as 994 described in the referenced underlying specification. 995 996 Table 6-9. libc - Localization Functions Data Interfaces 997 998 +-----------------------------+ 999 |_nl_msg_cat_cntr [1] | | | | | 1000 +-----------------------------+ 1001 1002 Referenced Specification(s) 1003 1004 [1]. Linux Standard Base 1005 1006 ------------------------------------------------------------------------------- 1007 1008 Socket Interface 1009 1010 ------------------------------------------------------------------------------- 1011 1012 Interfaces for Socket Interface 1013 1014 An LSB conforming implementation shall provide the generic functions for Socket 1015 Interface specified in Table 6-10, with the full functionality as described in 1016 the referenced underlying specification. 1017 1018 Table 6-10. libc - Socket Interface Function Interfaces 1019 1020 +-----------------------------------------------------------------------------+ 1021 |__h_errno_location |gethostid [2] |listen [2] |sendmsg [2] |socketpair | 1022 |[1] | | | |[2] | 1023 |---------------------+--------------+------------+-------------+-------------| 1024 |accept [2] |gethostname |recv [2] |sendto [2] | | 1025 | |[2] | | | | 1026 |---------------------+--------------+------------+-------------+-------------| 1027 |bind [2] |getpeername |recvfrom [2]|setsockopt | | 1028 | |[2] | |[1] | | 1029 |---------------------+--------------+------------+-------------+-------------| 1030 |bindresvport [1] |getsockname |recvmsg [2] |shutdown [2] | | 1031 | |[2] | | | | 1032 |---------------------+--------------+------------+-------------+-------------| 1033 |connect [2] |getsockopt [2]|send [2] |socket [2] | | 1034 +-----------------------------------------------------------------------------+ 1035 1036 Referenced Specification(s) 1037 1038 [1]. Linux Standard Base 1039 1040 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1041 Specification(SUS) V3 1042 1043 An LSB conforming implementation shall provide the generic deprecated functions 1044 for Socket Interface specified in Table 6-11, with the full functionality as 1045 described in the referenced underlying specification. 1046 1047 Note: These interfaces are deprecated, and applications should avoid using 1048 them. These interfaces may be withdrawn in future releases of this 1049 specification. 1050 1051 Table 6-11. libc - Socket Interface Deprecated Function Interfaces 1052 1053 +----------------------------+ 1054 |gethostbyname_r [1] | | | | | 1055 +----------------------------+ 1056 1057 Referenced Specification(s) 1058 1059 [1]. Linux Standard Base 1060 1061 ------------------------------------------------------------------------------- 1062 1063 Wide Characters 1064 1065 ------------------------------------------------------------------------------- 1066 1067 Interfaces for Wide Characters 1068 1069 An LSB conforming implementation shall provide the generic functions for Wide 1070 Characters specified in Table 6-12, with the full functionality as described in 1071 the referenced underlying specification. 1072 1073 Table 6-12. libc - Wide Characters Function Interfaces 1074 1075 +-----------------------------------------------------------------------------+ 1076 |__wcstod_internal [1]|mbsinit [2] |vwscanf [2] |wcsnlen [1] |wcstoumax | 1077 | | | | |[2] | 1078 |---------------------+-------------+--------------+-------------+------------| 1079 |__wcstof_internal [1]|mbsnrtowcs |wcpcpy [1] |wcsnrtombs |wcstouq [1] | 1080 | |[1] | |[1] | | 1081 |---------------------+-------------+--------------+-------------+------------| 1082 |__wcstol_internal [1]|mbsrtowcs [2]|wcpncpy [1] |wcspbrk [2] |wcswcs [2] | 1083 |---------------------+-------------+--------------+-------------+------------| 1084 |__wcstold_internal |mbstowcs [2] |wcrtomb [2] |wcsrchr [2] |wcswidth [2]| 1085 |[1] | | | | | 1086 |---------------------+-------------+--------------+-------------+------------| 1087 |__wcstoul_internal |mbtowc [2] |wcscasecmp [1]|wcsrtombs [2]|wcsxfrm [2] | 1088 |[1] | | | | | 1089 |---------------------+-------------+--------------+-------------+------------| 1090 |btowc [2] |putwc [2] |wcscat [2] |wcsspn [2] |wctob [2] | 1091 |---------------------+-------------+--------------+-------------+------------| 1092 |fgetwc [2] |putwchar [2] |wcschr [2] |wcsstr [2] |wctomb [2] | 1093 |---------------------+-------------+--------------+-------------+------------| 1094 |fgetws [2] |swprintf [2] |wcscmp [2] |wcstod [2] |wctrans [2] | 1095 |---------------------+-------------+--------------+-------------+------------| 1096 |fputwc [2] |swscanf [2] |wcscoll [2] |wcstof [2] |wctype [2] | 1097 |---------------------+-------------+--------------+-------------+------------| 1098 |fputws [2] |towctrans [2]|wcscpy [2] |wcstoimax [2]|wcwidth [2] | 1099 |---------------------+-------------+--------------+-------------+------------| 1100 |fwide [2] |towlower [2] |wcscspn [2] |wcstok [2] |wmemchr [2] | 1101 |---------------------+-------------+--------------+-------------+------------| 1102 |fwprintf [2] |towupper [2] |wcsdup [1] |wcstol [2] |wmemcmp [2] | 1103 |---------------------+-------------+--------------+-------------+------------| 1104 |fwscanf [2] |ungetwc [2] |wcsftime [2] |wcstold [2] |wmemcpy [2] | 1105 |---------------------+-------------+--------------+-------------+------------| 1106 |getwc [2] |vfwprintf [2]|wcslen [2] |wcstoll [2] |wmemmove [2]| 1107 |---------------------+-------------+--------------+-------------+------------| 1108 |getwchar [2] |vfwscanf [2] |wcsncasecmp |wcstombs [2] |wmemset [2] | 1109 | | |[1] | | | 1110 |---------------------+-------------+--------------+-------------+------------| 1111 |mblen [2] |vswprintf [2]|wcsncat [2] |wcstoq [1] |wprintf [2] | 1112 |---------------------+-------------+--------------+-------------+------------| 1113 |mbrlen [2] |vswscanf [2] |wcsncmp [2] |wcstoul [2] |wscanf [2] | 1114 |---------------------+-------------+--------------+-------------+------------| 1115 |mbrtowc [2] |vwprintf [2] |wcsncpy [2] |wcstoull [2] | | 1116 +-----------------------------------------------------------------------------+ 1117 1118 Referenced Specification(s) 1119 1120 [1]. Linux Standard Base 1121 1122 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1123 Specification(SUS) V3 1124 1125 ------------------------------------------------------------------------------- 1126 1127 String Functions 1128 1129 ------------------------------------------------------------------------------- 1130 1131 Interfaces for String Functions 1132 1133 An LSB conforming implementation shall provide the generic functions for String 1134 Functions specified in Table 6-13, with the full functionality as described in 1135 the referenced underlying specification. 1136 1137 Table 6-13. libc - String Functions Function Interfaces 1138 1139 +-----------------------------------------------------------------------------+ 1140 |__mempcpy [1] |bzero [2] |strcasestr |strncasecmp |strtoimax [2]| 1141 | | |[1] |[2] | | 1142 |---------------------+-------------+-------------+-------------+-------------| 1143 |__rawmemchr [1] |ffs [2] |strcat [2] |strncat [2] |strtok [2] | 1144 |---------------------+-------------+-------------+-------------+-------------| 1145 |__stpcpy [1] |index [2] |strchr [2] |strncmp [2] |strtok_r [1] | 1146 |---------------------+-------------+-------------+-------------+-------------| 1147 |__strdup [1] |memccpy [2] |strcmp [2] |strncpy [2] |strtold [2] | 1148 |---------------------+-------------+-------------+-------------+-------------| 1149 |__strtod_internal [1]|memchr [2] |strcoll [2] |strndup [1] |strtoll [2] | 1150 |---------------------+-------------+-------------+-------------+-------------| 1151 |__strtof_internal [1]|memcmp [2] |strcpy [2] |strnlen [1] |strtoq [1] | 1152 |---------------------+-------------+-------------+-------------+-------------| 1153 |__strtok_r [1] |memcpy [2] |strcspn [2] |strpbrk [2] |strtoull [2] | 1154 |---------------------+-------------+-------------+-------------+-------------| 1155 |__strtol_internal [1]|memmove [2] |strdup [2] |strptime [1] |strtoumax [2]| 1156 |---------------------+-------------+-------------+-------------+-------------| 1157 |__strtold_internal |memrchr [1] |strerror [2] |strrchr [2] |strtouq [1] | 1158 |[1] | | | | | 1159 |---------------------+-------------+-------------+-------------+-------------| 1160 |__strtoll_internal |memset [2] |strerror_r |strsep [1] |strverscmp | 1161 |[1] | |[1] | |[1] | 1162 |---------------------+-------------+-------------+-------------+-------------| 1163 |__strtoul_internal |rindex [2] |strfmon [2] |strsignal [1]|strxfrm [2] | 1164 |[1] | | | | | 1165 |---------------------+-------------+-------------+-------------+-------------| 1166 |__strtoull_internal |stpcpy [1] |strfry [1] |strspn [2] |swab [2] | 1167 |[1] | | | | | 1168 |---------------------+-------------+-------------+-------------+-------------| 1169 |bcmp [2] |stpncpy [1] |strftime [2] |strstr [2] | | 1170 |---------------------+-------------+-------------+-------------+-------------| 1171 |bcopy [2] |strcasecmp |strlen [2] |strtof [2] | | 1172 | |[2] | | | | 1173 +-----------------------------------------------------------------------------+ 1174 1175 Referenced Specification(s) 1176 1177 [1]. Linux Standard Base 1178 1179 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1180 Specification(SUS) V3 1181 1182 ------------------------------------------------------------------------------- 1183 1184 IPC Functions 1185 1186 ------------------------------------------------------------------------------- 1187 1188 Interfaces for IPC Functions 1189 1190 An LSB conforming implementation shall provide the generic functions for IPC 1191 Functions specified in Table 6-14, with the full functionality as described in 1192 the referenced underlying specification. 1193 1194 Table 6-14. libc - IPC Functions Function Interfaces 1195 1196 +---------------------------------------------+ 1197 |ftok [1] |msgrcv [1]|semget [1]|shmctl [1]| | 1198 |----------+----------+----------+----------+-| 1199 |msgctl [1]|msgsnd [1]|semop [1] |shmdt [1] | | 1200 |----------+----------+----------+----------+-| 1201 |msgget [1]|semctl [1]|shmat [1] |shmget [1]| | 1202 +---------------------------------------------+ 1203 1204 Referenced Specification(s) 1205 1206 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1207 Specification(SUS) V3 1208 1209 ------------------------------------------------------------------------------- 1210 1211 Regular Expressions 1212 1213 ------------------------------------------------------------------------------- 1214 1215 Interfaces for Regular Expressions 1216 1217 An LSB conforming implementation shall provide the generic functions for 1218 Regular Expressions specified in Table 6-15, with the full functionality as 1219 described in the referenced underlying specification. 1220 1221 Table 6-15. libc - Regular Expressions Function Interfaces 1222 1223 +--------------------------------------------------+ 1224 |regcomp [1]|regerror [1]|regexec [1]|regfree [1]| | 1225 +--------------------------------------------------+ 1226 1227 Referenced Specification(s) 1228 1229 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1230 Specification(SUS) V3 1231 1232 An LSB conforming implementation shall provide the generic deprecated functions 1233 for Regular Expressions specified in Table 6-16, with the full functionality as 1234 described in the referenced underlying specification. 1235 1236 Note: These interfaces are deprecated, and applications should avoid using 1237 them. These interfaces may be withdrawn in future releases of this 1238 specification. 1239 1240 Table 6-16. libc - Regular Expressions Deprecated Function Interfaces 1241 1242 +----------------------------------------------+ 1243 |advance [1]|re_comp [1]|re_exec [1]|step [1]| | 1244 +----------------------------------------------+ 1245 1246 Referenced Specification(s) 1247 1248 [1]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 1249 5 (ISBN: 1-85912-181-0, C606) 1250 1251 An LSB conforming implementation shall provide the generic deprecated data 1252 interfaces for Regular Expressions specified in Table 6-17, with the full 1253 functionality as described in the referenced underlying specification. 1254 1255 Note: These interfaces are deprecated, and applications should avoid using 1256 them. These interfaces may be withdrawn in future releases of this 1257 specification. 1258 1259 Table 6-17. libc - Regular Expressions Deprecated Data Interfaces 1260 1261 +------------------------------+ 1262 |loc1 [1]|loc2 [1]|locs [1]| | | 1263 +------------------------------+ 1264 1265 Referenced Specification(s) 1266 1267 [1]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 1268 5 (ISBN: 1-85912-181-0, C606) 1269 1270 ------------------------------------------------------------------------------- 1271 1272 Character Type Functions 1273 1274 ------------------------------------------------------------------------------- 1275 1276 Interfaces for Character Type Functions 1277 1278 An LSB conforming implementation shall provide the generic functions for 1279 Character Type Functions specified in Table 6-18, with the full functionality 1280 as described in the referenced underlying specification. 1281 1282 Table 6-18. libc - Character Type Functions Function Interfaces 1283 1284 +-----------------------------------------------------------------------------+ 1285 |__ctype_b_loc(GLIBC_2.3) [1] |isalpha |ispunct [2]|iswctype |iswupper | 1286 | |[2] | |[1] |[2] | 1287 |------------------------------+----------+-----------+-----------+-----------| 1288 |__ctype_get_mb_cur_max [1] |isascii |isspace [2]|iswdigit |iswxdigit | 1289 | |[2] | |[2] |[2] | 1290 |------------------------------+----------+-----------+-----------+-----------| 1291 |__ctype_tolower_loc(GLIBC_2.3)|iscntrl |isupper [2]|iswgraph |isxdigit | 1292 |[1] |[2] | |[2] |[2] | 1293 |------------------------------+----------+-----------+-----------+-----------| 1294 |__ctype_toupper_loc(GLIBC_2.3)|isdigit |iswalnum |iswlower |toascii [2]| 1295 |[1] |[2] |[2] |[2] | | 1296 |------------------------------+----------+-----------+-----------+-----------| 1297 |_tolower [2] |isgraph |iswalpha |iswprint |tolower [2]| 1298 | |[2] |[2] |[2] | | 1299 |------------------------------+----------+-----------+-----------+-----------| 1300 |_toupper [2] |islower |iswblank |iswpunct |toupper [2]| 1301 | |[2] |[2] |[2] | | 1302 |------------------------------+----------+-----------+-----------+-----------| 1303 |isalnum [2] |isprint |iswcntrl |iswspace | | 1304 | |[2] |[2] |[2] | | 1305 +-----------------------------------------------------------------------------+ 1306 1307 Referenced Specification(s) 1308 1309 [1]. Linux Standard Base 1310 1311 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1312 Specification(SUS) V3 1313 1314 ------------------------------------------------------------------------------- 1315 1316 Time Manipulation 1317 1318 ------------------------------------------------------------------------------- 1319 1320 Interfaces for Time Manipulation 1321 1322 An LSB conforming implementation shall provide the generic functions for Time 1323 Manipulation specified in Table 6-19, with the full functionality as described 1324 in the referenced underlying specification. 1325 1326 Table 6-19. libc - Time Manipulation Function Interfaces 1327 1328 +-------------------------------------------------------------------+ 1329 |adjtime [1] |ctime [2] |gmtime [2] |localtime_r [2]|ualarm [2]| 1330 |-------------+------------+-------------+---------------+----------| 1331 |asctime [2] |ctime_r [2] |gmtime_r [2] |mktime [2] | | 1332 |-------------+------------+-------------+---------------+----------| 1333 |asctime_r [2]|difftime [2]|localtime [2]|tzset [2] | | 1334 +-------------------------------------------------------------------+ 1335 1336 Referenced Specification(s) 1337 1338 [1]. Linux Standard Base 1339 1340 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1341 Specification(SUS) V3 1342 1343 An LSB conforming implementation shall provide the generic deprecated functions 1344 for Time Manipulation specified in Table 6-20, with the full functionality as 1345 described in the referenced underlying specification. 1346 1347 Note: These interfaces are deprecated, and applications should avoid using 1348 them. These interfaces may be withdrawn in future releases of this 1349 specification. 1350 1351 Table 6-20. libc - Time Manipulation Deprecated Function Interfaces 1352 1353 +---------------------+ 1354 |adjtimex [1] | | | | | 1355 +---------------------+ 1356 1357 Referenced Specification(s) 1358 1359 [1]. Linux Standard Base 1360 1361 An LSB conforming implementation shall provide the generic data interfaces for 1362 Time Manipulation specified in Table 6-21, with the full functionality as 1363 described in the referenced underlying specification. 1364 1365 Table 6-21. libc - Time Manipulation Data Interfaces 1366 1367 +--------------------------------------------+ 1368 |__daylight [1]|__tzname [1]|timezone [2]| | | 1369 |--------------+------------+------------+-+-| 1370 |__timezone [1]|daylight [2]|tzname [2] | | | 1371 +--------------------------------------------+ 1372 1373 Referenced Specification(s) 1374 1375 [1]. Linux Standard Base 1376 1377 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1378 Specification(SUS) V3 1379 1380 ------------------------------------------------------------------------------- 1381 1382 Terminal Interface Functions 1383 1384 ------------------------------------------------------------------------------- 1385 1386 Interfaces for Terminal Interface Functions 1387 1388 An LSB conforming implementation shall provide the generic functions for 1389 Terminal Interface Functions specified in Table 6-22, with the full 1390 functionality as described in the referenced underlying specification. 1391 1392 Table 6-22. libc - Terminal Interface Functions Function Interfaces 1393 1394 +-------------------------------------------------------------------------+ 1395 |cfgetispeed [1]|cfsetispeed [1]|tcdrain [1]|tcgetattr [1]|tcsendbreak [1]| 1396 |---------------+---------------+-----------+-------------+---------------| 1397 |cfgetospeed [1]|cfsetospeed [1]|tcflow [1] |tcgetpgrp [1]|tcsetattr [1] | 1398 |---------------+---------------+-----------+-------------+---------------| 1399 |cfmakeraw [2] |cfsetspeed [2] |tcflush [1]|tcgetsid [1] |tcsetpgrp [1] | 1400 +-------------------------------------------------------------------------+ 1401 1402 Referenced Specification(s) 1403 1404 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1405 Specification(SUS) V3 1406 1407 [2]. Linux Standard Base 1408 1409 ------------------------------------------------------------------------------- 1410 1411 System Database Interface 1412 1413 ------------------------------------------------------------------------------- 1414 1415 Interfaces for System Database Interface 1416 1417 An LSB conforming implementation shall provide the generic functions for System 1418 Database Interface specified in Table 6-23, with the full functionality as 1419 described in the referenced underlying specification. 1420 1421 Table 6-23. libc - System Database Interface Function Interfaces 1422 1423 +-----------------------------------------------------------------------------+ 1424 |endgrent [1] |getgrgid [1] |getprotobynumber |getservbyport |setgrent [1] | 1425 | | |[1] |[1] | | 1426 |-------------+---------------+-----------------+---------------+-------------| 1427 |endnetent [1]|getgrgid_r [1] |getprotoent [1] |getservent [1] |setgroups [2]| 1428 |-------------+---------------+-----------------+---------------+-------------| 1429 |endprotoent |getgrnam [1] |getpwent [1] |getutent [2] |setnetent [1]| 1430 |[1] | | | | | 1431 |-------------+---------------+-----------------+---------------+-------------| 1432 |endpwent [1] |getgrnam_r [1] |getpwnam [1] |getutent_r [2] |setprotoent | 1433 | | | | |[1] | 1434 |-------------+---------------+-----------------+---------------+-------------| 1435 |endservent |gethostbyaddr |getpwnam_r [1] |getutxent [1] |setpwent [1] | 1436 |[1] |[1] | | | | 1437 |-------------+---------------+-----------------+---------------+-------------| 1438 |endutent [3] |gethostbyname |getpwuid [1] |getutxid [1] |setservent | 1439 | |[1] | | |[1] | 1440 |-------------+---------------+-----------------+---------------+-------------| 1441 |endutxent [1]|getnetbyaddr |getpwuid_r [1] |getutxline [1] |setutent [2] | 1442 | |[1] | | | | 1443 |-------------+---------------+-----------------+---------------+-------------| 1444 |getgrent [1] |getprotobyname |getservbyname [1]|pututxline [1] |setutxent [1]| 1445 | |[1] | | | | 1446 +-----------------------------------------------------------------------------+ 1447 1448 Referenced Specification(s) 1449 1450 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1451 Specification(SUS) V3 1452 1453 [2]. Linux Standard Base 1454 1455 [3]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 1456 5 (ISBN: 1-85912-181-0, C606) 1457 1458 ------------------------------------------------------------------------------- 1459 1460 Language Support 1461 1462 ------------------------------------------------------------------------------- 1463 1464 Interfaces for Language Support 1465 1466 An LSB conforming implementation shall provide the generic functions for 1467 Language Support specified in Table 6-24, with the full functionality as 1468 described in the referenced underlying specification. 1469 1470 Table 6-24. libc - Language Support Function Interfaces 1471 1472 +---------------------------------------------------------------------------------+ 1473 |__libc_start_main|__register_atfork|_obstack_begin|_obstack_newchunk|obstack_free| 1474 |[1] |(GLIBC_2.3.2) [1]|[1] |[1] |[1] | 1475 +---------------------------------------------------------------------------------+ 1476 1477 Referenced Specification(s) 1478 1479 [1]. Linux Standard Base 1480 1481 ------------------------------------------------------------------------------- 1482 1483 Large File Support 1484 1485 ------------------------------------------------------------------------------- 1486 1487 Interfaces for Large File Support 1488 1489 An LSB conforming implementation shall provide the generic functions for Large 1490 File Support specified in Table 6-25, with the full functionality as described 1491 in the referenced underlying specification. 1492 1493 Table 6-25. libc - Large File Support Function Interfaces 1494 1495 +--------------------------------------------------------------------------+ 1496 |__fxstat64 [1]|fopen64 [2] |ftello64 [2] |lseek64 [2] |readdir64 [2] | 1497 |--------------+--------------+---------------+-------------+--------------| 1498 |__lxstat64 [1]|freopen64 [2] |ftruncate64 [2]|mkstemp64 [2]|statvfs64 [2] | 1499 |--------------+--------------+---------------+-------------+--------------| 1500 |__xstat64 [1] |fseeko64 [2] |ftw64 [2] |mmap64 [2] |tmpfile64 [2] | 1501 |--------------+--------------+---------------+-------------+--------------| 1502 |creat64 [2] |fsetpos64 [2] |getrlimit64 [2]|nftw64 [2] |truncate64 [2]| 1503 |--------------+--------------+---------------+-------------+--------------| 1504 |fgetpos64 [2] |fstatvfs64 [2]|lockf64 [2] |open64 [2] | | 1505 +--------------------------------------------------------------------------+ 1506 1507 Referenced Specification(s) 1508 1509 [1]. Linux Standard Base 1510 1511 [2]. Large File Support 1512 1513 ------------------------------------------------------------------------------- 1514 1515 Standard Library 1516 1517 ------------------------------------------------------------------------------- 1518 1519 Interfaces for Standard Library 1520 1521 An LSB conforming implementation shall provide the generic functions for 1522 Standard Library specified in Table 6-26, with the full functionality as 1523 described in the referenced underlying specification. 1524 1525 Table 6-26. libc - Standard Library Function Interfaces 1526 1527 +-----------------------------------------------------------------------------+ 1528 |_Exit [1] |dirname [1] |glob [1] |lsearch [1] |srand [1] | 1529 |-----------------+-----------------+------------+---------------+------------| 1530 |__assert_fail [2]|div [1] |glob64 [2] |makecontext [1]|srand48 [1] | 1531 |-----------------+-----------------+------------+---------------+------------| 1532 |__cxa_atexit [2] |drand48 [1] |globfree [1]|malloc [1] |srandom [1] | 1533 |-----------------+-----------------+------------+---------------+------------| 1534 |__errno_location |ecvt [1] |globfree64 |memmem [2] |strtod [1] | 1535 |[2] | |[2] | | | 1536 |-----------------+-----------------+------------+---------------+------------| 1537 |__fpending [2] |erand48 [1] |grantpt [1] |mkstemp [1] |strtol [1] | 1538 |-----------------+-----------------+------------+---------------+------------| 1539 |__getpagesize [2]|err [2] |hcreate [1] |mktemp [1] |strtoul [1] | 1540 |-----------------+-----------------+------------+---------------+------------| 1541 |__isinf [2] |error [2] |hdestroy [1]|mrand48 [1] |swapcontext | 1542 | | | | |[1] | 1543 |-----------------+-----------------+------------+---------------+------------| 1544 |__isinff [2] |errx [2] |hsearch [1] |nftw [1] |syslog [1] | 1545 |-----------------+-----------------+------------+---------------+------------| 1546 |__isinfl [2] |fcvt [1] |htonl [1] |nrand48 [1] |system [2] | 1547 |-----------------+-----------------+------------+---------------+------------| 1548 |__isnan [2] |fmtmsg [1] |htons [1] |ntohl [1] |tdelete [1] | 1549 |-----------------+-----------------+------------+---------------+------------| 1550 |__isnanf [2] |fnmatch [1] |imaxabs [1] |ntohs [1] |tfind [1] | 1551 |-----------------+-----------------+------------+---------------+------------| 1552 |__isnanl [2] |fpathconf [1] |imaxdiv [1] |openlog [1] |tmpfile [1] | 1553 |-----------------+-----------------+------------+---------------+------------| 1554 |__sysconf [2] |free [1] |inet_addr |perror [1] |tmpnam [1] | 1555 | | |[1] | | | 1556 |-----------------+-----------------+------------+---------------+------------| 1557 |_exit [1] |freeaddrinfo [1] |inet_ntoa |posix_memalign |tsearch [1] | 1558 | | |[1] |[1] | | 1559 |-----------------+-----------------+------------+---------------+------------| 1560 |_longjmp [1] |ftrylockfile [1] |inet_ntop |ptsname [1] |ttyname [1] | 1561 | | |[1] | | | 1562 |-----------------+-----------------+------------+---------------+------------| 1563 |_setjmp [1] |ftw [1] |inet_pton |putenv [1] |ttyname_r | 1564 | | |[1] | |[1] | 1565 |-----------------+-----------------+------------+---------------+------------| 1566 |a64l [1] |funlockfile [1] |initstate |qsort [1] |twalk [1] | 1567 | | |[1] | | | 1568 |-----------------+-----------------+------------+---------------+------------| 1569 |abort [1] |gai_strerror [1] |insque [1] |rand [1] |unlockpt [1]| 1570 |-----------------+-----------------+------------+---------------+------------| 1571 |abs [1] |gcvt [1] |isatty [1] |rand_r [1] |unsetenv [1]| 1572 |-----------------+-----------------+------------+---------------+------------| 1573 |atof [1] |getaddrinfo [1] |isblank [1] |random [1] |usleep [1] | 1574 |-----------------+-----------------+------------+---------------+------------| 1575 |atoi [1] |getcwd [1] |jrand48 [1] |random_r [2] |verrx [2] | 1576 |-----------------+-----------------+------------+---------------+------------| 1577 |atol [1] |getdate [1] |l64a [1] |realloc [1] |vfscanf [1] | 1578 |-----------------+-----------------+------------+---------------+------------| 1579 |atoll [1] |getenv [1] |labs [1] |realpath [1] |vscanf [1] | 1580 |-----------------+-----------------+------------+---------------+------------| 1581 |basename [1] |getlogin [1] |lcong48 [1] |remque [1] |vsscanf [1] | 1582 |-----------------+-----------------+------------+---------------+------------| 1583 |bsearch [1] |getnameinfo [1] |ldiv [1] |seed48 [1] |vsyslog [2] | 1584 |-----------------+-----------------+------------+---------------+------------| 1585 |calloc [1] |getopt [2] |lfind [1] |setenv [1] |warn [2] | 1586 |-----------------+-----------------+------------+---------------+------------| 1587 |closelog [1] |getopt_long [2] |llabs [1] |sethostid [2] |warnx [2] | 1588 |-----------------+-----------------+------------+---------------+------------| 1589 |confstr [1] |getopt_long_only |lldiv [1] |sethostname [2]|wordexp [1] | 1590 | |[2] | | | | 1591 |-----------------+-----------------+------------+---------------+------------| 1592 |cuserid [3] |getsubopt [1] |longjmp [1] |setlogmask [1] |wordfree [1]| 1593 |-----------------+-----------------+------------+---------------+------------| 1594 |daemon [2] |gettimeofday [1] |lrand48 [1] |setstate [1] | | 1595 +-----------------------------------------------------------------------------+ 1596 1597 Referenced Specification(s) 1598 1599 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1600 Specification(SUS) V3 1601 1602 [2]. Linux Standard Base 1603 1604 [3]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 1605 5 (ISBN: 1-85912-181-0, C606) 1606 1607 An LSB conforming implementation shall provide the generic data interfaces for 1608 Standard Library specified in Table 6-27, with the full functionality as 1609 described in the referenced underlying specification. 1610 1611 Table 6-27. libc - Standard Library Data Interfaces 1612 1613 +--------------------------------------------------------------------+ 1614 |__environ [1]|_sys_errlist [1]|getdate_err [2]|opterr [1]|optopt [1]| 1615 |-------------+----------------+---------------+----------+----------| 1616 |_environ [1] |environ [2] |optarg [2] |optind [1]| | 1617 +--------------------------------------------------------------------+ 1618 1619 Referenced Specification(s) 1620 1621 [1]. Linux Standard Base 1622 1623 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 1624 Specification(SUS) V3 1625 1626 ------------------------------------------------------------------------------- 1627 1628 Data Definitions for libc 1629 1630 This section defines global identifiers and their values that are associated 1631 with interfaces contained in libc. These definitions are organized into groups 1632 that correspond to system headers. This convention is used as a convenience for 1633 the reader, and does not imply the existence of these headers, or their 1634 content. 1635 1636 These definitions are intended to supplement those provided in the referenced 1637 underlying specifications. 1638 1639 This specification uses ISO/IEC 9899 C Language as the reference programming 1640 language, and data definitions are specified in ISO C format. The C language is 1641 used here as a convenient notation. Using a C language description of these 1642 data objects does not preclude their use by other programming languages. 1643 1644 ------------------------------------------------------------------------------- 1645 1646 assert.h 1647 1648 The assert.h header shall define the assert macro. It refers to the macro 1649 NDEBUG, which is not defined in this header. If NDEBUG is defined before the 1650 inclusion of this header, the assert macro shall be defined as described below, 1651 otherwise the macro shall behave as described in assert in ISO/IEC 9945 POSIX. 1652 1653 #define assert(expr) ((void)0) 1654 1655 ------------------------------------------------------------------------------- 1656 1657 ctype.h 1658 1659 enum 1660 { 1661 _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint, 1662 _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum 1663 } 1664 ; 1665 1666 ------------------------------------------------------------------------------- 1667 1668 dirent.h 1669 1670 typedef struct __dirstream DIR; 1671 1672 struct dirent 1673 { 1674 long d_ino; 1675 off_t d_off; 1676 unsigned short d_reclen; 1677 unsigned char d_type; 1678 char d_name[256]; 1679 } 1680 ; 1681 struct dirent64 1682 { 1683 uint64_t d_ino; 1684 int64_t d_off; 1685 unsigned short d_reclen; 1686 unsigned char d_type; 1687 char d_name[256]; 1688 } 1689 ; 1690 1691 ------------------------------------------------------------------------------- 1692 1693 errno.h 1694 1695 #define errno (*__errno_location()) 1696 1697 #define EPERM 1 1698 #define ECHILD 10 1699 #define ENETDOWN 100 1700 #define ENETUNREACH 101 1701 #define ENETRESET 102 1702 #define ECONNABORTED 103 1703 #define ECONNRESET 104 1704 #define ENOBUFS 105 1705 #define EISCONN 106 1706 #define ENOTCONN 107 1707 #define ESHUTDOWN 108 1708 #define ETOOMANYREFS 109 1709 #define EAGAIN 11 1710 #define ETIMEDOUT 110 1711 #define ECONNREFUSED 111 1712 #define EHOSTDOWN 112 1713 #define EHOSTUNREACH 113 1714 #define EALREADY 114 1715 #define EINPROGRESS 115 1716 #define ESTALE 116 1717 #define EUCLEAN 117 1718 #define ENOTNAM 118 1719 #define ENAVAIL 119 1720 #define ENOMEM 12 1721 #define EISNAM 120 1722 #define EREMOTEIO 121 1723 #define EDQUOT 122 1724 #define ENOMEDIUM 123 1725 #define EMEDIUMTYPE 124 1726 #define ECANCELED 125 1727 #define EACCES 13 1728 #define EFAULT 14 1729 #define ENOTBLK 15 1730 #define EBUSY 16 1731 #define EEXIST 17 1732 #define EXDEV 18 1733 #define ENODEV 19 1734 #define ENOENT 2 1735 #define ENOTDIR 20 1736 #define EISDIR 21 1737 #define EINVAL 22 1738 #define ENFILE 23 1739 #define EMFILE 24 1740 #define ENOTTY 25 1741 #define ETXTBSY 26 1742 #define EFBIG 27 1743 #define ENOSPC 28 1744 #define ESPIPE 29 1745 #define ESRCH 3 1746 #define EROFS 30 1747 #define EMLINK 31 1748 #define EPIPE 32 1749 #define EDOM 33 1750 #define ERANGE 34 1751 #define EDEADLK 35 1752 #define ENAMETOOLONG 36 1753 #define ENOLCK 37 1754 #define ENOSYS 38 1755 #define ENOTEMPTY 39 1756 #define EINTR 4 1757 #define ELOOP 40 1758 #define ENOMSG 42 1759 #define EIDRM 43 1760 #define ECHRNG 44 1761 #define EL2NSYNC 45 1762 #define EL3HLT 46 1763 #define EL3RST 47 1764 #define ELNRNG 48 1765 #define EUNATCH 49 1766 #define EIO 5 1767 #define ENOANO 55 1768 #define EBADRQC 56 1769 #define EBADSLT 57 1770 #define EBFONT 59 1771 #define ENXIO 6 1772 #define ENOSTR 60 1773 #define ENODATA 61 1774 #define ETIME 62 1775 #define ENOSR 63 1776 #define ENONET 64 1777 #define ENOPKG 65 1778 #define EREMOTE 66 1779 #define ENOLINK 67 1780 #define EADV 68 1781 #define ESRMNT 69 1782 #define E2BIG 7 1783 #define ECOMM 70 1784 #define EPROTO 71 1785 #define EMULTIHOP 72 1786 #define EDOTDOT 73 1787 #define EBADMSG 74 1788 #define EOVERFLOW 75 1789 #define ENOTUNIQ 76 1790 #define EBADFD 77 1791 #define EREMCHG 78 1792 #define ELIBACC 79 1793 #define ENOEXEC 8 1794 #define ELIBBAD 80 1795 #define ELIBSCN 81 1796 #define ELIBMAX 82 1797 #define ELIBEXEC 83 1798 #define EILSEQ 84 1799 #define ERESTART 85 1800 #define ESTRPIPE 86 1801 #define EUSERS 87 1802 #define ENOTSOCK 88 1803 #define EDESTADDRREQ 89 1804 #define EBADF 9 1805 #define EMSGSIZE 90 1806 #define EPROTOTYPE 91 1807 #define ENOPROTOOPT 92 1808 #define EPROTONOSUPPORT 93 1809 #define ESOCKTNOSUPPORT 94 1810 #define EOPNOTSUPP 95 1811 #define EPFNOSUPPORT 96 1812 #define EAFNOSUPPORT 97 1813 #define EADDRINUSE 98 1814 #define EADDRNOTAVAIL 99 1815 #define EWOULDBLOCK EAGAIN 1816 #define ENOTSUP EOPNOTSUPP 1817 1818 ------------------------------------------------------------------------------- 1819 1820 fcntl.h 1821 1822 #define O_RDONLY 00 1823 #define O_ACCMODE 0003 1824 #define O_WRONLY 01 1825 #define O_CREAT 0100 1826 #define O_TRUNC 01000 1827 #define O_SYNC 010000 1828 #define O_RDWR 02 1829 #define O_EXCL 0200 1830 #define O_APPEND 02000 1831 #define O_ASYNC 020000 1832 #define O_NOCTTY 0400 1833 #define O_NDELAY 04000 1834 #define O_NONBLOCK 04000 1835 #define FD_CLOEXEC 1 1836 1837 struct flock 1838 { 1839 short l_type; 1840 short l_whence; 1841 off_t l_start; 1842 off_t l_len; 1843 pid_t l_pid; 1844 } 1845 ; 1846 struct flock64 1847 { 1848 short l_type; 1849 short l_whence; 1850 loff_t l_start; 1851 loff_t l_len; 1852 pid_t l_pid; 1853 } 1854 ; 1855 1856 #define F_DUPFD 0 1857 #define F_RDLCK 0 1858 #define F_GETFD 1 1859 #define F_WRLCK 1 1860 #define F_SETFD 2 1861 #define F_UNLCK 2 1862 #define F_GETFL 3 1863 #define F_SETFL 4 1864 #define F_GETLK 5 1865 #define F_SETLK 6 1866 #define F_SETLKW 7 1867 #define F_SETOWN 8 1868 #define F_GETOWN 9 1869 1870 ------------------------------------------------------------------------------- 1871 1872 fmtmsg.h 1873 1874 #define MM_HARD 1 1875 #define MM_NRECOV 128 1876 #define MM_UTIL 16 1877 #define MM_SOFT 2 1878 #define MM_OPSYS 32 1879 #define MM_FIRM 4 1880 #define MM_RECOVER 64 1881 #define MM_APPL 8 1882 1883 #define MM_NOSEV 0 1884 #define MM_HALT 1 1885 #define MM_ERROR 2 1886 1887 #define MM_NULLLBL ((char *) 0) 1888 1889 ------------------------------------------------------------------------------- 1890 1891 fnmatch.h 1892 1893 #define FNM_PATHNAME (1<<0) 1894 #define FNM_NOESCAPE (1<<1) 1895 #define FNM_PERIOD (1<<2) 1896 #define FNM_NOMATCH 1 1897 1898 ------------------------------------------------------------------------------- 1899 1900 ftw.h 1901 1902 #define FTW_D FTW_D 1903 #define FTW_DNR FTW_DNR 1904 #define FTW_DP FTW_DP 1905 #define FTW_F FTW_F 1906 #define FTW_NS FTW_NS 1907 #define FTW_SL FTW_SL 1908 #define FTW_SLN FTW_SLN 1909 1910 enum 1911 { 1912 FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN 1913 } 1914 ; 1915 1916 enum 1917 { 1918 FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH 1919 } 1920 ; 1921 1922 struct FTW 1923 { 1924 int base; 1925 int level; 1926 } 1927 ; 1928 1929 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 1930 int __flag); 1931 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status, 1932 int __flag); 1933 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 1934 int __flag, struct FTW * __info); 1935 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status, 1936 int __flag, struct FTW * __info); 1937 1938 ------------------------------------------------------------------------------- 1939 1940 getopt.h 1941 1942 #define no_argument 0 1943 #define required_argument 1 1944 #define optional_argument 2 1945 1946 struct option 1947 { 1948 char *name; 1949 int has_arg; 1950 int *flag; 1951 int val; 1952 } 1953 ; 1954 1955 ------------------------------------------------------------------------------- 1956 1957 glob.h 1958 1959 #define GLOB_ERR (1<<0) 1960 #define GLOB_MARK (1<<1) 1961 #define GLOB_BRACE (1<<10) 1962 #define GLOB_NOMAGIC (1<<11) 1963 #define GLOB_TILDE (1<<12) 1964 #define GLOB_ONLYDIR (1<<13) 1965 #define GLOB_TILDE_CHECK (1<<14) 1966 #define GLOB_NOSORT (1<<2) 1967 #define GLOB_DOOFFS (1<<3) 1968 #define GLOB_NOCHECK (1<<4) 1969 #define GLOB_APPEND (1<<5) 1970 #define GLOB_NOESCAPE (1<<6) 1971 #define GLOB_PERIOD (1<<7) 1972 #define GLOB_MAGCHAR (1<<8) 1973 #define GLOB_ALTDIRFUNC (1<<9) 1974 1975 #define GLOB_NOSPACE 1 1976 #define GLOB_ABORTED 2 1977 #define GLOB_NOMATCH 3 1978 #define GLOB_NOSYS 4 1979 1980 typedef struct 1981 { 1982 size_t gl_pathc; 1983 char **gl_pathv; 1984 size_t gl_offs; 1985 int gl_flags; 1986 void (*gl_closedir) (void *); 1987 struct dirent *(*gl_readdir) (void *); 1988 void *(*gl_opendir) (const char *); 1989 int (*gl_lstat) (const char *, struct stat *); 1990 int (*gl_stat) (const char *, struct stat *); 1991 } 1992 glob_t; 1993 1994 typedef struct 1995 { 1996 size_t gl_pathc; 1997 char **gl_pathv; 1998 size_t gl_offs; 1999 int gl_flags; 2000 void (*gl_closedir) (void *); 2001 struct dirent64 *(*gl_readdir64) (void *); 2002 void *(*gl_opendir) (const char *); 2003 int (*gl_lstat) (const char *, struct stat *); 2004 int (*gl_stat) (const char *, struct stat *); 2005 } 2006 glob64_t; 2007 2008 ------------------------------------------------------------------------------- 2009 2010 grp.h 2011 2012 struct group 2013 { 2014 char *gr_name; 2015 char *gr_passwd; 2016 gid_t gr_gid; 2017 char **gr_mem; 2018 } 2019 ; 2020 2021 ------------------------------------------------------------------------------- 2022 2023 iconv.h 2024 2025 typedef void *iconv_t; 2026 2027 ------------------------------------------------------------------------------- 2028 2029 inttypes.h 2030 2031 typedef lldiv_t imaxdiv_t; 2032 typedef unsigned char uint8_t; 2033 typedef unsigned short uint16_t; 2034 typedef unsigned int uint32_t; 2035 2036 ------------------------------------------------------------------------------- 2037 2038 langinfo.h 2039 2040 #define ABDAY_1 0x20000 2041 #define ABDAY_2 0x20001 2042 #define ABDAY_3 0x20002 2043 #define ABDAY_4 0x20003 2044 #define ABDAY_5 0x20004 2045 #define ABDAY_6 0x20005 2046 #define ABDAY_7 0x20006 2047 2048 #define DAY_1 0x20007 2049 #define DAY_2 0x20008 2050 #define DAY_3 0x20009 2051 #define DAY_4 0x2000A 2052 #define DAY_5 0x2000B 2053 #define DAY_6 0x2000C 2054 #define DAY_7 0x2000D 2055 2056 #define ABMON_1 0x2000E 2057 #define ABMON_2 0x2000F 2058 #define ABMON_3 0x20010 2059 #define ABMON_4 0x20011 2060 #define ABMON_5 0x20012 2061 #define ABMON_6 0x20013 2062 #define ABMON_7 0x20014 2063 #define ABMON_8 0x20015 2064 #define ABMON_9 0x20016 2065 #define ABMON_10 0x20017 2066 #define ABMON_11 0x20018 2067 #define ABMON_12 0x20019 2068 2069 #define MON_1 0x2001A 2070 #define MON_2 0x2001B 2071 #define MON_3 0x2001C 2072 #define MON_4 0x2001D 2073 #define MON_5 0x2001E 2074 #define MON_6 0x2001F 2075 #define MON_7 0x20020 2076 #define MON_8 0x20021 2077 #define MON_9 0x20022 2078 #define MON_10 0x20023 2079 #define MON_11 0x20024 2080 #define MON_12 0x20025 2081 2082 #define AM_STR 0x20026 2083 #define PM_STR 0x20027 2084 2085 #define D_T_FMT 0x20028 2086 #define D_FMT 0x20029 2087 #define T_FMT 0x2002A 2088 #define T_FMT_AMPM 0x2002B 2089 2090 #define ERA 0x2002C 2091 #define ERA_D_FMT 0x2002E 2092 #define ALT_DIGITS 0x2002F 2093 #define ERA_D_T_FMT 0x20030 2094 #define ERA_T_FMT 0x20031 2095 2096 #define CODESET 14 2097 2098 #define CRNCYSTR 0x4000F 2099 2100 #define RADIXCHAR 0x10000 2101 #define THOUSEP 0x10001 2102 #define YESEXPR 0x50000 2103 #define NOEXPR 0x50001 2104 #define YESSTR 0x50002 2105 #define NOSTR 0x50003 2106 2107 ------------------------------------------------------------------------------- 2108 2109 limits.h 2110 2111 #define LLONG_MIN (-LLONG_MAX-1LL) 2112 #define ULLONG_MAX 18446744073709551615ULL 2113 #define OPEN_MAX 256 2114 #define PATH_MAX 4096 2115 #define LLONG_MAX 9223372036854775807LL 2116 #define SSIZE_MAX LONG_MAX 2117 2118 #define MB_LEN_MAX 16 2119 2120 #define SCHAR_MIN (-128) 2121 #define SCHAR_MAX 127 2122 #define UCHAR_MAX 255 2123 #define CHAR_BIT 8 2124 2125 #define SHRT_MIN (-32768) 2126 #define SHRT_MAX 32767 2127 #define USHRT_MAX 65535 2128 2129 #define INT_MIN (-INT_MAX-1) 2130 #define INT_MAX 2147483647 2131 #define __INT_MAX__ 2147483647 2132 #define UINT_MAX 4294967295U 2133 2134 #define LONG_MIN (-LONG_MAX-1L) 2135 2136 ------------------------------------------------------------------------------- 2137 2138 locale.h 2139 2140 #define LC_CTYPE 0 2141 #define LC_NUMERIC 1 2142 #define LC_TELEPHONE 10 2143 #define LC_MEASUREMENT 11 2144 #define LC_IDENTIFICATION 12 2145 #define LC_TIME 2 2146 #define LC_COLLATE 3 2147 #define LC_MONETARY 4 2148 #define LC_MESSAGES 5 2149 #define LC_ALL 6 2150 #define LC_PAPER 7 2151 #define LC_NAME 8 2152 #define LC_ADDRESS 9 2153 2154 struct lconv 2155 { 2156 char *decimal_point; 2157 char *thousands_sep; 2158 char *grouping; 2159 char *int_curr_symbol; 2160 char *currency_symbol; 2161 char *mon_decimal_point; 2162 char *mon_thousands_sep; 2163 char *mon_grouping; 2164 char *positive_sign; 2165 char *negative_sign; 2166 char int_frac_digits; 2167 char frac_digits; 2168 char p_cs_precedes; 2169 char p_sep_by_space; 2170 char n_cs_precedes; 2171 char n_sep_by_space; 2172 char p_sign_posn; 2173 char n_sign_posn; 2174 char int_p_cs_precedes; 2175 char int_p_sep_by_space; 2176 char int_n_cs_precedes; 2177 char int_n_sep_by_space; 2178 char int_p_sign_posn; 2179 char int_n_sign_posn; 2180 } 2181 ; 2182 2183 typedef struct __locale_struct 2184 { 2185 struct locale_data *__locales[13]; 2186 const unsigned short *__ctype_b; 2187 const int *__ctype_tolower; 2188 const int *__ctype_toupper; 2189 const char *__names[13]; 2190 } 2191 *__locale_t; 2192 2193 ------------------------------------------------------------------------------- 2194 2195 net/if.h 2196 2197 #define IF_NAMESIZE 16 2198 2199 #define IFF_UP 0x01 2200 #define IFF_BROADCAST 0x02 2201 #define IFF_DEBUG 0x04 2202 #define IFF_LOOPBACK 0x08 2203 #define IFF_POINTOPOINT 0x10 2204 #define IFF_PROMISC 0x100 2205 #define IFF_MULTICAST 0x1000 2206 #define IFF_NOTRAILERS 0x20 2207 #define IFF_RUNNING 0x40 2208 #define IFF_NOARP 0x80 2209 2210 struct ifaddr 2211 { 2212 struct sockaddr ifa_addr; 2213 union 2214 { 2215 struct sockaddr ifu_broadaddr; 2216 struct sockaddr ifu_dstaddr; 2217 } 2218 ifa_ifu; 2219 void *ifa_ifp; 2220 void *ifa_next; 2221 } 2222 ; 2223 #define IFNAMSIZ IF_NAMESIZE 2224 2225 struct ifreq 2226 { 2227 union 2228 { 2229 char ifrn_name[IFNAMSIZ]; 2230 } 2231 ifr_ifrn; 2232 union 2233 { 2234 struct sockaddr ifru_addr; 2235 struct sockaddr ifru_dstaddr; 2236 struct sockaddr ifru_broadaddr; 2237 struct sockaddr ifru_netmask; 2238 struct sockaddr ifru_hwaddr; 2239 short ifru_flags; 2240 int ifru_ivalue; 2241 int ifru_mtu; 2242 char ifru_slave[IFNAMSIZ]; 2243 char ifru_newname[IFNAMSIZ]; 2244 caddr_t ifru_data; 2245 struct ifmap ifru_map; 2246 } 2247 ifr_ifru; 2248 } 2249 ; 2250 2251 struct ifconf 2252 { 2253 int ifc_len; 2254 union 2255 { 2256 caddr_t ifcu_buf; 2257 struct ifreq *ifcu_req; 2258 } 2259 ifc_ifcu; 2260 } 2261 ; 2262 2263 ------------------------------------------------------------------------------- 2264 2265 netdb.h 2266 2267 #define h_errno (*__h_errno_location ()) 2268 #define NETDB_INTERNAL -1 2269 #define NETDB_SUCCESS 0 2270 #define HOST_NOT_FOUND 1 2271 #define IPPORT_RESERVED 1024 2272 #define NI_MAXHOST 1025 2273 #define TRY_AGAIN 2 2274 #define NO_RECOVERY 3 2275 #define NI_MAXSERV 32 2276 #define NO_DATA 4 2277 #define h_addr h_addr_list[0] 2278 #define NO_ADDRESS NO_DATA 2279 2280 struct servent 2281 { 2282 char *s_name; 2283 char **s_aliases; 2284 int s_port; 2285 char *s_proto; 2286 } 2287 ; 2288 struct hostent 2289 { 2290 char *h_name; 2291 char **h_aliases; 2292 int h_addrtype; 2293 int h_length; 2294 char **h_addr_list; 2295 } 2296 ; 2297 struct protoent 2298 { 2299 char *p_name; 2300 char **p_aliases; 2301 int p_proto; 2302 } 2303 ; 2304 struct netent 2305 { 2306 char *n_name; 2307 char **n_aliases; 2308 int n_addrtype; 2309 unsigned int n_net; 2310 } 2311 ; 2312 #define AI_PASSIVE 0x0001 2313 #define AI_CANONNAME 0x0002 2314 #define AI_NUMERICHOST 0x0004 2315 2316 struct addrinfo 2317 { 2318 int ai_flags; 2319 int ai_family; 2320 int ai_socktype; 2321 int ai_protocol; 2322 socklen_t ai_addrlen; 2323 struct sockaddr *ai_addr; 2324 char *ai_canonname; 2325 struct addrinfo *ai_next; 2326 } 2327 ; 2328 #define NI_NUMERICHOST 1 2329 #define NI_DGRAM 16 2330 #define NI_NUMERICSERV 2 2331 #define NI_NOFQDN 4 2332 #define NI_NAMEREQD 8 2333 2334 #define EAI_BADFLAGS -1 2335 #define EAI_MEMORY -10 2336 #define EAI_SYSTEM -11 2337 #define EAI_NONAME -2 2338 #define EAI_AGAIN -3 2339 #define EAI_FAIL -4 2340 #define EAI_NODATA -5 2341 #define EAI_FAMILY -6 2342 #define EAI_SOCKTYPE -7 2343 #define EAI_SERVICE -8 2344 #define EAI_ADDRFAMILY -9 2345 2346 ------------------------------------------------------------------------------- 2347 2348 netinet/in.h 2349 2350 #define IPPROTO_IP 0 2351 #define IPPROTO_ICMP 1 2352 #define IPPROTO_UDP 17 2353 #define IPPROTO_IGMP 2 2354 #define IPPROTO_RAW 255 2355 #define IPPROTO_IPV6 41 2356 #define IPPROTO_ICMPV6 58 2357 #define IPPROTO_TCP 6 2358 2359 typedef uint16_t in_port_t; 2360 2361 struct in_addr 2362 { 2363 uint32_t s_addr; 2364 } 2365 ; 2366 typedef uint32_t in_addr_t; 2367 #define INADDR_NONE ((in_addr_t) 0xffffffff) 2368 #define INADDR_BROADCAST (0xffffffff) 2369 #define INADDR_ANY 0 2370 2371 struct in6_addr 2372 { 2373 union 2374 { 2375 uint8_t u6_addr8[16]; 2376 uint16_t u6_addr16[8]; 2377 uint32_t u6_addr32[4]; 2378 } 2379 in6_u; 2380 } 2381 ; 2382 #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } 2383 #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } 2384 2385 #define INET_ADDRSTRLEN 16 2386 2387 struct sockaddr_in 2388 { 2389 sa_family_t sin_family; 2390 unsigned short sin_port; 2391 struct in_addr sin_addr; 2392 unsigned char sin_zero[8]; 2393 } 2394 ; 2395 #define INET6_ADDRSTRLEN 46 2396 2397 struct sockaddr_in6 2398 { 2399 unsigned short sin6_family; 2400 uint16_t sin6_port; 2401 uint32_t sin6_flowinfo; 2402 struct in6_addr sin6_addr; 2403 uint32_t sin6_scope_id; 2404 } 2405 ; 2406 #define SOL_IP 0 2407 #define IP_TOS 1 2408 #define IPV6_UNICAST_HOPS 16 2409 #define IPV6_MULTICAST_IF 17 2410 #define IPV6_MULTICAST_HOPS 18 2411 #define IPV6_MULTICAST_LOOP 19 2412 #define IPV6_JOIN_GROUP 20 2413 #define IPV6_LEAVE_GROUP 21 2414 #define IPV6_V6ONLY 26 2415 #define IP_MULTICAST_IF 32 2416 #define IP_MULTICAST_TTL 33 2417 #define IP_MULTICAST_LOOP 34 2418 #define IP_ADD_MEMBERSHIP 35 2419 #define IP_DROP_MEMBERSHIP 36 2420 2421 struct ipv6_mreq 2422 { 2423 struct in6_addr ipv6mr_multiaddr; 2424 int ipv6mr_interface; 2425 } 2426 ; 2427 struct ip_mreq 2428 { 2429 struct in_addr imr_multiaddr; 2430 struct in_addr imr_interface; 2431 } 2432 ; 2433 2434 ------------------------------------------------------------------------------- 2435 2436 netinet/tcp.h 2437 2438 #define TCP_NODELAY 1 2439 #define SOL_TCP 6 2440 2441 ------------------------------------------------------------------------------- 2442 2443 netinet/udp.h 2444 2445 #define SOL_UDP 17 2446 2447 ------------------------------------------------------------------------------- 2448 2449 nl_types.h 2450 2451 #define NL_CAT_LOCALE 1 2452 #define NL_SETD 1 2453 2454 typedef void *nl_catd; 2455 2456 typedef int nl_item; 2457 2458 ------------------------------------------------------------------------------- 2459 2460 pty.h 2461 2462 struct winsize 2463 { 2464 unsigned short ws_row; 2465 unsigned short ws_col; 2466 unsigned short ws_xpixel; 2467 unsigned short ws_ypixel; 2468 } 2469 ; 2470 2471 ------------------------------------------------------------------------------- 2472 2473 pwd.h 2474 2475 struct passwd 2476 { 2477 char *pw_name; 2478 char *pw_passwd; 2479 uid_t pw_uid; 2480 gid_t pw_gid; 2481 char *pw_gecos; 2482 char *pw_dir; 2483 char *pw_shell; 2484 } 2485 ; 2486 2487 ------------------------------------------------------------------------------- 2488 2489 regex.h 2490 2491 #define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int)1) 2492 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS<<1) 2493 #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) 2494 #define RE_CHAR_CLASSES (RE_BK_PLUS_QM<<1) 2495 #define RE_SYNTAX_GREP (RE_BK_PLUS_QM|RE_CHAR_CLASSES|RE_HAT_LISTS_NOT_NEWLINE|RE_INTERVALS|RE_NEWLINE_ALT) 2496 #define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES<<1) 2497 #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) 2498 #define _RE_SYNTAX_POSIX_COMMON (RE_CHAR_CLASSES|RE_DOT_NEWLINE|RE_DOT_NOT_NULL|RE_INTERVALS|RE_NO_EMPTY_RANGES) 2499 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS<<1) 2500 #define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS<<1) 2501 #define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS<<1) 2502 #define RE_INVALID_INTERVAL_ORD (RE_DEBUG<<1) 2503 #define RE_DOT_NOT_NULL (RE_DOT_NEWLINE<<1) 2504 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL<<1) 2505 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE<<1) 2506 #define RE_LIMITED_OPS (RE_INTERVALS<<1) 2507 #define RE_NEWLINE_ALT (RE_LIMITED_OPS<<1) 2508 #define RE_NO_BK_BRACES (RE_NEWLINE_ALT<<1) 2509 #define RE_NO_BK_PARENS (RE_NO_BK_BRACES<<1) 2510 #define RE_NO_BK_REFS (RE_NO_BK_PARENS<<1) 2511 #define RE_NO_BK_VBAR (RE_NO_BK_REFS<<1) 2512 #define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR<<1) 2513 #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES<<1) 2514 #define RE_DEBUG (RE_NO_GNU_OPS<<1) 2515 #define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING<<1) 2516 #define RE_SYNTAX_POSIX_EGREP (RE_SYNTAX_EGREP|RE_INTERVALS|RE_NO_BK_BRACES|RE_INVALID_INTERVAL_ORD) 2517 #define RE_SYNTAX_POSIX_AWK (RE_SYNTAX_POSIX_EXTENDED|RE_BACKSLASH_ESCAPE_IN_LISTS|RE_INTERVALS|RE_NO_GNU_OPS) 2518 #define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD<<1) 2519 #define RE_SYNTAX_POSIX_BASIC (_RE_SYNTAX_POSIX_COMMON|RE_BK_PLUS_QM) 2520 #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) 2521 #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) 2522 #define RE_SYNTAX_POSIX_MINIMAL_BASIC (_RE_SYNTAX_POSIX_COMMON|RE_LIMITED_OPS) 2523 #define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC 2524 #define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC 2525 2526 typedef unsigned long reg_syntax_t; 2527 2528 typedef struct re_pattern_buffer 2529 { 2530 unsigned char *buffer; 2531 unsigned long allocated; 2532 unsigned long used; 2533 reg_syntax_t syntax; 2534 char *fastmap; 2535 char *translate; 2536 size_t re_nsub; 2537 unsigned int can_be_null:1; 2538 unsigned int regs_allocated:2; 2539 unsigned int fastmap_accurate:1; 2540 unsigned int no_sub:1; 2541 unsigned int not_bol:1; 2542 unsigned int not_eol:1; 2543 unsigned int newline_anchor:1; 2544 } 2545 regex_t; 2546 typedef int regoff_t; 2547 typedef struct 2548 { 2549 regoff_t rm_so; 2550 regoff_t rm_eo; 2551 } 2552 regmatch_t; 2553 #define REG_NOTEOL (1<<1) 2554 #define REG_ICASE (REG_EXTENDED<<1) 2555 #define REG_NEWLINE (REG_ICASE<<1) 2556 #define REG_NOSUB (REG_NEWLINE<<1) 2557 #define REG_NOMATCH -1 2558 #define REG_EXTENDED 1 2559 #define REG_NOTBOL 1 2560 2561 ------------------------------------------------------------------------------- 2562 2563 rpc/auth.h 2564 2565 enum auth_stat 2566 { 2567 AUTH_OK, AUTH_BADCRED = 1, AUTH_REJECTEDCRED = 2, AUTH_BADVERF = 2568 3, AUTH_REJECTEDVERF = 4, AUTH_TOOWEAK = 5, AUTH_INVALIDRESP = 2569 6, AUTH_FAILED = 7 2570 } 2571 ; 2572 2573 union des_block 2574 { 2575 struct 2576 { 2577 u_int32_t high; 2578 u_int32_t low; 2579 } 2580 key; 2581 char c[8]; 2582 } 2583 ; 2584 2585 struct opaque_auth 2586 { 2587 enum_t oa_flavor; 2588 caddr_t oa_base; 2589 u_int oa_length; 2590 } 2591 ; 2592 2593 typedef struct AUTH 2594 { 2595 struct opaque_auth ah_cred; 2596 struct opaque_auth ah_verf; 2597 union des_block ah_key; 2598 struct auth_ops *ah_ops; 2599 caddr_t ah_private; 2600 } 2601 AUTH; 2602 2603 struct auth_ops 2604 { 2605 void (*ah_nextverf) (struct AUTH *); 2606 int (*ah_marshal) (struct AUTH *, XDR *); 2607 int (*ah_validate) (struct AUTH *, struct opaque_auth *); 2608 int (*ah_refresh) (struct AUTH *); 2609 void (*ah_destroy) (struct AUTH *); 2610 } 2611 ; 2612 2613 ------------------------------------------------------------------------------- 2614 2615 rpc/clnt.h 2616 2617 #define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) 2618 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 2619 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 2620 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 2621 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) 2622 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 2623 #define NULLPROC ((u_long)0) 2624 #define CLSET_TIMEOUT 1 2625 #define CLGET_XID 10 2626 #define CLSET_XID 11 2627 #define CLGET_VERS 12 2628 #define CLSET_VERS 13 2629 #define CLGET_PROG 14 2630 #define CLSET_PROG 15 2631 #define CLGET_TIMEOUT 2 2632 #define CLGET_SERVER_ADDR 3 2633 #define CLSET_RETRY_TIMEOUT 4 2634 #define CLGET_RETRY_TIMEOUT 5 2635 #define CLGET_FD 6 2636 #define CLGET_SVC_ADDR 7 2637 #define CLSET_FD_CLOSE 8 2638 #define CLSET_FD_NCLOSE 9 2639 2640 enum clnt_stat 2641 { 2642 RPC_SUCCESS, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 2, RPC_CANTSEND = 2643 3, RPC_CANTRECV = 4, RPC_TIMEDOUT = 5, RPC_VERSMISMATCH = 2644 6, RPC_AUTHERROR = 7, RPC_PROGUNAVAIL = 8, RPC_PROGVERSMISMATCH = 2645 9, RPC_PROCUNAVAIL = 10, RPC_CANTDECODEARGS = 11, RPC_SYSTEMERROR = 2646 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 2647 17, RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 14, RPC_PROGNOTREGISTERED = 2648 15, RPC_N2AXLATEFAILURE = 22, RPC_FAILED = 16, RPC_INTR = 2649 18, RPC_TLIERROR = 20, RPC_UDERROR = 23, RPC_INPROGRESS = 2650 24, RPC_STALERACHANDLE = 25 2651 } 2652 ; 2653 struct rpc_err 2654 { 2655 enum clnt_stat re_status; 2656 union 2657 { 2658 int RE_errno; 2659 enum auth_stat RE_why; 2660 struct 2661 { 2662 u_long low; 2663 u_long high; 2664 } 2665 RE_vers; 2666 struct 2667 { 2668 long s1; 2669 long s2; 2670 } 2671 RE_lb; 2672 } 2673 ru; 2674 } 2675 ; 2676 2677 typedef struct CLIENT 2678 { 2679 struct AUTH *cl_auth; 2680 struct clnt_ops *cl_ops; 2681 caddr_t cl_private; 2682 } 2683 CLIENT; 2684 2685 struct clnt_ops 2686 { 2687 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_t, 2688 xdrproc_t, caddr_t, struct timeval); 2689 void (*cl_abort) (void); 2690 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 2691 bool_t (*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 2692 void (*cl_destroy) (struct CLIENT *); 2693 bool_t (*cl_control) (struct CLIENT *, int, char *); 2694 } 2695 ; 2696 2697 ------------------------------------------------------------------------------- 2698 2699 rpc/rpc_msg.h 2700 2701 enum msg_type 2702 { 2703 CALL, REPLY = 1 2704 } 2705 ; 2706 enum reply_stat 2707 { 2708 MSG_ACCEPTED, MSG_DENIED = 1 2709 } 2710 ; 2711 enum accept_stat 2712 { 2713 SUCCESS, PROG_UNAVAIL = 1, PROG_MISMATCH = 2, PROC_UNAVAIL = 2714 3, GARBAGE_ARGS = 4, SYSTEM_ERR = 5 2715 } 2716 ; 2717 enum reject_stat 2718 { 2719 RPC_MISMATCH, AUTH_ERROR = 1 2720 } 2721 ; 2722 2723 struct accepted_reply 2724 { 2725 struct opaque_auth ar_verf; 2726 enum accept_stat ar_stat; 2727 union 2728 { 2729 struct 2730 { 2731 unsigned long low; 2732 unsigned long high; 2733 } 2734 AR_versions; 2735 struct 2736 { 2737 caddr_t where; 2738 xdrproc_t proc; 2739 } 2740 AR_results; 2741 } 2742 ru; 2743 } 2744 ; 2745 2746 struct rejected_reply 2747 { 2748 enum reject_stat rj_stat; 2749 union 2750 { 2751 struct 2752 { 2753 unsigned long low; 2754 unsigned long high; 2755 } 2756 RJ_versions; 2757 enum auth_stat RJ_why; 2758 } 2759 ru; 2760 } 2761 ; 2762 2763 struct reply_body 2764 { 2765 enum reply_stat rp_stat; 2766 union 2767 { 2768 struct accepted_reply RP_ar; 2769 struct rejected_reply RP_dr; 2770 } 2771 ru; 2772 } 2773 ; 2774 2775 struct call_body 2776 { 2777 unsigned long cb_rpcvers; 2778 unsigned long cb_prog; 2779 unsigned long cb_vers; 2780 unsigned long cb_proc; 2781 struct opaque_auth cb_cred; 2782 struct opaque_auth cb_verf; 2783 } 2784 ; 2785 2786 struct rpc_msg 2787 { 2788 unsigned long rm_xid; 2789 enum msg_type rm_direction; 2790 union 2791 { 2792 struct call_body RM_cmb; 2793 struct reply_body RM_rmb; 2794 } 2795 ru; 2796 } 2797 ; 2798 2799 ------------------------------------------------------------------------------- 2800 2801 rpc/svc.h 2802 2803 #define svc_freeargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) 2804 #define svc_getargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) 2805 #define RPC_ANYSOCK -1 2806 2807 typedef struct SVCXPRT 2808 { 2809 int xp_sock; 2810 u_short xp_port; 2811 struct xp_ops *xp_ops; 2812 int xp_addrlen; 2813 struct sockaddr_in xp_raddr; 2814 struct opaque_auth xp_verf; 2815 caddr_t xp_p1; 2816 caddr_t xp_p2; 2817 char xp_pad[256]; 2818 } 2819 SVCXPRT; 2820 2821 struct svc_req 2822 { 2823 rpcprog_t rq_prog; 2824 rpcvers_t rq_vers; 2825 rpcproc_t rq_proc; 2826 struct opaque_auth rq_cred; 2827 caddr_t rq_clntcred; 2828 SVCXPRT *rq_xprt; 2829 } 2830 ; 2831 2832 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 2833 2834 struct xp_ops 2835 { 2836 bool_t (*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 2837 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 2838 bool_t (*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 2839 caddr_t args_ptr); 2840 bool_t (*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 2841 bool_t (*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 2842 caddr_t args_ptr); 2843 void (*xp_destroy) (SVCXPRT * __xprt); 2844 } 2845 ; 2846 2847 ------------------------------------------------------------------------------- 2848 2849 rpc/types.h 2850 2851 typedef int bool_t; 2852 typedef int enum_t; 2853 typedef unsigned long rpcprog_t; 2854 typedef unsigned long rpcvers_t; 2855 typedef unsigned long rpcproc_t; 2856 typedef unsigned long rpcprot_t; 2857 2858 ------------------------------------------------------------------------------- 2859 2860 rpc/xdr.h 2861 2862 enum xdr_op 2863 { 2864 XDR_ENCODE, XDR_DECODE, XDR_FREE 2865 } 2866 ; 2867 typedef struct XDR 2868 { 2869 enum xdr_op x_op; 2870 struct xdr_ops *x_ops; 2871 caddr_t x_public; 2872 caddr_t x_private; 2873 caddr_t x_base; 2874 int x_handy; 2875 } 2876 XDR; 2877 2878 struct xdr_ops 2879 { 2880 bool_t (*x_getlong) (XDR * __xdrs, long *__lp); 2881 bool_t (*x_putlong) (XDR * __xdrs, long *__lp); 2882 bool_t (*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 2883 bool_t (*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 2884 u_int (*x_getpostn) (XDR * __xdrs); 2885 bool_t (*x_setpostn) (XDR * __xdrs, u_int __pos); 2886 int32_t *(*x_inline) (XDR * __xdrs, int __len); 2887 void (*x_destroy) (XDR * __xdrs); 2888 bool_t (*x_getint32) (XDR * __xdrs, int32_t * __ip); 2889 bool_t (*x_putint32) (XDR * __xdrs, int32_t * __ip); 2890 } 2891 ; 2892 2893 typedef bool_t (*xdrproc_t) (XDR *, void *, ...); 2894 2895 struct xdr_discrim 2896 { 2897 int value; 2898 xdrproc_t proc; 2899 } 2900 ; 2901 2902 ------------------------------------------------------------------------------- 2903 2904 sched.h 2905 2906 #define SCHED_OTHER 0 2907 #define SCHED_FIFO 1 2908 #define SCHED_RR 2 2909 2910 struct sched_param 2911 { 2912 int sched_priority; 2913 } 2914 ; 2915 2916 ------------------------------------------------------------------------------- 2917 2918 search.h 2919 2920 typedef struct entry 2921 { 2922 char *key; 2923 void *data; 2924 } 2925 ENTRY; 2926 typedef enum 2927 { 2928 FIND, ENTER 2929 } 2930 ACTION; 2931 typedef enum 2932 { 2933 preorder, postorder, endorder, leaf 2934 } 2935 VISIT; 2936 2937 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level); 2938 2939 ------------------------------------------------------------------------------- 2940 2941 setjmp.h 2942 2943 #define setjmp(env) _setjmp(env) 2944 #define sigsetjmp(a,b) __sigsetjmp(a,b) 2945 2946 struct __jmp_buf_tag 2947 { 2948 __jmp_buf __jmpbuf; 2949 int __mask_was_saved; 2950 sigset_t __saved_mask; 2951 } 2952 ; 2953 2954 typedef struct __jmp_buf_tag jmp_buf[1]; 2955 typedef jmp_buf sigjmp_buf; 2956 2957 ------------------------------------------------------------------------------- 2958 2959 signal.h 2960 2961 #define SIGRTMAX (__libc_current_sigrtmax ()) 2962 #define SIGRTMIN (__libc_current_sigrtmin ()) 2963 #define SIG_BLOCK 0 2964 #define SIG_UNBLOCK 1 2965 #define SIG_SETMASK 2 2966 #define NSIG 65 2967 2968 typedef int sig_atomic_t; 2969 struct sigstack 2970 { 2971 void *ss_sp; 2972 int ss_onstack; 2973 } 2974 ; 2975 2976 typedef void (*sighandler_t) (int); 2977 #define SIG_HOLD ((sighandler_t) 2) 2978 #define SIG_ERR ((sighandler_t)-1) 2979 #define SIG_DFL ((sighandler_t)0) 2980 #define SIG_IGN ((sighandler_t)1) 2981 2982 #define SIGHUP 1 2983 #define SIGUSR1 10 2984 #define SIGSEGV 11 2985 #define SIGUSR2 12 2986 #define SIGPIPE 13 2987 #define SIGALRM 14 2988 #define SIGTERM 15 2989 #define SIGSTKFLT 16 2990 #define SIGCHLD 17 2991 #define SIGCONT 18 2992 #define SIGSTOP 19 2993 #define SIGINT 2 2994 #define SIGTSTP 20 2995 #define SIGTTIN 21 2996 #define SIGTTOU 22 2997 #define SIGURG 23 2998 #define SIGXCPU 24 2999 #define SIGXFSZ 25 3000 #define SIGVTALRM 26 3001 #define SIGPROF 27 3002 #define SIGWINCH 28 3003 #define SIGIO 29 3004 #define SIGQUIT 3 3005 #define SIGPWR 30 3006 #define SIGSYS 31 3007 #define SIGUNUSED 31 3008 #define SIGILL 4 3009 #define SIGTRAP 5 3010 #define SIGABRT 6 3011 #define SIGIOT 6 3012 #define SIGBUS 7 3013 #define SIGFPE 8 3014 #define SIGKILL 9 3015 #define SIGCLD SIGCHLD 3016 #define SIGPOLL SIGIO 3017 3018 #define SV_ONSTACK (1<<0) 3019 #define SV_INTERRUPT (1<<1) 3020 #define SV_RESETHAND (1<<2) 3021 3022 typedef union sigval 3023 { 3024 int sival_int; 3025 void *sival_ptr; 3026 } 3027 sigval_t; 3028 #define SIGEV_SIGNAL 0 3029 #define SIGEV_NONE 1 3030 #define SIGEV_THREAD 2 3031 3032 typedef struct sigevent 3033 { 3034 sigval_t sigev_value; 3035 int sigev_signo; 3036 int sigev_notify; 3037 union 3038 { 3039 int _pad[SIGEV_PAD_SIZE]; 3040 struct 3041 { 3042 void (*sigev_thread_func) (sigval_t); 3043 void *_attribute; 3044 } 3045 _sigev_thread; 3046 } 3047 _sigev_un; 3048 } 3049 sigevent_t; 3050 #define si_pid _sifields._kill._pid 3051 #define si_uid _sifields._kill._uid 3052 #define si_value _sifields._rt._sigval 3053 #define si_int _sifields._rt._sigval.sival_int 3054 #define si_ptr _sifields._rt._sigval.sival_ptr 3055 #define si_status _sifields._sigchld._status 3056 #define si_stime _sifields._sigchld._stime 3057 #define si_utime _sifields._sigchld._utime 3058 #define si_addr _sifields._sigfault._addr 3059 #define si_band _sifields._sigpoll._band 3060 #define si_fd _sifields._sigpoll._fd 3061 #define si_timer1 _sifields._timer._timer1 3062 #define si_timer2 _sifields._timer._timer2 3063 3064 typedef struct siginfo 3065 { 3066 int si_signo; 3067 int si_errno; 3068 int si_code; 3069 union 3070 { 3071 int _pad[SI_PAD_SIZE]; 3072 struct 3073 { 3074 pid_t _pid; 3075 uid_t _uid; 3076 } 3077 _kill; 3078 struct 3079 { 3080 unsigned int _timer1; 3081 unsigned int _timer2; 3082 } 3083 _timer; 3084 struct 3085 { 3086 pid_t _pid; 3087 uid_t _uid; 3088 sigval_t _sigval; 3089 } 3090 _rt; 3091 struct 3092 { 3093 pid_t _pid; 3094 uid_t _uid; 3095 int _status; 3096 clock_t _utime; 3097 clock_t _stime; 3098 } 3099 _sigchld; 3100 struct 3101 { 3102 void *_addr; 3103 } 3104 _sigfault; 3105 struct 3106 { 3107 int _band; 3108 int _fd; 3109 } 3110 _sigpoll; 3111 } 3112 _sifields; 3113 } 3114 siginfo_t; 3115 #define SI_QUEUE -1 3116 #define SI_TIMER -2 3117 #define SI_MESGQ -3 3118 #define SI_ASYNCIO -4 3119 #define SI_SIGIO -5 3120 #define SI_TKILL -6 3121 #define SI_ASYNCNL -60 3122 #define SI_USER 0 3123 #define SI_KERNEL 0x80 3124 3125 #define ILL_ILLOPC 1 3126 #define ILL_ILLOPN 2 3127 #define ILL_ILLADR 3 3128 #define ILL_ILLTRP 4 3129 #define ILL_PRVOPC 5 3130 #define ILL_PRVREG 6 3131 #define ILL_COPROC 7 3132 #define ILL_BADSTK 8 3133 3134 #define FPE_INTDIV 1 3135 #define FPE_INTOVF 2 3136 #define FPE_FLTDIV 3 3137 #define FPE_FLTOVF 4 3138 #define FPE_FLTUND 5 3139 #define FPE_FLTRES 6 3140 #define FPE_FLTINV 7 3141 #define FPE_FLTSUB 8 3142 3143 #define SEGV_MAPERR 1 3144 #define SEGV_ACCERR 2 3145 3146 #define BUS_ADRALN 1 3147 #define BUS_ADRERR 2 3148 #define BUS_OBJERR 3 3149 3150 #define TRAP_BRKPT 1 3151 #define TRAP_TRACE 2 3152 3153 #define CLD_EXITED 1 3154 #define CLD_KILLED 2 3155 #define CLD_DUMPED 3 3156 #define CLD_TRAPPED 4 3157 #define CLD_STOPPED 5 3158 #define CLD_CONTINUED 6 3159 3160 #define POLL_IN 1 3161 #define POLL_OUT 2 3162 #define POLL_MSG 3 3163 #define POLL_ERR 4 3164 #define POLL_PRI 5 3165 #define POLL_HUP 6 3166 3167 typedef struct 3168 { 3169 unsigned long sig[_SIGSET_NWORDS]; 3170 } 3171 sigset_t; 3172 #define SA_NOCLDSTOP 0x00000001 3173 #define SA_NOCLDWAIT 0x00000002 3174 #define SA_SIGINFO 0x00000004 3175 #define SA_ONSTACK 0x08000000 3176 #define SA_RESTART 0x10000000 3177 #define SA_INTERRUPT 0x20000000 3178 #define SA_NODEFER 0x40000000 3179 #define SA_RESETHAND 0x80000000 3180 #define SA_NOMASK SA_NODEFER 3181 #define SA_ONESHOT SA_RESETHAND 3182 3183 typedef struct sigaltstack 3184 { 3185 void *ss_sp; 3186 int ss_flags; 3187 size_t ss_size; 3188 } 3189 stack_t; 3190 #define SS_ONSTACK 1 3191 #define SS_DISABLE 2 3192 3193 ------------------------------------------------------------------------------- 3194 3195 stddef.h 3196 3197 #define offsetof(TYPE,MEMBER) ((size_t)& ((TYPE*)0)->MEMBER) 3198 #define NULL (0L) 3199 3200 typedef int wchar_t; 3201 3202 ------------------------------------------------------------------------------- 3203 3204 stdio.h 3205 3206 #define EOF (-1) 3207 #define P_tmpdir "/tmp" 3208 #define FOPEN_MAX 16 3209 #define L_tmpnam 20 3210 #define FILENAME_MAX 4096 3211 #define BUFSIZ 8192 3212 #define L_ctermid 9 3213 #define L_cuserid 9 3214 3215 typedef struct 3216 { 3217 off_t __pos; 3218 mbstate_t __state; 3219 } 3220 fpos_t; 3221 typedef struct 3222 { 3223 off64_t __pos; 3224 mbstate_t __state; 3225 } 3226 fpos64_t; 3227 3228 typedef struct _IO_FILE FILE; 3229 #define _IOFBF 0 3230 #define _IOLBF 1 3231 #define _IONBF 2 3232 3233 ------------------------------------------------------------------------------- 3234 3235 stdlib.h 3236 3237 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 3238 #define EXIT_SUCCESS 0 3239 #define EXIT_FAILURE 1 3240 #define RAND_MAX 2147483647 3241 3242 typedef int (*__compar_fn_t) (const void *, const void *); 3243 struct random_data 3244 { 3245 int32_t *fptr; 3246 int32_t *rptr; 3247 int32_t *state; 3248 int rand_type; 3249 int rand_deg; 3250 int rand_sep; 3251 int32_t *end_ptr; 3252 } 3253 ; 3254 3255 typedef struct 3256 { 3257 int quot; 3258 int rem; 3259 } 3260 div_t; 3261 3262 typedef struct 3263 { 3264 long quot; 3265 long rem; 3266 } 3267 ldiv_t; 3268 3269 typedef struct 3270 { 3271 long long quot; 3272 long long rem; 3273 } 3274 lldiv_t; 3275 3276 ------------------------------------------------------------------------------- 3277 3278 sys/file.h 3279 3280 #define LOCK_SH 1 3281 #define LOCK_EX 2 3282 #define LOCK_NB 4 3283 #define LOCK_UN 8 3284 3285 ------------------------------------------------------------------------------- 3286 3287 sys/ipc.h 3288 3289 #define IPC_PRIVATE ((key_t)0) 3290 #define IPC_RMID 0 3291 #define IPC_CREAT 00001000 3292 #define IPC_EXCL 00002000 3293 #define IPC_NOWAIT 00004000 3294 #define IPC_SET 1 3295 #define IPC_STAT 2 3296 3297 ------------------------------------------------------------------------------- 3298 3299 sys/mman.h 3300 3301 #define MAP_FAILED ((void*)-1) 3302 #define PROT_NONE 0x0 3303 #define MAP_SHARED 0x01 3304 #define MAP_PRIVATE 0x02 3305 #define PROT_READ 0x1 3306 #define MAP_FIXED 0x10 3307 #define PROT_WRITE 0x2 3308 #define MAP_ANONYMOUS 0x20 3309 #define PROT_EXEC 0x4 3310 #define MS_ASYNC 1 3311 #define MS_INVALIDATE 2 3312 #define MS_SYNC 4 3313 #define MAP_ANON MAP_ANONYMOUS 3314 3315 ------------------------------------------------------------------------------- 3316 3317 sys/msg.h 3318 3319 #define MSG_NOERROR 010000 3320 3321 ------------------------------------------------------------------------------- 3322 3323 sys/param.h 3324 3325 #define NOFILE 256 3326 #define MAXPATHLEN 4096 3327 3328 ------------------------------------------------------------------------------- 3329 3330 sys/poll.h 3331 3332 #define POLLIN 0x0001 3333 #define POLLPRI 0x0002 3334 #define POLLOUT 0x0004 3335 #define POLLERR 0x0008 3336 #define POLLHUP 0x0010 3337 #define POLLNVAL 0x0020 3338 3339 struct pollfd 3340 { 3341 int fd; 3342 short events; 3343 short revents; 3344 } 3345 ; 3346 typedef unsigned long nfds_t; 3347 3348 ------------------------------------------------------------------------------- 3349 3350 sys/resource.h 3351 3352 #define RUSAGE_CHILDREN (-1) 3353 #define RUSAGE_BOTH (-2) 3354 #define RLIM_INFINITY (~0UL) 3355 #define RLIM_SAVED_CUR -1 3356 #define RLIM_SAVED_MAX -1 3357 #define RLIMIT_CPU 0 3358 #define RUSAGE_SELF 0 3359 #define RLIMIT_FSIZE 1 3360 #define RLIMIT_DATA 2 3361 #define RLIMIT_STACK 3 3362 #define RLIMIT_CORE 4 3363 #define RLIMIT_NOFILE 7 3364 #define RLIMIT_AS 9 3365 3366 typedef unsigned long rlim_t; 3367 typedef unsigned long long rlim64_t; 3368 typedef int __rlimit_resource_t; 3369 3370 struct rlimit 3371 { 3372 rlim_t rlim_cur; 3373 rlim_t rlim_max; 3374 } 3375 ; 3376 struct rlimit64 3377 { 3378 rlim64_t rlim_cur; 3379 rlim64_t rlim_max; 3380 } 3381 ; 3382 3383 struct rusage 3384 { 3385 struct timeval ru_utime; 3386 struct timeval ru_stime; 3387 long ru_maxrss; 3388 long ru_ixrss; 3389 long ru_idrss; 3390 long ru_isrss; 3391 long ru_minflt; 3392 long ru_majflt; 3393 long ru_nswap; 3394 long ru_inblock; 3395 long ru_oublock; 3396 long ru_msgsnd; 3397 long ru_msgrcv; 3398 long ru_nsignals; 3399 long ru_nvcsw; 3400 long ru_nivcsw; 3401 } 3402 ; 3403 3404 enum __priority_which 3405 { 3406 PRIO_PROCESS, PRIO_PGRP = 1, PRIO_USER = 2 3407 } 3408 ; 3409 #define PRIO_PGRP PRIO_PGRP 3410 #define PRIO_PROCESS PRIO_PROCESS 3411 #define PRIO_USER PRIO_USER 3412 3413 typedef enum __priority_which __priority_which_t; 3414 3415 ------------------------------------------------------------------------------- 3416 3417 sys/sem.h 3418 3419 #define SEM_UNDO 0x1000 3420 #define GETPID 11 3421 #define GETVAL 12 3422 #define GETALL 13 3423 #define GETNCNT 14 3424 #define GETZCNT 15 3425 #define SETVAL 16 3426 #define SETALL 17 3427 3428 struct sembuf 3429 { 3430 short sem_num; 3431 short sem_op; 3432 short sem_flg; 3433 } 3434 ; 3435 3436 ------------------------------------------------------------------------------- 3437 3438 sys/shm.h 3439 3440 #define SHM_RDONLY 010000 3441 #define SHM_W 0200 3442 #define SHM_RND 020000 3443 #define SHM_R 0400 3444 #define SHM_REMAP 040000 3445 #define SHM_LOCK 11 3446 #define SHM_UNLOCK 12 3447 3448 ------------------------------------------------------------------------------- 3449 3450 sys/socket.h 3451 3452 #define SHUT_RD 0 3453 #define MSG_WAITALL 0x100 3454 #define MSG_TRUNC 0x20 3455 #define MSG_EOR 0x80 3456 #define SIOCGIFCONF 0x8912 3457 #define SIOCGIFFLAGS 0x8913 3458 #define SIOCGIFADDR 0x8915 3459 #define SIOCGIFNETMASK 0x891b 3460 #define MSG_OOB 1 3461 #define SHUT_WR 1 3462 #define MSG_PEEK 2 3463 #define SHUT_RDWR 2 3464 #define MSG_DONTROUTE 4 3465 #define MSG_CTRUNC 8 3466 #define PF_UNSPEC AF_UNSPEC 3467 3468 struct linger 3469 { 3470 int l_onoff; 3471 int l_linger; 3472 } 3473 ; 3474 struct cmsghdr 3475 { 3476 size_t cmsg_len; 3477 int cmsg_level; 3478 int cmsg_type; 3479 } 3480 ; 3481 struct iovec 3482 { 3483 void *iov_base; 3484 size_t iov_len; 3485 } 3486 ; 3487 3488 typedef unsigned short sa_family_t; 3489 typedef unsigned int socklen_t; 3490 3491 struct sockaddr 3492 { 3493 sa_family_t sa_family; 3494 char sa_data[14]; 3495 } 3496 ; 3497 struct sockaddr_storage 3498 { 3499 sa_family_t ss_family; 3500 __ss_aligntype __ss_align; 3501 char __ss_padding[(128 - (2 * sizeof (__ss_aligntype)))]; 3502 } 3503 ; 3504 3505 struct msghdr 3506 { 3507 void *msg_name; 3508 int msg_namelen; 3509 struct iovec *msg_iov; 3510 size_t msg_iovlen; 3511 void *msg_control; 3512 size_t msg_controllen; 3513 unsigned int msg_flags; 3514 } 3515 ; 3516 #define AF_UNSPEC 0 3517 #define AF_UNIX 1 3518 #define AF_INET6 10 3519 #define AF_INET 2 3520 3521 #define PF_INET AF_INET 3522 #define PF_INET6 AF_INET6 3523 #define PF_UNIX AF_UNIX 3524 3525 #define SOCK_STREAM 1 3526 #define SOCK_PACKET 10 3527 #define SOCK_DGRAM 2 3528 #define SOCK_RAW 3 3529 #define SOCK_RDM 4 3530 #define SOCK_SEQPACKET 5 3531 3532 #define SOL_SOCKET 1 3533 #define SO_DEBUG 1 3534 #define SO_OOBINLINE 10 3535 #define SO_NO_CHECK 11 3536 #define SO_PRIORITY 12 3537 #define SO_LINGER 13 3538 #define SO_REUSEADDR 2 3539 #define SOL_RAW 255 3540 #define SO_TYPE 3 3541 #define SO_ERROR 4 3542 #define SO_DONTROUTE 5 3543 #define SO_BROADCAST 6 3544 #define SO_SNDBUF 7 3545 #define SO_RCVBUF 8 3546 #define SO_KEEPALIVE 9 3547 3548 ------------------------------------------------------------------------------- 3549 3550 sys/stat.h 3551 3552 #define S_ISBLK(m) (((m)& S_IFMT)==S_IFBLK) 3553 #define S_ISCHR(m) (((m)& S_IFMT)==S_IFCHR) 3554 #define S_ISDIR(m) (((m)& S_IFMT)==S_IFDIR) 3555 #define S_ISFIFO(m) (((m)& S_IFMT)==S_IFIFO) 3556 #define S_ISLNK(m) (((m)& S_IFMT)==S_IFLNK) 3557 #define S_ISREG(m) (((m)& S_IFMT)==S_IFREG) 3558 #define S_ISSOCK(m) (((m)& S_IFMT)==S_IFSOCK) 3559 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 3560 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 3561 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 3562 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 3563 #define S_IROTH (S_IRGRP>>3) 3564 #define S_IRGRP (S_IRUSR>>3) 3565 #define S_IRWXO (S_IRWXG>>3) 3566 #define S_IRWXG (S_IRWXU>>3) 3567 #define S_IWOTH (S_IWGRP>>3) 3568 #define S_IWGRP (S_IWUSR>>3) 3569 #define S_IXOTH (S_IXGRP>>3) 3570 #define S_IXGRP (S_IXUSR>>3) 3571 #define S_ISVTX 01000 3572 #define S_IXUSR 0x0040 3573 #define S_IWUSR 0x0080 3574 #define S_IRUSR 0x0100 3575 #define S_ISGID 0x0400 3576 #define S_ISUID 0x0800 3577 #define S_IFIFO 0x1000 3578 #define S_IFCHR 0x2000 3579 #define S_IFDIR 0x4000 3580 #define S_IFBLK 0x6000 3581 #define S_IFREG 0x8000 3582 #define S_IFLNK 0xa000 3583 #define S_IFSOCK 0xc000 3584 #define S_IFMT 0xf000 3585 #define st_atime st_atim.tv_sec 3586 #define st_ctime st_ctim.tv_sec 3587 #define st_mtime st_mtim.tv_sec 3588 #define S_IREAD S_IRUSR 3589 #define S_IWRITE S_IWUSR 3590 #define S_IEXEC S_IXUSR 3591 3592 ------------------------------------------------------------------------------- 3593 3594 sys/time.h 3595 3596 #define ITIMER_REAL 0 3597 #define ITIMER_VIRTUAL 1 3598 #define ITIMER_PROF 2 3599 3600 struct timezone 3601 { 3602 int tz_minuteswest; 3603 int tz_dsttime; 3604 } 3605 ; 3606 3607 typedef int __itimer_which_t; 3608 3609 struct timespec 3610 { 3611 time_t tv_sec; 3612 long tv_nsec; 3613 } 3614 ; 3615 3616 struct timeval 3617 { 3618 time_t tv_sec; 3619 suseconds_t tv_usec; 3620 } 3621 ; 3622 3623 struct itimerval 3624 { 3625 struct timeval it_interval; 3626 struct timeval it_value; 3627 } 3628 ; 3629 3630 ------------------------------------------------------------------------------- 3631 3632 sys/timeb.h 3633 3634 struct timeb 3635 { 3636 time_t time; 3637 unsigned short millitm; 3638 short timezone; 3639 short dstflag; 3640 } 3641 ; 3642 3643 ------------------------------------------------------------------------------- 3644 3645 sys/times.h 3646 3647 struct tms 3648 { 3649 clock_t tms_utime; 3650 clock_t tms_stime; 3651 clock_t tms_cutime; 3652 clock_t tms_cstime; 3653 } 3654 ; 3655 3656 ------------------------------------------------------------------------------- 3657 3658 sys/types.h 3659 3660 #define FD_ISSET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& (1<<((d)%(8*sizeof(long))))) 3661 #define FD_CLR(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& =~(1<<((d)%(8*sizeof(long))))) 3662 #define FD_SET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<((d)%(8*sizeof(long))))) 3663 #define FALSE 0 3664 #define TRUE 1 3665 #define FD_SETSIZE 1024 3666 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 3667 3668 typedef signed char int8_t; 3669 typedef short int16_t; 3670 typedef int int32_t; 3671 typedef unsigned char u_int8_t; 3672 typedef unsigned short u_int16_t; 3673 typedef unsigned int u_int32_t; 3674 typedef unsigned int uid_t; 3675 typedef int pid_t; 3676 typedef unsigned long off_t; 3677 typedef int key_t; 3678 typedef long suseconds_t; 3679 typedef unsigned int u_int; 3680 typedef struct 3681 { 3682 int __val[2]; 3683 } 3684 fsid_t; 3685 typedef unsigned int useconds_t; 3686 typedef unsigned long blksize_t; 3687 typedef long fd_mask; 3688 typedef int timer_t; 3689 typedef int clockid_t; 3690 3691 typedef unsigned int id_t; 3692 3693 typedef unsigned long long ino64_t; 3694 typedef long long loff_t; 3695 typedef unsigned long blkcnt_t; 3696 typedef unsigned long fsblkcnt_t; 3697 typedef unsigned long fsfilcnt_t; 3698 typedef unsigned long long blkcnt64_t; 3699 typedef unsigned long long fsblkcnt64_t; 3700 typedef unsigned long long fsfilcnt64_t; 3701 typedef unsigned char u_char; 3702 typedef unsigned short u_short; 3703 typedef unsigned long u_long; 3704 3705 typedef unsigned long ino_t; 3706 typedef unsigned int gid_t; 3707 typedef unsigned long long dev_t; 3708 typedef unsigned int mode_t; 3709 typedef unsigned long nlink_t; 3710 typedef char *caddr_t; 3711 3712 typedef struct 3713 { 3714 unsigned long fds_bits[__FDSET_LONGS]; 3715 } 3716 fd_set; 3717 3718 typedef long clock_t; 3719 typedef long time_t; 3720 3721 ------------------------------------------------------------------------------- 3722 3723 sys/un.h 3724 3725 #define UNIX_PATH_MAX 108 3726 3727 struct sockaddr_un 3728 { 3729 sa_family_t sun_family; 3730 char sun_path[UNIX_PATH_MAX]; 3731 } 3732 ; 3733 3734 ------------------------------------------------------------------------------- 3735 3736 sys/utsname.h 3737 3738 #define SYS_NMLN 65 3739 3740 struct utsname 3741 { 3742 char sysname[65]; 3743 char nodename[65]; 3744 char release[65]; 3745 char version[65]; 3746 char machine[65]; 3747 char domainname[65]; 3748 } 3749 ; 3750 3751 ------------------------------------------------------------------------------- 3752 3753 sys/wait.h 3754 3755 #define WIFSIGNALED(status) (!WIFSTOPPED(status) & & !WIFEXITED(status)) 3756 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 3757 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 3758 #define WTERMSIG(status) ((status) & 0x7f) 3759 #define WCOREDUMP(status) ((status) & 0x80) 3760 #define WIFEXITED(status) (WTERMSIG(status) == 0) 3761 #define WNOHANG 0x00000001 3762 #define WUNTRACED 0x00000002 3763 #define WCOREFLAG 0x80 3764 #define WSTOPSIG(status) WEXITSTATUS(status) 3765 3766 typedef enum 3767 { 3768 P_ALL, P_PID, P_PGID 3769 } 3770 idtype_t; 3771 3772 ------------------------------------------------------------------------------- 3773 3774 syslog.h 3775 3776 #define LOG_EMERG 0 3777 #define LOG_PRIMASK 0x07 3778 #define LOG_ALERT 1 3779 #define LOG_CRIT 2 3780 #define LOG_ERR 3 3781 #define LOG_WARNING 4 3782 #define LOG_NOTICE 5 3783 #define LOG_INFO 6 3784 #define LOG_DEBUG 7 3785 3786 #define LOG_KERN (0<<3) 3787 #define LOG_AUTHPRIV (10<<3) 3788 #define LOG_FTP (11<<3) 3789 #define LOG_USER (1<<3) 3790 #define LOG_MAIL (2<<3) 3791 #define LOG_DAEMON (3<<3) 3792 #define LOG_AUTH (4<<3) 3793 #define LOG_SYSLOG (5<<3) 3794 #define LOG_LPR (6<<3) 3795 #define LOG_NEWS (7<<3) 3796 #define LOG_UUCP (8<<3) 3797 #define LOG_CRON (9<<3) 3798 #define LOG_FACMASK 0x03f8 3799 3800 #define LOG_LOCAL0 (16<<3) 3801 #define LOG_LOCAL1 (17<<3) 3802 #define LOG_LOCAL2 (18<<3) 3803 #define LOG_LOCAL3 (19<<3) 3804 #define LOG_LOCAL4 (20<<3) 3805 #define LOG_LOCAL5 (21<<3) 3806 #define LOG_LOCAL6 (22<<3) 3807 #define LOG_LOCAL7 (23<<3) 3808 3809 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 3810 #define LOG_MASK(pri) (1 << (pri)) 3811 3812 #define LOG_PID 0x01 3813 #define LOG_CONS 0x02 3814 #define LOG_ODELAY 0x04 3815 #define LOG_NDELAY 0x08 3816 #define LOG_NOWAIT 0x10 3817 #define LOG_PERROR 0x20 3818 3819 ------------------------------------------------------------------------------- 3820 3821 termios.h 3822 3823 #define TCIFLUSH 0 3824 #define TCOOFF 0 3825 #define TCSANOW 0 3826 #define BS0 0000000 3827 #define CR0 0000000 3828 #define FF0 0000000 3829 #define NL0 0000000 3830 #define TAB0 0000000 3831 #define VT0 0000000 3832 #define OPOST 0000001 3833 #define OCRNL 0000010 3834 #define ONOCR 0000020 3835 #define ONLRET 0000040 3836 #define OFILL 0000100 3837 #define OFDEL 0000200 3838 #define NL1 0000400 3839 #define TCOFLUSH 1 3840 #define TCOON 1 3841 #define TCSADRAIN 1 3842 #define TCIOFF 2 3843 #define TCIOFLUSH 2 3844 #define TCSAFLUSH 2 3845 #define TCION 3 3846 3847 typedef unsigned int speed_t; 3848 typedef unsigned char cc_t; 3849 typedef unsigned int tcflag_t; 3850 #define NCCS 32 3851 3852 struct termios 3853 { 3854 tcflag_t c_iflag; 3855 tcflag_t c_oflag; 3856 tcflag_t c_cflag; 3857 tcflag_t c_lflag; 3858 cc_t c_line; 3859 cc_t c_cc[NCCS]; 3860 speed_t c_ispeed; 3861 speed_t c_ospeed; 3862 } 3863 ; 3864 #define VINTR 0 3865 #define VQUIT 1 3866 #define VLNEXT 15 3867 #define VERASE 2 3868 #define VKILL 3 3869 #define VEOF 4 3870 3871 #define IGNBRK 0000001 3872 #define BRKINT 0000002 3873 #define IGNPAR 0000004 3874 #define PARMRK 0000010 3875 #define INPCK 0000020 3876 #define ISTRIP 0000040 3877 #define INLCR 0000100 3878 #define IGNCR 0000200 3879 #define ICRNL 0000400 3880 #define IXANY 0004000 3881 #define IMAXBEL 0020000 3882 3883 #define CS5 0000000 3884 3885 #define ECHO 0000010 3886 3887 #define B0 0000000 3888 #define B50 0000001 3889 #define B75 0000002 3890 #define B110 0000003 3891 #define B134 0000004 3892 #define B150 0000005 3893 #define B200 0000006 3894 #define B300 0000007 3895 #define B600 0000010 3896 #define B1200 0000011 3897 #define B1800 0000012 3898 #define B2400 0000013 3899 #define B4800 0000014 3900 #define B9600 0000015 3901 #define B19200 0000016 3902 #define B38400 0000017 3903 3904 ------------------------------------------------------------------------------- 3905 3906 time.h 3907 3908 #define CLK_TCK ((clock_t)__sysconf(2)) 3909 #define CLOCK_REALTIME 0 3910 #define TIMER_ABSTIME 1 3911 #define CLOCKS_PER_SEC 1000000l 3912 3913 struct tm 3914 { 3915 int tm_sec; 3916 int tm_min; 3917 int tm_hour; 3918 int tm_mday; 3919 int tm_mon; 3920 int tm_year; 3921 int tm_wday; 3922 int tm_yday; 3923 int tm_isdst; 3924 long tm_gmtoff; 3925 char *tm_zone; 3926 } 3927 ; 3928 struct itimerspec 3929 { 3930 struct timespec it_interval; 3931 struct timespec it_value; 3932 } 3933 ; 3934 3935 ------------------------------------------------------------------------------- 3936 3937 ulimit.h 3938 3939 #define UL_GETFSIZE 1 3940 #define UL_SETFSIZE 2 3941 3942 ------------------------------------------------------------------------------- 3943 3944 unistd.h 3945 3946 #define SEEK_SET 0 3947 #define STDIN_FILENO 0 3948 #define SEEK_CUR 1 3949 #define STDOUT_FILENO 1 3950 #define SEEK_END 2 3951 #define STDERR_FILENO 2 3952 3953 typedef long long off64_t; 3954 #define F_OK 0 3955 #define X_OK 1 3956 #define W_OK 2 3957 #define R_OK 4 3958 3959 #define _POSIX_VDISABLE '\0' 3960 #define _POSIX_CHOWN_RESTRICTED 1 3961 #define _POSIX_JOB_CONTROL 1 3962 #define _POSIX_NO_TRUNC 1 3963 #define _POSIX_SHELL 1 3964 #define _POSIX_FSYNC 200112 3965 #define _POSIX_MAPPED_FILES 200112 3966 #define _POSIX_MEMLOCK 200112 3967 #define _POSIX_MEMLOCK_RANGE 200112 3968 #define _POSIX_MEMORY_PROTECTION 200112 3969 #define _POSIX_SEMAPHORES 200112 3970 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 3971 #define _POSIX_TIMERS 200112 3972 #define _POSIX2_C_BIND 200112L 3973 #define _POSIX2_VERSION 200112L 3974 #define _POSIX_THREADS 200112L 3975 #define _POSIX_VERSION 200112L 3976 3977 #define _PC_LINK_MAX 0 3978 #define _PC_MAX_CANON 1 3979 #define _PC_ASYNC_IO 10 3980 #define _PC_PRIO_IO 11 3981 #define _PC_FILESIZEBITS 13 3982 #define _PC_REC_INCR_XFER_SIZE 14 3983 #define _PC_REC_MIN_XFER_SIZE 16 3984 #define _PC_REC_XFER_ALIGN 17 3985 #define _PC_ALLOC_SIZE_MIN 18 3986 #define _PC_MAX_INPUT 2 3987 #define _PC_2_SYMLINKS 20 3988 #define _PC_NAME_MAX 3 3989 #define _PC_PATH_MAX 4 3990 #define _PC_PIPE_BUF 5 3991 #define _PC_CHOWN_RESTRICTED 6 3992 #define _PC_NO_TRUNC 7 3993 #define _PC_VDISABLE 8 3994 #define _PC_SYNC_IO 9 3995 3996 #define _SC_ARG_MAX 0 3997 #define _SC_CHILD_MAX 1 3998 #define _SC_PRIORITY_SCHEDULING 10 3999 #define _SC_TIMERS 11 4000 #define _SC_ASYNCHRONOUS_IO 12 4001 #define _SC_XBS5_ILP32_OFF32 125 4002 #define _SC_XBS5_ILP32_OFFBIG 126 4003 #define _SC_XBS5_LP64_OFF64 127 4004 #define _SC_XBS5_LPBIG_OFFBIG 128 4005 #define _SC_XOPEN_LEGACY 129 4006 #define _SC_PRIORITIZED_IO 13 4007 #define _SC_XOPEN_REALTIME 130 4008 #define _SC_XOPEN_REALTIME_THREADS 131 4009 #define _SC_ADVISORY_INFO 132 4010 #define _SC_BARRIERS 133 4011 #define _SC_CLOCK_SELECTION 137 4012 #define _SC_CPUTIME 138 4013 #define _SC_THREAD_CPUTIME 139 4014 #define _SC_SYNCHRONIZED_IO 14 4015 #define _SC_MONOTONIC_CLOCK 149 4016 #define _SC_FSYNC 15 4017 #define _SC_READER_WRITER_LOCKS 153 4018 #define _SC_SPIN_LOCKS 154 4019 #define _SC_REGEXP 155 4020 #define _SC_SHELL 157 4021 #define _SC_SPAWN 159 4022 #define _SC_MAPPED_FILES 16 4023 #define _SC_SPORADIC_SERVER 160 4024 #define _SC_THREAD_SPORADIC_SERVER 161 4025 #define _SC_TIMEOUTS 164 4026 #define _SC_TYPED_MEMORY_OBJECTS 165 4027 #define _SC_2_PBS_ACCOUNTING 169 4028 #define _SC_MEMLOCK 17 4029 #define _SC_2_PBS_LOCATE 170 4030 #define _SC_2_PBS_MESSAGE 171 4031 #define _SC_2_PBS_TRACK 172 4032 #define _SC_SYMLOOP_MAX 173 4033 #define _SC_2_PBS_CHECKPOINT 175 4034 #define _SC_V6_ILP32_OFF32 176 4035 #define _SC_V6_ILP32_OFFBIG 177 4036 #define _SC_V6_LP64_OFF64 178 4037 #define _SC_V6_LPBIG_OFFBIG 179 4038 #define _SC_MEMLOCK_RANGE 18 4039 #define _SC_HOST_NAME_MAX 180 4040 #define _SC_TRACE 181 4041 #define _SC_TRACE_EVENT_FILTER 182 4042 #define _SC_TRACE_INHERIT 183 4043 #define _SC_TRACE_LOG 184 4044 #define _SC_MEMORY_PROTECTION 19 4045 #define _SC_CLK_TCK 2 4046 #define _SC_MESSAGE_PASSING 20 4047 #define _SC_SEMAPHORES 21 4048 #define _SC_SHARED_MEMORY_OBJECTS 22 4049 #define _SC_AIO_LISTIO_MAX 23 4050 #define _SC_AIO_MAX 24 4051 #define _SC_AIO_PRIO_DELTA_MAX 25 4052 #define _SC_DELAYTIMER_MAX 26 4053 #define _SC_MQ_OPEN_MAX 27 4054 #define _SC_MQ_PRIO_MAX 28 4055 #define _SC_VERSION 29 4056 #define _SC_NGROUPS_MAX 3 4057 #define _SC_PAGESIZE 30 4058 #define _SC_PAGE_SIZE 30 4059 #define _SC_RTSIG_MAX 31 4060 #define _SC_SEM_NSEMS_MAX 32 4061 #define _SC_SEM_VALUE_MAX 33 4062 #define _SC_SIGQUEUE_MAX 34 4063 #define _SC_TIMER_MAX 35 4064 #define _SC_BC_BASE_MAX 36 4065 #define _SC_BC_DIM_MAX 37 4066 #define _SC_BC_SCALE_MAX 38 4067 #define _SC_BC_STRING_MAX 39 4068 #define _SC_OPEN_MAX 4 4069 #define _SC_COLL_WEIGHTS_MAX 40 4070 #define _SC_EXPR_NEST_MAX 42 4071 #define _SC_LINE_MAX 43 4072 #define _SC_RE_DUP_MAX 44 4073 #define _SC_2_VERSION 46 4074 #define _SC_2_C_BIND 47 4075 #define _SC_2_C_DEV 48 4076 #define _SC_2_FORT_DEV 49 4077 #define _SC_STREAM_MAX 5 4078 #define _SC_2_FORT_RUN 50 4079 #define _SC_2_SW_DEV 51 4080 #define _SC_2_LOCALEDEF 52 4081 #define _SC_TZNAME_MAX 6 4082 #define _SC_IOV_MAX 60 4083 #define _SC_THREADS 67 4084 #define _SC_THREAD_SAFE_FUNCTIONS 68 4085 #define _SC_GETGR_R_SIZE_MAX 69 4086 #define _SC_JOB_CONTROL 7 4087 #define _SC_GETPW_R_SIZE_MAX 70 4088 #define _SC_LOGIN_NAME_MAX 71 4089 #define _SC_TTY_NAME_MAX 72 4090 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 4091 #define _SC_THREAD_KEYS_MAX 74 4092 #define _SC_THREAD_STACK_MIN 75 4093 #define _SC_THREAD_THREADS_MAX 76 4094 #define _SC_THREAD_ATTR_STACKADDR 77 4095 #define _SC_THREAD_ATTR_STACKSIZE 78 4096 #define _SC_THREAD_PRIORITY_SCHEDULING 79 4097 #define _SC_SAVED_IDS 8 4098 #define _SC_THREAD_PRIO_INHERIT 80 4099 #define _SC_THREAD_PRIO_PROTECT 81 4100 #define _SC_THREAD_PROCESS_SHARED 82 4101 #define _SC_ATEXIT_MAX 87 4102 #define _SC_PASS_MAX 88 4103 #define _SC_XOPEN_VERSION 89 4104 #define _SC_REALTIME_SIGNALS 9 4105 #define _SC_XOPEN_UNIX 91 4106 #define _SC_XOPEN_CRYPT 92 4107 #define _SC_XOPEN_ENH_I18N 93 4108 #define _SC_XOPEN_SHM 94 4109 #define _SC_2_CHAR_TERM 95 4110 #define _SC_2_C_VERSION 96 4111 #define _SC_2_UPE 97 4112 4113 #define _CS_PATH 0 4114 #define _POSIX_REGEXP 1 4115 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 4116 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 4117 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 4118 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 4119 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 4120 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 4121 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 4122 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 4123 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 4124 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 4125 #define _CS_XBS5_LP64_OFF64_LIBS 1110 4126 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 4127 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 4128 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 4129 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 4130 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 4131 4132 #define _XOPEN_REALTIME 1 4133 #define _XOPEN_XPG4 1 4134 #define _XOPEN_XCU_VERSION 4 4135 #define _XOPEN_VERSION 500 4136 4137 #define F_ULOCK 0 4138 #define F_LOCK 1 4139 #define F_TLOCK 2 4140 #define F_TEST 3 4141 4142 ------------------------------------------------------------------------------- 4143 4144 utime.h 4145 4146 struct utimbuf 4147 { 4148 time_t actime; 4149 time_t modtime; 4150 } 4151 ; 4152 4153 ------------------------------------------------------------------------------- 4154 4155 utmp.h 4156 4157 #define UT_HOSTSIZE 256 4158 #define UT_LINESIZE 32 4159 #define UT_NAMESIZE 32 4160 4161 struct exit_status 4162 { 4163 short e_termination; 4164 short e_exit; 4165 } 4166 ; 4167 4168 #define EMPTY 0 4169 #define RUN_LVL 1 4170 #define BOOT_TIME 2 4171 #define NEW_TIME 3 4172 #define OLD_TIME 4 4173 #define INIT_PROCESS 5 4174 #define LOGIN_PROCESS 6 4175 #define USER_PROCESS 7 4176 #define DEAD_PROCESS 8 4177 #define ACCOUNTING 9 4178 4179 ------------------------------------------------------------------------------- 4180 4181 wchar.h 4182 4183 #define WEOF (0xffffffffu) 4184 #define WCHAR_MAX 0x7FFFFFFF 4185 #define WCHAR_MIN 0x80000000 4186 4187 ------------------------------------------------------------------------------- 4188 4189 wctype.h 4190 4191 typedef unsigned long wctype_t; 4192 typedef unsigned int wint_t; 4193 typedef const int32_t *wctrans_t; 4194 typedef struct 4195 { 4196 int count; 4197 wint_t value; 4198 } 4199 __mbstate_t; 4200 4201 typedef __mbstate_t mbstate_t; 4202 4203 ------------------------------------------------------------------------------- 4204 4205 wordexp.h 4206 4207 enum 4208 { 4209 WRDE_DOOFFS, WRDE_APPEND, WRDE_NOCMD, WRDE_REUSE, WRDE_SHOWERR, WRDE_UNDEF, 4210 __WRDE_FLAGS 4211 } 4212 ; 4213 4214 typedef struct 4215 { 4216 int we_wordc; 4217 char **we_wordv; 4218 int we_offs; 4219 } 4220 wordexp_t; 4221 4222 enum 4223 { 4224 WRDE_NOSYS, WRDE_NOSPACE, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB, 4225 WRDE_SYNTAX 4226 } 4227 ; 4228 4229 ------------------------------------------------------------------------------- 4230 4231 Interface Definitions for libc 4232 4233 Table of Contents 4234 _IO_feof -- alias for feof 4235 _IO_getc -- alias for getc 4236 _IO_putc -- alias for putc 4237 _IO_puts -- alias for puts 4238 __assert_fail -- abort the program after false assertion 4239 __ctype_b_loc -- accessor function for __ctype_b array for ctype functions 4240 __ctype_get_mb_cur_max -- maximum length of a multibyte character in the 4241 current locale 4242 __ctype_tolower_loc -- accessor function for __ctype_b_tolower array for ctype 4243 tolower() function 4244 __ctype_toupper_loc -- accessor function for __ctype_b_toupper array for ctype 4245 toupper() function 4246 __cxa_atexit -- register a function to be called by exit or when a shared 4247 library is unloaded 4248 __daylight -- global variable containing daylight 4249 __environ -- alias for environ - user environment 4250 __errno_location -- address of errno variable 4251 __fpending -- returns in bytes the amount of output pending on a stream 4252 __getpagesize -- alias for getpagesize - get current page size 4253 __getpgid -- get the process group id 4254 __h_errno_location -- address of h_errno variable 4255 __isinf -- test for infinity 4256 __isinff -- test for infinity 4257 __isinfl -- test for infinity 4258 __isnan -- test for infinity 4259 __isnanf -- test for infinity 4260 __isnanl -- test for infinity 4261 __libc_current_sigrtmax -- return number of available real-time signal with 4262 lowest priority 4263 __libc_current_sigrtmin -- return number of available real-time signal with 4264 highest priority 4265 __libc_start_main -- initialization routine 4266 __lxstat -- inline wrapper around call to lxstat 4267 __mempcpy -- copy given number of bytes of source to destination 4268 __rawmemchr -- scan memory 4269 __register_atfork -- alias for register_atfork 4270 __sigsetjmp -- save stack context for non-local goto 4271 __stpcpy -- copy a string returning a pointer to its end 4272 __strdup -- alias for strdup 4273 __strtod_internal -- underlying function for strtod 4274 __strtof_internal -- underlying function for strtof 4275 __strtok_r -- alias for strtok_r 4276 __strtol_internal -- alias for strtol 4277 __strtold_internal -- underlying function for strtold 4278 __strtoll_internal -- underlying function for strtoll 4279 __strtoul_internal -- underlying function for strtoul 4280 __strtoull_internal -- underlying function for strtoull 4281 __sysconf -- get configuration information at runtime 4282 __sysv_signal -- signal handling 4283 __timezone -- global variable containing timezone 4284 __tzname -- global variable containing the timezone 4285 __wcstod_internal -- underlying function for wcstod 4286 __wcstof_internal -- underlying function for wcstof 4287 __wcstol_internal -- underlying function for wcstol 4288 __wcstold_internal -- underlying function for wcstold 4289 __wcstoul_internal -- underlying function for wcstoul 4290 __xmknod -- make block or character special file 4291 __xstat -- provide inode information 4292 __xstat64 -- provide inode information 4293 _environ -- alias for environ - user environment 4294 _nl_msg_cat_cntr -- new catalog load counter 4295 _obstack_begin -- initialize an obstack for use 4296 _obstack_newchunk -- allocate a new current chunk of memory for the obstack 4297 _sys_errlist -- array containing the "C" locale strings used by strerror() 4298 _sys_siglist -- array containing the names of the signal names 4299 acct -- switch process accounting on or off 4300 adjtime -- correct the time to allow synchronization of the system clock 4301 adjtimex -- tune kernel clock (DEPRECATED) 4302 asprintf -- write formatted output to a string dynamically allocated with 4303 malloc and store the address of the string 4304 bind_textdomain_codeset -- specify encoding for message retrieval from message 4305 catalog for domain DOMAINNAME 4306 bindresvport -- bind socket to privileged IP port 4307 bindtextdomain -- specify the locale of a message catalog 4308 cfmakeraw -- get and set terminal attributes 4309 cfsetspeed -- set terminal input and output data rate 4310 creat -- open a file 4311 daemon -- run in the background 4312 dcgettext -- perform lookup in message catalog for the current LC_MESSAGES 4313 locale 4314 dcngettext -- perform lookup in message catalog for the current LC_MESSAGES 4315 locale 4316 dgettext -- perform lookup in message catalog for the current LC_MESSAGES 4317 locale 4318 dngettext -- perform lookup in message catalog for the current LC_MESSAGES 4319 locale 4320 err -- display formatted error messages 4321 error -- print error message 4322 errx -- format error messages 4323 fcntl -- file control 4324 fflush_unlocked -- non thread safe fflush 4325 fgetwc_unlocked -- non thread safe fgetwc 4326 flock -- apply or remove an advisory lock on an open file 4327 fopen -- open a file 4328 freopen -- open a file 4329 getdomainname -- get NIS domain name. 4330 gethostbyname_r -- find network host database entry matching host name 4331 (DEPRECATED) 4332 getloadavg -- get system load averages 4333 getopt -- parse command line options 4334 getopt_long -- parse command line options 4335 getopt_long_only -- parse command line options 4336 gettext -- perform lookup in message catalog for the current LC_MESSAGES locale 4337 getutent -- access utmp file entries 4338 getutent_r -- access utmp file entries 4339 glob64 -- find pathnames matching a pattern (Large File Support) 4340 globfree64 -- free memory from glob64() (Large File Support) 4341 initgroups -- initialize the supplementary group access list 4342 ioctl -- control device 4343 sockio -- socket ioctl commands 4344 iswctype -- wide character classification 4345 kill -- send a signal 4346 mbsnrtowcs -- convert a multibyte string to a wide character string 4347 memmem -- locate a substring 4348 memrchr -- scan memory for a character 4349 ngettext -- perform lookup in message catalog for the current LC_MESSAGES 4350 locale 4351 obstack_free -- free an object in the obstack 4352 open -- open a file 4353 opterr -- external variable used in getopt() 4354 optind -- external variable used in getopt() 4355 optopt -- external variable used in getopt() 4356 pmap_getport -- Returns the port number on which a service is waiting for. 4357 pmap_set -- Establishes mapping to machine's portmap service. 4358 pmap_unset -- Destroys all mapping between the triple and ports. 4359 psignal -- print signal message 4360 random_r -- generate random number 4361 setbuffer -- stream buffering operation 4362 setdomainname -- set NIS domain name. 4363 setgroups -- set list of supplementary group IDs 4364 sethostid -- set the unique identifier of the current host 4365 sethostname -- set host name 4366 setsockopt -- set options on sockets 4367 setutent -- access utmp file entries 4368 sigandset -- build a new signal set by combining the two input sets using 4369 logical AND 4370 sigblock -- manipulate the signal mask 4371 siggetmask -- manipulate the signal mask 4372 sigisemptyset -- check for empty signal set 4373 sigorset -- build a new signal set by combining the two input sets using 4374 logical or 4375 sigreturn -- return from signal handler and cleanup stack frame 4376 stime -- set time 4377 stpcpy -- copy a string returning a pointer to its end 4378 stpncpy -- copy a fixed-size string, returning a pointer to its end 4379 strcasestr -- locate a substring - ignores the case of both strings 4380 strerror_r -- reentrant version of strerror 4381 strfry -- randomize a string 4382 strndup -- return a malloc'd copy of at most the specified number of bytes of a 4383 string 4384 strnlen -- determine the length of a fixed-size string 4385 strptime -- parse a time string 4386 strsep -- extract token from string 4387 strsignal -- return string describing signal 4388 strtok_r -- extract tokens from strings 4389 strtoq -- convert string value to a long or quad_t integer 4390 strtouq -- convert a string to an uquad_t 4391 strverscmp -- compare strings holding name and indices/version numbers 4392 svc_register -- Associates program and versnum with the service dispatch 4393 procedure, dispatch. 4394 svc_run -- Waits for RPC requests to arrive and calls service procedure. 4395 svc_sendreply -- called by RPC service's dispatch routine 4396 svctcp_create -- Creates a TCP/IP-based RPC service transport. 4397 svcudp_create -- Creates a UDP-based RPC service transport. 4398 system -- execute a shell command 4399 textdomain -- set the current default message catalog 4400 unlink -- remove a directory entry 4401 vasprintf -- write formatted output to a string dynamically allocated with 4402 malloc and store the address of the string 4403 vdprintf -- write formatted output to a file descriptor 4404 verrx -- display formatted error messages 4405 vsyslog -- log to system log 4406 wait3 -- wait for child process 4407 wait4 -- wait for process termination, BSD style 4408 waitpid -- wait for child process 4409 warn -- formatted error messages 4410 warnx -- formatted error messages 4411 wcpcpy -- copy a wide character string, returning a pointer to its end 4412 wcpncpy -- copy a fixed-size string of wide characters, returning a pointer to 4413 its end 4414 wcscasecmp -- compare two wide-character strings, ignoring case 4415 wcsdup -- duplicate a wide-character string 4416 wcsncasecmp -- compare two fixed-size wide-character strings, ignoring case 4417 wcsnlen -- determine the length of a fixed-size wide-character string 4418 wcsnrtombs -- convert a wide character string to a multi-byte string 4419 wcstoq -- convert initial portion of wide string NPTR to long int 4420 representation 4421 wcstouq -- convert initial portion of wide string NPTR to unsigned long long 4422 int representation 4423 xdr_u_int -- library routines for external data representation 4424 4425 The following interfaces are included in libc and are defined by this 4426 specification. Unless otherwise noted, these interfaces shall be included in 4427 the source standard. 4428 4429 Other interfaces listed above for libc shall behave as described in the 4430 referenced base document. 4431 4432 _IO_feof 4433 4434 Name 4435 4436 _IO_feof -- alias for feof 4437 4438 Synopsis 4439 4440 int _IO_feof(_IO_FILE *__fp); 4441 4442 Description 4443 4444 _IO_feof tests the end-of-file indicator for the stream pointed to by __fp, 4445 returning a non-zero value if it is set. 4446 4447 _IO_feof is not in the source standard; it is only in the binary standard. 4448 4449 _IO_getc 4450 4451 Name 4452 4453 _IO_getc -- alias for getc 4454 4455 Synopsis 4456 4457 int _IO_getc(_IO_FILE *__fp); 4458 4459 Description 4460 4461 _IO_getc reads the next character from __fp and returns it as an unsigned char 4462 cast to an int, or EOF on end-of-file or error. 4463 4464 _IO_getc is not in the source standard; it is only in the binary standard. 4465 4466 _IO_putc 4467 4468 Name 4469 4470 _IO_putc -- alias for putc 4471 4472 Synopsis 4473 4474 int _IO_putc(int __c, _IO_FILE *__fp); 4475 4476 Description 4477 4478 _IO_putc writes the character __c, cast to an unsigned char, to __fp. 4479 4480 _IO_putc is not in the source standard; it is only in the binary standard. 4481 4482 _IO_puts 4483 4484 Name 4485 4486 _IO_puts -- alias for puts 4487 4488 Synopsis 4489 4490 int _IO_puts(const char *__c); 4491 4492 Description 4493 4494 _IO_puts writes the string __s and a trailing newline to stdout. 4495 4496 _IO_puts is not in the source standard; it is only in the binary standard. 4497 4498 __assert_fail 4499 4500 Name 4501 4502 __assert_fail -- abort the program after false assertion 4503 4504 Synopsis 4505 4506 void __assert_fail(const char *assertion, const char *file, unsigned int line, 4507 const char *function); 4508 4509 Description 4510 4511 __assert_fail receives a string containing the expression assertion, the 4512 filename file, and the line number line, and prints a message on the standard 4513 error stream. For example: 4514 4515 4516 a.c:10: foobar: Assertion a == b failed. 4517 4518 __assert_fail then aborts program execution via a call to abort. The exact form 4519 of the message is up to the implementation. 4520 4521 If function is NULL, then omit information about the function. 4522 4523 assertion, file, and line shall be non-NULL. 4524 4525 __assert_fail is not in the source standard; it is only in the binary standard. 4526 4527 __ctype_b_loc 4528 4529 Name 4530 4531 __ctype_b_loc -- accessor function for __ctype_b array for ctype functions 4532 4533 Synopsis 4534 4535 #include 4536 4537 extern const unsigned short int **ctype_b_loc(void); 4538 4539 Description 4540 4541 __ctype_b_loc() returns the address of the array to be used by the ctype 4542 functions. This array is locale aware, and is local to the current thread if 4543 the application is multithreaded. 4544 4545 __ctype_get_mb_cur_max 4546 4547 Name 4548 4549 __ctype_get_mb_cur_max -- maximum length of a multibyte character in the 4550 current locale 4551 4552 Synopsis 4553 4554 size_t __ctype_get_mb_cur_max(void); 4555 4556 Description 4557 4558 __ctype_get_mb_cur_max returns the maximum length of a multibyte character in 4559 the current locale. 4560 4561 __ctype_get_mb_cur_max is not in the source standard; it is only in the binary 4562 standard. 4563 4564 __ctype_tolower_loc 4565 4566 Name 4567 4568 __ctype_tolower_loc -- accessor function for __ctype_b_tolower array for ctype 4569 tolower() function 4570 4571 Synopsis 4572 4573 #include 4574 4575 int32_t **__ctype_tolower_loc(void); 4576 4577 Description 4578 4579 __ctype_tolower_loc() returns the address of the array to be used by the 4580 tolower function. This array is locale aware, and is local to the current 4581 thread if the application is multithreaded. 4582 4583 __ctype_toupper_loc 4584 4585 Name 4586 4587 __ctype_toupper_loc -- accessor function for __ctype_b_toupper array for ctype 4588 toupper() function 4589 4590 Synopsis 4591 4592 #include 4593 4594 int32_t **__ctype_toupper_loc(void); 4595 4596 Description 4597 4598 __ctype_toupper_loc() returns the address of the array to be used by the 4599 toupper function. This array is locale aware, and is local to the current 4600 thread if the application is multithreaded. 4601 4602 __cxa_atexit 4603 4604 Name 4605 4606 __cxa_atexit -- register a function to be called by exit or when a shared 4607 library is unloaded 4608 4609 Synopsis 4610 4611 int __cxa_atexit(void (*func) (void *), void *arg, void *d); 4612 4613 Description 4614 4615 __cxa_atexit registers a function to be called by exit or when a shared library 4616 is unloaded. This function is only called from code generated by the C++ 4617 compiler. 4618 4619 __cxa_atexit has the same specification as atexit. 4620 4621 __cxa_atexit is not in the source standard; it is only in the binary standard. 4622 4623 __daylight 4624 4625 Name 4626 4627 -- global variable containing daylight 4628 4629 Synopsis 4630 4631 int __daylight; 4632 4633 Description 4634 4635 __daylight is as specified in the ISO/IEC 9945:2003 Portable Operating System 4636 (POSIX)and The Single UNIX Specification(SUS) V3. 4637 4638 __environ 4639 4640 Name 4641 4642 __environ -- alias for environ - user environment 4643 4644 Synopsis 4645 4646 extern char **__environ; 4647 4648 Description 4649 4650 __environ is an alias for environ - user environment. 4651 4652 __environ has the same specification as environ. 4653 4654 __environ is not in the source standard; it is only in the binary standard. 4655 4656 __errno_location 4657 4658 Name 4659 4660 __errno_location -- address of errno variable 4661 4662 Synopsis 4663 4664 int *__errno_location(void); 4665 4666 Description 4667 4668 __errno_location is not in the source standard; it is only in the binary 4669 standard. 4670 4671 __fpending 4672 4673 Name 4674 4675 __fpending -- returns in bytes the amount of output pending on a stream 4676 4677 Synopsis 4678 4679 #include 4680 4681 size_t __fpending(FILE *stream); 4682 4683 Description 4684 4685 __fpending returns the amount of output in bytes pending on a stream. 4686 4687 __fpending is not in the source standard; it is only in the binary standard. 4688 4689 __getpagesize 4690 4691 Name 4692 4693 __getpagesize -- alias for getpagesize - get current page size 4694 4695 Synopsis 4696 4697 extern int __getpagesize(void); 4698 4699 Description 4700 4701 __getpagesize is an alias for getpagesize - get current page size. 4702 4703 __getpagesize has the same specification as getpagesize. 4704 4705 __getpagesize is not in the source standard; it is only in the binary standard. 4706 4707 __getpgid 4708 4709 Name 4710 4711 __getpgid -- get the process group id 4712 4713 Synopsis 4714 4715 pid_t __getpgid(pid_t pid); 4716 4717 Description 4718 4719 __getpgid has the same specification as getpgid. 4720 4721 __getpgid is not in the source standard; it is only in the binary standard. 4722 4723 __h_errno_location 4724 4725 Name 4726 4727 __h_errno_location -- address of h_errno variable 4728 4729 Synopsis 4730 4731 int *__h_errno_location(void); 4732 4733 Description 4734 4735 __h_errno_location returns the address of the h_errno variable, where h_errno 4736 is as specified in the Single Unix Specification. 4737 4738 __h_errno_location is not in the source standard; it is only in the binary 4739 standard. Note that h_errno itself is only in the source standard; it is not in 4740 the binary standard. 4741 4742 __isinf 4743 4744 Name 4745 4746 __isinf -- test for infinity 4747 4748 Synopsis 4749 4750 int __isinf(double arg); 4751 4752 Description 4753 4754 __isinf has the same specification as isinf in the Single UNIX Specification, 4755 Version 3, except that the argument type for __isinf is known to be double. 4756 4757 __isinf is not in the source standard; it is only in the binary standard. 4758 4759 __isinff 4760 4761 Name 4762 4763 __isinff -- test for infinity 4764 4765 Synopsis 4766 4767 int __isinff(float arg); 4768 4769 Description 4770 4771 __isinff has the same specification as isinf in the Single UNIX Specification, 4772 Version 3, except that the argument type for __isinff is known to be float. 4773 4774 __isinff is not in the source standard; it is only in the binary standard. 4775 4776 __isinfl 4777 4778 Name 4779 4780 __isinfl -- test for infinity 4781 4782 Synopsis 4783 4784 int __isinfl(long double arg); 4785 4786 Description 4787 4788 __isinfl has the same specification as isinf in the Single UNIX Specification, 4789 Version 3, except that the argument type for __isinfl is known to be long 4790 double. 4791 4792 __isinfl is not in the source standard; it is only in the binary standard. 4793 4794 __isnan 4795 4796 Name 4797 4798 __isnan -- test for infinity 4799 4800 Synopsis 4801 4802 int __isnan(double arg); 4803 4804 Description 4805 4806 __isnan has the same specification as isnan in the Single UNIX Specification, 4807 Version 3, except that the argument type for __isnan is known to be double. 4808 4809 __isnan is not in the source standard; it is only in the binary standard. 4810 4811 __isnanf 4812 4813 Name 4814 4815 __isnanf -- test for infinity 4816 4817 Synopsis 4818 4819 int __isnanf(float arg); 4820 4821 Description 4822 4823 __isnanf has the same specification as isnan in the Single UNIX Specification, 4824 Version 3, except that the argument type for __isnanf is known to be float. 4825 4826 __isnanf is not in the source standard; it is only in the binary standard. 4827 4828 __isnanl 4829 4830 Name 4831 4832 __isnanl -- test for infinity 4833 4834 Synopsis 4835 4836 int __isnanl(long double arg); 4837 4838 Description 4839 4840 __isnanl has the same specification as isnan in the Single UNIX Specification, 4841 Version 3, except that the argument type for __isnanl is known to be long 4842 double. 4843 4844 __isnanl is not in the source standard; it is only in the binary standard. 4845 4846 __libc_current_sigrtmax 4847 4848 Name 4849 4850 __libc_current_sigrtmax -- return number of available real-time signal with 4851 lowest priority 4852 4853 Synopsis 4854 4855 int __libc_current_sigrtmax(void); 4856 4857 Description 4858 4859 __libc_current_sigrtmax returns the number of an available real-time signal 4860 with the lowest priority. 4861 4862 __libc_current_sigrtmax is not in the source standard; it is only in the binary 4863 standard. 4864 4865 __libc_current_sigrtmin 4866 4867 Name 4868 4869 __libc_current_sigrtmin -- return number of available real-time signal with 4870 highest priority 4871 4872 Synopsis 4873 4874 int __libc_current_sigrtmin(void); 4875 4876 Description 4877 4878 __libc_current_sigrtmin returns the number of an available real-time signal 4879 with the highest priority. 4880 4881 __libc_current_sigrtmin is not in the source standard; it is only in the binary 4882 standard. 4883 4884 __libc_start_main 4885 4886 Name 4887 4888 __libc_start_main -- initialization routine 4889 4890 Synopsis 4891 4892 BP_SYM __libc_start_main(int (*main) (int, char**, char**), int argc, char 4893 *__unbounded *__unbounded ubp_av, void (*init) (void), void (*fini) (void), 4894 void (*rtld_fini) (void), void (*__unbounded stack_end)); 4895 4896 Description 4897 4898 __libc_start_main initializes glibc. 4899 4900 __libc_start_main is not in the source standard; it is only in the binary 4901 standard. 4902 4903 __lxstat 4904 4905 Name 4906 4907 __lxstat -- inline wrapper around call to lxstat 4908 4909 Synopsis 4910 4911 #include 4912 4913 int __lxstat(int version, char *__path, (struct stat *__statbuf)); 4914 4915 Description 4916 4917 __lxstat is an inline wrapper around call to lxstat. 4918 4919 __lxstat is not in the source standard; it is only in the binary standard. 4920 4921 __mempcpy 4922 4923 Name 4924 4925 __mempcpy -- copy given number of bytes of source to destination 4926 4927 Synopsis 4928 4929 #include 4930 4931 extern ptr_t __mempcpy(ptr_t restrict dest, const ptr_t restrict src, size_t 4932 n); 4933 4934 Description 4935 4936 __mempcpy copies n bytes of source to destination, returning pointer to bytes 4937 after the last written byte. 4938 4939 __mempcpy is not in the source standard; it is only in the binary standard. 4940 4941 __rawmemchr 4942 4943 Name 4944 4945 __rawmemchr -- scan memory 4946 4947 Synopsis 4948 4949 #include 4950 4951 extern ptr_t __rawmemchr(const ptr_t s, int c); 4952 4953 Description 4954 4955 __rawmemchr searches in s for c. 4956 4957 __rawmemchr is a weak alias to rawmemchr. It is similar to memchr, but it has 4958 no length limit. 4959 4960 __rawmemchr is not in the source standard; it is only in the binary standard. 4961 4962 __register_atfork 4963 4964 Name 4965 4966 __register_atfork -- alias for register_atfork 4967 4968 Synopsis 4969 4970 int __register_atfork(void (*prepare)(), void (*parent)(), void (*child)(), 4971 void *__dso_handle); 4972 4973 Description 4974 4975 __register_atfork implements pthread_atfork as specified in ISO/IEC 9945:2003 4976 Portable Operating System(POSIX)and The Single UNIX Specification(SUS) V3. The 4977 additional parameter __dso_handle allows a shared object to pass in it's handle 4978 so that functions registered by __register_atfork can be unregistered by the 4979 runtime when the shared object is unloaded. 4980 4981 __sigsetjmp 4982 4983 Name 4984 4985 __sigsetjmp -- save stack context for non-local goto 4986 4987 Synopsis 4988 4989 int __sigsetjmp(jmp_buf env, int savemask); 4990 4991 Description 4992 4993 __sigsetjmp has the same behavior as sigsetjmp as specified by the Single UNIX 4994 Specification, Version 2. 4995 4996 __sigsetjmp is not in the source standard; it is only in the binary standard. 4997 4998 __stpcpy 4999 5000 Name 5001 5002 __stpcpy -- copy a string returning a pointer to its end 5003 5004 Synopsis 5005 5006 #include 5007 5008 char *__stpcpy(char *dest, const char *src); 5009 5010 Description 5011 5012 __stpcpy copies the string src (including the terminating /0 character) to the 5013 array dest. The strings may not overlap, and dest must be large enough to 5014 receive the copy. 5015 5016 Return Value 5017 5018 __stpcpy returns a pointer to the end of the string dest (that is, the address 5019 of the terminating NULL character) rather than the beginning. 5020 5021 __stpcpy has the same specification as stpcpy. 5022 5023 __stpcpy is not in the source standard; it is only in the binary standard. 5024 5025 __strdup 5026 5027 Name 5028 5029 __strdup -- alias for strdup 5030 5031 Synopsis 5032 5033 char *__strdup(const char string); 5034 5035 Description 5036 5037 __strdup has the same specification as strdup. 5038 5039 __strdup is not in the source standard; it is only in the binary standard. 5040 5041 __strtod_internal 5042 5043 Name 5044 5045 __strtod_internal -- underlying function for strtod 5046 5047 Synopsis 5048 5049 double __strtod_internal(const char *__nptr, char **__endptr, int __group); 5050 5051 Description 5052 5053 __group shall be 0 or the behavior of __strtod_internal is undefined. 5054 5055 __strtod_internal(__nptr, __endptr, 0) has the same specification as strtod 5056 (__nptr, __endptr). 5057 5058 __strtod_internal is not in the source standard; it is only in the binary 5059 standard. 5060 5061 __strtof_internal 5062 5063 Name 5064 5065 __strtof_internal -- underlying function for strtof 5066 5067 Synopsis 5068 5069 float __strtof_internal(const char *__nptr, char **__endptr, int __group); 5070 5071 Description 5072 5073 __group shall be 0 or the behavior of __strtof_internal is undefined. 5074 5075 __strtof_internal(__nptr, __endptr, 0) has the same specification as strtof 5076 (__nptr, __endptr). 5077 5078 __strtof_internal is not in the source standard; it is only in the binary 5079 standard. 5080 5081 __strtok_r 5082 5083 Name 5084 5085 __strtok_r -- alias for strtok_r 5086 5087 Synopsis 5088 5089 char *__strtok_r(char *__restrict s, __const char *__restrict delim, char 5090 **__restrict save_ptr); 5091 5092 Description 5093 5094 __strtok_r has the same specification as strtok_r. 5095 5096 __strtok_r is not in the source standard; it is only in the binary standard. 5097 5098 __strtol_internal 5099 5100 Name 5101 5102 __strtol_internal -- alias for strtol 5103 5104 Synopsis 5105 5106 long int __strtol_internal(const char *__nptr, char **__endptr, int __base, int 5107 __group); 5108 5109 Description 5110 5111 __group shall be 0 or the behavior of __strtol_internal is undefined. 5112 5113 __strtol_internal(__nptr, __endptr, __base, 0) has the same specification as 5114 strtol(__nptr, __endptr, __base). 5115 5116 __strtol_internal is not in the source standard; it is only in the binary 5117 standard. 5118 5119 __strtold_internal 5120 5121 Name 5122 5123 __strtold_internal -- underlying function for strtold 5124 5125 Synopsis 5126 5127 long double __strtold_internal(const char *__nptr, char **__endptr, int 5128 __group); 5129 5130 Description 5131 5132 __group shall be 0 or the behavior of __strtold_internal is undefined. 5133 5134 __strtold_internal(__nptr, __endptr, 0) has the same specification as strtold 5135 (__nptr, __endptr). 5136 5137 __strtold_internal is not in the source standard; it is only in the binary 5138 standard. 5139 5140 __strtoll_internal 5141 5142 Name 5143 5144 __strtoll_internal -- underlying function for strtoll 5145 5146 Synopsis 5147 5148 long long __strtoll_internal(const char *__nptr, char **__endptr, int __base, 5149 int __group); 5150 5151 Description 5152 5153 __group shall be 0 or the behavior of __strtoll_internal is undefined. 5154 5155 __strtoll_internal(__nptr, __endptr, __base, 0) has the same specification as 5156 strtoll(__nptr, __endptr, __base). 5157 5158 __strtoll_internal is not in the source standard; it is only in the binary 5159 standard. 5160 5161 __strtoul_internal 5162 5163 Name 5164 5165 __strtoul_internal -- underlying function for strtoul 5166 5167 Synopsis 5168 5169 unsigned long int __strtoul_internal(const char *__nptr, char **__endptr, int 5170 __base, int __group); 5171 5172 Description 5173 5174 __group shall be 0 or the behavior of __strtoul_internal is undefined. 5175 5176 __strtoul_internal(__nptr, __endptr, __base, 0) has the same specification as 5177 strtoul(__nptr, __endptr, __base). 5178 5179 __strtoul_internal is not in the source standard; it is only in the binary 5180 standard. 5181 5182 __strtoull_internal 5183 5184 Name 5185 5186 __strtoull_internal -- underlying function for strtoull 5187 5188 Synopsis 5189 5190 unsigned long long __strtoull_internal(const char *__nptr, char **__endptr, int 5191 __base, int __group); 5192 5193 Description 5194 5195 __group shall be 0 or the behavior of __strtoull_internal is undefined. 5196 5197 __strtoull_internal(__nptr, __endptr, __base, 0) has the same specification as 5198 strtoull(__nptr, __endptr, __base). 5199 5200 __strtoull_internal is not in the source standard; it is only in the binary 5201 standard. 5202 5203 __sysconf 5204 5205 Name 5206 5207 __sysconf -- get configuration information at runtime 5208 5209 Synopsis 5210 5211 #include 5212 5213 long __sysconf(int name); 5214 5215 Description 5216 5217 __sysconf gets configuration information at runtime. 5218 5219 __sysconf is weak alias to sysconf. 5220 5221 __sysconf has the same specification as sysconf. 5222 5223 __sysconf is not in the source standard; it is only in the binary standard. 5224 5225 __sysv_signal 5226 5227 Name 5228 5229 __sysv_signal -- signal handling 5230 5231 Synopsis 5232 5233 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 5234 5235 Description 5236 5237 __sysv_signal has the same behavior as signal as specified by X/Open. 5238 5239 __sysv_signal is not in the source standard; it is only in the binary standard. 5240 5241 __timezone 5242 5243 Name 5244 5245 -- global variable containing timezone 5246 5247 Synopsis 5248 5249 long int __timezone; 5250 5251 Description 5252 5253 __timezone has the same specification as timezone in the Single UNIX 5254 Specification. 5255 5256 __tzname 5257 5258 Name 5259 5260 -- global variable containing the timezone 5261 5262 Synopsis 5263 5264 char *__tzname[2]; 5265 5266 Description 5267 5268 __tzname has the same specification as tzname in the Single UNIX Specification. 5269 5270 Note that the array size of 2 is explicit in the Single UNIX Specification, 5271 Version 3, but not in the Single UNIX Specification, Version 2. 5272 5273 __wcstod_internal 5274 5275 Name 5276 5277 __wcstod_internal -- underlying function for wcstod 5278 5279 Synopsis 5280 5281 double __wcstod_internal(const wchar_t *nptr, wchar_t **endptr, int group); 5282 5283 Description 5284 5285 group shall be 0 or the behavior of __wcstod_internal is undefined. 5286 5287 __wcstod_internal(nptr, endptr, 0) has the same specification as wcstod(nptr, 5288 endptr). 5289 5290 __wcstod_internal is not in the source standard; it is only in the binary 5291 standard. 5292 5293 __wcstof_internal 5294 5295 Name 5296 5297 __wcstof_internal -- underlying function for wcstof 5298 5299 Synopsis 5300 5301 float __wcstof_internal(const wchar_t *nptr, wchar_t **endptr, int group); 5302 5303 Description 5304 5305 group shall be 0 or the behavior of __wcstof_internal is undefined. 5306 5307 __wcstof_internal(nptr, endptr, 0) has the same specification as wcstof(nptr, 5308 endptr). 5309 5310 __wcstof_internal is not in the source standard; it is only in the binary 5311 standard. 5312 5313 __wcstol_internal 5314 5315 Name 5316 5317 __wcstol_internal -- underlying function for wcstol 5318 5319 Synopsis 5320 5321 long __wcstol_internal(const wchar_t *nptr, wchar_t **endptr, int base, int 5322 group); 5323 5324 Description 5325 5326 group shall be 0 or the behavior of __wcstol_internal is undefined. 5327 5328 __wcstol_internal(nptr, endptr, base, 0) has the same specification as wcstol 5329 (nptr, endptr, base). 5330 5331 __wcstol_internal is not in the source standard; it is only in the binary 5332 standard. 5333 5334 __wcstold_internal 5335 5336 Name 5337 5338 __wcstold_internal -- underlying function for wcstold 5339 5340 Synopsis 5341 5342 long double __wcstold_internal(const wchar_t *nptr, wchar_t **endptr, int 5343 group); 5344 5345 Description 5346 5347 group shall be 0 or the behavior of __wcstold_internal is undefined. 5348 5349 __wcstold_internal(nptr, endptr, 0) has the same specification as wcstold(nptr, 5350 endptr). 5351 5352 __wcstold_internal is not in the source standard; it is only in the binary 5353 standard. 5354 5355 __wcstoul_internal 5356 5357 Name 5358 5359 __wcstoul_internal -- underlying function for wcstoul 5360 5361 Synopsis 5362 5363 unsigned long __wcstoul_internal(const wchar_t *restrict nptr, wchar_t 5364 **restrict endptr, int base, int group); 5365 5366 Description 5367 5368 group shall be 0 or the behavior of __wcstoul_internal is undefined. 5369 5370 __wcstoul_internal(nptr, endptr, base, 0) has the same specification as wcstoul 5371 (nptr, endptr, base). 5372 5373 __wcstoul_internal is not in the source standard; it is only in the binary 5374 standard. 5375 5376 __xmknod 5377 5378 Name 5379 5380 __xmknod -- make block or character special file 5381 5382 Synopsis 5383 5384 int __xmknod(int ver, __const char *path, __mode_t mode, __dev_t *dev); 5385 5386 Description 5387 5388 ver shall be 1 or the behavior of __xmknod is undefined. 5389 5390 __xmknod(1, path, mode, dev) has the same specification as mknod(path, mode, 5391 dev). 5392 5393 Note that the format of dev_t is not the same as the argument that the kernel 5394 syscall uses. 5395 5396 __xmknod is not in the source standard; it is only in the binary standard. 5397 5398 __xstat 5399 5400 Name 5401 5402 __xstat -- provide inode information 5403 5404 Synopsis 5405 5406 #include 5407 #include 5408 5409 int __xstat(int __ver, const char *__filename, (struct stat *__stat_buf)); 5410 5411 int __lxstat(int __ver, const char *__filename, (struct stat *__stat_buf)); 5412 5413 int __fxstat(int __ver, int __filedesc, (struct stat *__stat_buf)); 5414 5415 Description 5416 5417 __ver shall be 3 or the behavior of these functions is undefined. 5418 5419 __filename is as specified in POSIX. 5420 5421 __filedesc is as specified in POSIX. 5422 5423 __stat_buf is as specified in POSIX. 5424 5425 __xstat(3, __filename, __stat_buf) has the same specification as stat 5426 (__filename, __stat_buf) as specified by POSIX. 5427 5428 __lxstat(3, __filename, __stat_buf) has the same specification as lstat 5429 (__filename, __stat_buf) as specified by POSIX. 5430 5431 __fxstat(3, __filedesc, __stat_buf) has the same specification as fstat 5432 (__filedesc, __stat_buf) as specified by POSIX. 5433 5434 Note that the struct stat used by these functions is not the one that the 5435 kernel uses. 5436 5437 __xstat, __lxstat, and __fxstat are not in the source standard; they are only 5438 in the binary standard. 5439 5440 stat, lstat, and fstat are not in the binary standard; they are only in the 5441 source standard. 5442 5443 __xstat64 5444 5445 Name 5446 5447 __xstat64 -- provide inode information 5448 5449 Synopsis 5450 5451 #define _LARGEFILE_SOURCE 1 5452 #include 5453 #include 5454 5455 int __xstat64(int __ver, const char *__filename, (struct stat64 *__stat_buf)); 5456 5457 int __lxstat64(int __ver, const char *__filename, (struct stat64 *__stat_buf)); 5458 5459 int __fxstat64(int __ver, int __filedesc, (struct stat64 *__stat_buf)); 5460 5461 Description 5462 5463 __ver shall be 3 or the behavior of these functions is undefined. 5464 5465 __filename is as specified by the Large File Summit. 5466 5467 __filedesc is as specified by the Large File Summit. 5468 5469 __stat_buf is as specified by the Large File Summit. 5470 5471 __xstat64(3, __filename, __stat_buf) has the same specification as stat64 5472 (__filename, __stat_buf) as specified by the Large File Summit. 5473 5474 __lxstat64(3, __filename, __stat_buf) has the same specification as lstat64 5475 (__filename, __stat_buf) as specified by the Large File Summit. 5476 5477 __fxstat64(3, __filedesc, __stat_buf) has the same specification as fstat64 5478 (__filedesc, __stat_buf) as specified by the Large File Summit. 5479 5480 __xstat64, __lxstat64, and __fxstat64 are not in the source standard; they are 5481 only in the binary standard. 5482 5483 stat64, lstat64, and fstat64 are not in the binary standard; they are only in 5484 the source standard. 5485 5486 _environ 5487 5488 Name 5489 5490 _environ -- alias for environ - user environment 5491 5492 Synopsis 5493 5494 extern char **_environ; 5495 5496 Description 5497 5498 _environ is an alias for environ - user environment. 5499 5500 _nl_msg_cat_cntr 5501 5502 Name 5503 5504 _nl_msg_cat_cntr -- new catalog load counter 5505 5506 Synopsis 5507 5508 #include 5509 5510 extern int _nl_msg_cat_cntr; 5511 5512 Description 5513 5514 _nl_msg_cat_cntr is incremented each time a new catalong is loaded. It is a 5515 variable defined in loadmsgcat.c and is used by Message catalogs for 5516 internationalization. 5517 5518 _obstack_begin 5519 5520 Name 5521 5522 _obstack_begin -- initialize an obstack for use 5523 5524 Synopsis 5525 5526 #include 5527 5528 extern int _obstack_begin(struct obstack *, int, int, void *(*) (long), void 5529 (*) (void *)); 5530 5531 Description 5532 5533 _obstack_begin initializes an obstack for use. 5534 5535 _obstack_newchunk 5536 5537 Name 5538 5539 _obstack_newchunk -- allocate a new current chunk of memory for the obstack 5540 5541 Synopsis 5542 5543 #include 5544 5545 extern void _obstack_newchunk(struct obstack *, int); 5546 5547 Description 5548 5549 _obstack_newchunk allocates a new current chunk of memory for the obstack. 5550 5551 _sys_errlist 5552 5553 Name 5554 5555 _sys_errlist -- array containing the "C" locale strings used by strerror() 5556 5557 Synopsis 5558 5559 #include 5560 5561 extern const char *const _sys_errlist[]; 5562 5563 Description 5564 5565 _sys_errlist is an array containing the "C" locale strings used by strerror. 5566 This normally should not be used directly. strerror provides all of the needed 5567 functionality. 5568 5569 _sys_siglist 5570 5571 Name 5572 5573 _sys_siglist -- array containing the names of the signal names 5574 5575 Synopsis 5576 5577 #include 5578 5579 extern const char *const _sys_siglist[NSIG]; 5580 5581 Description 5582 5583 _sys_siglist is an array containing the names of the signal names. 5584 5585 _sys_siglist exists only for compatibility; use strsignal instead. (See 5586 string.h). 5587 5588 acct 5589 5590 Name 5591 5592 acct -- switch process accounting on or off 5593 5594 Synopsis 5595 5596 #include 5597 5598 int acct(const char *filename); 5599 5600 Description 5601 5602 When filename is the name of an existing file, acct turns accounting on and 5603 appends a record to filename for each terminating process. When filename is 5604 NULL, acct turns accounting off. 5605 5606 Return Value 5607 5608 On success, 0 is returned. On error, -1 is returned and the global variable 5609 errno is set appropriately. 5610 5611 Errors 5612 5613 ENOSYS 5614 5615 BSD process accounting has not been enabled when the operating system 5616 kernel was compiled. The kernel configuration parameter controlling this 5617 feature is CONFIG_BSD_PROCESS_ACCT. 5618 5619 ENOMEM 5620 5621 Out of memory. 5622 5623 EPERM 5624 5625 The calling process has no permission to enable process accounting. 5626 5627 EACCES 5628 5629 filename is not a regular file. 5630 5631 EIO 5632 5633 Error writing to the filename. 5634 5635 EUSERS 5636 5637 There are no more free file structures or we run out of memory. 5638 5639 adjtime 5640 5641 Name 5642 5643 adjtime -- correct the time to allow synchronization of the system clock 5644 5645 Synopsis 5646 5647 #include 5648 5649 int adjtime((const struct timeval *delta), (struct timeval *olddelta)); 5650 5651 Description 5652 5653 adjtime makes small adjustments to the system time as returned by gettimeofday 5654 (2), advancing or retarding it by the time specified by the timeval delta. If 5655 delta is negative, the clock is slowed down by incrementing it more slowly than 5656 normal until the correction is complete. If delta is positive, a larger 5657 increment than normal is used. The skew used to perform the correction is 5658 generally a fraction of one percent. Thus, the time is always a monotonically 5659 increasing function. A time correction from an earlier call to adjtime may not 5660 be finished when adjtime is called again. If olddelta is non-NULL, the 5661 structure pointed to will contain, upon return, the number of microseconds 5662 still to be corrected from the earlier call. 5663 5664 adjtime may be used by time servers that synchronize the clocks of computers in 5665 a local area network. Such time servers would slow down the clocks of some 5666 machines and speed up the clocks of others to bring them to the average network 5667 time. 5668 5669 The adjtime is restricted to the super-user. 5670 5671 Return Value 5672 5673 On success, 0 is returned. On error, -1 is returned and the global variable 5674 errno is set appropriately. 5675 5676 Errors 5677 5678 EFAULT 5679 5680 An argument points outside the process's allocated address space. 5681 5682 EPERM 5683 5684 The process's effective user ID is not that of the super-user. 5685 5686 adjtimex 5687 5688 Name 5689 5690 adjtimex -- tune kernel clock (DEPRECATED) 5691 5692 Synopsis 5693 5694 #include 5695 5696 int adjtimex((struct timex *buf)); 5697 5698 Description 5699 5700 The adjtimex function is deprecated from the LSB and is expected to disappear 5701 from a future version of the LSB. [1] 5702 5703 Linux uses David L. Mills' clock adjustment algorithm (see RFC 1305). adjtimex 5704 reads and optionally sets adjustment parameters for this algorithm. adjtimex 5705 takes a pointer to a timex structure, updates kernel parameters from field 5706 values, and returns the same structure with current kernel values. This 5707 structure is declared as follows: 5708 5709 struct timex { 5710 int modes; /* mode selector */ 5711 long offset; /* time offset (usec) */ 5712 long freq; /* frequency offset (scaled ppm) */ 5713 long maxerror; /* maximum error (usec) */ 5714 long esterror; /* estimated error (usec) */ 5715 int status; /* clock command/status */ 5716 long constant; /* pll time constant */ 5717 long precision; /* clock precision (usec) (read only) */ 5718 long tolerance; /* clock frequency tolerance (ppm) 5719 (read only) */ 5720 struct timeval time; /* current time (read only) */ 5721 long tick; /* usecs between clock ticks */ 5722 }; 5723 5724 modes determines which parameters, if any, to set. modes may contain a 5725 bitwise-or combination of zero or more of the following bits: 5726 5727 #define ADJ_OFFSET 0x0001 /* time offset */ 5728 #define ADJ_FREQUENCY 0x0002 /* frequency offset */ 5729 #define ADJ_MAXERROR 0x0004 /* maximum time error */ 5730 #define ADJ_ESTERROR 0x0008 /* estimated time error */ 5731 #define ADJ_STATUS 0x0010 /* clock status */ 5732 #define ADJ_TIMECONST 0x0020 /* pll time constant */ 5733 #define ADJ_TICK 0x4000 /* tick value */ 5734 #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ 5735 5736 Ordinary users are restricted to a 0 value for modes. Only the superuser may 5737 set any parameters. 5738 5739 Return Value 5740 5741 On success, adjtimex returns the clock state: 5742 5743 #define TIME_OK 0 /* clock synchronized */ 5744 #define TIME_INS 1 /* insert leap second */ 5745 #define TIME_DEL 2 /* delete leap second */ 5746 #define TIME_OOP 3 /* leap second in progress */ 5747 #define TIME_WAIT 4 /* leap second has occurred */ 5748 #define TIME_BAD 5 /* clock not synchronized */ 5749 5750 On error, the global variable errno is set to -1. 5751 5752 Errors 5753 5754 EFAULT 5755 5756 buf does not point to writable memory. 5757 5758 EPERM 5759 5760 buf.mode is nonzero and the user is not super-user. 5761 5762 EINVAL 5763 5764 An attempt is made to set buf.offset to a value outside of the range 5765 -131071 to +131071, or to set buf.status to a value other than those listed 5766 above, or to set buf.tick to a value outside of the range 900000/HZ to 5767 1100000/HZ, where HZ is the system timer interrupt frequency. 5768 5769 asprintf 5770 5771 Name 5772 5773 asprintf -- write formatted output to a string dynamically allocated with 5774 malloc and store the address of the string 5775 5776 Synopsis 5777 5778 #include 5779 5780 extern int asprintf(char **restrict ptr, const char *restrict format ...); 5781 5782 Description 5783 5784 asprintf has the same behavior as sprintf, but calls malloc to dynamically 5785 allocate space for the output, and then puts the output string in that space. 5786 5787 asprintf stores the address of the string in ptr. 5788 5789 bind_textdomain_codeset 5790 5791 Name 5792 5793 bind_textdomain_codeset -- specify encoding for message retrieval from message 5794 catalog for domain DOMAINNAME 5795 5796 Synopsis 5797 5798 #include 5799 5800 extern char *bind_textdomain_codeset(const char *domainname, const char *codeset); 5801 5802 Description 5803 5804 The bind_textdomain_codeset function can be used to specify the output codeset 5805 for message catalogs for domain domainname. The codeset argument shall be a 5806 valid codeset name which can be used tor the iconv_open() funtion, or a null 5807 pointer. If the codeset argument is the null pointer, then function returns the 5808 currently selected codeset for the domain with the name domainname. It returns 5809 null pointer if no codeset has yet been selected 5810 5811 The bind_textdomain_codeset function can be used several times. If used 5812 multiple times, with the same domainname argument, the later call overrrides 5813 the settings made by the earlier one. 5814 5815 The bind_textdomain_codeset function returns a pointer to a string containing 5816 the name of the selected codeset. The string is allocated internally in the 5817 function and shall not be changed by the user. 5818 5819 Parameters 5820 5821 domainname 5822 5823 The domainname argument is applied to the currenlty active LC_MESSAGE 5824 locale. It is equivalent in syntax and meaning to the domainname argument 5825 to textdomain(), except that the selection of the domain is valid only for 5826 the duration of the call. 5827 5828 Return 5829 5830 Returns the currently selected codeset name. It returns null pointer if no 5831 codeset has yet been selected. 5832 5833 Errors 5834 5835 The function is not required to set the external errno variable. 5836 5837 See Also 5838 5839 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 5840 bindtextdomain, bind_textdomain_codeset 5841 5842 bindresvport 5843 5844 Name 5845 5846 bindresvport -- bind socket to privileged IP port 5847 5848 Synopsis 5849 5850 #include 5851 #include 5852 5853 int bindresvport(int sd, struct sockaddr_in *sin); 5854 5855 Description 5856 5857 bindresvport binds a socket to a privileged IP port. This function can be used 5858 only by root. 5859 5860 Return Value 5861 5862 On success, 0 is returned. On error, -1 is returned and the global variable 5863 errno is set appropriately. 5864 5865 Errors 5866 5867 EPFNOSUPPORT 5868 5869 Address of sin did not match address family of sd. 5870 5871 bindtextdomain 5872 5873 Name 5874 5875 bindtextdomain -- specify the locale of a message catalog 5876 5877 Synopsis 5878 5879 #include 5880 5881 extern char *bindtextdomain(const char *domainname, const char *dirname); 5882 5883 Description 5884 5885 bindtextdomain specifies that the domainname message catalog can be found in 5886 the dirname directory hierarchy, rather than in the system locale data base. 5887 5888 bindtextdomain applies domainname to the currently active LC_MESSAGE locale. 5889 This usage is equivalent in syntax and meaning to the textdomain function's 5890 application of domainname, except that the selection of the domain in 5891 bind_textdomain_codeset is valid only for the duration of the call. 5892 5893 dirname can be an absolute or relative pathname. 5894 5895 On success, bindtextdomain returns the directory pathname currently bound to 5896 the domain. On failure, a NULL pointer is returned. 5897 5898 See Also 5899 5900 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 5901 bindtextdomain, bind_textdomain_codeset 5902 5903 cfmakeraw 5904 5905 Name 5906 5907 cfmakeraw -- get and set terminal attributes 5908 5909 Synopsis 5910 5911 #include 5912 5913 void cfmakeraw(struct termios *termios_p); 5914 5915 Description 5916 5917 The cfmakeraw() function shall set the attributes of the termios structure 5918 referenced by termios_p as follows: 5919 5920 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 5921 |INLCR|IGNCR|ICRNL|IXON); 5922 5923 termios_p->c_oflag &= ~OPOST; 5924 5925 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 5926 5927 termios_p->c_cflag &= ~(CSIZE|PARENB); 5928 5929 termios_p->c_cflag |= CS8; 5930 5931 termios_p shall point to a termios structure that contains the following 5932 members: 5933 5934 tcflag_t c_iflag; /* input modes */ 5935 tcflag_t c_oflag; /* output modes */ 5936 tcflag_t c_cflag; /* control modes */ 5937 tcflag_t c_lflag; /* local modes */ 5938 cc_t c_cc[NCCS]; /* control chars */ 5939 5940 cfsetspeed 5941 5942 Name 5943 5944 cfsetspeed -- set terminal input and output data rate 5945 5946 Synopsis 5947 5948 #include 5949 5950 int cfsetspeed(struct termios *t, speedt speed); 5951 5952 Description 5953 5954 cfsetspeed sets the baud rate values in the termios structure. The effects of 5955 the function on the terminal as described below do not become effective, nor 5956 are all errors detected, until the tcsetattr function is called. Certain values 5957 for baud rates set in termios and passed to tcsetattr have special meanings. 5958 5959 Getting and Setting the Baud Rate 5960 5961 Input and output baud rates are found in the termios structure. The unsigned 5962 integer speed_t is typdef'd in the include file termios.h. The value of the 5963 integer corresponds directly to the baud rate being represented; however, the 5964 following symbolic values are defined. 5965 5966 #define B0 0 5967 #define B50 50 5968 #define B75 75 5969 #define B110 110 5970 #define B134 134 5971 #define B150 150 5972 #define B200 200 5973 #define B300 300 5974 #define B600 600 5975 #define B1200 1200 5976 #define B1800 1800 5977 #define B2400 2400 5978 #define B4800 4800 5979 #define B9600 9600 5980 #define B19200 19200 5981 #define B38400 38400 5982 #ifndef _POSIX_SOURCE 5983 #define EXTA 19200 5984 #define EXTB 38400 5985 #endif /*_POSIX_SOURCE */ 5986 5987 cfsetspeed sets both the input and output baud rates in the termios structure 5988 referenced by t to speed. 5989 5990 Return Value 5991 5992 On success, 0 is returned. On error, -1 is returned and the global variable 5993 errno is set appropriately. 5994 5995 Errors 5996 5997 EINVAL 5998 5999 Invalid speed argument 6000 6001 creat 6002 6003 Name 6004 6005 creat -- open a file 6006 6007 Description 6008 6009 creat is as specified in the Single UNIX Specification, but with differences as 6010 listed below. 6011 6012 May return ENODEV in place of ENXIO 6013 6014 Where the Single UNIX Specification specifies an ENXIO return, the 6015 implementation may return either ENXIO or ENODEV. Implementations are 6016 encouarged to return ENXIO. [2] 6017 6018 daemon 6019 6020 Name 6021 6022 daemon -- run in the background 6023 6024 Synopsis 6025 6026 #include 6027 6028 int daemon(int nochdir, int noclose); 6029 6030 Description 6031 6032 daemon allows programs to detach from the controlling terminal and run in the 6033 background as system daemons. Unless nochdir is nonzero, daemon changes the 6034 current working directory to the root (`/'). Unless noclose is non-zero, daemon 6035 will redirect standard input, standard output and standard error to /dev/null. 6036 6037 Return Value 6038 6039 On error, -1 is returned, and the global variable errno is set to any of the 6040 errors specified for the library functions fork(2) and setsid(2). 6041 6042 dcgettext 6043 6044 Name 6045 6046 dcgettext -- perform lookup in message catalog for the current LC_MESSAGES 6047 locale 6048 6049 Synopsis 6050 6051 #include 6052 #include 6053 6054 extern char *dcgettext(const char *domainname, const char *msgid, int 6055 category); 6056 6057 Description 6058 6059 dcgettext is a domain specified version of gettext. 6060 6061 Parameters 6062 6063 domainname 6064 6065 dcgettext applies domainname to the currently active LC_MESSAGE locale. 6066 This usage is equivalent in syntax and meaning to the textdomain function's 6067 application of domainname, except that the selection of the domain in 6068 dcgettext is valid only for the duration of the call. 6069 6070 msgid 6071 6072 a NULL-terminated string to be matched in the catalogue with respect to a 6073 specific domain and the current locale. 6074 6075 category 6076 6077 category is used for retrieving messages string for other than LC_MESSAGES 6078 category. Available value for category are LC_CTYPE, LC_COLLATE, 6079 LC_MESSAGES, LC_MONETARY,LC_NUMERIC, and LC_TIME. 6080 6081 dcgettext(domainname, msgid, LC_MESSAGES) has the same specification as 6082 dgettext(domainname, msgid). Note that LC_ALL shall not be used. 6083 6084 Return Value 6085 6086 On success, the translated NULL-terminated string is returned. On error, msgid 6087 is returned. 6088 6089 Errors 6090 6091 dcgettext will not modify the errno global variable. 6092 6093 See Also 6094 6095 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 6096 bindtextdomain, bind_textdomain_codeset 6097 6098 dcngettext 6099 6100 Name 6101 6102 dcngettext -- perform lookup in message catalog for the current LC_MESSAGES 6103 locale 6104 6105 Synopsis 6106 6107 #include 6108 #include 6109 6110 extern char *dcngettext(const char *domainname, const char *msgid1, const char 6111 *msgid2, unsigned long int n, int category); 6112 6113 Description 6114 6115 dcngettext is a plural version of dcgettext. (See dcgettext for more 6116 information.) 6117 6118 Parameters 6119 6120 domainname 6121 6122 dcngettext applies domainname to the currently active LC_MESSAGE locale. 6123 This usage is equivalent in syntax and meaning to the textdomain function's 6124 application of domainname, except that the selection of the domain in 6125 dcngettext is valid only for the duration of the call. 6126 6127 msgid1 6128 6129 a NULL-terminated string to be matched in the catalogue with respect to a 6130 specific domain and the current locale. If the value of n is 1 and no 6131 message catalogs containing a translation for msgid1 are found, msgid1 is 6132 returned. 6133 6134 msgid2 6135 6136 a NULL-terminated string to be returned if the value of n is not 1 and no 6137 message catalogs are found. 6138 6139 n 6140 6141 determines which plural form is returned, in a language and message catalog 6142 dependent way. 6143 6144 category 6145 6146 category is used for retrieving messages string for other than LC_MESSAGES 6147 category. Available value for category are LC_CTYPE, LC_COLLATE, 6148 LC_MESSAGES, LC_MONETARY,LC_NUMERIC, and LC_TIME. 6149 6150 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) has the same 6151 specification as dngettext(domainname, msgid1, msgid2, n). Note that LC_ALL 6152 shall not be used. 6153 6154 Return Value 6155 6156 On success of a msgid1 query, the translated NULL-terminated string is 6157 returned. On error, the original msgid1 or msgid2 is returned, according to n. 6158 6159 Errors 6160 6161 dcngettext will not modify the errno global variable. 6162 6163 See Also 6164 6165 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 6166 bindtextdomain, bind_textdomain_codeset 6167 6168 dgettext 6169 6170 Name 6171 6172 dgettext -- perform lookup in message catalog for the current LC_MESSAGES 6173 locale 6174 6175 Synopsis 6176 6177 #include 6178 6179 extern char *dgettext(const char *domainname, const char *msgid); 6180 6181 Description 6182 6183 dgettext is a domain specified version of gettext. 6184 6185 Parameters 6186 6187 domainname 6188 6189 dgettext applies domainname to the currently active LC_MESSAGE locale. This 6190 usage is equivalent in syntax and meaning to the textdomain function's 6191 application of domainname, except that the selection of the domain in 6192 dgettext is valid only for the duration of the call. 6193 6194 msgid 6195 6196 a NULL-terminated string to be matched in the catalogue with respect to a 6197 specific domain and the current locale. 6198 6199 Return Value 6200 6201 On success of a msgid query, the translated NULL-terminated string is returned. 6202 On error, the original msgid is returned. The length of the string returned is 6203 undetermined until dgettext is called. 6204 6205 Errors 6206 6207 dgettext will not modify the errno global variable. 6208 6209 See Also 6210 6211 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 6212 bindtextdomain, bind_textdomain_codeset 6213 6214 dngettext 6215 6216 Name 6217 6218 dngettext -- perform lookup in message catalog for the current LC_MESSAGES 6219 locale 6220 6221 Synopsis 6222 6223 #include 6224 6225 extern char *dngettext(const char *domainname, const char *msgid1, const char 6226 *msgid2, unsigned long int n); 6227 6228 Description 6229 6230 dngettext is a plural version of dgettext. (See dgettext for more information.) 6231 6232 Parameters 6233 6234 domainname 6235 6236 dngettext applies domainname to the currently active LC_MESSAGE locale. 6237 This usage is equivalent in syntax and meaning to the textdomain function's 6238 application of domainname, except that the selection of the domain in 6239 dngettext is valid only for the duration of the call. 6240 6241 msgid1 6242 6243 a NULL-terminated string to be matched in the catalogue with respect to a 6244 specific domain and the current locale. If the value of n is 1 and no 6245 message catalogs containing a translation for msgid1 are found, msgid1 is 6246 returned. 6247 6248 msgid2 6249 6250 a NULL-terminated string to be returned if the value of n is not 1 and no 6251 message catalogs are found. 6252 6253 n 6254 6255 determines which plural form is returned, in a language and message catalog 6256 dependent way. 6257 6258 Return Value 6259 6260 On success of a msgid1 query, the translated NULL-terminated string is 6261 returned. On error, the original msgid1 or msgid2 is returned, according to n. 6262 6263 Errors 6264 6265 dcngettext will not modify the errno global variable. 6266 6267 See Also 6268 6269 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 6270 bindtextdomain, bind_textdomain_codeset 6271 6272 err 6273 6274 Name 6275 6276 err -- display formatted error messages 6277 6278 Synopsis 6279 6280 #include 6281 6282 void err(int eval, const char *fmt ...); 6283 6284 Description 6285 6286 err displays a formatted error message on the standard error output. The last 6287 component of the program name, a colon character, and a space are output. If 6288 fmt is non-NULL, the formatted error message, a colon character, and a space 6289 are output. The error message string affiliated with the current value of the 6290 global variable errno is output. The output is followed by a newline character. 6291 6292 err does not return, but exits with the value of eval. 6293 6294 error 6295 6296 Name 6297 6298 error -- print error message 6299 6300 Synopsis 6301 6302 void error(int exitstatus, int errnum, const char *format ...); 6303 6304 Description 6305 6306 error prints a message to standard error. 6307 6308 error builds the message from the following elements in their specified order: 6309 6310 1. the program name. If the application has provided a function named 6311 error_print_progname, error calls this to supply the program name; 6312 otherwise, error uses the content of the global variable program_name. 6313 6314 2. the colon and space characters, then the result of using the printf-style 6315 format and the optional arguments. 6316 6317 3. if errnum is nonzero, error adds the colon and space characters, then the 6318 result of strerror(errnum). 6319 6320 4. a newline. 6321 6322 If exitstatus is nonzero, error calls exit(exitstatus). 6323 6324 errx 6325 6326 Name 6327 6328 errx -- format error messages 6329 6330 Synopsis 6331 6332 #include 6333 6334 void errx(int eval, const char *fmt ...); 6335 6336 Description 6337 6338 errx displays a formatted error message on the standard error output. The last 6339 component of the program name, a colon character, and a space are output. If 6340 fmt is non-NULL, the formatted error message, a colon character, and a space 6341 are output. The output is followed by a newline character. 6342 6343 errx does not return, but exits with the value of eval. 6344 6345 fcntl 6346 6347 Name 6348 6349 fcntl -- file control 6350 6351 Description 6352 6353 fcntl is as specified in the Single UNIX Specification, Version 3, but with 6354 differences as listed below. 6355 6356 Implementation may set O_LARGEFILE 6357 6358 According to the Single UNIX Specification, only an application sets fcntl 6359 flags, for example O_LARGEFILE. However, this specification also allows 6360 implementations to set O_LARGEFILE in a case in which the default behavior 6361 matches the O_LARGEFILE behavior. [3] Or in other words, calling fcntl with the 6362 F_GETFL command may return O_LARGEFILE as well as flags explicitly set by the 6363 application. 6364 6365 fflush_unlocked 6366 6367 Name 6368 6369 fflush_unlocked -- non thread safe fflush 6370 6371 Description 6372 6373 fflush_unlocked is the same as fflush except that it need not be thread safe. 6374 That is, it may only be invoked in the ways which are legal for getc_unlocked. 6375 6376 fgetwc_unlocked 6377 6378 Name 6379 6380 fgetwc_unlocked -- non thread safe fgetwc 6381 6382 Description 6383 6384 fgetwc_unlocked is the same as fgetwc except that it need not be thread safe. 6385 That is, it may only be invoked in the ways which are legal for getc_unlocked. 6386 6387 flock 6388 6389 Name 6390 6391 flock -- apply or remove an advisory lock on an open file 6392 6393 Synopsis 6394 6395 int flock(int fd, int operation); 6396 6397 Description 6398 6399 flock applies or removes an advisory lock on the open file fd. Valid operation 6400 types are: 6401 6402 LOCK_SH 6403 6404 Shared lock. More than one process may hold a shared lock for a given file 6405 at a given time. 6406 6407 LOCK_EX 6408 6409 Exclusive lock. Only one process may hold an exclusive lock for a given 6410 file at a given time. 6411 6412 LOCK_UN 6413 6414 Unlock. 6415 6416 LOCK_NB 6417 6418 Don't block when locking. May be specified (by oring) along with one of the 6419 other operations. 6420 6421 A single file may not simultaneously have both shared and exclusive locks. 6422 6423 Return Value 6424 6425 On success, 0 is returned. On error, -1 is returned and the global variable 6426 errno is set appropriately. 6427 6428 Errors 6429 6430 EWOULDBLOCK 6431 6432 The file is locked and the LOCK_NB flag was selected. 6433 6434 fopen 6435 6436 Name 6437 6438 fopen -- open a file 6439 6440 Description 6441 6442 fopen is as specified in the Single UNIX Specification, but with differences as 6443 listed below. 6444 6445 May return ENODEV in place of ENXIO 6446 6447 Where the Single UNIX Specification specifies an ENXIO return, the 6448 implementation may return either ENXIO or ENODEV. Implementations are 6449 encouarged to return ENXIO. [4] 6450 6451 freopen 6452 6453 Name 6454 6455 freopen -- open a file 6456 6457 Description 6458 6459 freopen is as specified in the Single UNIX Specification, but with differences 6460 as listed below. 6461 6462 May return ENODEV in place of ENXIO 6463 6464 Where the Single UNIX Specification specifies an ENXIO return, the 6465 implementation may return either ENXIO or ENODEV. Implementations are 6466 encouarged to return ENXIO. [5] 6467 6468 getdomainname 6469 6470 Name 6471 6472 getdomainname -- get NIS domain name. 6473 6474 Synopsis 6475 6476 #include 6477 6478 extern int getdomainname(char *name, size_t namelen); 6479 6480 Description 6481 6482 If NIS is in use, provide the NIS domain name. Note that this is not the same 6483 as the domain name which provides the domain portion of a fully qualified 6484 domain name (for example, in DNS). If NIS is not in use, provide the string " 6485 (none)". 6486 6487 If the string which is provided is strictly less than namelen characters in 6488 length, getdomainname places it in the array pointed to by name followed by a 6489 terminating null character. If not, getdomainname may either truncate it to 6490 namelen characters and place it in name (without a terminating null character), 6491 or may fail with EINVAL. 6492 6493 Return Value 6494 6495 getdomainname returns 0 if successful; -1 if not (in which case errno is set to 6496 indicate the error). 6497 6498 gethostbyname_r 6499 6500 Name 6501 6502 gethostbyname_r -- find network host database entry matching host name 6503 (DEPRECATED) 6504 6505 Synopsis 6506 6507 extern int gethostbyname_r(__const char *__restrict __name, (struct hostent 6508 *__restrict __result_buf), char *__restrict __buf, size_t __buflen, (struct 6509 hostent **__restrict __result), int *__restrict __h_errnop); 6510 6511 Description 6512 6513 The gethostbyname_r function is deprecated; applications should call 6514 getaddrinfo instead. 6515 6516 gethostbyname_r is a reentrant version of gethostbyname that searches the 6517 network host database for a host name match. 6518 6519 getloadavg 6520 6521 Name 6522 6523 getloadavg -- get system load averages 6524 6525 Synopsis 6526 6527 #include 6528 6529 int getloadavg(double loadavg[], int nelem); 6530 6531 Description 6532 6533 getloadavg returns the number of processes in the system run queue averaged 6534 over various periods of time. Up to nelem samples are retrieved and assigned to 6535 successive elements of loadavg[]. The system imposes a maximum of 3 samples, 6536 representing averages over the last 1, 5, and 15 minutes, respectively. 6537 6538 getopt 6539 6540 Name 6541 6542 getopt -- parse command line options 6543 6544 Synopsis 6545 6546 int getopt(int argc, char * const argv[], const char *opstring); 6547 6548 extern char *optarg; 6549 extern int optind, opterr, optopt; 6550 6551 Description 6552 6553 getopt parses command line arguments. GNU and POSIX specifications for this 6554 function vary in the following areas. LSB systems shall implement the GNU 6555 behaviors described below. 6556 6557 Option Characteristics 6558 6559 GNU specifies that: 6560 6561 * an element of argv that starts with "-" (and is not exactly "-" or "--") is 6562 an option element. 6563 6564 * characters of an option element, aside from the initial "-", are option 6565 characters. 6566 6567 POSIX specifies that: 6568 6569 * applications using getopt shall obey the following syntax guidelines: 6570 6571 + option name is a single alphanumeric character from the portable 6572 character set 6573 6574 + option is preceded by the "-" delimiter character 6575 6576 + options without option-arguments should be accepted when grouped behind 6577 one "-" delimiter 6578 6579 + each option and option-argument is a separate argument 6580 6581 + option-arguments are not optional 6582 6583 + all options should precede operands on the command line 6584 6585 + the argument "--" is accepted as a delimiter indicating the end of 6586 options and the consideration of subsequent arguments, if any, as 6587 operands 6588 6589 * historical implementations of getopt support other characters as options as 6590 an allowed extension, but applications that use extensions are not 6591 maximally portable. 6592 6593 * support for multi-byte option characters is only possible when such 6594 characters can be represented as type int. 6595 6596 * applications that call any utility with a first operand starting with "-" 6597 should usually specify "--" to mark the end of the options. Standard 6598 utilities that do not support this guideline indicate that fact in the 6599 OPTIONS section of the utility description. 6600 6601 Extensions 6602 6603 GNU specifies that: 6604 6605 * if a character is followed by two colons, the option takes an optional arg; 6606 if there is text in the current argv element, it is returned in optarg, 6607 otherwise optarg is set to 0. 6608 6609 * if optstring contains W followed by a ;, then -W foo is treated as the long 6610 option --foo. (Not available with libraries before GNU libc 2.) 6611 6612 POSIX specifies that: 6613 6614 * the -W option is reserved for implementation extensions. 6615 6616 Return Values 6617 6618 GNU specifies the following getopt return values: 6619 6620 * the next option character is returned, if found successfully. 6621 6622 * ":" is returned if a parameter is missing for one of the options. 6623 6624 * "?" is returned if an unknown option character is encountered. 6625 6626 * -1 is returned for the end of the option list. 6627 6628 POSIX specifies the following getopt return values: 6629 6630 * the next option character is returned, if found successfully. 6631 6632 * ":" is returned if a parameter is missing for one of the options and the 6633 first character of opstring is ":". 6634 6635 * "?" is returned if an unknown option character not in optstring is 6636 encountered, or if getopt detects a missing argument and the first 6637 character of optstring is not ":". 6638 6639 * -1 is returned for the end of the option list. 6640 6641 Environment Variables 6642 6643 GNU specifies that: 6644 6645 * if the variable POSIXLY_CORRECT is set, option processing stops as soon as 6646 a non-option argument is encountered. 6647 6648 * if POSIXLY_CORRECT is set, GNU getopt conforms to ISO/IEC 9945:2003 6649 Portable Operating System(POSIX)and The Single UNIX Specification(SUS) V3. 6650 6651 * the variable _[PID]_GNU_nonoption_argv_flags_ was used by bash 2.0 to 6652 communicate to GNU libc which arguments resulted from wildcard expansion 6653 and so should not be considered as options. This behavior was removed in 6654 bash version 2.01, but the support remains in GNU libc. 6655 6656 getopt_long 6657 6658 Name 6659 6660 getopt_long -- parse command line options 6661 6662 Synopsis 6663 6664 #define _GNU_SOURCE 6665 #include 6666 6667 int getopt_long(int argc, char * const argv[], const char *opstring, (const 6668 struct option *longopts), int *longindex); 6669 6670 Description 6671 6672 getopt_long works like getopt except that it also accepts long options, started 6673 out by two dashes. Long option names may be abbreviated if the abbreviation is 6674 unique or is an exact match for some defined option. A long option may take a 6675 parameter, of the form --arg=param or --arg param. 6676 6677 longopts is a pointer to the first element of an array of struct option 6678 declared in getopt.h as: 6679 6680 struct option { 6681 const char *name; 6682 int *flag; 6683 int has_arg; 6684 int val; 6685 }; 6686 6687 Return Value 6688 6689 getopt_long returns the option character if the option was found successfully, 6690 or ":" if there was a missing parameter for one of the options, or "?" for an 6691 unknown option character, or -1 for the end of the option list. 6692 6693 getopt_long also returns the option character when a short option is 6694 recognized. For a long option, they return val if flag is NULL, and 0 6695 otherwise. Error and -1 returns are the same as for getopt, plus "?" for an 6696 ambiguous match or an extraneous parameter. 6697 6698 getopt_long_only 6699 6700 Name 6701 6702 getopt_long_only -- parse command line options 6703 6704 Synopsis 6705 6706 #define _GNU_SOURCE 6707 #include 6708 6709 int getopt_long_only(int argc, char * const argv[], const char *opstring, 6710 (const struct option *longopts), int *longindex); 6711 6712 Description 6713 6714 getopt_long_only is like getopt_long, but "-" as well as "--" can indicate a 6715 long option. If an option that starts with "-" (not "--") doesn't match a long 6716 option, but does match a short option, it is parsed as a short option instead. 6717 6718 Return Value 6719 6720 getopt_long_only returns the option character if the option was found 6721 successfully, or ":" if there was a missing parameter for one of the options, 6722 or "?" for an unknown option character, or -1 for the end of the option list. 6723 6724 getopt_long_only also returns the option character when a short option is 6725 recognized. For a long option, they return val if flag is NULL, and 0 6726 otherwise. Error and -1 returns are the same as for getopt, plus "?" for an 6727 ambiguous match or an extraneous parameter. 6728 6729 gettext 6730 6731 Name 6732 6733 gettext -- perform lookup in message catalog for the current LC_MESSAGES locale 6734 6735 Synopsis 6736 6737 #include 6738 6739 extern char *gettext(const char *msgid); 6740 6741 Description 6742 6743 gettext attempts to retrieve a target string based on the specified key from 6744 msgid within the context of a specific domain and the current locale. 6745 6746 The LANGUAGE environment variable is examined first to determine the message 6747 catalogs to be used. LANGUAGE is a list of locale names separated by ":" 6748 character. If LANGUAGE is defined, each locale name is tried in the specified 6749 order and if a message catalog containing the requested message is found, the 6750 message is returned. If LANGUAGE is defined but failed to locate a message 6751 catalog, the msgid string is returned. If LANGUAGE is not defined, the LC_ALL, 6752 LC_xxx, and LANG environment variables are examined to locate the message 6753 catalog, following the convention used by the setlocale function. 6754 6755 The pathname used to locate the message catalog is dirname/locale/category/ 6756 domainname.mo, where dirname is the directory specified by the bindtextdomain 6757 function, locale is a locale name determined by the definition of environment 6758 variables, and category is LC_MESSAGES. 6759 6760 If the LC_MESSAGES locale category of the current locale is the standard C 6761 locale or the standard POSIX locale, gettext returns msgid without looking in 6762 any message catalog. 6763 6764 Parameters 6765 6766 msgid 6767 6768 A NULL-terminated string to be matched in the catalogue with respect to a 6769 specific domain and the current locale. 6770 6771 Return Value 6772 6773 If the function query above succeeds with msgid, then a translated 6774 NULL-terminated string is returned. If the search fails, then the original 6775 msgid is returned. The length of the string returned is undetermined until the 6776 function is called. 6777 6778 Errors 6779 6780 gettext does not modify the global variable errno. 6781 6782 See Also 6783 6784 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 6785 bindtextdomain, bind_textdomain_codeset 6786 6787 getutent 6788 6789 Name 6790 6791 getutent -- access utmp file entries 6792 6793 Synopsis 6794 6795 #include 6796 6797 struct utmp *getutent(void); 6798 6799 Description 6800 6801 getutent reads a line from the current file position in the utmp file. It 6802 returns a pointer to a structure containing the fields of the line. 6803 6804 Return Value 6805 6806 getutent returns a pointer to a static struct utmp. 6807 6808 Errors 6809 6810 On error, (struct utmp*)0 is returned. 6811 6812 Files 6813 6814 /var/run/utmp database of currently logged-in users 6815 6816 /var/log/wtmp database of past user logins 6817 6818 getutent_r 6819 6820 Name 6821 6822 getutent_r -- access utmp file entries 6823 6824 Synopsis 6825 6826 extern int getutent_r((struct utmp *__buffer), (struct utmp **__result)); 6827 6828 Description 6829 6830 getutent_r is a reentrant version of the getutent utmp file handler. 6831 6832 glob64 6833 6834 Name 6835 6836 glob64 -- find pathnames matching a pattern (Large File Support) 6837 6838 Synopsis 6839 6840 #include 6841 6842 int glob64(const char *pattern, int flags, int (*errfunc) (const char *, int), 6843 glob64_t *pglob); 6844 6845 Description 6846 6847 glob64 searches for all the pathnames matching pattern according to the rules 6848 used by the shell. (See glob(7).) No tilde expansion or parameter substitution 6849 is done; if you want these, use wordexp(3). 6850 6851 The results of a glob64 call are stored in the structure pointed to by pglob, 6852 which is a glob64_t declared in glob.h and includes the following elements 6853 defined by POSIX.2 (more may be present as an extension): 6854 6855 glob64 is a 64-bit version of glob. 6856 6857 Return Value 6858 6859 On success, 0 is returned. Other possible returns are: 6860 6861 GLOB_NOSPACE 6862 6863 out of memory 6864 6865 GLOB_ABORTED 6866 6867 read error 6868 6869 GLOB_NOMATCH 6870 6871 no match found 6872 6873 globfree64 6874 6875 Name 6876 6877 globfree64 -- free memory from glob64() (Large File Support) 6878 6879 Synopsis 6880 6881 #include 6882 6883 void globfree64(glob64_t *pglob); 6884 6885 Description 6886 6887 globfree64 frees the dynamically allocated storage from an earlier call to 6888 glob64. 6889 6890 globfree64 is a 64-bit version of globfree. 6891 6892 initgroups 6893 6894 Name 6895 6896 initgroups -- initialize the supplementary group access list 6897 6898 Synopsis 6899 6900 #include 6901 #include 6902 6903 int initgroups(const char *user, gid_t group); 6904 6905 Description 6906 6907 initgroups initializes the group access list by reading the group database and 6908 using all groups of which user is a member. The additional group group is also 6909 added to the list. 6910 6911 Return Value 6912 6913 On success, 0 is returned. On error, -1 is returned and the global variable 6914 errno is set appropriately. 6915 6916 Errors 6917 6918 EPERM 6919 6920 The calling process does not have sufficient privileges. 6921 6922 ENOMEM 6923 6924 Insufficient memory to allocate group information structure. 6925 6926 ioctl 6927 6928 Name 6929 6930 ioctl -- control device 6931 6932 Synopsis 6933 6934 #include 6935 6936 int ioctl (int d , int request , ... ); 6937 6938 Description 6939 6940 The ioctl() function shall manipulate the underlying device parameters of 6941 special files. d shall be an open file descriptor referring to a special file. 6942 The ioctl() function shall take three parameters; the type and value of the 6943 third parameter is dependent on the device and request. 6944 6945 An application may not call ioctl except for situations explicitly stated in 6946 this specification. 6947 6948 Return Value 6949 6950 On success, 0 is returned. An ioctl may use the return value as an output 6951 parameter and return a non-negative value on success. On error, -1 is returned 6952 and the global variable errno is set appropriately. 6953 6954 Errors 6955 6956 EBADF 6957 6958 d is not a valid descriptor. 6959 6960 EFAULT 6961 6962 The third parameter references an inaccessible memory area. 6963 6964 ENOTTY 6965 6966 d is not associated with a character special device. 6967 6968 ENOTTY 6969 6970 The specified request does not apply to the kind of object that d 6971 references. 6972 6973 EINVAL 6974 6975 request or the third parameter is not valid. 6976 6977 sockio 6978 6979 Name 6980 6981 sockio -- socket ioctl commands 6982 6983 Synopsis 6984 6985 #include 6986 #include 6987 #include 6988 6989 int ioctl(int sockfd, int request, char *argp); 6990 6991 Description 6992 6993 Socket ioctl commands are a subset of the ioctl calls, which can perform a 6994 variety of functions on sockets. sockfd shall contain the value of a file 6995 descriptor that was created with the socket or accept calls. 6996 6997 Socket ioctl commands apply to the underlying network interfaces, and affect 6998 the entire system, not just the file descriptor used to issue the ioctl. 6999 7000 The following ioctls are provided: 7001 7002 SIOCGIFCONF 7003 7004 Gets the interface configuration list for the system. [6] argp is a pointer 7005 to a ifconf structure. Before calling, the caller shall allocate the 7006 ifc_ifcu.ifcu_req field to point to an array of ifreq structures, and set 7007 if_len to the size of this allocated array (in bytes). Upon return, if_len 7008 will contain the amount of the array which was actually used (again, in 7009 bytes). If it is the same as the length upon calling, the caller should 7010 assume that the array was too small and try again with a larger array. 7011 7012 On success, SIOCGIFCONF can return any nonnegative value. [7] 7013 7014 SIOCGIFFLAGS 7015 7016 Gets the interface flags for the indicated interface. argp is a pointer to 7017 a ifreq structure. Before calling, the caller should fill in the ifr_name 7018 field with the interface name, and upon return, the ifr_ifru.ifru_flags 7019 field is set with the interface flags. 7020 7021 SIOCGIFADDR 7022 7023 Gets the interface address list for the system. argp is a pointer to a 7024 ifreq structure. Before calling, the caller should fill in the ifr_name 7025 field with the interface name, and upon return, the ifr_ifru.ifru_addr 7026 field is set with the interface address. 7027 7028 SIOCGIFNETMASK 7029 7030 Gets the network mask for the indicated interface. argp is a pointer to a 7031 ifreq structure. Before calling, the caller should fill in the ifr_name 7032 field with the interface name, and upon return, the ifr_ifru.ifru_netmask 7033 field is set with the network mask. 7034 7035 FIONREAD 7036 7037 Returns the amount of queued unread data in the receive buffer. Argument is 7038 a pointer to an integer where the result is to be placed. 7039 7040 The sockaddr structure is as specified in the Single UNIX Specification. 7041 7042 Return Value 7043 7044 On success, 0 is returned. On error, -1 is returned and the global variable 7045 errno is set appropriately. 7046 7047 Errors 7048 7049 EBADF 7050 7051 sockfd is not a valid descriptor. 7052 7053 EFAULT 7054 7055 argp references an inaccessible memory area. 7056 7057 ENOTTY 7058 7059 sockfd is not associated with a character special device. 7060 7061 ENOTTY 7062 7063 The specified request does not apply to the kind of object that the 7064 descriptor sockfd references. 7065 7066 EINVAL 7067 7068 request and argp are not valid. 7069 7070 ENOTCONN 7071 7072 The operation is only defined on a connected socket, but the socket wasn't 7073 connected. 7074 7075 iswctype 7076 7077 Name 7078 7079 iswctype -- wide character classification 7080 7081 Synopsis 7082 7083 #include 7084 7085 int iswctype(wint_t wc, wctype_t desc); 7086 7087 Description 7088 7089 iswctype tests wc to determine if it is a wide character whose property is 7090 designated by the character class desc. 7091 7092 desc shall be a character property descriptor returned by the wctype function. 7093 7094 Return Value 7095 7096 If wc belongs to the character class desc, a nonzero value is returned. 7097 Otherwise, 0 is returned. 7098 7099 Note that if wc is WEOF, 0 is returned. 7100 7101 Notes 7102 7103 The behavior of iswctype depends on the LC_CTYPE category of the current 7104 locale. 7105 7106 kill 7107 7108 Name 7109 7110 kill -- send a signal 7111 7112 Synopsis 7113 7114 int kill(pid_t pid, int sig); 7115 7116 Description 7117 7118 kill is as specified in the Single UNIX Specification, Version 2, but with 7119 differences as listed below. 7120 7121 Process ID -1 doesn't affect calling process 7122 7123 If pid is specified as -1, sig shall not be sent to the calling process. [8] 7124 Other than this, the rules in the Single UNIX Specification, Version 2 apply. 7125 7126 mbsnrtowcs 7127 7128 Name 7129 7130 mbsnrtowcs -- convert a multibyte string to a wide character string 7131 7132 Synopsis 7133 7134 #include 7135 7136 size_t mbsnrtowcs(wchar_t *dest, const char **src, size_t nms, size_t len, 7137 mbstate_t *ps); 7138 7139 Description 7140 7141 mbsnrtowcs is like mbsrtowcs, except that the number of bytes to be converted, 7142 starting at src, is limited to nms. 7143 7144 If dest is not a NULL pointer, mbsnrtowcs converts at most nms bytes from the 7145 multibyte string src to a wide-character string starting at dest. At most, len 7146 wide characters are written to dest. The state ps is updated. 7147 7148 The conversion is effectively performed by repeatedly calling: 7149 7150 7151 mbrtowc(dest, *src, n, ps) 7152 7153 where n is some positive number, as long as this call succeeds, and then 7154 incrementing dest by one and src by the number of bytes consumed. 7155 7156 The conversion can stop for three reasons: 7157 7158 * An invalid multibyte sequence has been encountered. In this case src is 7159 left pointing to the invalid multibyte sequence, (size_t)(-1) is returned, 7160 and errno is set to EILSEQ. 7161 7162 * The nms limit forces a stop, or len non-L'\0' wide characters have been 7163 stored at dest. In this case, src is left pointing to the next multibyte 7164 sequence to be converted, and the number of wide characters written to dest 7165 is returned. 7166 7167 * The multibyte string has been completely converted, including the 7168 terminating '\0' (which has the side effect of bringing back ps to the 7169 initial state). In this case, src is set to NULL, and the number of wide 7170 characters written to dest, excluding the terminating L'\0' character, is 7171 returned. 7172 7173 If dest is NULL, len is ignored, and the conversion proceeds as above, except 7174 that the converted wide characters are not written out to memory, and that no 7175 destination length limit exists. 7176 7177 In both of the above cases, if ps is a NULL pointer, a static anonymous state 7178 only known to mbsnrtowcs is used instead. 7179 7180 The programmer shall ensure that there is room for at least len wide characters 7181 at dest. 7182 7183 Return Value 7184 7185 mbsnrtowcs returns the number of wide characters that make up the converted 7186 part of the wide character string, not including the terminating null wide 7187 character. If an invalid multibyte sequence was encountered, (size_t)(-1) is 7188 returned, and the global variable errno is set to EILSEQ. 7189 7190 Notes 7191 7192 The behavior of mbsnrtowcs depends on the LC_CTYPE category of the current 7193 locale. 7194 7195 Passing NULL as ps is not multi-thread safe. 7196 7197 memmem 7198 7199 Name 7200 7201 memmem -- locate a substring 7202 7203 Synopsis 7204 7205 #define _GNU_SOURCE 7206 #include 7207 7208 void *memmem(const void *haystack, size_t haystacklen, const void *needle, 7209 size_t needlelen); 7210 7211 Description 7212 7213 memmem finds the start of the first occurrence of the substring needle of 7214 length needlelen in the memory area haystack of length haystacklen. 7215 7216 Return Value 7217 7218 memmem returns a pointer to the beginning of the substring, or NULL if the 7219 substring is not found. 7220 7221 Notes 7222 7223 memmem was broken in Linux libraries up to and including libc 5.0.9; there the 7224 needle and haystack arguments were interchanged, and a pointer to the end of 7225 the first occurrence of needle was returned. Since libc 5.0.9 is still widely 7226 used, this is a dangerous function to use. 7227 7228 Both old and new libc's have the bug that if needle is empty, haystack-1 is 7229 returned (instead of haystack). And glibc 2.0 makes it worse, returning a 7230 pointer to the last byte of haystack. This is fixed in glibc 2.1. 7231 7232 memrchr 7233 7234 Name 7235 7236 memrchr -- scan memory for a character 7237 7238 Synopsis 7239 7240 #include 7241 7242 void *memrchr(const void *s, int c, size_t n); 7243 7244 Description 7245 7246 memrchr returns a pointer to the last occurrence of c in the first n characters 7247 of the string represented by s. 7248 7249 ngettext 7250 7251 Name 7252 7253 ngettext -- perform lookup in message catalog for the current LC_MESSAGES 7254 locale 7255 7256 Synopsis 7257 7258 #include 7259 7260 extern char *ngettext(const char *msgid1, const char *msgid2, unsigned long int 7261 n); 7262 7263 Description 7264 7265 ngettext is the plural version of gettext, which searches for the message 7266 string using the msgid1 arguments as the key, using the argument n to determine 7267 the plural form. If no message catalogs containing a translation for msgid1 are 7268 found, msgid1 is returned if n == 1, otherwise, msgid2 is returned. (See 7269 gettext for more details.) 7270 7271 Parameters 7272 7273 msgid1 7274 7275 A NULL-terminated string to be matched in the catalogue with respect to a 7276 specific domain and the current locale. If no message catalogs are found, 7277 msgid1 is returned if n == 1. 7278 7279 msgid2 7280 7281 A NULL-terminated string to be returned if no message catalogs are found 7282 and n != 1. 7283 7284 n 7285 7286 Determines in which plural form a message string is returned, in a language 7287 and message catalog dependent way. 7288 7289 Return 7290 7291 If the function query above succeeds with msgid1, then a translated 7292 NULL-terminated string is returned. If the search fails, then the original 7293 msgid1 or msgid2 is returned, according to n. 7294 7295 Errors 7296 7297 ngettext will not modify the errno global variable. 7298 7299 See Also 7300 7301 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, 7302 bindtextdomain, bind_textdomain_codeset 7303 7304 obstack_free 7305 7306 Name 7307 7308 obstack_free -- free an object in the obstack 7309 7310 Synopsis 7311 7312 #include 7313 7314 void obstack_free((struct obstack *obstack), void *block); 7315 7316 Description 7317 7318 obstack_free frees an object in the obstack. 7319 7320 open 7321 7322 Name 7323 7324 open -- open a file 7325 7326 Description 7327 7328 open is as specified in ISO/IEC 9945:2003 Portable Operating System(POSIX)and 7329 The Single UNIX Specification(SUS) V3, but with differences as listed below. 7330 7331 May return ENODEV in place of ENXIO 7332 7333 Where ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 7334 Specification(SUS) V3 specifies an ENXIO return, a conforming implementation 7335 may return either ENXIO or ENODEV. Implementations are encouarged to return 7336 ENXIO. [9] 7337 7338 opterr 7339 7340 Name 7341 7342 opterr -- external variable used in getopt() 7343 7344 Synopsis 7345 7346 extern int opterr; 7347 7348 Description 7349 7350 opterr is used as a flag to suppress an error message generated by getopt. When 7351 opterr is set to 0, it suppresses the error message generated by getopt when 7352 that function does not recognize an option character. 7353 7354 optind 7355 7356 Name 7357 7358 optind -- external variable used in getopt() 7359 7360 Synopsis 7361 7362 extern int optind; 7363 7364 Description 7365 7366 optind holds the current index of the array argr[], which contains the command 7367 line options being parsed by getopt. 7368 7369 optopt 7370 7371 Name 7372 7373 optopt -- external variable used in getopt() 7374 7375 Synopsis 7376 7377 extern int optopt; 7378 7379 Description 7380 7381 optopt holds the unknown option character when that option character is not 7382 recognized by getopt. 7383 7384 pmap_getport 7385 7386 Name 7387 7388 pmap_getport -- Returns the port number on which a service is waiting for. 7389 7390 Synopsis 7391 7392 #include 7393 7394 extern u_short *pmap_getport(struct sockaddr_in *address, __const u_long 7395 program, __const u_long *version, u_int protocol); 7396 7397 Description 7398 7399 pmap_getport returns the port number on which a service is waiting for. 7400 pmap_getport is called given the RPC program number program, version, and the 7401 transport protocol set to either IPPROTO_UDP or IPPROTO_TCP. The pre-allocated 7402 socket address is a returned parameter. 7403 7404 Return Value 7405 7406 pmap_getport returns 0 if the mapping does not exist or if contact to the 7407 remote portmap service failed. If the remote portmap service could not be 7408 reached, the status is left in the global variable rpc_createerr. 7409 7410 pmap_set 7411 7412 Name 7413 7414 pmap_set -- Establishes mapping to machine's portmap service. 7415 7416 Synopsis 7417 7418 #include 7419 7420 *pmap_set(__const u_long program, __const u_long version, int protocol, u_short 7421 port); 7422 7423 Description 7424 7425 pmap_set establishes a mapping between the triple [program,version,protocol] 7426 and port on the machine's portmap service. The value of protocol is most likely 7427 IPPROTO_UDP or IPPROTO_TCP. Automatically done by svc_register. 7428 7429 Return Value 7430 7431 pmap_set returns 1 if it suceeds, 0 otherwise. 7432 7433 pmap_unset 7434 7435 Name 7436 7437 pmap_unset -- Destroys all mapping between the triple and ports. 7438 7439 Synopsis 7440 7441 #include 7442 7443 void pmap_unset(u_long prognum, u_long versnum); 7444 7445 Description 7446 7447 As a user interface to the portmap service, pmap_unset destroys all mapping 7448 between the triple [prognum,versnum, *] and ports on the machine's portmap 7449 service. 7450 7451 Return Value 7452 7453 pmap_unset returns 1 if it succeeds, zero otherwise. 7454 7455 psignal 7456 7457 Name 7458 7459 psignal -- print signal message 7460 7461 Synopsis 7462 7463 #include 7464 7465 void psignal(int sig, const char *s); 7466 7467 extern const char *const sys_siglist[] 7468 7469 Description 7470 7471 psignal displays a message on stderr consisting of the string s, a colon, a 7472 space, and a string describing the signal number sig. If sig is invalid, the 7473 message displayed will indicate an unknown signal. 7474 7475 The array sys_siglist holds the signal description strings indexed by signal 7476 number. 7477 7478 Return Value 7479 7480 psignal returns no value. 7481 7482 random_r 7483 7484 Name 7485 7486 random_r -- generate random number 7487 7488 Synopsis 7489 7490 extern int random_r((struct random_data *__restrict __buf), int32_t *__restrict 7491 __result); 7492 7493 Description 7494 7495 random_r is a reentrant version of random, which generates a pseudorandom 7496 number. 7497 7498 setbuffer 7499 7500 Name 7501 7502 setbuffer -- stream buffering operation 7503 7504 Synopsis 7505 7506 #include 7507 7508 void setbuffer(FILE *stream, char *buf, size_t size); 7509 7510 Description 7511 7512 setbuffer is an alias for the call to setvbuf. It works the same, except that 7513 the size of the buffer in setbuffer is up to the caller, rather than being 7514 determined by the default BUFSIZ. 7515 7516 setdomainname 7517 7518 Name 7519 7520 setdomainname -- set NIS domain name. 7521 7522 Synopsis 7523 7524 #include 7525 7526 extern int setdomainname(char *name, size_t namelen); 7527 7528 Description 7529 7530 If NIS is in use, set the NIS domain name. Note that this is not the same as 7531 the domain name which provides the domain portion of a fully qualified domain 7532 name (for example, in DNS). If NIS is not in use, this function may set the 7533 domain name anyway, or it may fail. 7534 7535 This call shall fail unless the caller has appropriate privileges. 7536 7537 namelen shall be the length of the string pointed to by name. 7538 7539 Return Value 7540 7541 setdomainname returns 0 if successful; -1 if not (in which case errno is set to 7542 indicate the error). 7543 7544 setgroups 7545 7546 Name 7547 7548 setgroups -- set list of supplementary group IDs 7549 7550 Synopsis 7551 7552 #include 7553 7554 int setgroups(size_t size, const gid_t *list); 7555 7556 Description 7557 7558 setgroups sets the supplementary groups for the process. Only the super-user 7559 may use this function. 7560 7561 Return Value 7562 7563 On success, 0 is returned. On error, -1 is returned and the global variable 7564 errno is set appropriately. 7565 7566 Errors 7567 7568 EFAULT 7569 7570 list has an invalid address. 7571 7572 EPERM 7573 7574 The user is not the super-user. 7575 7576 EINVA 7577 7578 size is greater than NGROUPS (32 for Linux 2.0.32). 7579 7580 sethostid 7581 7582 Name 7583 7584 sethostid -- set the unique identifier of the current host 7585 7586 Synopsis 7587 7588 #include 7589 7590 int sethostid(long int hostid); 7591 7592 Description 7593 7594 sethostid sets a unique 32-bit identifier for the current machine. The 32-bit 7595 identifier is intended to be unique among all UNIX systems in existence. This 7596 normally resembles the Internet address for the local machine as returned by 7597 gethostbyname(3), and thus usually never needs to be set. 7598 7599 The sethostid call is restricted to the superuser. 7600 7601 hostid is stored in the file /etc/hostid. 7602 7603 Return Value 7604 7605 gethostid returns the 32-bit identifier for the current host as set by 7606 sethostid(2). 7607 7608 Files 7609 7610 /etc/hostid 7611 7612 sethostname 7613 7614 Name 7615 7616 sethostname -- set host name 7617 7618 Synopsis 7619 7620 #include 7621 7622 int sethostname(const char *name, size_t len); 7623 7624 Description 7625 7626 sethostname changes the host name of the current processor. 7627 7628 Return Value 7629 7630 On success, 0 is returned. On error, -1 is returned and the global variable 7631 errno is set appropriately. 7632 7633 Errors 7634 7635 EINVAL 7636 7637 len is negative or larger than the maximum allowed size. 7638 7639 EPERM 7640 7641 the caller was not the superuser. 7642 7643 EFAULT 7644 7645 name is an invalid address. 7646 7647 Notes 7648 7649 The Single UNIX Specification, Version 2 guarantees that: 7650 7651 7652 Host names are limited to 255 bytes. 7653 7654 setsockopt 7655 7656 Name 7657 7658 setsockopt -- set options on sockets 7659 7660 Synopsis 7661 7662 #include 7663 #include 7664 7665 int setsockopt(int sockfd, int level, int optname, void *optval, socklen_t 7666 optlen); 7667 7668 Description 7669 7670 In addition to the setsockopt options specified in SUSv3, setsockopt also 7671 supports the options specified here. 7672 7673 The following setsockopt operations are provided for level IPPROTO_IP: 7674 7675 IP_MULTICAST_TTL 7676 7677 Set or reads the time-to-live value of outgoing multicast packets for this 7678 socket. optval is a pointer to an integer which contains the new TTL value. 7679 7680 IP_MULTICAST_LOOP 7681 7682 Sets a boolean flag indicating whether multicast packets originating 7683 locally should be looped back to the local sockets. optval is a pointer to 7684 an integer which contains the new flag value. 7685 7686 IP_ADD_MEMBERSHIP 7687 7688 Join a multicast group. optval is a pointer to a ip_mreq structure. Before 7689 calling, the caller should fill in the imr_multiaddr field with the 7690 multicast group address and the imr_address field with the address of the 7691 local interface. If imr_address is set to INADDR_ANY, then an appropriate 7692 interface is chosen by the system. 7693 7694 IP_DROP_MEMBERSHIP 7695 7696 Leave a multicast group. optval is a pointer to a ip_mreq structure 7697 containing the same values as were used with IP_ADD_MEMBERSHIP. 7698 7699 IP_MULTICAST_IF 7700 7701 Set the local device for a multicast socket. optval is a pointer to a 7702 ip_mreq structure initialized in the same manner as with IP_ADD_MEMBERSHIP. 7703 7704 The ip_mreq structure contains two struct in_addr fields: imr_multiaddr and 7705 imr_address. 7706 7707 Return Value 7708 7709 On success, 0 is returned. On error, -1 is returned and the global variable 7710 errno is set appropriately. 7711 7712 setutent 7713 7714 Name 7715 7716 setutent -- access utmp file entries 7717 7718 Synopsis 7719 7720 #include 7721 7722 void setutent(void); 7723 7724 Description 7725 7726 setutent rewinds the file pointer to the beginning of the utmp file. It is 7727 generally a Good Idea to call it before any of the other functions. 7728 7729 Errors 7730 7731 On error, (struct utmp*)0 will be returned. 7732 7733 Files 7734 7735 /var/run/utmp database of currently logged-in users /var/log/wtmp database of 7736 past user logins 7737 7738 sigandset 7739 7740 Name 7741 7742 sigandset -- build a new signal set by combining the two input sets using 7743 logical AND 7744 7745 Synopsis 7746 7747 #include 7748 7749 extern int sigandset(sigset_t *set, const sigset_t *left, const sigset_t 7750 *right); 7751 7752 Description 7753 7754 sigandset is a signal function that builds a new signal set by combining the 7755 two input sets using logical AND. 7756 7757 sigblock 7758 7759 Name 7760 7761 sigblock -- manipulate the signal mask 7762 7763 Synopsis 7764 7765 #include 7766 7767 int sigblock(int mask); 7768 7769 Description 7770 7771 sigblock is made obsolete by sigprocmask(2). 7772 7773 sigblock adds the signals specified in mask to the set of signals currently 7774 being blocked from delivery. 7775 7776 Notes 7777 7778 Prototype for sigblock is only available if _BSD_SOURCE is defined before the 7779 inclusion of any system. 7780 7781 siggetmask 7782 7783 Name 7784 7785 siggetmask -- manipulate the signal mask 7786 7787 Synopsis 7788 7789 #include 7790 7791 int siggetmask(void); 7792 7793 Description 7794 7795 siggetmask is made obsolete by sigprocmask(2). 7796 7797 siggetmask returns the current set of masked signals. 7798 7799 Notes 7800 7801 Prototype for siggetmask is only available if _BSD_SOURCE is defined before the 7802 inclusion of any system header file. 7803 7804 sigisemptyset 7805 7806 Name 7807 7808 sigisemptyset -- check for empty signal set 7809 7810 Synopsis 7811 7812 #include 7813 7814 extern int sigisemptyset(const sigset_t *set); 7815 7816 Description 7817 7818 sigisemptyset checks for empty signal set. It returns a non-empty value if set 7819 is not empty. 7820 7821 sigorset 7822 7823 Name 7824 7825 sigorset -- build a new signal set by combining the two input sets using 7826 logical or 7827 7828 Synopsis 7829 7830 #include 7831 7832 extern int sigorset(sigset_t *set, const sigset_t *left, const sigset_t 7833 *right); 7834 7835 Description 7836 7837 sigorset is a signal function that builds a new signal set by combining the two 7838 input sets using logical or. 7839 7840 sigreturn 7841 7842 Name 7843 7844 sigreturn -- return from signal handler and cleanup stack frame 7845 7846 Synopsis 7847 7848 int sigreturn(unsigned long __unused); 7849 7850 Description 7851 7852 When the Linux kernel creates the stack frame for a signal handler, a call to 7853 sigreturn is inserted into the stack frame so that the the signal handler will 7854 call sigreturn upon return. This inserted call to sigreturn cleans up the stack 7855 so that the process can restart from where it was interrupted by the signal. 7856 7857 Return Value 7858 7859 sigreturn never returns. 7860 7861 Warning 7862 7863 sigreturn is used by the kernel to implement signal handlers. It should never 7864 be called directly. Better yet, the specific use of __unused varies depending 7865 on the architecture. 7866 7867 Files 7868 7869 /usr/src/linux/arch/i386/kernel/signal.c 7870 7871 /usr/src/linux/arch/alpha/kernel/entry.s 7872 7873 stime 7874 7875 Name 7876 7877 stime -- set time 7878 7879 Synopsis 7880 7881 #define _SVID_SOURCE /* glibc needs this */ 7882 #include 7883 7884 int stime(time_t *t); 7885 7886 Description 7887 7888 stime sets the system's idea of the time and date. Time, pointed to by t, is 7889 measured in seconds from 00:00:00 GMT January 1, 1970. stime may only be 7890 executed by the super user. 7891 7892 Return Value 7893 7894 On success, 0 is returned. On error, -1 is returned and the global variable 7895 errno is set appropriately. 7896 7897 Errors 7898 7899 EPERM 7900 7901 The caller is not the super-user. 7902 7903 Notes 7904 7905 Under glibc2, time.h only provides a prototype when _SVID_SOURCE is defined. 7906 7907 stpcpy 7908 7909 Name 7910 7911 stpcpy -- copy a string returning a pointer to its end 7912 7913 Synopsis 7914 7915 #include 7916 7917 char *stpcpy(char *dest, const char *src); 7918 7919 Description 7920 7921 stpcpy copies the string pointed to by src (including the terminating '\0' 7922 character) to the array pointed to by dest. The strings may not overlap, and 7923 the destination string dest shall be large enough to receive the copy. 7924 7925 Return Value 7926 7927 stpcpy returns a pointer to the end of the string dest (that is, the address of 7928 the terminating '\0' character) rather than the beginning. 7929 7930 Example 7931 7932 This program uses stpcpy to concatenate foo and bar to produce foobar, which it 7933 then prints. 7934 7935 #include 7936 7937 int 7938 main (void) 7939 { 7940 char *to = buffer; 7941 to = stpcpy (to, "foo"); 7942 to = stpcpy (to, "bar"); 7943 printf ("%s\n", buffer); 7944 } 7945 7946 stpncpy 7947 7948 Name 7949 7950 stpncpy -- copy a fixed-size string, returning a pointer to its end 7951 7952 Synopsis 7953 7954 #include 7955 7956 char *stpncpy(char *dest, const char *src, size_t n); 7957 7958 Description 7959 7960 stpncpy copies at most n characters from the string pointed to by src, 7961 including the terminating \0 character, to the array pointed to by dest. 7962 Exactly n characters are written at dest. If the length strlen(src) is smaller 7963 than n, the remaining characters in dest are filled with \0 characters. If the 7964 length strlen(src) is greater than or equal to n, dest will not be \0 7965 terminated. 7966 7967 The strings may not overlap. 7968 7969 The programmer shall ensure that there is room for at least n characters at 7970 dest. 7971 7972 Return Value 7973 7974 stpncpy returns a pointer to the terminating NULL in dest, or, if dest is not 7975 NULL-terminated, dest + n. 7976 7977 strcasestr 7978 7979 Name 7980 7981 strcasestr -- locate a substring - ignores the case of both strings 7982 7983 Synopsis 7984 7985 #include 7986 7987 char *strcasestr(const char *haystack, const char *needle); 7988 7989 Description 7990 7991 strcasestr is similar to strstr, but ignores the case of both strings. 7992 7993 strerror_r 7994 7995 Name 7996 7997 strerror_r -- reentrant version of strerror 7998 7999 Synopsis 8000 8001 #include 8002 8003 extern char *strerror_r(int errnum, char *buf, size_t buflen); 8004 8005 Description 8006 8007 strerror_r is a reentrant version of strerror. strerror_r returns a pointer to 8008 an error message corresponding to error number errnum. The returned pointer may 8009 point within the buffer buf (at most buflen bytes). [10] 8010 8011 strfry 8012 8013 Name 8014 8015 strfry -- randomize a string 8016 8017 Synopsis 8018 8019 #include 8020 8021 char *strfry(char *string); 8022 8023 Description 8024 8025 strfry randomizes the contents of string by using rand(3) to randomly swap 8026 characters in the string. The result is an anagram of string. 8027 8028 Return Value 8029 8030 strfry returns a pointer to the randomized string. 8031 8032 strndup 8033 8034 Name 8035 8036 strndup -- return a malloc'd copy of at most the specified number of bytes of a 8037 string 8038 8039 Synopsis 8040 8041 #include 8042 8043 extern char *strndup(const char *string, size_t n); 8044 8045 Description 8046 8047 strndup returns a malloc'd copy of at most n bytes of string. The resultant 8048 string is terminated even if no NULL terminator appears before STRING[N]. 8049 8050 strnlen 8051 8052 Name 8053 8054 strnlen -- determine the length of a fixed-size string 8055 8056 Synopsis 8057 8058 #include 8059 8060 size_t strnlen(const char *s, size_t maxlen); 8061 8062 Description 8063 8064 strnlen returns the number of characters in the string s, not including the 8065 terminating \0 character, but at most maxlen. In doing this, strnlen looks only 8066 at the first maxlen characters at s and never beyond s + maxlen. 8067 8068 Return Value 8069 8070 strnlen returns strlen(s), if that is less than maxlen, or maxlen if there is 8071 no \0 character among the first maxlen characters pointed to by s. 8072 8073 strptime 8074 8075 Name 8076 8077 strptime -- parse a time string 8078 8079 Description 8080 8081 strptime is as specified in the Single UNIX Specification, Version 2 with 8082 differences as listed below. 8083 8084 Number of leading zeroes limited 8085 8086 The Single UNIX Specification, Version 2 specifies fields for which "leading 8087 zeros are permitted but not required"; however, applications shall not expect 8088 to be able to supply more leading zeroes for these fields than would be implied 8089 by the range of the field. Implementations may choose to either match an input 8090 with excess leading zeroes, or treat this as a non-matching input. For example, 8091 %j has a range of 001 to 366, so 0, 00, 000, 001, and 045 are acceptable 8092 inputs, but inputs such as 0000, 0366 and the like are not. 8093 8094 Rationale 8095 8096 glibc developers consider it appropriate behavior to forbid excess leading 8097 zeroes. When trying to parse a given input against several format strings, 8098 forbidding excess leading zeroes could be helpful. For example, if one matches 8099 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it seems useful for the 8100 first match to fail, as it would be perverse to parse that date as November 12, 8101 year 26. The second pattern parses it as December 26, year 11. 8102 8103 The Single UNIX Specification is not explicit that an unlimited number of 8104 leading zeroes are required, although it may imply this. The LSB explicitly 8105 allows implementations to have either behavior. Future versions of this 8106 standard may require implementations to forbid excess leading zeroes. 8107 8108 strsep 8109 8110 Name 8111 8112 strsep -- extract token from string 8113 8114 Synopsis 8115 8116 #include 8117 8118 char *strsep(char **stringp, const char *delim); 8119 8120 Description 8121 8122 If stringp is NULL, strsep returns NULL and does nothing else. 8123 8124 If stringp is non-NULL, strsep finds the first token in the stringp, where 8125 tokens are delimited by symbols in the string delim. This token is terminated 8126 with a \0 character (by overwriting the delimiter) and stringp is updated to 8127 point past the token. In case no delimiter was found, the token is taken to be 8128 the entire string stringp, and stringp is made NULL. 8129 8130 Return Value 8131 8132 strsep returns a pointer to the token, that is, it returns the original value 8133 of stringp. 8134 8135 Notes 8136 8137 strsep was introduced as a replacement for strtok, since the latter cannot 8138 handle empty fields. However, strtok conforms to ANSI-C and hence is more 8139 portable. 8140 8141 Bugs 8142 8143 strsep suffers from the same problems as strtok. In particular, strsep modifies 8144 the original string. Avoid it. 8145 8146 strsignal 8147 8148 Name 8149 8150 strsignal -- return string describing signal 8151 8152 Synopsis 8153 8154 #define _GNU_SOURCE 8155 #include 8156 8157 char *strsignal(int sig); 8158 8159 extern const char * const sys_siglist[]; 8160 8161 Description 8162 8163 strsignal returns a string describing the signal number sig. The string can 8164 only be used until the next call to strsignal. 8165 8166 The array sys_siglist holds the signal description strings indexed by signal 8167 number. strsignal should be used if possible instead of this array. 8168 8169 Return Value 8170 8171 strsignal returns the appropriate description string, or an unknown signal 8172 message if the signal number is invalid. On some systems (but not on Linux), a 8173 NULL pointer may be returned instead for an invalid signal number. 8174 8175 strtok_r 8176 8177 Name 8178 8179 strtok_r -- extract tokens from strings 8180 8181 Synopsis 8182 8183 #include 8184 8185 char *strtok_r(char *s, const char *delim, char **ptrptr); 8186 8187 Description 8188 8189 strtok_r parses the string s into tokens. [11] The first call to strtok_r 8190 should have s as its first argument. Subsequent calls should have the first 8191 argument set to NULL. Each call returns a pointer to the next token, or NULL 8192 when no more tokens are found. 8193 8194 If a token ends with a delimiter, this delimiting character is overwritten with 8195 a \0 and a pointer to the next character is saved for the next call to 8196 strtok_r. The delimiter string delim may be different for each call. 8197 8198 ptrptr is a user allocated char* pointer. It shall be the same while parsing 8199 the same string. 8200 8201 Bugs 8202 8203 Never use this function. Note that: 8204 8205 * It modifies its first argument. 8206 8207 * The identity of the delimiting character is lost. 8208 8209 * It cannot be used on constant strings. 8210 8211 Return Value 8212 8213 strtok_r returns a pointer to the next token, or NULL if there are no more 8214 tokens. 8215 8216 strtoq 8217 8218 Name 8219 8220 strtoq -- convert string value to a long or quad_t integer 8221 8222 Synopsis 8223 8224 #include 8225 #include 8226 #include 8227 8228 quadt strtoq(const char *nptr, char **endptr, int base); 8229 8230 Description 8231 8232 strtoq converts the string nptr to a quadt value. The conversion is done 8233 according to the given base, which shall be between 2 and 36 inclusive, or be 8234 the special value 0. 8235 8236 nptr may begin with an arbitrary amount of white space (as determined by 8237 isspace(3)), followed by a single optional + or - sign character. If base is 0 8238 or 16, the string may then include a 0x prefix, and the number will be read in 8239 base 16; otherwise, a 0 base is taken as 10 (decimal), unless the next 8240 character is 0, in which case it is taken as 8 (octal). 8241 8242 The remainder of the string is converted to a long value in the obvious manner, 8243 stopping at the first character which is not a valid digit in the given base. 8244 (In bases above 10, the letter A in either upper or lower case represents 10, B 8245 represents 11, and so forth, with Z representing 35.) 8246 8247 Return Value 8248 8249 strtoq returns the result of the conversion, unless the value would underflow 8250 or overflow. If an underflow occurs, strtoq returns QUAD_MIN. If an overflow 8251 occurs, strtoq returns QUAD_MAX. In both cases, the global variable errno is 8252 set to ERANGE. 8253 8254 Errors 8255 8256 ERANGE 8257 8258 The given string was out of range; the value converted has been clamped. 8259 8260 strtouq 8261 8262 Name 8263 8264 strtouq -- convert a string to an uquad_t 8265 8266 Synopsis 8267 8268 #include 8269 #include 8270 #include 8271 8272 uquadt strtouq(const char *nptr, char **endptr, int base); 8273 8274 Description 8275 8276 strtouq converts the string nptr to a uquadt value. The conversion is done 8277 according to the given base, which shall be between 2 and 36 inclusive, or be 8278 the special value 0. 8279 8280 nptr may begin with an arbitrary amount of white space (as determined by 8281 isspace(3)), followed by a single optional + or - sign character. If base is 0 8282 or 16, the string may then include a 0x prefix, and the number will be read in 8283 base 16; otherwise, a 0 base is taken as 10 (decimal), unless the next 8284 character is 0, in which case it is taken as 8 (octal). 8285 8286 The remainder of the string is converted to an unsigned long value in the 8287 obvious manner, stopping at the end of the string or at the first character 8288 that does not produce a valid digit in the given base. (In bases above 10, the 8289 letter A in either upper or lower case represents 10, B represents 11, and so 8290 forth, with Z representing 35.) 8291 8292 Return Value 8293 8294 On success, strtouq returns either the result of the conversion or, if there 8295 was a leading minus sign, the negation of the result of the conversion, unless 8296 the original (non-negated) value would overflow. In the case of an overflow the 8297 function returns UQUAD_MAX and the global variable errno is set to ERANGE. 8298 8299 Errors 8300 8301 ERANGE 8302 8303 The given string was out of range; the value converted has been clamped. 8304 8305 strverscmp 8306 8307 Name 8308 8309 strverscmp -- compare strings holding name and indices/version numbers 8310 8311 Synopsis 8312 8313 #include 8314 8315 extern int strverscmp(const char *s1, const char *s2); 8316 8317 Description 8318 8319 strverscmp compares s1 and s2 as strings holding name and indices/version 8320 numbers. 8321 8322 svc_register 8323 8324 Name 8325 8326 svc_register -- Associates program and versnum with the service dispatch 8327 procedure, dispatch. 8328 8329 Synopsis 8330 8331 #include 8332 8333 void svc_register(SVCXPRT *xprt, u_long prognum, u_long versnum, void 8334 (*dispatch)(), u_long protocol); 8335 8336 Description 8337 8338 Associates prognum and versnum with the service dispatch procedure, dispatch. 8339 If protocol is zero, the service is not registered with the portmap service. If 8340 protocol is non-zero, then a mapping of the triple [prognum, versnum,protocol] 8341 to xprt->xp_port is established with the local portmap service (generally 8342 protocol is zero, IPPROTO_UDP or IPPROTO_TCP). The procedure dispatch has the 8343 following form: 8344 8345 dispatch(request, xprt) struct svc_req *request; SVCXPRT *xprt; 8346 8347 Return Value 8348 8349 svc_register returns 1 if it succeeds, and zero otherwise. 8350 8351 svc_run 8352 8353 Name 8354 8355 svc_run -- Waits for RPC requests to arrive and calls service procedure. 8356 8357 Synopsis 8358 8359 #include 8360 8361 svc_run(); 8362 8363 Description 8364 8365 The svc_run routine never returns. It waits for RPC requests to arrive, and 8366 calls the appropriate service procedure using svc_getreq when one arrives. This 8367 procedure is usually waiting for a select system call to return. 8368 8369 svc_sendreply 8370 8371 Name 8372 8373 svc_sendreply -- called by RPC service's dispatch routine 8374 8375 Synopsis 8376 8377 svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, char out); 8378 8379 Description 8380 8381 Called by an RPC service's dispatch routine to send the results of a remote 8382 procedure call. The parameter xprt is the request's associated transport 8383 handle; outproc is the XDR routine which is used to encode the results; and out 8384 is the address of the results. This routine returns one if it succeeds, zero 8385 other-wise. 8386 8387 svctcp_create 8388 8389 Name 8390 8391 svctcp_create -- Creates a TCP/IP-based RPC service transport. 8392 8393 Synopsis 8394 8395 #include 8396 8397 SVCXPRT *svctcp_create(int sock, u_int send_buf_size, u_int recv_buf_size); 8398 8399 Description 8400 8401 svctcp_create cretes a TCP/IP-based RPC service transport, to which it returns 8402 a pointer. The transport is associated with the socket sock, which may be 8403 RPC_ANYSOCK, in which case a new socket is created. If the socket is not bound 8404 to a local TCP port, ten this routine binds it to an arbitrary port. Upon 8405 completion, xprt->xp_sock is the transport's socket descriptor, and xprt-> 8406 xp_port is the transport's port number. Since TCP-based RPC uses buffered I/O, 8407 users may specify the size of buffers; values of zero choose suitable defaults. 8408 8409 Return Value 8410 8411 svctcp_create returns NULL if it fails, or a pointer to the RPC service 8412 transport otherwise. 8413 8414 svcudp_create 8415 8416 Name 8417 8418 svcudp_create -- Creates a UDP-based RPC service transport. 8419 8420 Synopsis 8421 8422 SVCXPRT * 8423 8424 svcudp_create(int sock); 8425 8426 Description 8427 8428 This call is equivalent to svcudp_bufcreate (sock, SZ, SZ) for some default 8429 size SZ. 8430 8431 system 8432 8433 Name 8434 8435 system -- execute a shell command 8436 8437 Synopsis 8438 8439 #include 8440 8441 int system(const char *string); 8442 8443 Description 8444 8445 system executes a command specified in string by calling /bin/sh -c string, and 8446 returns after the command has been completed. During execution of the command, 8447 SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored. 8448 8449 Return Value 8450 8451 The value 127 returned if the execve call for /bin/sh fails, -1 if there was 8452 another error and the return code of the command otherwise. 8453 8454 If the value of string is NULL, system returns a nonzero value if the shell is 8455 available, and zero if not. 8456 8457 system does not affect the wait status of any other children. 8458 8459 Notes 8460 8461 The fact that system ignores interrupts is often not what a program wants. The 8462 Single UNIX Specification describes some of the consequences; an additional 8463 consequence is that a program calling system from a loop cannot be reliably 8464 interrupted. Many programs will want to use the exec(3) family of functions 8465 instead. 8466 8467 Do not use system from a program with suid or sgid privileges, because strange 8468 values for some environment variables might be used to subvert system 8469 integrity. Use the exec(3) family of functions instead, but not execlp(3) or 8470 execvp(3). system will not, in fact, work properly from programs with suid or 8471 sgid privileges on systems on which /bin/sh is bash version 2, since bash 2 8472 drops privileges on startup. (Debian uses a modified bash which does not do 8473 this when invoked as sh.) 8474 8475 The check for the availability of /bin/sh is not actually performed; it is 8476 always assumed to be available. ISO C specifies the check, but POSIX.2 8477 specifies that the return shall always be nonzero, since a system without the 8478 shell is not conforming, and it is this that is implemented. 8479 8480 It is possible for the shell command to return 127, so that code is not a sure 8481 indication that the execve call failed; check the global variable errno to make 8482 sure. 8483 8484 textdomain 8485 8486 Name 8487 8488 textdomain -- set the current default message catalog 8489 8490 Synopsis 8491 8492 #include 8493 8494 extern char *textdomain(const char *domainname); 8495 8496 Description 8497 8498 textdomain sets the current default message catalog to domainname, which 8499 remains valid across subsequent calls to setlocale, and gettext. 8500 8501 Return 8502 8503 On success, textdomain returns the currently selected domain. On error, a NULL 8504 pointer is returned. 8505 8506 If domainname is NULL, textdomain returns the current default. 8507 8508 If domainname is "", reset to the default of "messages". 8509 8510 Errors 8511 8512 ENOMEM 8513 8514 The function may have failed if there was "insufficent memory available." 8515 8516 unlink 8517 8518 Name 8519 8520 unlink -- remove a directory entry 8521 8522 Synopsis 8523 8524 int unlink(const char *path); 8525 8526 Description 8527 8528 unlink is as specified in the ISO/IEC 9945:2003 Portable Operating System 8529 (POSIX)and The Single UNIX Specification(SUS) V3, but with differences as 8530 listed below. 8531 8532 See also Additional behaviors: unlink/link on directory>. 8533 8534 May return EISDIR on directories 8535 8536 If path specifies a directory, the implementation may return EISDIR instead of 8537 EPERM as specified by ISO/IEC 9945:2003 Portable Operating System(POSIX)and The 8538 Single UNIX Specification(SUS) V3. [12] 8539 8540 vasprintf 8541 8542 Name 8543 8544 vasprintf -- write formatted output to a string dynamically allocated with 8545 malloc and store the address of the string 8546 8547 Synopsis 8548 8549 #include 8550 8551 extern int vasprintf(char **restrict ptr, const char *restrict f, G_va_list 8552 arg); 8553 8554 Description 8555 8556 vasprintf writes formatted output to a string dynamically allocated with 8557 malloc, and stores the address of the string in ptr. 8558 8559 vdprintf 8560 8561 Name 8562 8563 vdprintf -- write formatted output to a file descriptor 8564 8565 Synopsis 8566 8567 #include 8568 8569 extern int vdprintf(int fd, const char *restrict fmt, G_va_list arg); 8570 8571 Description 8572 8573 vdprintf writes formatted output to a file descriptor. 8574 8575 verrx 8576 8577 Name 8578 8579 verrx -- display formatted error messages 8580 8581 Synopsis 8582 8583 #include 8584 8585 void verrx(int eval, const char *fmt, valist args); 8586 8587 Description 8588 8589 verrx displays a formatted error message on the standard error output. The last 8590 component of the program name, a colon character, and a space are output. If 8591 fmt is not NULL, the formatted error message, a colon, and a space are output. 8592 The output is followed by a newline character. 8593 8594 verrx does not return, but exits with the value of eval. 8595 8596 vsyslog 8597 8598 Name 8599 8600 vsyslog -- log to system log 8601 8602 Synopsis 8603 8604 void vsyslog(int priority, char *message, va_list arglist); 8605 8606 Description 8607 8608 vsyslog is identical to syslog as specified in the Single UNIX Specification, 8609 except that arglist (as defined by stdarg.h) replaces the variable number of 8610 arguments. 8611 8612 The caller is responsible for running va_end after calling vsyslog. 8613 8614 wait3 8615 8616 Name 8617 8618 wait3 -- wait for child process 8619 8620 Description 8621 8622 wait3 is as specified in the Single UNIX Specification, Version 2, but with 8623 differences as listed below. 8624 8625 Notes 8626 8627 Implementations need not support the functionality of WCONTINUED or 8628 WIFCONTINUED. 8629 8630 wait4 8631 8632 Name 8633 8634 wait4 -- wait for process termination, BSD style 8635 8636 Synopsis 8637 8638 #include 8639 #include 8640 #include 8641 8642 pid_t wait4(pid_t pid, int *status, int options, (struct rusage *rusage)); 8643 8644 Description 8645 8646 wait4 suspends execution of the current process until a child (as specified by 8647 pid) has exited, or until a signal is delivered whose action is to terminate 8648 the current process or to call a signal handling function. If a child (as 8649 requested by pid) has already exited by the time of the call (a so-called 8650 "zombie" process), the function returns immediately. Any system resources used 8651 by the child are freed. 8652 8653 The value of pid can be one of: 8654 8655 < -1 8656 8657 wait for any child process whose process group ID is equal to the absolute 8658 value of pid. 8659 8660 -1 8661 8662 wait for any child process; this is equivalent to calling wait3. 8663 8664 0 8665 8666 wait for any child process whose process group ID is equal to that of the 8667 calling process. 8668 8669 > 0 8670 8671 wait for the child whose process ID is equal to the value of pid. 8672 8673 The value of options is a bitwise or of zero or more of the following 8674 constants: 8675 8676 WNOHANG 8677 8678 return immediately if no child is there to be waited for. 8679 8680 WUNTRACED 8681 8682 return for children that are stopped, and whose status has not been 8683 reported. 8684 8685 If status is not NULL, wait4 stores status information in the location status. 8686 This status can be evaluated with the following macros: [13] 8687 8688 WIFEXITED(status) 8689 8690 is nonzero if the child exited normally. 8691 8692 WEXITSTATUS(status) 8693 8694 evaluates to the least significant eight bits of the return code of the 8695 child that terminated, which may have been set as the argument to a call to 8696 exit or as the argument for a return statement in the main program. This 8697 macro can only be evaluated if WIFEXITED returned nonzero. 8698 8699 WIFSIGNALED(status) 8700 8701 returns true if the child process exited because of a signal that was not 8702 caught. 8703 8704 WTERMSIG(status) 8705 8706 returns the number of the signal that caused the child process to 8707 terminate. This macro can only be evaluated if WIFSIGNALED returned 8708 nonzero. 8709 8710 WIFSTOPPED(status) 8711 8712 returns true if the child process that caused the return is currently 8713 stopped; this is only possible if the call was done using WUNTRACED. 8714 8715 WSTOPSIG(status) 8716 8717 returns the number of the signal that caused the child to stop. This macro 8718 can only be evaluated if WIFSTOPPED returned nonzero. 8719 8720 If rusage is not NULL, the struct rusage (as defined in sys/resource.h) that it 8721 points to will be filled with accounting information. (See getrusage(2) for 8722 details. 8723 8724 Return Value 8725 8726 On success, the process ID of the child that exited is returned. On error, -1 8727 is returned (in particular, when no unwaited-for child processes of the 8728 specified kind exist), or 0 if WNOHANG was used and no child was available yet. 8729 In the latter two cases, the global variable errno is set appropriately. 8730 8731 Errors 8732 8733 ECHILD 8734 8735 No unwaited-for child process as specified does exist. 8736 8737 ERESTARTSYS 8738 8739 A WNOHANG was not set and an unblocked signal or a SIGCHILD was caught. 8740 This error is returned by the system call. The library interface is not 8741 allowed to return ERESTARTSYS, but will return EINTR. 8742 8743 waitpid 8744 8745 Name 8746 8747 waitpid -- wait for child process 8748 8749 Description 8750 8751 waitpid is as specified in the Single UNIX Specification, but with differences 8752 as listed below. 8753 8754 Need not support WCONTINUED 8755 8756 Implementations need not support the functionality of WCONTINUED or 8757 WIFCONTINUED. 8758 8759 warn 8760 8761 Name 8762 8763 warn -- formatted error messages 8764 8765 Synopsis 8766 8767 #include 8768 8769 void warn(const char *fmt ...); 8770 8771 Description 8772 8773 warn displays a formatted error message on the standard error output. The last 8774 component of the program name, a colon character, and a space are output. If 8775 fmt is not NULL, the formatted error message, a colon, and space are output. 8776 The error message string affiliated with the current value of the global 8777 variable errno is output. The output is followed by a newline character. 8778 8779 warnx 8780 8781 Name 8782 8783 warnx -- formatted error messages 8784 8785 Synopsis 8786 8787 #include 8788 8789 void warnx(const char *fmt ...); 8790 8791 Description 8792 8793 warnx displays a formatted error message on the standard error output. The last 8794 component of the program name, a colon character, and a space are output. If 8795 fmt is not NULL, the formatted error message, a colon, and space are output. 8796 The output is followed by a newline character. 8797 8798 wcpcpy 8799 8800 Name 8801 8802 wcpcpy -- copy a wide character string, returning a pointer to its end 8803 8804 Synopsis 8805 8806 #include 8807 8808 wchar_t *wcpcpy(wchar_t *dest, const wchar_t *src); 8809 8810 Description 8811 8812 wcpcpy is the wide-character equivalent of stpcpy. It copies the wide character 8813 string src, including the terminating L'\0' character, to the array dest. 8814 8815 The strings may not overlap. 8816 8817 The programmer shall ensure that there is room for at least wcslen(src)+1 wide 8818 characters at dest. 8819 8820 Return Value 8821 8822 wcpcpy returns a pointer to the end of the wide-character string dest, that is, 8823 a pointer to the terminating L'\0' character. 8824 8825 wcpncpy 8826 8827 Name 8828 8829 wcpncpy -- copy a fixed-size string of wide characters, returning a pointer to 8830 its end 8831 8832 Synopsis 8833 8834 #include 8835 8836 wchar_t *wcpncpy(wchar_t *dest, const wchar_t *src, size_t n); 8837 8838 Description 8839 8840 wcpncpy is the wide-character equivalent of stpncpy. It copies at most n wide 8841 characters from the wide-character string src, including the terminating L'\0' 8842 character, to the array dest. Exactly n wide characters are written at dest. If 8843 the length wcslen(src) is smaller than n, the remaining wide characters in the 8844 array dest are filled with L'\0' characters. If the length wcslen(src) is 8845 greater than or equal to n, the string dest will not be L'\0' terminated. 8846 8847 The strings may not overlap. 8848 8849 The programmer shall ensure that there is room for at least n wide characters 8850 at dest. 8851 8852 Return Value 8853 8854 wcpncpy returns a pointer to the wide character one past the last non-null wide 8855 character written. 8856 8857 wcscasecmp 8858 8859 Name 8860 8861 wcscasecmp -- compare two wide-character strings, ignoring case 8862 8863 Synopsis 8864 8865 #include 8866 8867 int wcscasecmp(const wchar_t *s1, const wchar_t *s2); 8868 8869 Description 8870 8871 wcscasecmp is the wide-character equivalent of strcasecmp. It compares the 8872 wide-character string s1 and the wide-character string s2, ignoring case 8873 differences (towupper, towlower). 8874 8875 Return Value 8876 8877 wcscasecmp returns 0 if the wide-character strings s1 and s2 are equal except 8878 for case distinctions. It returns a positive integer if s1 is greater than s2, 8879 ignoring case. It returns a negative integer if s1 is smaller than s2, ignoring 8880 case. 8881 8882 Notes 8883 8884 The behavior of wcscasecmp depends upon the LC_CTYPE category of the current 8885 locale. 8886 8887 wcsdup 8888 8889 Name 8890 8891 wcsdup -- duplicate a wide-character string 8892 8893 Synopsis 8894 8895 #include 8896 8897 wchar_t *wcsdup(const wchar_t *s); 8898 8899 Description 8900 8901 wcsdup is the wide-character equivalent of strdup. It allocates and returns a 8902 new wide-character string whose initial contents is a duplicate of the 8903 wide-character string s. 8904 8905 Memory for the new wide-character string is obtained with malloc(3), and can be 8906 freed with free(3). 8907 8908 Return Value 8909 8910 wcsdup returns a pointer to the new wide-character string, or NULL if 8911 sufficient memory was not available. 8912 8913 wcsncasecmp 8914 8915 Name 8916 8917 wcsncasecmp -- compare two fixed-size wide-character strings, ignoring case 8918 8919 Synopsis 8920 8921 #include 8922 8923 int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n); 8924 8925 Description 8926 8927 wcsncasecmp is the wide-character equivalent of strncasecmp. It compares the 8928 wide-character string s1 and the wide-character string s2, but at most n wide 8929 characters from each string, ignoring case differences (towupper, towlower). 8930 8931 Return Value 8932 8933 wcscasecmp returns 0 if the wide-character strings s1 and s2, truncated to at 8934 most length n, are equal except for case distinctions. It returns a positive 8935 integer if truncated s1 is greater than truncated s2, ignoring case. It returns 8936 a negative integer if truncated s1 is smaller than truncated s2, ignoring case. 8937 8938 Notes 8939 8940 The behavior of wcsncasecmp depends upon the LC_CTYPE category of the current 8941 locale. 8942 8943 wcsnlen 8944 8945 Name 8946 8947 wcsnlen -- determine the length of a fixed-size wide-character string 8948 8949 Synopsis 8950 8951 #include 8952 8953 size_t wcsnlen(const wchar_t *s, size_t maxlen); 8954 8955 Description 8956 8957 wcsnlen is the wide-character equivalent of strnlen. It returns the number of 8958 wide-characters in the string s, not including the terminating L'\0' character, 8959 but at most maxlen. In doing this, wcsnlen looks only at the first maxlen 8960 wide-characters at s and never beyond s + maxlen. 8961 8962 Return Value 8963 8964 wcsnlen returns wcslen(s) if that is less than maxlen, or maxlen if there is no 8965 L'\0' character among the first maxlen wide characters pointed to by s. 8966 8967 Notes 8968 8969 The behavior of wcsncasecmp depends on the LC_CTYPE category of the current 8970 locale. 8971 8972 wcsnrtombs 8973 8974 Name 8975 8976 wcsnrtombs -- convert a wide character string to a multi-byte string 8977 8978 Synopsis 8979 8980 #include 8981 8982 size_t wcsnrtombs(char *dest, const wchar_t **src, size_t nwc, size_t len, 8983 mbstate_t *ps); 8984 8985 Description 8986 8987 wcsnrtombs is like wcsrtombs, except that the number of wide characters to be 8988 converted, starting at src, is limited to nwc. 8989 8990 If dest is not a NULL pointer, wcsnrtombs converts at most nwc wide characters 8991 from the wide-character string src to a multibyte string starting at dest. At 8992 most len bytes are written to dest. The state ps is updated. 8993 8994 The conversion is effectively performed by repeatedly calling: 8995 8996 wcrtomb(dest, *src, ps) 8997 8998 as long as this call succeeds, and then incrementing dest by the number of 8999 bytes written and src by 1. 9000 9001 The conversion can stop for three reasons: 9002 9003 * A wide character has been encountered that cannot be represented as a 9004 multibyte sequence (according to the current locale). In this case src is 9005 left pointing to the invalid wide character, (size_t)(-1) is returned, and 9006 errno is set to EILSEQ. 9007 9008 * nws wide characters have been converted without encountering a L'\0', or 9009 the length limit forces a stop. In this case, src is left pointing to the 9010 next wide character to be converted, and the number bytes written to dest 9011 is returned. 9012 9013 * The wide-character string has been completely converted, including the 9014 terminating L'\0' (which has the side effect of bringing back ps to the 9015 initial state). In this case, src is set to NULL, and the number of bytes 9016 written to dest, excluding the terminating L'\0' byte, is returned. 9017 9018 If dest is NULL, len is ignored, and the conversion proceeds as above, except 9019 that the converted bytes are not written out to memory, and that no destination 9020 length limit exists. 9021 9022 In both of the above cases, if ps is a NULL pointer, a static anonymous state 9023 only known to wcsnrtombs is used instead. 9024 9025 The programmer shall ensure that there is room for at least len bytes at dest. 9026 9027 Return Value 9028 9029 wcsnrtombs returns the number of bytes that make up the converted part of 9030 multibyte sequence, not including the terminating L'\0' byte. If a wide 9031 character was encountered which could not be converted, (size_t)(-1) is 9032 returned, and the global variable errno set to EILSEQ. 9033 9034 Notes 9035 9036 The behavior of wcsnrtombs depends on the LC_CTYPE category of the current 9037 locale. 9038 9039 Passing NULL as ps is not multi-thread safe. 9040 9041 wcstoq 9042 9043 Name 9044 9045 wcstoq -- convert initial portion of wide string NPTR to long int 9046 representation 9047 9048 Synopsis 9049 9050 #include 9051 9052 extern long long int wcstoq(const wchar_t *restrict nptr, wchar_t **restrict 9053 endptr, int base); 9054 9055 Description 9056 9057 wcstoq converts the initial portion of the wide string nptr to long int 9058 representation. 9059 9060 wcstouq 9061 9062 Name 9063 9064 wcstouq -- convert initial portion of wide string NPTR to unsigned long long 9065 int representation 9066 9067 Synopsis 9068 9069 #include 9070 9071 extern unsigned long long int wcstouq(const wchar_t *restrict nptr, wchar_t 9072 **restrict endptr, int base); 9073 9074 Description 9075 9076 wcstouq converts the initial portion of the wide string nptr to unsigned long 9077 long int representation. 9078 9079 xdr_u_int 9080 9081 Name 9082 9083 xdr_u_int -- library routines for external data representation 9084 9085 Synopsis 9086 9087 int xdr_u_int(XDR * xdrs, unsigned int * up); 9088 9089 Description 9090 9091 xdr_u_int is a filter primitive that translates between C unsigned integers and 9092 their external representations. 9093 9094 Return Value 9095 9096 On success, 1 is returned. On error, 0 is returned. 9097 9098 ------------------------------------------------------------------------------- 9099 9100 Interfaces for libm 9101 9102 Table 6-28 defines the library name and shared object name for the libm library 9103 9104 Table 6-28. libm Definition 9105 9106 +----------------------+ 9107 |Library:|libm | 9108 |--------+-------------| 9109 |SONAME: |See archLSB. | 9110 +----------------------+ 9111 9112 The behavior of the interfaces in this library is specified by the following 9113 specifications: 9114 9115 ISO/IEC 9899: 1999, Programming Languages --C 9116 CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 5 9117 (ISBN: 1-85912-181-0, C606) 9118 ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9119 Specification(SUS) V3 9120 9121 ------------------------------------------------------------------------------- 9122 9123 Math 9124 9125 ------------------------------------------------------------------------------- 9126 9127 Interfaces for Math 9128 9129 An LSB conforming implementation shall provide the generic functions for Math 9130 specified in Table 6-29, with the full functionality as described in the 9131 referenced underlying specification. 9132 9133 Table 6-29. libm - Math Function Interfaces 9134 9135 +-----------------------------------------------------------------------------+ 9136 |acos [1] |cexp [1] |expf [1] |jnf [2] |remquof [1] | 9137 |-----------+-------------+------------------+---------------+----------------| 9138 |acosf [1] |cexpf [1] |expl [1] |jnl [2] |remquol [1] | 9139 |-----------+-------------+------------------+---------------+----------------| 9140 |acosh [1] |cexpl [1] |expm1 [1] |ldexp [1] |rint [1] | 9141 |-----------+-------------+------------------+---------------+----------------| 9142 |acoshf [1] |cimag [1] |fabs [1] |ldexpf [1] |rintf [1] | 9143 |-----------+-------------+------------------+---------------+----------------| 9144 |acoshl [1] |cimagf [1] |fabsf [1] |ldexpl [1] |rintl [1] | 9145 |-----------+-------------+------------------+---------------+----------------| 9146 |acosl [1] |cimagl [1] |fabsl [1] |lgamma [1] |round [1] | 9147 |-----------+-------------+------------------+---------------+----------------| 9148 |asin [1] |clog [1] |fdim [1] |lgamma_r [2] |roundf [1] | 9149 |-----------+-------------+------------------+---------------+----------------| 9150 |asinf [1] |clog10 [2] |fdimf [1] |lgammaf [1] |roundl [1] | 9151 |-----------+-------------+------------------+---------------+----------------| 9152 |asinh [1] |clog10f [2] |fdiml [1] |lgammaf_r [2] |scalb [1] | 9153 |-----------+-------------+------------------+---------------+----------------| 9154 |asinhf [1] |clog10l [2] |feclearexcept [1] |lgammal [1] |scalbf [2] | 9155 |-----------+-------------+------------------+---------------+----------------| 9156 |asinhl [1] |clogf [1] |fegetenv [1] |lgammal_r [2] |scalbl [2] | 9157 |-----------+-------------+------------------+---------------+----------------| 9158 |asinl [1] |clogl [1] |fegetexceptflag |llrint [1] |scalbln [1] | 9159 | | |[1] | | | 9160 |-----------+-------------+------------------+---------------+----------------| 9161 |atan [1] |conj [1] |fegetround [1] |llrintf [1] |scalblnf [1] | 9162 |-----------+-------------+------------------+---------------+----------------| 9163 |atan2 [1] |conjf [1] |feholdexcept [1] |llrintl [1] |scalblnl [1] | 9164 |-----------+-------------+------------------+---------------+----------------| 9165 |atan2f [1] |conjl [1] |feraiseexcept [1] |llround [1] |scalbn [1] | 9166 |-----------+-------------+------------------+---------------+----------------| 9167 |atan2l [1] |copysign [1] |fesetenv [1] |llroundf [1] |scalbnf [1] | 9168 |-----------+-------------+------------------+---------------+----------------| 9169 |atanf [1] |copysignf [1]|fesetexceptflag |llroundl [1] |scalbnl [1] | 9170 | | |[1] | | | 9171 |-----------+-------------+------------------+---------------+----------------| 9172 |atanh [1] |copysignl [1]|fesetround [1] |log [1] |significand [2] | 9173 |-----------+-------------+------------------+---------------+----------------| 9174 |atanhf [1] |cos [1] |fetestexcept [1] |log10 [1] |significandf [2]| 9175 |-----------+-------------+------------------+---------------+----------------| 9176 |atanhl [1] |cosf [1] |feupdateenv [1] |log10f [1] |significandl [2]| 9177 |-----------+-------------+------------------+---------------+----------------| 9178 |atanl [1] |cosh [1] |finite [3] |log10l [1] |sin [1] | 9179 |-----------+-------------+------------------+---------------+----------------| 9180 |cabs [1] |coshf [1] |finitef [2] |log1p [1] |sincos [2] | 9181 |-----------+-------------+------------------+---------------+----------------| 9182 |cabsf [1] |coshl [1] |finitel [2] |logb [1] |sincosf [2] | 9183 |-----------+-------------+------------------+---------------+----------------| 9184 |cabsl [1] |cosl [1] |floor [1] |logf [1] |sincosl [2] | 9185 |-----------+-------------+------------------+---------------+----------------| 9186 |cacos [1] |cpow [1] |floorf [1] |logl [1] |sinf [1] | 9187 |-----------+-------------+------------------+---------------+----------------| 9188 |cacosf [1] |cpowf [1] |floorl [1] |lrint [1] |sinh [1] | 9189 |-----------+-------------+------------------+---------------+----------------| 9190 |cacosh [1] |cpowl [1] |fma [1] |lrintf [1] |sinhf [1] | 9191 |-----------+-------------+------------------+---------------+----------------| 9192 |cacoshf [1]|cproj [1] |fmaf [1] |lrintl [1] |sinhl [1] | 9193 |-----------+-------------+------------------+---------------+----------------| 9194 |cacoshl [1]|cprojf [1] |fmal [1] |lround [1] |sinl [1] | 9195 |-----------+-------------+------------------+---------------+----------------| 9196 |cacosl [1] |cprojl [1] |fmax [1] |lroundf [1] |sqrt [1] | 9197 |-----------+-------------+------------------+---------------+----------------| 9198 |carg [1] |creal [1] |fmaxf [1] |lroundl [1] |sqrtf [1] | 9199 |-----------+-------------+------------------+---------------+----------------| 9200 |cargf [1] |crealf [1] |fmaxl [1] |matherr [2] |sqrtl [1] | 9201 |-----------+-------------+------------------+---------------+----------------| 9202 |cargl [1] |creall [1] |fmin [1] |modf [1] |tan [1] | 9203 |-----------+-------------+------------------+---------------+----------------| 9204 |casin [1] |csin [1] |fminf [1] |modff [1] |tanf [1] | 9205 |-----------+-------------+------------------+---------------+----------------| 9206 |casinf [1] |csinf [1] |fminl [1] |modfl [1] |tanh [1] | 9207 |-----------+-------------+------------------+---------------+----------------| 9208 |casinh [1] |csinh [1] |fmod [1] |nan [1] |tanhf [1] | 9209 |-----------+-------------+------------------+---------------+----------------| 9210 |casinhf [1]|csinhf [1] |fmodf [1] |nanf [1] |tanhl [1] | 9211 |-----------+-------------+------------------+---------------+----------------| 9212 |casinhl [1]|csinhl [1] |fmodl [1] |nanl [1] |tanl [1] | 9213 |-----------+-------------+------------------+---------------+----------------| 9214 |casinl [1] |csinl [1] |frexp [1] |nearbyint [1] |tgamma [1] | 9215 |-----------+-------------+------------------+---------------+----------------| 9216 |catan [1] |csqrt [1] |frexpf [1] |nearbyintf [1] |tgammaf [1] | 9217 |-----------+-------------+------------------+---------------+----------------| 9218 |catanf [1] |csqrtf [1] |frexpl [1] |nearbyintl [1] |tgammal [1] | 9219 |-----------+-------------+------------------+---------------+----------------| 9220 |catanh [1] |csqrtl [1] |gamma [3] |nextafter [1] |trunc [1] | 9221 |-----------+-------------+------------------+---------------+----------------| 9222 |catanhf [1]|ctan [1] |gammaf [2] |nextafterf [1] |truncf [1] | 9223 |-----------+-------------+------------------+---------------+----------------| 9224 |catanhl [1]|ctanf [1] |gammal [2] |nextafterl [1] |truncl [1] | 9225 |-----------+-------------+------------------+---------------+----------------| 9226 |catanl [1] |ctanh [1] |hypot [1] |nexttoward [1] |y0 [1] | 9227 |-----------+-------------+------------------+---------------+----------------| 9228 |cbrt [1] |ctanhf [1] |hypotf [1] |nexttowardf [1]|y0f [2] | 9229 |-----------+-------------+------------------+---------------+----------------| 9230 |cbrtf [1] |ctanhl [1] |hypotl [1] |nexttowardl [1]|y0l [2] | 9231 |-----------+-------------+------------------+---------------+----------------| 9232 |cbrtl [1] |ctanl [1] |ilogb [1] |pow [1] |y1 [1] | 9233 |-----------+-------------+------------------+---------------+----------------| 9234 |ccos [1] |dremf [2] |ilogbf [1] |pow10 [2] |y1f [2] | 9235 |-----------+-------------+------------------+---------------+----------------| 9236 |ccosf [1] |dreml [2] |ilogbl [1] |pow10f [2] |y1l [2] | 9237 |-----------+-------------+------------------+---------------+----------------| 9238 |ccosh [1] |erf [1] |j0 [1] |pow10l [2] |yn [1] | 9239 |-----------+-------------+------------------+---------------+----------------| 9240 |ccoshf [1] |erfc [1] |j0f [2] |powf [1] |ynf [2] | 9241 |-----------+-------------+------------------+---------------+----------------| 9242 |ccoshl [1] |erfcf [1] |j0l [2] |powl [1] |ynl [2] | 9243 |-----------+-------------+------------------+---------------+----------------| 9244 |ccosl [1] |erfcl [1] |j1 [1] |remainder [1] | | 9245 |-----------+-------------+------------------+---------------+----------------| 9246 |ceil [1] |erff [1] |j1f [2] |remainderf [1] | | 9247 |-----------+-------------+------------------+---------------+----------------| 9248 |ceilf [1] |erfl [1] |j1l [2] |remainderl [1] | | 9249 |-----------+-------------+------------------+---------------+----------------| 9250 |ceill [1] |exp [1] |jn [1] |remquo [1] | | 9251 +-----------------------------------------------------------------------------+ 9252 9253 Referenced Specification(s) 9254 9255 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9256 Specification(SUS) V3 9257 9258 [2]. ISO/IEC 9899: 1999, Programming Languages --C 9259 9260 [3]. CAE Specification, January 1997, System Interfaces and Headers (XSH),Issue 9261 5 (ISBN: 1-85912-181-0, C606) 9262 9263 An LSB conforming implementation shall provide the generic data interfaces for 9264 Math specified in Table 6-30, with the full functionality as described in the 9265 referenced underlying specification. 9266 9267 Table 6-30. libm - Math Data Interfaces 9268 9269 +--------------------+ 9270 |signgam [1] | | | | | 9271 +--------------------+ 9272 9273 Referenced Specification(s) 9274 9275 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9276 Specification(SUS) V3 9277 9278 ------------------------------------------------------------------------------- 9279 9280 Data Definitions for libm 9281 9282 This section defines global identifiers and their values that are associated 9283 with interfaces contained in libm. These definitions are organized into groups 9284 that correspond to system headers. This convention is used as a convenience for 9285 the reader, and does not imply the existence of these headers, or their 9286 content. 9287 9288 These definitions are intended to supplement those provided in the referenced 9289 underlying specifications. 9290 9291 This specification uses ISO/IEC 9899 C Language as the reference programming 9292 language, and data definitions are specified in ISO C format. The C language is 9293 used here as a convenient notation. Using a C language description of these 9294 data objects does not preclude their use by other programming languages. 9295 9296 ------------------------------------------------------------------------------- 9297 9298 complex.h 9299 9300 #define complex _Complex 9301 9302 ------------------------------------------------------------------------------- 9303 9304 math.h 9305 9306 #define DOMAIN 1 9307 #define SING 2 9308 9309 struct exception 9310 { 9311 int type; 9312 char *name; 9313 double arg1; 9314 double arg2; 9315 double retval; 9316 } 9317 ; 9318 #define isinf(x) (sizeof (x) == sizeof (float) ? __isinff (x): sizeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) 9319 #define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) : sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) 9320 9321 #define HUGE_VAL 0x1.0p2047 9322 #define HUGE_VALF 0x1.0p255f 9323 #define HUGE_VALL 0x1.0p32767L 9324 9325 #define NAN ((float)0x7fc00000UL) 9326 #define M_1_PI 0.31830988618379067154 9327 #define M_LOG10E 0.43429448190325182765 9328 #define M_2_PI 0.63661977236758134308 9329 #define M_LN2 0.69314718055994530942 9330 #define M_SQRT1_2 0.70710678118654752440 9331 #define M_PI_4 0.78539816339744830962 9332 #define M_2_SQRTPI 1.12837916709551257390 9333 #define M_SQRT2 1.41421356237309504880 9334 #define M_LOG2E 1.4426950408889634074 9335 #define M_PI_2 1.57079632679489661923 9336 #define M_LN10 2.30258509299404568402 9337 #define M_E 2.7182818284590452354 9338 #define M_PI 3.14159265358979323846 9339 #define INFINITY HUGE_VALF 9340 9341 #define MATH_ERRNO 1 9342 #define MATH_ERREXCEPT 2 9343 9344 ------------------------------------------------------------------------------- 9345 9346 Interfaces for libpthread 9347 9348 Table 6-31 defines the library name and shared object name for the libpthread 9349 library 9350 9351 Table 6-31. libpthread Definition 9352 9353 +-------------------------+ 9354 |Library:|libpthread | 9355 |--------+----------------| 9356 |SONAME: |libpthread.so.0 | 9357 +-------------------------+ 9358 9359 The behavior of the interfaces in this library is specified by the following 9360 specifications: 9361 9362 Large File Support 9363 Linux Standard Base 9364 ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9365 Specification(SUS) V3 9366 9367 ------------------------------------------------------------------------------- 9368 9369 Realtime Threads 9370 9371 ------------------------------------------------------------------------------- 9372 9373 Interfaces for Realtime Threads 9374 9375 No external functions are defined for libpthread - Realtime Threads 9376 9377 ------------------------------------------------------------------------------- 9378 9379 Advanced Realtime Threads 9380 9381 ------------------------------------------------------------------------------- 9382 9383 Interfaces for Advanced Realtime Threads 9384 9385 No external functions are defined for libpthread - Advanced Realtime Threads 9386 9387 ------------------------------------------------------------------------------- 9388 9389 Posix Threads 9390 9391 ------------------------------------------------------------------------------- 9392 9393 Interfaces for Posix Threads 9394 9395 An LSB conforming implementation shall provide the generic functions for Posix 9396 Threads specified in Table 6-32, with the full functionality as described in 9397 the referenced underlying specification. 9398 9399 Table 6-32. libpthread - Posix Threads Function Interfaces 9400 9401 +-----------------------------------------------------------------------------------------------------------------------------------------+ 9402 |_pthread_cleanup_pop [1] |pthread_cancel [2] |pthread_join [2] |pthread_rwlock_destroy [2] |pthread_setconcurrency| 9403 | | | | |[2] | 9404 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9405 |_pthread_cleanup_push [1] |pthread_cond_broadcast [2] |pthread_key_create [2] |pthread_rwlock_init [2] |pthread_setspecific | 9406 | | | | |[2] | 9407 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9408 |pread [2] |pthread_cond_destroy [2] |pthread_key_delete [2] |pthread_rwlock_rdlock [2] |pthread_sigmask [2] | 9409 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9410 |pread64 [3] |pthread_cond_init [2] |pthread_kill [2] |pthread_rwlock_timedrdlock |pthread_testcancel [2]| 9411 | | | |[2] | | 9412 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9413 |pthread_attr_destroy [2] |pthread_cond_signal [2] |pthread_mutex_destroy [2] |pthread_rwlock_timedwrlock |pwrite [2] | 9414 | | | |[2] | | 9415 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9416 |pthread_attr_getdetachstate|pthread_cond_timedwait [2] |pthread_mutex_init [2] |pthread_rwlock_tryrdlock [2] |pwrite64 [3] | 9417 |[2] | | | | | 9418 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9419 |pthread_attr_getguardsize |pthread_cond_wait [2] |pthread_mutex_lock [2] |pthread_rwlock_trywrlock [2] |sem_close [2] | 9420 |[2] | | | | | 9421 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9422 |pthread_attr_getschedparam |pthread_condattr_destroy |pthread_mutex_trylock [2] |pthread_rwlock_unlock [2] |sem_destroy [2] | 9423 |[2] |[2] | | | | 9424 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9425 |pthread_attr_getstackaddr |pthread_condattr_getpshared|pthread_mutex_unlock [2] |pthread_rwlock_wrlock [2] |sem_getvalue [2] | 9426 |[2] |[2] | | | | 9427 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9428 |pthread_attr_getstacksize |pthread_condattr_init [2] |pthread_mutexattr_destroy |pthread_rwlockattr_destroy |sem_init [2] | 9429 |[2] | |[2] |[2] | | 9430 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9431 |pthread_attr_init [2] |pthread_condattr_setpshared|pthread_mutexattr_getpshared|pthread_rwlockattr_getpshared|sem_open [2] | 9432 | |[2] |[2] |[2] | | 9433 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9434 |pthread_attr_setdetachstate|pthread_create [2] |pthread_mutexattr_gettype |pthread_rwlockattr_init [2] |sem_post [2] | 9435 |[2] | |[2] | | | 9436 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9437 |pthread_attr_setguardsize |pthread_detach [2] |pthread_mutexattr_init [2] |pthread_rwlockattr_setpshared|sem_timedwait [2] | 9438 |[2] | | |[2] | | 9439 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9440 |pthread_attr_setschedparam |pthread_equal [2] |pthread_mutexattr_setpshared|pthread_self [2] |sem_trywait [2] | 9441 |[2] | |[2] | | | 9442 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9443 |pthread_attr_setstackaddr |pthread_exit [2] |pthread_mutexattr_settype |pthread_setcancelstate [2] |sem_unlink [2] | 9444 |[2] | |[2] | | | 9445 |---------------------------+---------------------------+----------------------------+-----------------------------+----------------------| 9446 |pthread_attr_setstacksize |pthread_getspecific [2] |pthread_once [2] |pthread_setcanceltype [2] |sem_wait [2] | 9447 |[2] | | | | | 9448 +-----------------------------------------------------------------------------------------------------------------------------------------+ 9449 9450 Referenced Specification(s) 9451 9452 [1]. Linux Standard Base 9453 9454 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9455 Specification(SUS) V3 9456 9457 [3]. Large File Support 9458 9459 ------------------------------------------------------------------------------- 9460 9461 Data Definitions for libpthread 9462 9463 This section defines global identifiers and their values that are associated 9464 with interfaces contained in libpthread. These definitions are organized into 9465 groups that correspond to system headers. This convention is used as a 9466 convenience for the reader, and does not imply the existence of these headers, 9467 or their content. 9468 9469 These definitions are intended to supplement those provided in the referenced 9470 underlying specifications. 9471 9472 This specification uses ISO/IEC 9899 C Language as the reference programming 9473 language, and data definitions are specified in ISO C format. The C language is 9474 used here as a convenient notation. Using a C language description of these 9475 data objects does not preclude their use by other programming languages. 9476 9477 ------------------------------------------------------------------------------- 9478 9479 pthread.h 9480 9481 #define PTHREAD_MUTEX_DEFAULT 1 9482 #define PTHREAD_MUTEX_NORMAL 1 9483 #define PTHREAD_MUTEX_TIMED_NP 1 9484 #define PTHREAD_MUTEX_RECURSIVE 2 9485 #define PTHREAD_RWLOCK_DEFAULT_NP 2 9486 #define PTHREAD_MUTEX_ERRORCHECK 3 9487 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(& _buffer,(execute));} 9488 #define __LOCK_INITIALIZER { 0, 0 } 9489 #define PTHREAD_RWLOCK_INITIALIZER { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE } 9490 #define PTHREAD_MUTEX_INITIALIZER {0,0,0,PTHREAD_MUTEX_TIMED_NP,__LOCK_INITIALIZER} 9491 #define pthread_cleanup_push(routine,arg) {struct _pthread_cleanup_buffer _buffer;_pthread_cleanup_push(& _buffer,(routine),(arg)); 9492 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 9493 9494 struct _pthread_cleanup_buffer 9495 { 9496 void (*__routine) (void *); 9497 void *__arg; 9498 int __canceltype; 9499 struct _pthread_cleanup_buffer *__prev; 9500 } 9501 ; 9502 typedef unsigned int pthread_key_t; 9503 typedef int pthread_once_t; 9504 typedef long long __pthread_cond_align_t; 9505 9506 typedef unsigned long pthread_t; 9507 struct _pthread_fastlock 9508 { 9509 long __status; 9510 int __spinlock; 9511 } 9512 ; 9513 9514 typedef struct _pthread_descr_struct *_pthread_descr; 9515 9516 typedef struct 9517 { 9518 int __m_reserved; 9519 int __m_count; 9520 _pthread_descr __m_owner; 9521 int __m_kind; 9522 struct _pthread_fastlock __m_lock; 9523 } 9524 pthread_mutex_t; 9525 typedef struct 9526 { 9527 int __mutexkind; 9528 } 9529 pthread_mutexattr_t; 9530 9531 typedef struct 9532 { 9533 int __detachstate; 9534 int __schedpolicy; 9535 struct sched_param __schedparam; 9536 int __inheritsched; 9537 int __scope; 9538 size_t __guardsize; 9539 int __stackaddr_set; 9540 void *__stackaddr; 9541 unsigned long __stacksize; 9542 } 9543 pthread_attr_t; 9544 9545 typedef struct 9546 { 9547 struct _pthread_fastlock __c_lock; 9548 _pthread_descr __c_waiting; 9549 char __padding[48 - sizeof (struct _pthread_fastlock) - 9550 sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)]; 9551 __pthread_cond_align_t __align; 9552 } 9553 pthread_cond_t; 9554 typedef struct 9555 { 9556 int __dummy; 9557 } 9558 pthread_condattr_t; 9559 9560 typedef struct _pthread_rwlock_t 9561 { 9562 struct _pthread_fastlock __rw_lock; 9563 int __rw_readers; 9564 _pthread_descr __rw_writer; 9565 _pthread_descr __rw_read_waiting; 9566 _pthread_descr __rw_write_waiting; 9567 int __rw_kind; 9568 int __rw_pshared; 9569 } 9570 pthread_rwlock_t; 9571 typedef struct 9572 { 9573 int __lockkind; 9574 int __pshared; 9575 } 9576 pthread_rwlockattr_t; 9577 9578 #define PTHREAD_CREATE_JOINABLE 0 9579 #define PTHREAD_INHERIT_SCHED 0 9580 #define PTHREAD_ONCE_INIT 0 9581 #define PTHREAD_PROCESS_PRIVATE 0 9582 #define PTHREAD_CREATE_DETACHED 1 9583 #define PTHREAD_EXPLICIT_SCHED 1 9584 #define PTHREAD_PROCESS_SHARED 1 9585 9586 #define PTHREAD_CANCELED ((void*)-1) 9587 #define PTHREAD_CANCEL_DEFERRED 0 9588 #define PTHREAD_CANCEL_ENABLE 0 9589 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 9590 #define PTHREAD_CANCEL_DISABLE 1 9591 9592 ------------------------------------------------------------------------------- 9593 9594 semaphore.h 9595 9596 typedef struct 9597 { 9598 struct _pthread_fastlock __sem_lock; 9599 int __sem_value; 9600 _pthread_descr __sem_waiting; 9601 } 9602 sem_t; 9603 #define SEM_FAILED ((sem_t*)0) 9604 9605 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 9606 9607 ------------------------------------------------------------------------------- 9608 9609 Interface Definitions for libpthread 9610 9611 Table of Contents 9612 _pthread_cleanup_pop -- establish cancellation handlers 9613 _pthread_cleanup_push -- establish cancellation handlers 9614 9615 The following interfaces are included in libpthread and are defined by this 9616 specification. Unless otherwise noted, these interfaces shall be included in 9617 the source standard. 9618 9619 Other interfaces listed above for libpthread shall behave as described in the 9620 referenced base document. 9621 9622 _pthread_cleanup_pop 9623 9624 Name 9625 9626 _pthread_cleanup_pop -- establish cancellation handlers 9627 9628 Synopsis 9629 9630 #include 9631 9632 extern void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, int); 9633 9634 Description 9635 9636 Macro pthread_cleanup_pop defines the ABI _pthread_cleanup_pop is as specified 9637 in the Single UNIX Specification, Version 3. 9638 9639 _pthread_cleanup_push 9640 9641 Name 9642 9643 _pthread_cleanup_push -- establish cancellation handlers 9644 9645 Synopsis 9646 9647 #include 9648 9649 extern void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, void (*) 9650 (void *), void *); 9651 9652 Description 9653 9654 Macro pthread_cleanup_push defines the ABI _pthread_cleanup_push is as 9655 specified in the Single UNIX Specification, Version 3. 9656 9657 ------------------------------------------------------------------------------- 9658 9659 Interfaces for libgcc_s 9660 9661 Table 6-33 defines the library name and shared object name for the libgcc_s 9662 library 9663 9664 Table 6-33. libgcc_s Definition 9665 9666 +-----------------------+ 9667 |Library:|libgcc_s | 9668 |--------+--------------| 9669 |SONAME: |libgcc_s.so.1 | 9670 +-----------------------+ 9671 9672 ------------------------------------------------------------------------------- 9673 9674 Unwind Library 9675 9676 ------------------------------------------------------------------------------- 9677 9678 Interfaces for Unwind Library 9679 9680 No external functions are defined for libgcc_s - Unwind Library 9681 9682 ------------------------------------------------------------------------------- 9683 9684 Data Definitions for libgcc_s 9685 9686 This section defines global identifiers and their values that are associated 9687 with interfaces contained in libgcc_s. These definitions are organized into 9688 groups that correspond to system headers. This convention is used as a 9689 convenience for the reader, and does not imply the existence of these headers, 9690 or their content. 9691 9692 These definitions are intended to supplement those provided in the referenced 9693 underlying specifications. 9694 9695 This specification uses ISO/IEC 9899 C Language as the reference programming 9696 language, and data definitions are specified in ISO C format. The C language is 9697 used here as a convenient notation. Using a C language description of these 9698 data objects does not preclude their use by other programming languages. 9699 9700 ------------------------------------------------------------------------------- 9701 9702 unwind.h 9703 9704 struct dwarf_eh_base 9705 { 9706 void *tbase; 9707 void *dbase; 9708 void *func; 9709 } 9710 ; 9711 struct _Unwind_Context; 9712 9713 typedef unsigned int _Unwind_Ptr; 9714 typedef unsigned int _Unwind_Word; 9715 9716 typedef enum 9717 { 9718 _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_FATAL_PHASE2_ERROR = 9719 2, _URC_FATAL_PHASE1_ERROR = 3, _URC_NORMAL_STOP = 4, _URC_END_OF_STACK = 9720 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 9721 7, _URC_CONTINUE_UNWIND = 8 9722 } 9723 _Unwind_Reason_Code; 9724 9725 struct _Unwind_Exception 9726 { 9727 _Unwind_Exception_Class; 9728 _Unwind_Exception_Cleanup_Fn; 9729 _Unwind_Word; 9730 _Unwind_Word; 9731 } 9732 ; 9733 #define _UA_SEARCH_PHASE 1 9734 #define _UA_END_OF_STACK 16 9735 #define _UA_CLEANUP_PHASE 2 9736 #define _UA_HANDLER_FRAME 4 9737 #define _UA_FORCE_UNWIND 8 9738 9739 ------------------------------------------------------------------------------- 9740 9741 Interfaces for libdl 9742 9743 Table 6-34 defines the library name and shared object name for the libdl 9744 library 9745 9746 Table 6-34. libdl Definition 9747 9748 +--------------------+ 9749 |Library:|libdl | 9750 |--------+-----------| 9751 |SONAME: |libdl.so.2 | 9752 +--------------------+ 9753 9754 The behavior of the interfaces in this library is specified by the following 9755 specifications: 9756 9757 Linux Standard Base 9758 ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9759 Specification(SUS) V3 9760 9761 ------------------------------------------------------------------------------- 9762 9763 Dynamic Loader 9764 9765 ------------------------------------------------------------------------------- 9766 9767 Interfaces for Dynamic Loader 9768 9769 An LSB conforming implementation shall provide the generic functions for 9770 Dynamic Loader specified in Table 6-35, with the full functionality as 9771 described in the referenced underlying specification. 9772 9773 Table 6-35. libdl - Dynamic Loader Function Interfaces 9774 9775 +-------------------------------------------------------+ 9776 |dladdr [1]|dlclose [2]|dlerror [2]|dlopen [1]|dlsym [1]| 9777 +-------------------------------------------------------+ 9778 9779 Referenced Specification(s) 9780 9781 [1]. Linux Standard Base 9782 9783 [2]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9784 Specification(SUS) V3 9785 9786 ------------------------------------------------------------------------------- 9787 9788 Data Definitions for libdl 9789 9790 This section defines global identifiers and their values that are associated 9791 with interfaces contained in libdl. These definitions are organized into groups 9792 that correspond to system headers. This convention is used as a convenience for 9793 the reader, and does not imply the existence of these headers, or their 9794 content. 9795 9796 These definitions are intended to supplement those provided in the referenced 9797 underlying specifications. 9798 9799 This specification uses ISO/IEC 9899 C Language as the reference programming 9800 language, and data definitions are specified in ISO C format. The C language is 9801 used here as a convenient notation. Using a C language description of these 9802 data objects does not preclude their use by other programming languages. 9803 9804 ------------------------------------------------------------------------------- 9805 9806 dlfcn.h 9807 9808 #define RTLD_NEXT ((void *) -1l) 9809 #define RTLD_LOCAL 0 9810 #define RTLD_LAZY 0x00001 9811 #define RTLD_NOW 0x00002 9812 #define RTLD_GLOBAL 0x00100 9813 9814 typedef struct 9815 { 9816 char *dli_fname; 9817 void *dli_fbase; 9818 char *dli_sname; 9819 void *dli_saddr; 9820 } 9821 Dl_info; 9822 9823 ------------------------------------------------------------------------------- 9824 9825 Interface Definitions for libdl 9826 9827 Table of Contents 9828 dladdr -- library routine for dynamic linking of object files 9829 dlopen -- open dynamic object 9830 dlsym -- obtain the address of a symbol from a dlopen object 9831 9832 The following interfaces are included in libdl and are defined by this 9833 specification. Unless otherwise noted, these interfaces shall be included in 9834 the source standard. 9835 9836 Other interfaces listed above for libdl shall behave as described in the 9837 referenced base document. 9838 9839 dladdr 9840 9841 Name 9842 9843 dladdr -- library routine for dynamic linking of object files 9844 9845 Synopsis 9846 9847 #include 9848 9849 typedef struct { 9850 const char *dli_fname; 9851 void *dli_fbase; 9852 const char *dli_sname; 9853 void *dli_saddr; 9854 } Dl_info; 9855 9856 int dladdr(void *address, Dl_info *dlip); 9857 9858 Description 9859 9860 dladdr implements the System V dynamic linking routines. 9861 9862 Return Value 9863 9864 dladdr is the inverse of dlsym. If address is successfully located inside a 9865 module, dladdr returns a nonzero value, otherwise, it returns a 0. On success, 9866 dladdr fills in the fields of dlip as follows: 9867 9868 dli_fname 9869 9870 the pathname of the module 9871 9872 dli_fbase 9873 9874 the base address of the module 9875 9876 dli_sname 9877 9878 the name of the highest addressed symbol whose address precedes the given 9879 address 9880 9881 dli_saddr 9882 9883 the address of that symbol 9884 9885 Shared objects shall be linked using the -shared option to the linker ld(1). 9886 The linker flag -rpath may be used to add a directory to the default search 9887 path for shared objects and shared libraries. The linker flag -E or the C 9888 compiler flag -rdynamic should be used to cause the application to export its 9889 symbols to the shared objects. 9890 9891 Environment 9892 9893 LD_LIBRARY_PATH 9894 9895 directory search-path for object files 9896 9897 dlopen 9898 9899 Name 9900 9901 dlopen -- open dynamic object 9902 9903 Synopsis 9904 9905 #include 9906 9907 void * dlopen(const char *filename, int flag); 9908 9909 Description 9910 9911 dlopen shall behave as specified in ISO/IEC 9945:2003 Portable Operating System 9912 (POSIX)and The Single UNIX Specification(SUS) V3, but with additional 9913 behaviors listed below. 9914 9915 If the file argument does not contain a slash character, then the system shall 9916 look for a library of that name in at least the following directories, and use 9917 the first one which is found: 9918 9919 * The directories specified by the DT_RPATH dynamic entry. 9920 9921 * The directories specified in the LD_LIBRARY_PATH environment variable 9922 (which is a colon separated list of pathnames). This step shall be skipped 9923 for setuid and setgid executables. 9924 9925 * A set of directories sufficient to contain the libraries specified in this 9926 standard. [14] 9927 9928 9929 9930 dlsym 9931 9932 Name 9933 9934 dlsym -- obtain the address of a symbol from a dlopen object 9935 9936 Description 9937 9938 dlsym is as specified in the ISO/IEC 9945:2003 Portable Operating System(POSIX) 9939 and The Single UNIX Specification(SUS) V3, but with differences as listed 9940 below. 9941 9942 The special purpose value for handle RTLD_NEXT 9943 9944 The value RTLD_NEXT, which is reserved for future use shall be available, with 9945 the behavior as described in ISO/IEC 9945:2003 Portable Operating System(POSIX) 9946 and The Single UNIX Specification(SUS) V3. 9947 9948 ------------------------------------------------------------------------------- 9949 9950 Interfaces for libcrypt 9951 9952 Table 6-36 defines the library name and shared object name for the libcrypt 9953 library 9954 9955 Table 6-36. libcrypt Definition 9956 9957 +-----------------------+ 9958 |Library:|libcrypt | 9959 |--------+--------------| 9960 |SONAME: |libcrypt.so.1 | 9961 +-----------------------+ 9962 9963 The behavior of the interfaces in this library is specified by the following 9964 specifications: 9965 9966 ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9967 Specification(SUS) V3 9968 9969 ------------------------------------------------------------------------------- 9970 9971 Encryption 9972 9973 ------------------------------------------------------------------------------- 9974 9975 Interfaces for Encryption 9976 9977 An LSB conforming implementation shall provide the generic functions for 9978 Encryption specified in Table 6-37, with the full functionality as described in 9979 the referenced underlying specification. 9980 9981 Table 6-37. libcrypt - Encryption Function Interfaces 9982 9983 +------------------------------------+ 9984 |crypt [1]|encrypt [1]|setkey [1]| | | 9985 +------------------------------------+ 9986 9987 Referenced Specification(s) 9988 9989 [1]. ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 9990 Specification(SUS) V3 9991 9992 ------------------------------------------------------------------------------- 9993 9994 Interfaces for libpam 9995 9996 Table 6-38 defines the library name and shared object name for the libpam 9997 library 9998 9999 Table 6-38. libpam Definition 10000 10001 +---------------------+ 10002 |Library:|libpam | 10003 |--------+------------| 10004 |SONAME: |libpam.so.0 | 10005 +---------------------+ 10006 10007 A single service name, other, shall always be present. The behavior of this 10008 service shall be determined by the system administrator. Additional service 10009 names may also exist. [15] 10010 10011 The behavior of the interfaces in this library is specified by the following 10012 specifications: 10013 10014 Linux Standard Base 10015 10016 ------------------------------------------------------------------------------- 10017 10018 Pluggable Authentication API 10019 10020 ------------------------------------------------------------------------------- 10021 10022 Interfaces for Pluggable Authentication API 10023 10024 An LSB conforming implementation shall provide the generic functions for 10025 Pluggable Authentication API specified in Table 6-39, with the full 10026 functionality as described in the referenced underlying specification. 10027 10028 Table 6-39. libpam - Pluggable Authentication API Function Interfaces 10029 10030 +-----------------------------------------------------------------------------+ 10031 |pam_acct_mgmt |pam_close_session|pam_get_item [1]|pam_set_item|pam_strerror| 10032 |[1] |[1] | |[1] |[1] | 10033 |----------------+-----------------+----------------+------------+------------| 10034 |pam_authenticate|pam_end [1] |pam_getenvlist |pam_setcred | | 10035 |[1] | |[1] |[1] | | 10036 |----------------+-----------------+----------------+------------+------------| 10037 |pam_chauthtok |pam_fail_delay |pam_open_session|pam_start | | 10038 |[1] |[1] |[1] |[1] | | 10039 +-----------------------------------------------------------------------------+ 10040 10041 Referenced Specification(s) 10042 10043 [1]. Linux Standard Base 10044 10045 ------------------------------------------------------------------------------- 10046 10047 Data Definitions for libpam 10048 10049 This section defines global identifiers and their values that are associated 10050 with interfaces contained in libpam. These definitions are organized into 10051 groups that correspond to system headers. This convention is used as a 10052 convenience for the reader, and does not imply the existence of these headers, 10053 or their content. 10054 10055 These definitions are intended to supplement those provided in the referenced 10056 underlying specifications. 10057 10058 This specification uses ISO/IEC 9899 C Language as the reference programming 10059 language, and data definitions are specified in ISO C format. The C language is 10060 used here as a convenient notation. Using a C language description of these 10061 data objects does not preclude their use by other programming languages. 10062 10063 ------------------------------------------------------------------------------- 10064 10065 security/pam_appl.h 10066 10067 typedef struct pam_handle pam_handle_t; 10068 struct pam_message 10069 { 10070 int msg_style; 10071 const char *msg; 10072 } 10073 ; 10074 struct pam_response 10075 { 10076 char *resp; 10077 int resp_retcode; 10078 } 10079 ; 10080 10081 struct pam_conv 10082 { 10083 int (*conv) (int num_msg, const struct pam_message * *msg, 10084 struct pam_response * *resp, void *appdata_ptr); 10085 void *appdata_ptr; 10086 } 10087 ; 10088 #define PAM_PROMPT_ECHO_OFF 1 10089 #define PAM_PROMPT_ECHO_ON 2 10090 #define PAM_ERROR_MSG 3 10091 #define PAM_TEXT_INFO 4 10092 10093 #define PAM_SERVICE 1 10094 #define PAM_USER 2 10095 #define PAM_TTY 3 10096 #define PAM_RHOST 4 10097 #define PAM_CONV 5 10098 #define PAM_RUSER 8 10099 #define PAM_USER_PROMPT 9 10100 10101 #define PAM_SUCCESS 0 10102 #define PAM_OPEN_ERR 1 10103 #define PAM_USER_UNKNOWN 10 10104 #define PAM_MAXTRIES 11 10105 #define PAM_NEW_AUTHTOK_REQD 12 10106 #define PAM_ACCT_EXPIRED 13 10107 #define PAM_SESSION_ERR 14 10108 #define PAM_CRED_UNAVAIL 15 10109 #define PAM_CRED_EXPIRED 16 10110 #define PAM_CRED_ERR 17 10111 #define PAM_CONV_ERR 19 10112 #define PAM_SYMBOL_ERR 2 10113 #define PAM_AUTHTOK_ERR 20 10114 #define PAM_AUTHTOK_RECOVER_ERR 21 10115 #define PAM_AUTHTOK_LOCK_BUSY 22 10116 #define PAM_AUTHTOK_DISABLE_AGING 23 10117 #define PAM_TRY_AGAIN 24 10118 #define PAM_ABORT 26 10119 #define PAM_AUTHTOK_EXPIRED 27 10120 #define PAM_BAD_ITEM 29 10121 #define PAM_SERVICE_ERR 3 10122 #define PAM_SYSTEM_ERR 4 10123 #define PAM_BUF_ERR 5 10124 #define PAM_PERM_DENIED 6 10125 #define PAM_AUTH_ERR 7 10126 #define PAM_CRED_INSUFFICIENT 8 10127 #define PAM_AUTHINFO_UNAVAIL 9 10128 10129 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 10130 #define PAM_ESTABLISH_CRED 0x0002U 10131 #define PAM_DELETE_CRED 0x0004U 10132 #define PAM_REINITIALIZE_CRED 0x0008U 10133 #define PAM_REFRESH_CRED 0x0010U 10134 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 10135 #define PAM_SILENT 0x8000U 10136 10137 ------------------------------------------------------------------------------- 10138 10139 Interface Definitions for libpam 10140 10141 Table of Contents 10142 pam_acct_mgmt -- establish the status of a user's account 10143 pam_authenticate -- authenticate the user 10144 pam_chauthtok -- change the authentication token for a given user 10145 pam_close_session -- indicate that an authenticated session has ended 10146 pam_end -- terminate the use of the PAM library 10147 pam_fail_delay -- specify delay time to use on authentication error 10148 pam_get_item -- obtain the value of the indicated item. 10149 pam_getenvlist -- returns a pointer to the complete PAM environment. 10150 pam_open_session -- used to indicate that an authenticated session has been 10151 initiated 10152 pam_set_item -- (re)set the value of an item. 10153 pam_setcred -- set the module-specific credentials of the user 10154 pam_start -- initialize the PAM library 10155 pam_strerror -- returns a string describing the PAM error 10156 10157 The following interfaces are included in libpam and are defined by this 10158 specification. Unless otherwise noted, these interfaces shall be included in 10159 the source standard. 10160 10161 Other interfaces listed above for libpam shall behave as described in the 10162 referenced base document. 10163 10164 pam_acct_mgmt 10165 10166 Name 10167 10168 pam_acct_mgmt -- establish the status of a user's account 10169 10170 Synopsis 10171 10172 #include 10173 10174 extern int pam_acct_mgmt(pam_handle_t *pamh, int flags); 10175 10176 Description 10177 10178 pam_acct_mgmt establishes the account's usability and the user's accessibility 10179 to the system. It is typically called after the user has been authenticated. 10180 10181 flags may be specified as any valid flag (namely, one of those applicable to 10182 the flags argument of pam_authenticate). Additionally, the value of flags may 10183 be logically or'd with PAM_SILENT. 10184 10185 Return Value 10186 10187 PAM_SUCCESS 10188 10189 Success. 10190 10191 PAM_NEW_AUTHTOK_REQD 10192 10193 User is valid, but user's authentication token has expired. The correct 10194 response to this return-value is to require that the user satisfy the 10195 pam_chauthtok function before obtaining service. It may not be possible for 10196 an application to do this. In such a case, the user should be denied access 10197 until the account password is updated. 10198 10199 PAM_ACCT_EXPIRED 10200 10201 User is no longer permitted access to the system. 10202 10203 PAM_AUTH_ERR 10204 10205 Authentication error. 10206 10207 PAM_PERM_DENIED 10208 10209 User is not permitted to gain access at this time. 10210 10211 PAM_USER_UNKNOWN 10212 10213 User is not known to a module's account management component. 10214 10215 Errors 10216 10217 May be translated to text with pam_strerror. 10218 10219 pam_authenticate 10220 10221 Name 10222 10223 pam_authenticate -- authenticate the user 10224 10225 Synopsis 10226 10227 #include 10228 10229 extern int pam_authenticate(pam_handle_t *pamh, int flags); 10230 10231 Description 10232 10233 pam_authenticate serves as an interface to the authentication mechanisms of the 10234 loaded modules. 10235 10236 flags is an optional parameter that may be specified by the following value: 10237 10238 PAM_DISALLOW_NULL_AUTHTOK 10239 10240 Instruct the authentication modules to return PAM_AUTH_ERR if the user does 10241 not have a registered authorization token. 10242 10243 Additionally, the value of flags may be logically or'd with PAM_SILENT. 10244 10245 The process may need to be privileged in order to successfully call this 10246 function. 10247 10248 Return Value 10249 10250 PAM_SUCCESS 10251 10252 Success. 10253 10254 PAM_AUTH_ERR 10255 10256 User was not authenticated or process did not have sufficient privileges to 10257 perform authentication. 10258 10259 PAM_CRED_INSUFFICIENT 10260 10261 Application does not have sufficient credentials to authenticate the user. 10262 10263 PAM_AUTHINFO_UNAVAIL 10264 10265 Modules were not able to access the authentication information. This might 10266 be due to a network or hardware failure, etc. 10267 10268 PAM_USER_UNKNOWN 10269 10270 Supplied username is not known to the authentication service. 10271 10272 PAM_MAXTRIES 10273 10274 One or more authentication modules has reached its limit of tries 10275 authenticating the user. Do not try again. 10276 10277 PAM_ABORT 10278 10279 One or more authentication modules failed to load. 10280 10281 Errors 10282 10283 May be translated to text with pam_strerror. 10284 10285 pam_chauthtok 10286 10287 Name 10288 10289 pam_chauthtok -- change the authentication token for a given user 10290 10291 Synopsis 10292 10293 #include 10294 10295 extern int pam_chauthtok(pam_handle_t *pamh, const int flags); 10296 10297 Description 10298 10299 pam_chauthtok is used to change the authentication token for a given user as 10300 indicated by the state associated with the handle pamh. 10301 10302 flags is an optional parameter that may be specified by the following value: 10303 10304 PAM_CHANGE_EXPIRED_AUTHTOK 10305 10306 User's authentication token should only be changed if it has expired. 10307 10308 Additionally, the value of flags may be logically or'd with PAM_SILENT. 10309 10310 RETURN VALUE 10311 10312 PAM_SUCCESS 10313 10314 Success. 10315 10316 PAM_AUTHTOK_ERR 10317 10318 A module was unable to obtain the new authentication token. 10319 10320 PAM_AUTHTOK_RECOVER_ERR 10321 10322 A module was unable to obtain the old authentication token. 10323 10324 PAM_AUTHTOK_LOCK_BUSY 10325 10326 One or more modules were unable to change the authentication token since it 10327 is currently locked. 10328 10329 PAM_AUTHTOK_DISABLE_AGING 10330 10331 Authentication token aging has been disabled for at least one of the 10332 modules. 10333 10334 PAM_PERM_DENIED 10335 10336 Permission denied. 10337 10338 PAM_TRY_AGAIN 10339 10340 Not all modules were in a position to update the authentication token(s). 10341 In such a case, none of the user's authentication tokens are updated. 10342 10343 PAM_USER_UNKNOWN 10344 10345 User is not known to the authentication token changing service. 10346 10347 ERRORS 10348 10349 May be translated to text with pam_strerror. 10350 10351 pam_close_session 10352 10353 Name 10354 10355 pam_close_session -- indicate that an authenticated session has ended 10356 10357 Synopsis 10358 10359 #include 10360 10361 extern int pam_close_session(pam_handle_t *pamh, int flags); 10362 10363 Description 10364 10365 pam_close_session is used to indicate that an authenticated session has ended. 10366 It is used to inform the module that the user is exiting a session. It should 10367 be possible for the PAM library to open a session and close the same session 10368 from different applications. 10369 10370 flags may have the value PAM_SILENT to indicate that no output should be 10371 generated as a result of this function call. 10372 10373 Return Value 10374 10375 PAM_SUCCESS 10376 10377 Success. 10378 10379 PAM_SESSION_ERR 10380 10381 One of the required loaded modules was unable to close a session for the 10382 user. 10383 10384 Errors 10385 10386 May be translated to text with pam_strerror. 10387 10388 pam_end 10389 10390 Name 10391 10392 pam_end -- terminate the use of the PAM library 10393 10394 Synopsis 10395 10396 #include 10397 10398 extern int pam_end(pam_handle_t *pamh, int pam_status); 10399 10400 Description 10401 10402 pam_end terminates use of the PAM library. On success, the contents of *pamh 10403 are no longer valid, and all memory associated with it is invalid. 10404 10405 Normally, pam_status is passed the value PAM_SUCCESS, but in the event of an 10406 unsuccessful service application, the appropriate PAM error return value should 10407 be used. 10408 10409 Return Value 10410 10411 PAM_SUCCESS 10412 10413 Success. 10414 10415 Errors 10416 10417 May be translated to text with pam_strerror. 10418 10419 pam_fail_delay 10420 10421 Name 10422 10423 pam_fail_delay -- specify delay time to use on authentication error 10424 10425 Synopsis 10426 10427 #include 10428 10429 extern int pam_fail_delay(pam_handle_t *pamh, unsigned int micro_sec); 10430 10431 Description 10432 10433 pam_fail_delay specifies the minimum delay for the PAM library to use when an 10434 authentication error occurs. The actual delay can vary by as much at 25%. If 10435 this function is called multiple times, the longest time specified by any of 10436 the call will be used. 10437 10438 The delay is invoked if an authentication error occurs during the 10439 pam_authenticate or pam_chauthtok function calls. 10440 10441 Independent of the success of pam_authenticate or pam_chauthtok, the delay time 10442 is reset to its default value of 0 when the PAM library returns control to the 10443 application from these two functions. 10444 10445 Return Value 10446 10447 PAM_SUCCESS 10448 10449 Success. 10450 10451 Errors 10452 10453 May be translated to text with pam_strerror. 10454 10455 pam_get_item 10456 10457 Name 10458 10459 pam_get_item -- obtain the value of the indicated item. 10460 10461 Synopsis 10462 10463 #include 10464 10465 extern int pam_get_item(const pam_handle_t *pamh, int item_type, const void 10466 **item); 10467 10468 Description 10469 10470 pam_get_item obtains the value of the indicated item_type. The possible values 10471 of item_type are the same as listed for pam_set_item. 10472 10473 On success, item contains a pointer to the value of the corresponding item. 10474 Note that this is a pointer to the actual data and should not be free'd or 10475 over-written. 10476 10477 Return Value 10478 10479 PAM_SUCCESS 10480 10481 Success. 10482 10483 PAM_PERM_DENIED 10484 10485 Application passed a NULL pointer for item. 10486 10487 PAM_BAD_ITEM 10488 10489 Application attempted to get an undefined item. 10490 10491 Errors 10492 10493 May be translated to text with pam_strerror. 10494 10495 pam_getenvlist 10496 10497 Name 10498 10499 pam_getenvlist -- returns a pointer to the complete PAM environment. 10500 10501 Synopsis 10502 10503 #include 10504 10505 extern char * const *pam_getenvlist(pam_handle_t *pamh); 10506 10507 Description 10508 10509 pam_getenvlist returns a pointer to the complete PAM environment. This pointer 10510 points to an array of pointers to NUL-terminated strings and must be terminated 10511 by a NULL pointer. Each string has the form "name=value". 10512 10513 The PAM library module allocates memory for the returned value and the 10514 associated strings. The calling application is responsible for freeing this 10515 memory. 10516 10517 Return Value 10518 10519 pam_getenvlist returns an array of string pointers containing the PAM 10520 environment. On error, NULL is returned. 10521 10522 pam_open_session 10523 10524 Name 10525 10526 pam_open_session -- used to indicate that an authenticated session has been 10527 initiated 10528 10529 Synopsis 10530 10531 #include 10532 10533 extern int pam_open_session(pam_handle_t *pamh, int flags); 10534 10535 Description 10536 10537 pam_handle_t is used to indicate that an authenticated session has begun. It is 10538 used to inform the module that the user is currently in a session. It should be 10539 possible for the PAM library to open a session and close the same session from 10540 different applications. 10541 10542 flags may have the value PAM_SILENT to indicate that no output be generated as 10543 a rsult of this function call. 10544 10545 Return Value 10546 10547 PAM_SUCCESS 10548 10549 Success. 10550 10551 PAM_SESSION_ERR 10552 10553 One of the loaded modules was unable to open a session for the user. 10554 10555 ERRORS 10556 10557 May be translated to text with pam_strerror. 10558 10559 pam_set_item 10560 10561 Name 10562 10563 pam_set_item -- (re)set the value of an item. 10564 10565 Synopsis 10566 10567 #include 10568 10569 extern int pam_set_item(pam_handle_t *pamh, int item_type, const void *item); 10570 10571 Description 10572 10573 pam_set_item (re)sets the value of one of the following item_types: 10574 10575 PAM_SERVICE 10576 10577 service name 10578 10579 PAM_USER 10580 10581 user name 10582 10583 PAM_TTY 10584 10585 terminal name 10586 10587 The value for a device file should include the /dev/ prefix. The value for 10588 graphical, X-based, applications should be the $DISPLAY variable. 10589 10590 PAM_RHOST 10591 10592 remote host name 10593 10594 PAM_CONV 10595 10596 conversation structure 10597 10598 PAM_RUSER 10599 10600 remote user name 10601 10602 PAM_USER_PROMPT 10603 10604 string to be used when prompting for a user's name 10605 10606 The default value for this string is Please enter username: . 10607 10608 For all item_types other than PAM_CONV, item is a pointer to a NULL-terminated 10609 character string. In the case of PAM_CONV, item points to an initialized 10610 pam_conv structure. 10611 10612 Return Value 10613 10614 PAM_SUCCESS 10615 10616 Success. 10617 10618 PAM_PERM_DENIED 10619 10620 An attempt was made to replace the conversation structure with a NULL 10621 value. 10622 10623 PAM_BUF_ERR 10624 10625 Function ran out of memory making a copy of the item. 10626 10627 PAM_BAD_ITEM 10628 10629 Application attempted to set an undefined item. 10630 10631 Errors 10632 10633 May be translated to text with pam_strerror. 10634 10635 pam_setcred 10636 10637 Name 10638 10639 pam_setcred -- set the module-specific credentials of the user 10640 10641 Synopsis 10642 10643 #include 10644 10645 extern int pam_setcred(pam_handle_t *pamh, int flags); 10646 10647 Description 10648 10649 pam_setcred sets the module-specific credentials of the user. It is usually 10650 called after the user has been authenticated, after the account management 10651 function has been called and after a session has been opened for the user. 10652 10653 flags maybe specified from among the following values: 10654 10655 PAM_ESTABLISH_CRED 10656 10657 set credentials for the authentication service 10658 10659 PAM_DELETE_CRED 10660 10661 delete credentials associated with the authentication service 10662 10663 PAM_REINITIALIZE_CRED 10664 10665 reinitialize the user credentials 10666 10667 PAM_REFRESH_CRED 10668 10669 extend lifetime of the user credentials 10670 10671 Additionally, the value of flags may be logically or'd with PAM_SILENT. 10672 10673 Return Value 10674 10675 PAM_SUCCESS 10676 10677 Success. 10678 10679 PAM_CRED_UNAVAIL 10680 10681 Module cannot retrieve the user's credentials. 10682 10683 PAM_CRED_EXPIRED 10684 10685 User's credentials have expired. 10686 10687 PAM_USER_UNKNOWN 10688 10689 User is not known to an authentication module. 10690 10691 PAM_CRED_ERR 10692 10693 Module was unable to set the credentials of the user. 10694 10695 Errors 10696 10697 May be translated to text with pam_strerror. 10698 10699 pam_start 10700 10701 Name 10702 10703 pam_start -- initialize the PAM library 10704 10705 Synopsis 10706 10707 #include 10708 10709 extern int pam_start(const char *service_name, const char *user, const (struct 10710 pam_conv *pam_conversation), pam_handle_t **pamh); 10711 10712 Description 10713 10714 pam_start is used to initialize the PAM library. It must be called prior to any 10715 other usage of the PAM library. On success, *pamh becomes a handle that 10716 provides continuity for successive calls to the PAM library. pam_start expects 10717 arguments as follows: the service_name of the program, the username of the 10718 individual to be authenticated, a pointer to an application-supplied pam_conv 10719 structure, and a pointer to a pam_handle_t pointer. 10720 10721 An application must provide the conversation function used for direct 10722 communication between a loaded module and the application. The application also 10723 typically provides a means for the module to prompt the user for a password, 10724 etc. 10725 10726 The structure, pam_conv, is defined to be, 10727 10728 struct pam_conv { 10729 int (*conv) (int num_msg, 10730 const struct pam_message * *msg, 10731 struct pam_response * *resp, 10732 void *appdata_ptr); 10733 void *appdata_ptr; 10734 }; 10735 10736 It is initialized by the application before it is passed to the library. The 10737 contents of this structure are attached to the *pamh handle. The point of this 10738 argument is to provide a mechanism for any loaded module to interact directly 10739 with the application program; this is why it is called a conversation 10740 structure. 10741 10742 When a module calls the referenced conv function, appdata_ptr is set to the 10743 second element of this structure. 10744 10745 The other arguments of a call to conv concern the information exchanged by 10746 module and application. num_msg holds the length of the array of pointers 10747 passed via msg. On success, the pointer resp points to an array of num_msg 10748 pam_response structures, holding the application-supplied text. Note that resp 10749 is a struct pam_response array and not an array of pointers. 10750 10751 Return Value 10752 10753 PAM_SUCCESS 10754 10755 Success. 10756 10757 PAM_BUF_ERR 10758 10759 Memory allocation error. 10760 10761 PAM_ABORT 10762 10763 Internal failure. 10764 10765 ERRORS 10766 10767 May be translated to text with pam_strerror. 10768 10769 pam_strerror 10770 10771 Name 10772 10773 pam_strerror -- returns a string describing the PAM error 10774 10775 Synopsis 10776 10777 #include 10778 10779 extern const char * pam_strerror(pam_handle_t *pamh, int errnum); 10780 10781 Description 10782 10783 pam_strerror returns a string describing the PAM error associated with errnum. 10784 10785 Return Value 10786 10787 On success, this function returns a description of the indicated error. The 10788 application should not free or modify this string. This returned string will 10789 not be translated. 10790 10791 III. Utility Libraries 10792 10793 Table of Contents 10794 7. Libraries 10795 10796 ------------------------------------------------------------------------------- 10797 10798 Chapter 7. Libraries 10799 10800 An LSB-conforming implementation may also support some utility libraries which 10801 are built on top of the interfaces provided by the base libraries. These 10802 libraries implement common functionality, and hide additional system dependent 10803 information such as file formats and device names. 10804 10805 ------------------------------------------------------------------------------- 10806 10807 Interfaces for libz 10808 10809 Table 7-1 defines the library name and shared object name for the libz library 10810 10811 Table 7-1. libz Definition 10812 10813 +-------------------+ 10814 |Library:|libz | 10815 |--------+----------| 10816 |SONAME: |libz.so.1 | 10817 +-------------------+ 10818 10819 The behavior of the interfaces in this library is specified by the following 10820 specifications: 10821 10822 zlib 1.2 Manual 10823 10824 ------------------------------------------------------------------------------- 10825 10826 Compression Library 10827 10828 ------------------------------------------------------------------------------- 10829 10830 Interfaces for Compression Library 10831 10832 An LSB conforming implementation shall provide the generic functions for 10833 Compression Library specified in Table 7-2, with the full functionality as 10834 described in the referenced underlying specification. 10835 10836 Table 7-2. libz - Compression Library Function Interfaces 10837 10838 +-----------------------------------------------------------------------------+ 10839 |adler32 [1] |deflateInit_ [1] |gzerror |gzread [1] |inflateInit2_ [1] | 10840 | | |[1] | | | 10841 |-------------+--------------------+---------+-----------+--------------------| 10842 |compress [1] |deflateParams [1] |gzflush |gzrewind |inflateInit_ [1] | 10843 | | |[1] |[1] | | 10844 |-------------+--------------------+---------+-----------+--------------------| 10845 |compress2 [1]|deflateReset [1] |gzgetc |gzseek [1] |inflateReset [1] | 10846 | | |[1] | | | 10847 |-------------+--------------------+---------+-----------+--------------------| 10848 |crc32 [1] |deflateSetDictionary|gzgets |gzsetparams|inflateSetDictionary| 10849 | |[1] |[1] |[1] |[1] | 10850 |-------------+--------------------+---------+-----------+--------------------| 10851 |deflate [1] |get_crc_table [1] |gzopen |gztell [1] |inflateSync [1] | 10852 | | |[1] | | | 10853 |-------------+--------------------+---------+-----------+--------------------| 10854 |deflateCopy |gzclose [1] |gzprintf |gzwrite [1]|inflateSyncPoint [1]| 10855 |[1] | |[1] | | | 10856 |-------------+--------------------+---------+-----------+--------------------| 10857 |deflateEnd |gzdopen [1] |gzputc |inflate [1]|uncompress [1] | 10858 |[1] | |[1] | | | 10859 |-------------+--------------------+---------+-----------+--------------------| 10860 |deflateInit2_|gzeof [1] |gzputs |inflateEnd |zError [1] | 10861 |[1] | |[1] |[1] | | 10862 +-----------------------------------------------------------------------------+ 10863 10864 Referenced Specification(s) 10865 10866 [1]. zlib 1.2 Manual 10867 10868 ------------------------------------------------------------------------------- 10869 10870 Data Definitions for libz 10871 10872 This section defines global identifiers and their values that are associated 10873 with interfaces contained in libz. These definitions are organized into groups 10874 that correspond to system headers. This convention is used as a convenience for 10875 the reader, and does not imply the existence of these headers, or their 10876 content. 10877 10878 These definitions are intended to supplement those provided in the referenced 10879 underlying specifications. 10880 10881 This specification uses ISO/IEC 9899 C Language as the reference programming 10882 language, and data definitions are specified in ISO C format. The C language is 10883 used here as a convenient notation. Using a C language description of these 10884 data objects does not preclude their use by other programming languages. 10885 10886 ------------------------------------------------------------------------------- 10887 10888 zlib.h 10889 10890 #define Z_NULL 0 10891 #define MAX_WBITS 15 10892 #define MAX_MEM_LEVEL 9 10893 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy),ZLIB_VERSION,sizeof(z_stream)) 10894 #define deflateInit(strm,level) deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 10895 #define inflateInit2(strm,windowBits) inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) 10896 #define inflateInit(strm) inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 10897 10898 typedef int intf; 10899 10900 typedef void *voidpf; 10901 typedef unsigned int uInt; 10902 typedef unsigned long uLong; 10903 typedef uLong uLongf; 10904 typedef void *voidp; 10905 typedef unsigned char Byte; 10906 typedef off_t z_off_t; 10907 typedef void *const voidpc; 10908 10909 typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size); 10910 typedef void (*free_func) (voidpf opaque, voidpf address); 10911 struct internal_state 10912 { 10913 int dummy; 10914 } 10915 ; 10916 typedef Byte Bytef; 10917 typedef uInt uIntf; 10918 10919 typedef struct z_stream_s 10920 { 10921 Bytef *next_in; 10922 uInt avail_in; 10923 uLong total_in; 10924 Bytef *next_out; 10925 uInt avail_out; 10926 uLong total_out; 10927 char *msg; 10928 struct internal_state *state; 10929 alloc_func zalloc; 10930 free_func zfree; 10931 voidpf opaque; 10932 int data_type; 10933 uLong adler; 10934 uLong reserved; 10935 } 10936 z_stream; 10937 10938 typedef z_stream *z_streamp; 10939 typedef voidp gzFile; 10940 #define Z_NO_FLUSH 0 10941 #define Z_PARTIAL_FLUSH 1 10942 #define Z_SYNC_FLUSH 2 10943 #define Z_FULL_FLUSH 3 10944 #define Z_FINISH 4 10945 10946 #define Z_ERRNO (-1) 10947 #define Z_STREAM_ERROR (-2) 10948 #define Z_DATA_ERROR (-3) 10949 #define Z_MEM_ERROR (-4) 10950 #define Z_BUF_ERROR (-5) 10951 #define Z_OK 0 10952 #define Z_STREAM_END 1 10953 #define Z_NEED_DICT 2 10954 10955 #define Z_DEFAULT_COMPRESSION (-1) 10956 #define Z_NO_COMPRESSION 0 10957 #define Z_BEST_SPEED 1 10958 #define Z_BEST_COMPRESSION 9 10959 10960 #define Z_DEFAULT_STRATEGY 0 10961 #define Z_FILTERED 1 10962 #define Z_HUFFMAN_ONLY 2 10963 10964 #define Z_BINARY 0 10965 #define Z_ASCII 1 10966 #define Z_UNKNOWN 2 10967 10968 #define Z_DEFLATED 8 10969 10970 ------------------------------------------------------------------------------- 10971 10972 Interfaces for libncurses 10973 10974 Table 7-3 defines the library name and shared object name for the libncurses 10975 library 10976 10977 Table 7-3. libncurses Definition 10978 10979 +-------------------------+ 10980 |Library:|libncurses | 10981 |--------+----------------| 10982 |SONAME: |libncurses.so.5 | 10983 +-------------------------+ 10984 10985 The behavior of the interfaces in this library is specified by the following 10986 specifications: 10987 10988 CAE Specification, May 1996, X/Open Curses, Issue 4, Version 2 (ISBN: 10989 1-85912-171-3, C610), plus Corrigendum U018 10990 10991 ------------------------------------------------------------------------------- 10992 10993 Curses 10994 10995 ------------------------------------------------------------------------------- 10996 10997 Interfaces for Curses 10998 10999 An LSB conforming implementation shall provide the generic functions for Curses 11000 specified in Table 7-4, with the full functionality as described in the 11001 referenced underlying specification. 11002 11003 Table 7-4. libncurses - Curses Function Interfaces 11004 11005 +-----------------------------------------------------------------------------+ 11006 |addch [1] |has_ic [1] |mvwaddchnstr [1]|scr_init [1] |vwscanw [1] | 11007 |----------------+--------------+----------------+---------------+------------| 11008 |addchnstr [1] |has_il [1] |mvwaddchstr [1] |scr_restore [1]|waddch [1] | 11009 |----------------+--------------+----------------+---------------+------------| 11010 |addchstr [1] |hline [1] |mvwaddnstr [1] |scr_set [1] |waddchnstr | 11011 | | | | |[1] | 11012 |----------------+--------------+----------------+---------------+------------| 11013 |addnstr [1] |idcok [1] |mvwaddstr [1] |scrl [1] |waddchstr | 11014 | | | | |[1] | 11015 |----------------+--------------+----------------+---------------+------------| 11016 |addstr [1] |idlok [1] |mvwchgat [1] |scroll [1] |waddnstr [1]| 11017 |----------------+--------------+----------------+---------------+------------| 11018 |attr_get [1] |immedok [1] |mvwdelch [1] |scrollok [1] |waddstr [1] | 11019 |----------------+--------------+----------------+---------------+------------| 11020 |attr_off [1] |inch [1] |mvwgetch [1] |set_curterm [1]|wattr_get | 11021 | | | | |[1] | 11022 |----------------+--------------+----------------+---------------+------------| 11023 |attr_on [1] |inchnstr [1] |mvwgetnstr [1] |set_term [1] |wattr_off | 11024 | | | | |[1] | 11025 |----------------+--------------+----------------+---------------+------------| 11026 |attr_set [1] |inchstr [1] |mvwgetstr [1] |setscrreg [1] |wattr_on [1]| 11027 |----------------+--------------+----------------+---------------+------------| 11028 |attroff [1] |init_color [1]|mvwhline [1] |setupterm [1] |wattr_set | 11029 | | | | |[1] | 11030 |----------------+--------------+----------------+---------------+------------| 11031 |attron [1] |init_pair [1] |mvwin [1] |slk_attr_set |wattroff [1]| 11032 | | | |[1] | | 11033 |----------------+--------------+----------------+---------------+------------| 11034 |attrset [1] |initscr [1] |mvwinch [1] |slk_attroff [1]|wattron [1] | 11035 |----------------+--------------+----------------+---------------+------------| 11036 |baudrate [1] |innstr [1] |mvwinchnstr [1] |slk_attron [1] |wattrset [1]| 11037 |----------------+--------------+----------------+---------------+------------| 11038 |beep [1] |insch [1] |mvwinchstr [1] |slk_attrset [1]|wbkgd [1] | 11039 |----------------+--------------+----------------+---------------+------------| 11040 |bkgd [1] |insdelln [1] |mvwinnstr [1] |slk_clear [1] |wbkgdset [1]| 11041 |----------------+--------------+----------------+---------------+------------| 11042 |bkgdset [1] |insertln [1] |mvwinsch [1] |slk_color [1] |wborder [1] | 11043 |----------------+--------------+----------------+---------------+------------| 11044 |border [1] |insnstr [1] |mvwinsnstr [1] |slk_init [1] |wchgat [1] | 11045 |----------------+--------------+----------------+---------------+------------| 11046 |box [1] |insstr [1] |mvwinsstr [1] |slk_label [1] |wclear [1] | 11047 |----------------+--------------+----------------+---------------+------------| 11048 |can_change_color|instr [1] |mvwinstr [1] |slk_noutrefresh|wclrtobot | 11049 |[1] | | |[1] |[1] | 11050 |----------------+--------------+----------------+---------------+------------| 11051 |cbreak [1] |intrflush [1] |mvwprintw [1] |slk_refresh [1]|wclrtoeol | 11052 | | | | |[1] | 11053 |----------------+--------------+----------------+---------------+------------| 11054 |chgat [1] |is_linetouched|mvwscanw [1] |slk_restore [1]|wcolor_set | 11055 | |[1] | | |[1] | 11056 |----------------+--------------+----------------+---------------+------------| 11057 |clear [1] |is_wintouched |mvwvline [1] |slk_set [1] |wcursyncup | 11058 | |[1] | | |[1] | 11059 |----------------+--------------+----------------+---------------+------------| 11060 |clearok [1] |isendwin [1] |napms [1] |slk_touch [1] |wdelch [1] | 11061 |----------------+--------------+----------------+---------------+------------| 11062 |clrtobot [1] |keyname [1] |newpad [1] |standend [1] |wdeleteln | 11063 | | | | |[1] | 11064 |----------------+--------------+----------------+---------------+------------| 11065 |clrtoeol [1] |keypad [1] |newterm [1] |standout [1] |wechochar | 11066 | | | | |[1] | 11067 |----------------+--------------+----------------+---------------+------------| 11068 |color_content |killchar [1] |newwin [1] |start_color [1]|werase [1] | 11069 |[1] | | | | | 11070 |----------------+--------------+----------------+---------------+------------| 11071 |color_set [1] |leaveok [1] |nl [1] |subpad [1] |wgetch [1] | 11072 |----------------+--------------+----------------+---------------+------------| 11073 |copywin [1] |longname [1] |nocbreak [1] |subwin [1] |wgetnstr [1]| 11074 |----------------+--------------+----------------+---------------+------------| 11075 |curs_set [1] |meta [1] |nodelay [1] |syncok [1] |wgetstr [1] | 11076 |----------------+--------------+----------------+---------------+------------| 11077 |def_prog_mode |move [1] |noecho [1] |termattrs [1] |whline [1] | 11078 |[1] | | | | | 11079 |----------------+--------------+----------------+---------------+------------| 11080 |def_shell_mode |mvaddch [1] |nonl [1] |termname [1] |winch [1] | 11081 |[1] | | | | | 11082 |----------------+--------------+----------------+---------------+------------| 11083 |del_curterm [1] |mvaddchnstr |noqiflush [1] |tgetent [1] |winchnstr | 11084 | |[1] | | |[1] | 11085 |----------------+--------------+----------------+---------------+------------| 11086 |delay_output [1]|mvaddchstr [1]|noraw [1] |tgetflag [1] |winchstr [1]| 11087 |----------------+--------------+----------------+---------------+------------| 11088 |delch [1] |mvaddnstr [1] |notimeout [1] |tgetnum [1] |winnstr [1] | 11089 |----------------+--------------+----------------+---------------+------------| 11090 |deleteln [1] |mvaddstr [1] |overlay [1] |tgetstr [1] |winsch [1] | 11091 |----------------+--------------+----------------+---------------+------------| 11092 |delscreen [1] |mvchgat [1] |overwrite [1] |tgoto [1] |winsdelln | 11093 | | | | |[1] | 11094 |----------------+--------------+----------------+---------------+------------| 11095 |delwin [1] |mvcur [1] |pair_content [1]|tigetflag [1] |winsertln | 11096 | | | | |[1] | 11097 |----------------+--------------+----------------+---------------+------------| 11098 |derwin [1] |mvdelch [1] |pechochar [1] |tigetnum [1] |winsnstr [1]| 11099 |----------------+--------------+----------------+---------------+------------| 11100 |doupdate [1] |mvderwin [1] |pnoutrefresh [1]|tigetstr [1] |winsstr [1] | 11101 |----------------+--------------+----------------+---------------+------------| 11102 |dupwin [1] |mvgetch [1] |prefresh [1] |timeout [1] |winstr [1] | 11103 |----------------+--------------+----------------+---------------+------------| 11104 |echo [1] |mvgetnstr [1] |printw [1] |touchline [1] |wmove [1] | 11105 |----------------+--------------+----------------+---------------+------------| 11106 |echochar [1] |mvgetstr [1] |putp [1] |touchwin [1] |wnoutrefresh| 11107 | | | | |[1] | 11108 |----------------+--------------+----------------+---------------+------------| 11109 |endwin [1] |mvhline [1] |putwin [1] |tparm [1] |wprintw [1] | 11110 |----------------+--------------+----------------+---------------+------------| 11111 |erase [1] |mvinch [1] |qiflush [1] |tputs [1] |wredrawln | 11112 | | | | |[1] | 11113 |----------------+--------------+----------------+---------------+------------| 11114 |erasechar [1] |mvinchnstr [1]|raw [1] |typeahead [1] |wrefresh [1]| 11115 |----------------+--------------+----------------+---------------+------------| 11116 |filter [1] |mvinchstr [1] |redrawwin [1] |unctrl [1] |wscanw [1] | 11117 |----------------+--------------+----------------+---------------+------------| 11118 |flash [1] |mvinnstr [1] |refresh [1] |ungetch [1] |wscrl [1] | 11119 |----------------+--------------+----------------+---------------+------------| 11120 |flushinp [1] |mvinsch [1] |reset_prog_mode |untouchwin [1] |wsetscrreg | 11121 | | |[1] | |[1] | 11122 |----------------+--------------+----------------+---------------+------------| 11123 |getbkgd [1] |mvinsnstr [1] |reset_shell_mode|use_env [1] |wstandend | 11124 | | |[1] | |[1] | 11125 |----------------+--------------+----------------+---------------+------------| 11126 |getch [1] |mvinsstr [1] |resetty [1] |vidattr [1] |wstandout | 11127 | | | | |[1] | 11128 |----------------+--------------+----------------+---------------+------------| 11129 |getnstr [1] |mvinstr [1] |restartterm [1] |vidputs [1] |wsyncdown | 11130 | | | | |[1] | 11131 |----------------+--------------+----------------+---------------+------------| 11132 |getstr [1] |mvprintw [1] |ripoffline [1] |vline [1] |wsyncup [1] | 11133 |----------------+--------------+----------------+---------------+------------| 11134 |getwin [1] |mvscanw [1] |savetty [1] |vw_printw [1] |wtimeout [1]| 11135 |----------------+--------------+----------------+---------------+------------| 11136 |halfdelay [1] |mvvline [1] |scanw [1] |vw_scanw [1] |wtouchln [1]| 11137 |----------------+--------------+----------------+---------------+------------| 11138 |has_colors [1] |mvwaddch [1] |scr_dump [1] |vwprintw [1] |wvline [1] | 11139 +-----------------------------------------------------------------------------+ 11140 11141 Referenced Specification(s) 11142 11143 [1]. CAE Specification, May 1996, X/Open Curses, Issue 4, Version 2 (ISBN: 11144 1-85912-171-3, C610), plus Corrigendum U018 11145 11146 An LSB conforming implementation shall provide the generic data interfaces for 11147 Curses specified in Table 7-5, with the full functionality as described in the 11148 referenced underlying specification. 11149 11150 Table 7-5. libncurses - Curses Data Interfaces 11151 11152 +---------------------------------------------------+ 11153 |COLORS [1] |COLS [1] |acs_map [1] |curscr [1]| | 11154 |---------------+---------+------------+----------+-| 11155 |COLOR_PAIRS [1]|LINES [1]|cur_term [1]|stdscr [1]| | 11156 +---------------------------------------------------+ 11157 11158 Referenced Specification(s) 11159 11160 [1]. CAE Specification, May 1996, X/Open Curses, Issue 4, Version 2 (ISBN: 11161 1-85912-171-3, C610), plus Corrigendum U018 11162 11163 ------------------------------------------------------------------------------- 11164 11165 Data Definitions for libncurses 11166 11167 This section defines global identifiers and their values that are associated 11168 with interfaces contained in libncurses. These definitions are organized into 11169 groups that correspond to system headers. This convention is used as a 11170 convenience for the reader, and does not imply the existence of these headers, 11171 or their content. 11172 11173 These definitions are intended to supplement those provided in the referenced 11174 underlying specifications. 11175 11176 This specification uses ISO/IEC 9899 C Language as the reference programming 11177 language, and data definitions are specified in ISO C format. The C language is 11178 used here as a convenient notation. Using a C language description of these 11179 data objects does not preclude their use by other programming languages. 11180 11181 ------------------------------------------------------------------------------- 11182 11183 curses.h 11184 11185 #define ERR (-1) 11186 #define OK (0) 11187 #define ACS_RARROW (acs_map['+']) 11188 #define ACS_LARROW (acs_map[',']) 11189 #define ACS_UARROW (acs_map['-']) 11190 #define ACS_DARROW (acs_map['.']) 11191 #define ACS_BLOCK (acs_map['0']) 11192 #define ACS_CKBOARD (acs_map['a']) 11193 #define ACS_DEGREE (acs_map['f']) 11194 #define ACS_PLMINUS (acs_map['g']) 11195 #define ACS_BOARD (acs_map['h']) 11196 #define ACS_LANTERN (acs_map['i']) 11197 #define ACS_LRCORNER (acs_map['j']) 11198 #define ACS_URCORNER (acs_map['k']) 11199 #define ACS_ULCORNER (acs_map['l']) 11200 #define ACS_LLCORNER (acs_map['m']) 11201 #define ACS_PLUS (acs_map['n']) 11202 #define ACS_S1 (acs_map['o']) 11203 #define ACS_HLINE (acs_map['q']) 11204 #define ACS_S9 (acs_map['s']) 11205 #define ACS_LTEE (acs_map['t']) 11206 #define ACS_RTEE (acs_map['u']) 11207 #define ACS_BTEE (acs_map['v']) 11208 #define ACS_TTEE (acs_map['w']) 11209 #define ACS_VLINE (acs_map['x']) 11210 #define ACS_DIAMOND (acs_map['`']) 11211 #define ACS_BULLET (acs_map['~']) 11212 #define getmaxyx(win,y,x) (y=(win)?((win)->_maxy+1):ERR,x=(win)?((win)->_maxx+1):ERR) 11213 #define getbegyx(win,y,x) (y=(win)?(win)->_begy:ERR,x=(win)?(win)->_begx:ERR) 11214 #define getyx(win,y,x) (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx:ERR) 11215 #define getparyx(win,y,x) (y=(win)?(win)->_pary:ERR,x=(win)?(win)->_parx:ERR) 11216 11217 #define WA_ALTCHARSET A_ALTCHARSET 11218 #define WA_ATTRIBUTES A_ATTRIBUTES 11219 #define WA_BLINK A_BLINK 11220 #define WA_BOLD A_BOLD 11221 #define WA_DIM A_DIM 11222 #define WA_HORIZONTAL A_HORIZONTAL 11223 #define WA_INVIS A_INVIS 11224 #define WA_LEFT A_LEFT 11225 #define WA_LOW A_LOW 11226 #define WA_NORMAL A_NORMAL 11227 #define WA_PROTECT A_PROTECT 11228 #define WA_REVERSE A_REVERSE 11229 #define WA_RIGHT A_RIGHT 11230 #define WA_STANDOUT A_STANDOUT 11231 #define WA_TOP A_TOP 11232 #define WA_UNDERLINE A_UNDERLINE 11233 #define WA_VERTICAL A_VERTICAL 11234 #define A_REVERSE NCURSES_BITS(1UL,10) 11235 11236 #define COLOR_BLACK 0 11237 #define COLOR_RED 1 11238 #define COLOR_GREEN 2 11239 #define COLOR_YELLOW 3 11240 #define COLOR_BLUE 4 11241 #define COLOR_MAGENTA 5 11242 #define COLOR_CYAN 6 11243 #define COLOR_WHITE 7 11244 11245 #define _SUBWIN 0x01 11246 #define _ENDLINE 0x02 11247 #define _FULLWIN 0x04 11248 #define _ISPAD 0x10 11249 #define _HASMOVED 0x20 11250 11251 typedef unsigned char bool; 11252 11253 typedef unsigned long chtype; 11254 typedef struct screen SCREEN; 11255 typedef struct _win_st WINDOW; 11256 typedef chtype attr_t; 11257 typedef struct 11258 { 11259 attr_t attr; 11260 wchar_t chars[5]; 11261 } 11262 cchar_t; 11263 struct pdat 11264 { 11265 short _pad_y; 11266 short _pad_x; 11267 short _pad_top; 11268 short _pad_left; 11269 short _pad_bottom; 11270 short _pad_right; 11271 } 11272 ; 11273 11274 struct _win_st 11275 { 11276 short _cury; 11277 short _curx; 11278 short _maxy; 11279 short _maxx; 11280 short _begy; 11281 short _begx; 11282 short _flags; 11283 attr_t _attrs; 11284 chtype _bkgd; 11285 bool _notimeout; 11286 bool _clear; 11287 bool _leaveok; 11288 bool _scroll; 11289 bool _idlok; 11290 bool _idcok; 11291 bool _immed; 11292 bool _sync; 11293 bool _use_keypad; 11294 int _delay; 11295 struct ldat *_line; 11296 short _regtop; 11297 short _regbottom; 11298 int _parx; 11299 int _pary; 11300 WINDOW *_parent; 11301 struct pdat _pad; 11302 short _yoffset; 11303 cchar_t _bkgrnd; 11304 } 11305 ; 11306 #define KEY_CODE_YES 0400 11307 #define KEY_BREAK 0401 11308 #define KEY_MIN 0401 11309 #define KEY_DOWN 0402 11310 #define KEY_UP 0403 11311 #define KEY_LEFT 0404 11312 #define KEY_RIGHT 0405 11313 #define KEY_HOME 0406 11314 #define KEY_BACKSPACE 0407 11315 #define KEY_F0 0410 11316 #define KEY_DL 0510 11317 #define KEY_IL 0511 11318 #define KEY_DC 0512 11319 #define KEY_IC 0513 11320 #define KEY_EIC 0514 11321 #define KEY_CLEAR 0515 11322 #define KEY_EOS 0516 11323 #define KEY_EOL 0517 11324 #define KEY_SF 0520 11325 #define KEY_SR 0521 11326 #define KEY_NPAGE 0522 11327 #define KEY_PPAGE 0523 11328 #define KEY_STAB 0524 11329 #define KEY_CTAB 0525 11330 #define KEY_CATAB 0526 11331 #define KEY_ENTER 0527 11332 #define KEY_SRESET 0530 11333 #define KEY_RESET 0531 11334 #define KEY_PRINT 0532 11335 #define KEY_LL 0533 11336 #define KEY_A1 0534 11337 #define KEY_A3 0535 11338 #define KEY_B2 0536 11339 #define KEY_C1 0537 11340 #define KEY_C3 0540 11341 #define KEY_BTAB 0541 11342 #define KEY_BEG 0542 11343 #define KEY_CANCEL 0543 11344 #define KEY_CLOSE 0544 11345 #define KEY_COMMAND 0545 11346 #define KEY_COPY 0546 11347 #define KEY_CREATE 0547 11348 #define KEY_END 0550 11349 #define KEY_EXIT 0551 11350 #define KEY_FIND 0552 11351 #define KEY_HELP 0553 11352 #define KEY_MARK 0554 11353 #define KEY_MESSAGE 0555 11354 #define KEY_MOVE 0556 11355 #define KEY_NEXT 0557 11356 #define KEY_OPEN 0560 11357 #define KEY_OPTIONS 0561 11358 #define KEY_PREVIOUS 0562 11359 #define KEY_REDO 0563 11360 #define KEY_REFERENCE 0564 11361 #define KEY_REFRESH 0565 11362 #define KEY_REPLACE 0566 11363 #define KEY_RESTART 0567 11364 #define KEY_RESUME 0570 11365 #define KEY_SAVE 0571 11366 #define KEY_SBEG 0572 11367 #define KEY_SCANCEL 0573 11368 #define KEY_SCOMMAND 0574 11369 #define KEY_SCOPY 0575 11370 #define KEY_SCREATE 0576 11371 #define KEY_SDC 0577 11372 #define KEY_SDL 0600 11373 #define KEY_SELECT 0601 11374 #define KEY_SEND 0602 11375 #define KEY_SEOL 0603 11376 #define KEY_SEXIT 0604 11377 #define KEY_SFIND 0605 11378 #define KEY_SHELP 0606 11379 #define KEY_SHOME 0607 11380 #define KEY_SIC 0610 11381 #define KEY_SLEFT 0611 11382 #define KEY_SMESSAGE 0612 11383 #define KEY_SMOVE 0613 11384 #define KEY_SNEXT 0614 11385 #define KEY_SOPTIONS 0615 11386 #define KEY_SPREVIOUS 0616 11387 #define KEY_SPRINT 0617 11388 #define KEY_SREDO 0620 11389 #define KEY_SREPLACE 0621 11390 #define KEY_SRIGHT 0622 11391 #define KEY_SRSUME 0623 11392 #define KEY_SSAVE 0624 11393 #define KEY_SSUSPEND 0625 11394 #define KEY_SUNDO 0626 11395 #define KEY_SUSPEND 0627 11396 #define KEY_UNDO 0630 11397 #define KEY_MOUSE 0631 11398 #define KEY_RESIZE 0632 11399 #define KEY_MAX 0777 11400 11401 #define PAIR_NUMBER(a) (((a)& A_COLOR)>>8) 11402 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 11403 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 11404 #define A_NORMAL 0L 11405 #define NCURSES_ATTR_SHIFT 8 11406 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 11407 #define A_BLINK NCURSES_BITS(1UL,11) 11408 #define A_DIM NCURSES_BITS(1UL,12) 11409 #define A_BOLD NCURSES_BITS(1UL,13) 11410 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 11411 #define A_INVIS NCURSES_BITS(1UL,15) 11412 #define A_PROTECT NCURSES_BITS(1UL,16) 11413 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 11414 #define A_LEFT NCURSES_BITS(1UL,18) 11415 #define A_LOW NCURSES_BITS(1UL,19) 11416 #define A_RIGHT NCURSES_BITS(1UL,20) 11417 #define A_TOP NCURSES_BITS(1UL,21) 11418 #define A_VERTICAL NCURSES_BITS(1UL,22) 11419 #define A_STANDOUT NCURSES_BITS(1UL,8) 11420 #define A_UNDERLINE NCURSES_BITS(1UL,9) 11421 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 11422 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 11423 11424 ------------------------------------------------------------------------------- 11425 11426 Interfaces for libutil 11427 11428 Table 7-6 defines the library name and shared object name for the libutil 11429 library 11430 11431 Table 7-6. libutil Definition 11432 11433 +----------------------+ 11434 |Library:|libutil | 11435 |--------+-------------| 11436 |SONAME: |libutil.so.1 | 11437 +----------------------+ 11438 11439 The behavior of the interfaces in this library is specified by the following 11440 specifications: 11441 11442 Linux Standard Base 11443 11444 ------------------------------------------------------------------------------- 11445 11446 Utility Functions 11447 11448 ------------------------------------------------------------------------------- 11449 11450 Interfaces for Utility Functions 11451 11452 An LSB conforming implementation shall provide the generic functions for 11453 Utility Functions specified in Table 7-7, with the full functionality as 11454 described in the referenced underlying specification. 11455 11456 Table 7-7. libutil - Utility Functions Function Interfaces 11457 11458 +-----------------------------------------+ 11459 |forkpty [1]|login_tty [1]|logwtmp [1]| | | 11460 |-----------+-------------+-----------+-+-| 11461 |login [1] |logout [1] |openpty [1]| | | 11462 +-----------------------------------------+ 11463 11464 Referenced Specification(s) 11465 11466 [1]. Linux Standard Base 11467 11468 ------------------------------------------------------------------------------- 11469 11470 Interface Definitions for libutil 11471 11472 Table of Contents 11473 forkpty -- find and open an available pseudo-tty 11474 login -- login utility function 11475 login_tty -- find and open an available pseudo-tty 11476 logout -- logout utility function 11477 logwtmp -- append an entry to the wtmp file 11478 openpty -- find and open an available pseudo-tty 11479 11480 The following interfaces are included in libutil and are defined by this 11481 specification. Unless otherwise noted, these interfaces shall be included in 11482 the source standard. 11483 11484 Other interfaces listed above for libutil shall behave as described in the 11485 referenced base document. 11486 11487 forkpty 11488 11489 Name 11490 11491 forkpty -- find and open an available pseudo-tty 11492 11493 Synopsis 11494 11495 int forkpty(int *amaster, 11496 char *name, 11497 struct termios *termp, 11498 struct winsize *winp); 11499 11500 Description 11501 11502 The forkpty() function joins openpty(), fork(), and login_tty() to create a new 11503 process operating on a pseudo-tty. The file descriptor of the master side of 11504 the pseudo-tty is returned in amaster, and null or the filename of the slave in 11505 name. If non-null, the termp and winp parameters will determine the terminal 11506 attributes and window size of the slave side of the pseudo-tty. 11507 11508 Return Value 11509 11510 On success of the child process, zero is returned. When the parent process 11511 receives the PID of its child process, pid is returned. On error, -1 is 11512 returned, and errno is set appropriately. 11513 11514 login 11515 11516 Name 11517 11518 login -- login utility function 11519 11520 Synopsis 11521 11522 void login(struct utmp *ut); 11523 11524 Description 11525 11526 The login() function updates the /var/run/utmp and /var/log/wtmp files with 11527 user information contained in ut. 11528 11529 login_tty 11530 11531 Name 11532 11533 login_tty -- find and open an available pseudo-tty 11534 11535 Synopsis 11536 11537 int login_tty(int fdr); 11538 11539 Description 11540 11541 login_tty() sets up for a login on the tty referenced by the file descriptor 11542 fdr. This function creates a new session, makes the tty for the current process 11543 the controlling terminal, sets the standard input, output, and error streams of 11544 the current process, and closes fdr. 11545 11546 Return Value 11547 11548 On success, zero is returned. On error, -1 is returned, and errno is set 11549 appropriately. 11550 11551 logout 11552 11553 Name 11554 11555 logout -- logout utility function 11556 11557 Synopsis 11558 11559 int logout(const char *line); 11560 11561 Description 11562 11563 Given the device line, the logout() function removes the entry from the 11564 corresponding /var/run/utmp system file. 11565 11566 Return Value 11567 11568 Zero is returned if there was no entry to remove. A non-zero return value 11569 indicates success. 11570 11571 logwtmp 11572 11573 Name 11574 11575 logwtmp -- append an entry to the wtmp file 11576 11577 Synopsis 11578 11579 #include 11580 11581 void logwtmp(const char *line, const char *name, const char *host); 11582 11583 Description 11584 11585 logwtmp() constructs an utmp structure using line, name, host, current time and 11586 current process id. Then it calls updwtmp() to append the structure to the utmp 11587 file. 11588 11589 Availability 11590 11591 Both functions are available under glibc2, but not under libc5. However, 11592 logwtmp occurs in the old libbsd. 11593 11594 Files 11595 11596 /var/log/wtmp database of past user logins 11597 11598 openpty 11599 11600 Name 11601 11602 openpty -- find and open an available pseudo-tty 11603 11604 Synopsis 11605 11606 int openpty(int *amaster, 11607 int *aslave, 11608 char *name, 11609 struct termios *termp, 11610 struct winsize *winp); 11611 11612 Description 11613 11614 The openpty() function finds an available pseudo-tty and returns file 11615 descriptors for the amaster and aslave. The filename of the slave is returned 11616 in name, otherwise a null. The terminal parameters of the slave will be set to 11617 the values in termp, otherwise a null. The window size of the slave will be set 11618 to the values in winp, otherwise a null. 11619 11620 Return Value 11621 11622 On success, zero is returned. On error, -1 is returned, and errno is set 11623 appropriately. 11624 11625 Errors 11626 11627 ENOENT 11628 11629 There are no available ttys. 11630 11631 IV. Commands and Utilities 11632 11633 Table of Contents 11634 8. Commands and Utilities 11635 11636 ------------------------------------------------------------------------------- 11637 11638 Chapter 8. Commands and Utilities 11639 11640 Commands and Utilities 11641 11642 If any operand (except one which follows --) starts with a hyphen the behavior 11643 is unspecified. [16] 11644 11645 The following table lists the Commands and Utilities. Unless otherwise 11646 specified the command or utility is described in the Single UNIX Specification 11647 (SUS). When an interface is not defined in the Single UNIX Specification, then 11648 the next prevailing standard is referenced (ie., POSIX, SVID). 11649 11650 The behavior of the interfaces described in this section are specified by the 11651 following standards. 11652 11653 Linux Standard Base [17] 11654 ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 11655 Specification(SUS) V3 [18] 11656 11657 Table 8-1. Commands and Utilities 11658 11659 +-----------------------------------------------------------------------------+ 11660 |[ [18] |ar [17] |at [17] |awk [17] |basename [18] | 11661 |-----------------+------------+---------------+-------------+----------------| 11662 |batch [17] |bc [17] |cat [18] |chfn [17] |chgrp [17] | 11663 |-----------------+------------+---------------+-------------+----------------| 11664 |chmod [18] |chown [17] |chsh [17] |cksum [18] |cmp [18] | 11665 |-----------------+------------+---------------+-------------+----------------| 11666 |col [17] |comm [18] |cp [18] |cpio [17] |crontab [17] | 11667 |-----------------+------------+---------------+-------------+----------------| 11668 |csplit [18] |cut [17] |date [18] |dd [18] |df [17] | 11669 |-----------------+------------+---------------+-------------+----------------| 11670 |diff [18] |dirname [18]|dmesg [17] |du [17] |echo [17] | 11671 |-----------------+------------+---------------+-------------+----------------| 11672 |egrep [17] |env [18] |expand [18] |expr [18] |false [18] | 11673 |-----------------+------------+---------------+-------------+----------------| 11674 |fgrep [17] |file [17] |find [17] |fold [18] |fuser [17] | 11675 |-----------------+------------+---------------+-------------+----------------| 11676 |gencat [18] |getconf [18]|gettext [17] |grep [17] |groupadd [17] | 11677 |-----------------+------------+---------------+-------------+----------------| 11678 |groupdel [17] |groupmod |groups [17] |gunzip [17] |gzip [17] | 11679 | |[17] | | | | 11680 |-----------------+------------+---------------+-------------+----------------| 11681 |head [18] |hostname |iconv [18] |id [18] |install [17] | 11682 | |[17] | | | | 11683 |-----------------+------------+---------------+-------------+----------------| 11684 |install_initd |ipcrm [17] |ipcs [17] |join [18] |kill [18] | 11685 |[17] | | | | | 11686 |-----------------+------------+---------------+-------------+----------------| 11687 |killall [17] |ln [18] |locale [18] |localedef |logname [18] | 11688 | | | |[18] | | 11689 |-----------------+------------+---------------+-------------+----------------| 11690 |lpr [17] |ls [17] |lsb_release |m4 [17] |make [18] | 11691 | | |[17] | | | 11692 |-----------------+------------+---------------+-------------+----------------| 11693 |man [18] |md5sum [17] |mkdir [18] |mkfifo [18] |mknod [17] | 11694 |-----------------+------------+---------------+-------------+----------------| 11695 |mktemp [17] |more [17] |mount [17] |msgfmt [17] |mv [18] | 11696 |-----------------+------------+---------------+-------------+----------------| 11697 |newgrp [17] |nice [18] |nl [18] |nohup [18] |od [17] | 11698 |-----------------+------------+---------------+-------------+----------------| 11699 |passwd [17] |paste [18] |patch [17] |pathchk [18] |pidof [17] | 11700 |-----------------+------------+---------------+-------------+----------------| 11701 |pr [18] |printf [18] |ps [18] |pwd [18] |remove_initd | 11702 | | | | |[17] | 11703 |-----------------+------------+---------------+-------------+----------------| 11704 |renice [17] |rm [18] |rmdir [18] |sed [17] |sendmail [17] | 11705 |-----------------+------------+---------------+-------------+----------------| 11706 |sh [18] |shutdown |sleep [18] |sort [18] |split [18] | 11707 | |[17] | | | | 11708 |-----------------+------------+---------------+-------------+----------------| 11709 |strip [18] |stty [18] |su [17] |sync [17] |tail [18] | 11710 |-----------------+------------+---------------+-------------+----------------| 11711 |tar [17] |tee [18] |test [18] |time [18] |touch [18] | 11712 |-----------------+------------+---------------+-------------+----------------| 11713 |tr [18] |true [18] |tsort [18] |tty [18] |umount [17] | 11714 |-----------------+------------+---------------+-------------+----------------| 11715 |uname [18] |unexpand |uniq [18] |useradd [17] |userdel [17] | 11716 | |[18] | | | | 11717 |-----------------+------------+---------------+-------------+----------------| 11718 |usermod [17] |wc [18] |xargs [17] | | | 11719 +-----------------------------------------------------------------------------+ 11720 ------------------------------------------------------------------------------- 11721 11722 Command Behavior 11723 11724 Table of Contents 11725 ar -- create and maintain library archives (LSB DEPRECATED) 11726 at -- examine or delete jobs for later execution 11727 awk -- pattern scanning and processing language 11728 batch -- execute commands when the system load permits 11729 bc -- An arbitrary precision calculator language 11730 chfn -- change user name and information 11731 chgrp -- change file group 11732 chown -- change file owner and group 11733 chsh -- change login shell 11734 col -- filter reverse line feeds from input 11735 cpio -- copy file archives in and out 11736 crontab -- maintain crontab files for individual users 11737 cut -- split a file into sections determined by context lines 11738 df -- report filesystem disk space usage 11739 dmesg -- print or control the kernel ring buffer 11740 du -- estimate file space usage 11741 echo -- display a line of text 11742 egrep -- search a file with an ERE pattern 11743 fgrep -- search a file with a fixed pattern 11744 file -- determine file type 11745 find -- search for files in a directory hierarchy 11746 fuser -- identify processes using files or sockets 11747 gettext -- retrieve text string from message database 11748 grep -- print lines matching a pattern 11749 groupadd -- create a new group 11750 groupdel -- delete a group 11751 groupmod -- modify a group 11752 groups -- display a group 11753 gunzip -- uncompress files 11754 gzip -- compress or expand files 11755 hostname -- show the system's host name 11756 install -- copy files and set attributes 11757 install_initd -- install an init.d file 11758 ipcrm -- provide information on ipc facilities 11759 ipcs -- provide information on ipc facilities 11760 killall -- kill processes by name 11761 lpr -- off line print 11762 ls -- list directory contents 11763 lsb_release -- print distribution specific information 11764 m4 -- macro processor 11765 md5sum -- generates or checks MD5 message digests 11766 mknod -- make block or character special files 11767 mktemp -- make temporary file name (unique) 11768 more -- file perusal filter for crt viewing 11769 mount -- mount a file system 11770 msgfmt -- create a message object from a message file 11771 newgrp -- change group ID 11772 od -- dump files in octal and other formats 11773 passwd -- change user password 11774 patch -- apply a diff file to an original 11775 pidof -- find the process ID of a running program 11776 remove_initd -- clean up boot script system modifications introduced by 11777 install_initd 11778 renice -- alter priority of running processes 11779 sed -- stream editor 11780 sendmail -- an electronic mail transport agent 11781 shutdown -- bring the system down 11782 su -- change user ID or become super-user 11783 sync -- flush filesystem buffers 11784 tar -- file archiver 11785 umount -- unmount file systems 11786 useradd -- create a new user or update default new user information 11787 userdel -- delete a user account and related files 11788 usermod -- modify a user account 11789 xargs -- build and execute command lines from standard input 11790 11791 This section contains descriptions for commands and utilities whose specified 11792 behavior in the LSB contradicts or extends the standards referenced. It also 11793 contains commands and utilities only required by the LSB and not specified by 11794 other standards. 11795 11796 ar 11797 11798 Name 11799 11800 ar -- create and maintain library archives (LSB DEPRECATED) 11801 11802 Description 11803 11804 ar is deprecated from the LSB and is expected to disappear from a future 11805 version of the LSB. [19] 11806 11807 ar is as specified in the Single UNIX Specification but with differences as 11808 listed below. 11809 11810 Differences 11811 11812 -T, -C 11813 11814 need not be accepted. 11815 11816 -l 11817 11818 has unspecified behavior. 11819 11820 -q 11821 11822 has unspecified behavior; using -r is suggested. 11823 11824 at 11825 11826 Name 11827 11828 at -- examine or delete jobs for later execution 11829 11830 Description 11831 11832 at is as specified in the Single UNIX Specification but with differences as 11833 listed below. 11834 11835 Differences 11836 11837 -d 11838 11839 is functionally equivalent to the -r option specified in the Single UNIX 11840 Specification. 11841 11842 -r 11843 11844 need not be supported, but the '-d' option is equivalent. 11845 11846 -t time 11847 11848 need not be supported. 11849 11850 Files 11851 11852 The files at.allow and at.deny reside in /etc rather than /usr/lib/cron. 11853 11854 awk 11855 11856 Name 11857 11858 awk -- pattern scanning and processing language 11859 11860 Description 11861 11862 awk is as specified in the Single UNIX Specification but with differences as 11863 listed below. 11864 11865 Differences 11866 11867 Certain aspects of internationalized regular expressions are optional; see 11868 Internationalization and Regular Expressions>. 11869 11870 batch 11871 11872 Name 11873 11874 batch -- execute commands when the system load permits 11875 11876 Description 11877 11878 The specification for batch is as specified in the Single UNIX Specification 11879 but with the following differences as listed below. 11880 11881 Files 11882 11883 The files at.allow and at.deny reside in /etc rather than /usr/lib/cron. 11884 11885 bc 11886 11887 Name 11888 11889 bc -- An arbitrary precision calculator language 11890 11891 Description 11892 11893 bc is as specified in the Single UNIX Specification but with differences as 11894 listed below. 11895 11896 Differences 11897 11898 -s, --standard 11899 11900 processes exactly the POSIX bc language. 11901 11902 -w, --warn 11903 11904 gives warnings for extensions to POSIX bc. 11905 11906 chfn 11907 11908 Name 11909 11910 chfn -- change user name and information 11911 11912 Synopsis 11913 11914 chfn [-f full_name] [-h home-phone] [user] 11915 11916 Description 11917 11918 chfn changes user fullname and other information for a user's account. This 11919 information is typically printed by finger and similar programs. A normal user 11920 may only change the fields for their own account, the super user may change the 11921 fields for any account. 11922 11923 The only restrictions placed on the contents of the fields is that no control 11924 characters may be present, nor any of comma, colon, or equal sign. 11925 11926 If none of the options are selected, chfn operates in an interactive fashion. 11927 The prompts and expected input in interactive mode are unspecified and should 11928 not be relied upon. 11929 11930 As it is possible for the system to be configured to restrict which fields a 11931 non-privileged user is permitted to change, applications should be written to 11932 gracefully handle these situations. 11933 11934 Standard Options 11935 11936 -f full_name 11937 11938 sets the user's full name. 11939 11940 -h home-phone 11941 11942 sets the user's home phone number. 11943 11944 [20] 11945 11946 chgrp 11947 11948 Name 11949 11950 chgrp -- change file group 11951 11952 Description 11953 11954 chgrp is as specified in the Single UNIX Specification but with differences as 11955 listed below. 11956 11957 Differences 11958 11959 The -L, -H, and -P options need not be supported. 11960 11961 chown 11962 11963 Name 11964 11965 chown -- change file owner and group 11966 11967 Description 11968 11969 chown is as specified in the Single UNIX Specification but with differences as 11970 listed below. 11971 11972 Differences 11973 11974 The -L, -H, and -P options need not be supported. 11975 11976 chsh 11977 11978 Name 11979 11980 chsh -- change login shell 11981 11982 Synopsis 11983 11984 chsh [-s login_shell] [user] 11985 11986 Description 11987 11988 chsh changes the user login shell. This determines the name of the user's 11989 initial login command. A normal user may only change the login shell for their 11990 own account, the super user may change the login shell for any account. 11991 11992 The only restrictions placed on the login shell is that the command name shall 11993 be listed in /etc/shells, unless the invoker is the super-user, and then any 11994 value may be added. Accounts which are restricted (in an implementation-defined 11995 manner) may not change their login shell. 11996 11997 If the -s option is not selected, chsh operates in an interactive mode. The 11998 prompts and expected input in this mode are implementation-defined. 11999 12000 Standard Options 12001 12002 -s login_shell 12003 12004 sets the login shell. 12005 12006 col 12007 12008 Name 12009 12010 col -- filter reverse line feeds from input 12011 12012 Description 12013 12014 col is as specified in the The Single UNIX Specification(SUS) Version 2, 12015 Commands and Utilities (XCU), Issue 5 (ISBN: 1-85912-191-8, C604) with the 12016 difference that the -p option has unspecified behavior. 12017 12018 Although col is shown as legacy in the Single UNIX Specification, Version 2, it 12019 is not (yet) deprecated in the LSB. 12020 12021 cpio 12022 12023 Name 12024 12025 cpio -- copy file archives in and out 12026 12027 Description 12028 12029 cpio is as specified in the Single UNIX Specification but with differences as 12030 listed below. 12031 12032 Differences 12033 12034 Certain aspects of internationalized filename globbing are optional; see 12035 Internationalization and Filename Globbing>. 12036 12037 crontab 12038 12039 Name 12040 12041 crontab -- maintain crontab files for individual users 12042 12043 Synopsis 12044 12045 crontab [ -u user ] file 12046 crontab [ -u user ] { -l | -r | -e } 12047 12048 Description 12049 12050 crontab is as specified in the Single UNIX Specification but with differences 12051 as listed below. 12052 12053 Files 12054 12055 The files cron.allow and cron.deny reside in /etc rather than /usr/lib/cron. 12056 12057 cut 12058 12059 Name 12060 12061 cut -- split a file into sections determined by context lines 12062 12063 Description 12064 12065 cut is as specified in the Single UNIX Specification but with differences as 12066 listed below. 12067 12068 Differences 12069 12070 -n 12071 12072 has unspecified behavior. 12073 12074 df 12075 12076 Name 12077 12078 df -- report filesystem disk space usage 12079 12080 Description 12081 12082 df is as specified in the Single UNIX Specification but with the following 12083 differences. 12084 12085 If the -k option is not specified, disk space is shown in unspecified units. 12086 Applications should specify -k. 12087 12088 If an argument is the absolute file name of a disk device node containing a 12089 mounted filesystem, df shows the space available on that filesystem rather than 12090 on the filesystem containing the device node (which is always the root 12091 filesystem). 12092 12093 dmesg 12094 12095 Name 12096 12097 dmesg -- print or control the kernel ring buffer 12098 12099 Synopsis 12100 12101 dmesg [ -c ] [ -n level ] [ -s bufsize ] 12102 12103 Description 12104 12105 dmesg examines or controls the kernel ring buffer. 12106 12107 Standard Options 12108 12109 -c 12110 12111 clears the ring buffer contents after printing. 12112 12113 -n level 12114 12115 sets the level at which logging of messages is done to the console. 12116 12117 -s bufsize 12118 12119 uses a buffer of bufsize to query the kernel ring buffer. This is 8196 by 12120 default (this matches the default kernel syslog buffer size in 2.0.33 and 12121 2.1.103). If you have set the kernel buffer to larger than the default then 12122 this option can be used to view the entire buffer. 12123 12124 du 12125 12126 Name 12127 12128 du -- estimate file space usage 12129 12130 Description 12131 12132 du is as specified in the Single UNIX Specification but with differences as 12133 listed below. 12134 12135 Differences 12136 12137 If the -k option is not specified, disk space is shown in unspecified units. 12138 Applications should specify -k. 12139 12140 echo 12141 12142 Name 12143 12144 echo -- display a line of text 12145 12146 Synopsis 12147 12148 echo [STRING]... 12149 12150 Description 12151 12152 The echo command is as specified in the Single UNIX Specification but with the 12153 following differences. 12154 12155 Unlike the behavior specified in the Single UNIX Specification, whether echo 12156 supports options is implementation defined. The behavior of echo if any 12157 arguments contain backslashes is also implementation defined. Applications 12158 shall not run echo with a first argument starting with a hyphen, or with any 12159 arguments containing backslashes; they shall use printf in those cases. [21] 12160 12161 egrep 12162 12163 Name 12164 12165 egrep -- search a file with an ERE pattern 12166 12167 Description 12168 12169 egrep is equivalent to grep -E. For further details, see the specification for 12170 grep. 12171 12172 fgrep 12173 12174 Name 12175 12176 fgrep -- search a file with a fixed pattern 12177 12178 Description 12179 12180 fgrep is equivalent to grep -F. For further details, see the specification for 12181 grep. 12182 12183 file 12184 12185 Name 12186 12187 file -- determine file type 12188 12189 Description 12190 12191 file is as specified in the Single UNIX Specification but with differences as 12192 listed below. 12193 12194 Differences 12195 12196 The -M, -h, -d, and -i options need not be supported. 12197 12198 find 12199 12200 Name 12201 12202 find -- search for files in a directory hierarchy 12203 12204 Description 12205 12206 find is as specified in the Single UNIX Specification but with additional 12207 options as specified below. 12208 12209 Differences 12210 12211 Certain aspects of internationalized filename globbing are optional; see 12212 Internationalization and Filename Globbing>. 12213 12214 fuser 12215 12216 Name 12217 12218 fuser -- identify processes using files or sockets 12219 12220 Description 12221 12222 fuser is as specified in the Single UNIX Specification but with differences as 12223 listed below. 12224 12225 Differences 12226 12227 -c 12228 12229 has unspecified behavior. 12230 12231 -f 12232 12233 has unspecified behavior. 12234 12235 gettext 12236 12237 Name 12238 12239 gettext -- retrieve text string from message database 12240 12241 Synopsis 12242 12243 gettext [ options ] [ textdomain ] msgid 12244 12245 gettext -s [ options ] msgid ... 12246 12247 Description 12248 12249 The gettext utility retrieves a translated text string corresponding to string 12250 msgid from a message object generated with msgfmt utility. 12251 12252 The message object name is derived from the optional argument textdomain if 12253 present, otherwise from the TEXTDOMAIN environment. If no domain is specified, 12254 or if a corresponding string cannot be found, gettext prints msgid. 12255 12256 Ordinarily gettext looks for its message object in dirname/lang/LC_MESSAGES 12257 where dirname is the implementation-defined default directory and lang is the 12258 locale name. If present, the TEXTDOMAINDIR environment variable replaces the 12259 dirname. 12260 12261 This utility interprets C escape sequences such as \t for tab. Use \\ to print 12262 a backslash. To produce a message on a line of its own, either put a \n at the 12263 end of msgid, or use this command in conjunction with printf utility. 12264 12265 When used with the -s option the utility behaves like the echo utility. But it 12266 does not simply copy its arguments to standard output. Instead those messages 12267 found in the selected catalog are translated. 12268 12269 Options 12270 12271 -d domainname, --domain=domainname 12272 12273 Retrieve translated messages from domainname. 12274 12275 -e 12276 12277 Enable expansion of some escape sequences. 12278 12279 -n 12280 12281 Suppress trailing newline. 12282 12283 Operands 12284 12285 The following operands are supported: 12286 12287 textdomain 12288 12289 A domain name used to retrieve the messages. 12290 12291 msgid 12292 12293 A key to retrieve the localized message. 12294 12295 Environment Variables 12296 12297 LANGUAGE 12298 12299 Specifies one or more locale names. See gettext message handling functions 12300 for more information. 12301 12302 LANG 12303 12304 Specifies locale name. 12305 12306 LC_MESSAGES 12307 12308 Specifies messaging locale, and if present overrides LANG for messages. 12309 12310 TEXTDOMAIN 12311 12312 Specifies the text domain name, which is identical to the message object 12313 filename without .mo suffix. 12314 12315 TEXTDOMAINDIR 12316 12317 Specifies the pathname to the message database, and if present replaces the 12318 implementation-defined default directory. 12319 12320 Exit Status 12321 12322 The following exit values are returned: 12323 12324 0 12325 12326 Successful completion. 12327 12328 >0 12329 12330 An error occurred. 12331 12332 grep 12333 12334 Name 12335 12336 grep -- print lines matching a pattern 12337 12338 Description 12339 12340 grep is as specified in the Single UNIX Specification but with differences as 12341 listed below. 12342 12343 LSB Differences 12344 12345 Certain aspects of internationalized regular expressions are optional; see 12346 Internationalization and Regular Expressions>. 12347 12348 groupadd 12349 12350 Name 12351 12352 groupadd -- create a new group 12353 12354 Synopsis 12355 12356 groupadd [-g gid [-o]] group 12357 12358 Options 12359 12360 -g gid [-o] 12361 12362 specifies the numerical value of the group's ID. This value shall be 12363 unique, unless the -o option is used. The value shall be non-negative. 12364 12365 groupdel 12366 12367 Name 12368 12369 groupdel -- delete a group 12370 12371 Synopsis 12372 12373 groupdel group 12374 12375 Description 12376 12377 groupdel modifies the system account files, deleting all entries that refer to 12378 group. The named group shall exist. 12379 12380 groupmod 12381 12382 Name 12383 12384 groupmod -- modify a group 12385 12386 Synopsis 12387 12388 groupmod [-g gid [-o]] [-n group_name ] group 12389 12390 Options 12391 12392 -g gid [-o] 12393 12394 specifies the numerical value of the group's ID. This value shall be 12395 unique, unless the -o option is used. The value shall be non-negative. Any 12396 files which the old group ID is the file group ID shall have the file group 12397 ID changed manually. 12398 12399 -n groupname 12400 12401 changes the name of the group from group to group_name. 12402 12403 groups 12404 12405 Name 12406 12407 groups -- display a group 12408 12409 Synopsis 12410 12411 groups [user] 12412 12413 Description 12414 12415 groups displays the current group ID names or values. If the value does not 12416 have a corresponding entry in the group database, the value will be displayed 12417 as the numerical group value. The optional user parameter will display the 12418 groups for the named user. 12419 12420 gunzip 12421 12422 Name 12423 12424 gunzip -- uncompress files 12425 12426 Description 12427 12428 gunzip is equivalent to gzip -d. See the specification for gzip for further 12429 details. 12430 12431 gzip 12432 12433 Name 12434 12435 gzip -- compress or expand files 12436 12437 Synopsis 12438 12439 gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] 12440 12441 Description 12442 12443 gzip tries to reduce the size of the named files. Whenever possible, each file 12444 is replaced by one with the extension .gz, while keeping the same ownership 12445 modes, access and modification times. If no files are specified, or if a file 12446 name is "-", the standard input is compressed to the standard output. gzip will 12447 only attempt to compress regular files. In particular, it will ignore symbolic 12448 links. 12449 12450 When compressing, gzip uses the deflate algorithm specified in RFC1951 and 12451 stores the result in a file using the gzip file format specified in RFC1952. 12452 12453 Options 12454 12455 -a, --ascii 12456 12457 does nothing on Linux systems. 12458 12459 -c, --stdout, --to-stdout 12460 12461 writes output on standard output; keeps original files unchanged. If there 12462 are several input files, the output consists of a sequence of independently 12463 compressed members. To obtain better compression, concatenate all input 12464 files before compressing them. 12465 12466 -d, --decompress, --uncompress 12467 12468 decompresses. 12469 12470 -f, --force 12471 12472 forces compression or decompression even if the file has multiple links or 12473 the corresponding file already exists, or if the compressed data is read 12474 from or written to a terminal. If the input data is not in a format 12475 recognized by gzip, and if the option --stdout is also given, copy the 12476 input data without change to the standard ouput: let gzip behave as cat. If 12477 -f is not given, and when not running in the background, gzip prompts to 12478 verify whether an existing file should be overwritten. 12479 12480 -l, --list 12481 12482 lists the compressed size, uncompressed size, ration and uncompressed name 12483 for each compressed file. Gives the uncompressed size as -1 for files not 12484 in gzip format. Additionally displays method, crc and timestamp for the 12485 uncompress file when used in combination with --verbose. 12486 12487 The compression methods currently supported are deflate, compress, lzh (SCO 12488 compress -H) and pack. The crc is given as ffffffff for a file not in gzip 12489 format. 12490 12491 With --name, the uncompressed name, date and time are those stored within 12492 the compress file, if present. 12493 12494 With --verbose, the size totals and compression ratio for all files is also 12495 displayed, unless some sizes are unknown. With --quiet, the title and 12496 totals lines are not displayed. 12497 12498 -L, --license 12499 12500 displays the gzip license and quit. 12501 12502 -n, --no-name 12503 12504 does not save the original file name and time stamp by default when 12505 compressing. (The original name is always saved if the name had to be 12506 truncated.) When decompressing, do not restore the original file name if 12507 present (remove only the gzip suffix from the compressed file name) and do 12508 not restore the original time stamp if present (copy it from the compressed 12509 file). This option is the default when decompressing. 12510 12511 -N, --name 12512 12513 always saves the original file name and time stamp when compressing; this 12514 is the default. When decompressing, restore the original file name and time 12515 stamp if present. This option is useful on systems which have a limit on 12516 file name length or when the time stamp has been lost after a file 12517 transfer. 12518 12519 -q, --quiet 12520 12521 suppresses all warnings. 12522 12523 -r, --recursive 12524 12525 travels the directory structure recursively. If any of the file names 12526 specified on the command line are directories, gzip will descend into the 12527 directory and compress all the files it finds there (or decompress them in 12528 the case of gunzip). 12529 12530 -S .suf, --sufix .suf 12531 12532 uses suffix .suf instead of .gz. 12533 12534 -t, --test 12535 12536 checks the compressed file integrity. 12537 12538 -v, --verbose 12539 12540 displays the name and percentage reduction for each file compressed or 12541 decompressed. 12542 12543 -#, --fast, --best 12544 12545 regulates the speed of compression using the specified digit #, where -1 or 12546 --fast indicates the fastest compression method (less compression) and -9 12547 or --best indicates the slowest compression method (best compression). The 12548 default compression level is -6 (that is, biased towards high compression 12549 at expense of speed). 12550 12551 LSB Deprecated Options 12552 12553 The behaviors specified in this section are expected to disappear from a future 12554 version of the LSB; applications should only use the non-LSB-deprecated 12555 behaviors. 12556 12557 -V, --version 12558 12559 displays the version number and compilation options, then quits. 12560 12561 hostname 12562 12563 Name 12564 12565 hostname -- show the system's host name 12566 12567 Synopsis 12568 12569 hostname [-v] [-a] [--alias] [-d] [--domain] [-f] [--fqdn] 12570 [-i] [--ip-address] [--long] [-s] [--short] [-y] [--yp] 12571 [--nis] 12572 12573 hostname [-v] [-F filename] [--file filename] [hostname] 12574 12575 hostname [-v] [-h] [--help] [-V] [--version] 12576 12577 Description 12578 12579 hostname is used to either set or display the current host or domain name of 12580 the system. This name is used by many of the networking programs to identify 12581 the machine. The domain name is also used by NIS/YP. 12582 12583 When called without any arguments, the program displays the name of the system 12584 as returned by the gethostname(2) function. 12585 12586 When called with one argument or with the --file option, the commands set the 12587 host name or the NIS/YP domain name. Note, that only the super-user can change 12588 the names. 12589 12590 Options 12591 12592 -a, --alias 12593 12594 displays the alias name of the host (if used). 12595 12596 -d, --domain 12597 12598 displays the name of the DNS domain. 12599 12600 -F, --file filename 12601 12602 reads the host name from the specified file. Comments (lines starting with 12603 a #) are ignored. 12604 12605 -f, --fqdn, --long 12606 12607 displays the FQDN (Fully Qualified Domain Name). 12608 12609 -i, --ip-address 12610 12611 displays the IP address(es) of the host. 12612 12613 -s, --short 12614 12615 displays the short host name. This is the host name cut at the first dot. 12616 12617 -v, --verbose 12618 12619 tells what's going on. 12620 12621 -y, --yp, --nis 12622 12623 displays the NIS domain name. If a parameter is given (or --file name) then 12624 root can also set a new NIS domain. 12625 12626 LSB Deprecated Options 12627 12628 The behaviors specified in this section are expected to disappear from a future 12629 version of the LSB; applications should only use the non-LSB-deprecated 12630 behaviors. 12631 12632 -V, --version 12633 12634 prints version information on standard output and exits successfully. 12635 12636 install 12637 12638 Name 12639 12640 install -- copy files and set attributes 12641 12642 Synopsis 12643 12644 install [OPTION]... SOURCE DEST (1st format) 12645 install [OPTION]... SOURCE... DIRECTORY (2nd format) 12646 install -d [OPTION]... DIRECTORY... (3rd format) 12647 12648 Description 12649 12650 In the first two formats, copy SOURCE to DEST or multiple SOURCE(s) to the 12651 existing DIRECTORY, while setting permission modes and owner/group. In the 12652 third format, create all components of the given DIRECTORY(ies). 12653 12654 Standard Options 12655 12656 --backup[=CONTROL] 12657 12658 makes a backup of each existing destination file. 12659 12660 -b 12661 12662 is like --backup, but does not accept an argument. 12663 12664 -d, --directory 12665 12666 treats all arguments as directory names; creates all components of the 12667 specified directories. 12668 12669 -D 12670 12671 creates all leading components of DEST except the last, then copies SOURCE 12672 to DEST; useful in the 1st format. 12673 12674 -g, --group=GROUP 12675 12676 sets group ownership, instead of process' current group. 12677 12678 -m, --mode=MODE 12679 12680 sets permission mode (as in chmod), instead of rwxr-xr-x. 12681 12682 -o, --owner=OWNER 12683 12684 sets ownership (super-user only). 12685 12686 -p, --preserve-timestamps 12687 12688 applies access/modification times of SOURCE files to corresponding 12689 destination files. 12690 12691 -s, --strip 12692 12693 strips symbol tables, only for 1st and 2nd formats. 12694 12695 -S, --suffix=SUFFIX 12696 12697 overrides the usual backup suffix. 12698 12699 --verbose 12700 12701 prints the name of each directory as it is created. 12702 12703 install_initd 12704 12705 Name 12706 12707 install_initd -- install an init.d file 12708 12709 Synopsis 12710 12711 /usr/lib/lsb/install_initd initd_file 12712 12713 Description 12714 12715 install_initd installs an init.d file that has been copied to the /etc/init.d 12716 location or symlink. In the postinstall script of a package, the program /usr/ 12717 lib/lsb/install_initd configures a distribution's boot script system to call 12718 the init.d file of the package at an appropriate time. See also the Section 12719 called Installation and Removal of init.d Files in Chapter 13. 12720 12721 ipcrm 12722 12723 Name 12724 12725 ipcrm -- provide information on ipc facilities 12726 12727 Synopsis 12728 12729 ipcrm [ shm | msg | sem ] id... 12730 12731 Description 12732 12733 ipcrm removes the resource(s) specified by id. 12734 12735 ipcs 12736 12737 Name 12738 12739 ipcs -- provide information on ipc facilities 12740 12741 Synopsis 12742 12743 ipcs [ -smq ] [ -tcp ] 12744 12745 Description 12746 12747 ipcs provides information on the ipc facilities for which the calling process 12748 has read access. 12749 12750 Resource display options 12751 12752 -m 12753 12754 shared memory segments. 12755 12756 -q 12757 12758 message queues. 12759 12760 -s 12761 12762 semaphore arrays. 12763 12764 Output format options 12765 12766 -t 12767 12768 time. 12769 12770 -p 12771 12772 pid. 12773 12774 -c 12775 12776 creator. 12777 12778 Application Usage 12779 12780 In some implementations of ipcs the -a option will print all information 12781 available. In other implementations the -a option will print all resource 12782 types. Therefore, applications shall not use the -a option. 12783 12784 Some implements of ipcs implement more output formats than are specified here. 12785 These options are not consistent between differing implementations of ipcs. 12786 Therefore, only the -t -c and -p option flags may be used. At least one of the 12787 -t -c and -p options shall be specified. 12788 12789 killall 12790 12791 Name 12792 12793 killall -- kill processes by name 12794 12795 Synopsis 12796 12797 killall [-egiqvw] [-signal] name ... 12798 killall -l 12799 killall -V 12800 12801 Description 12802 12803 killall sends a signal to all processes running any of the specified commands. 12804 If no signal name is specified, SIGTERM is sent. 12805 12806 Signals can be specified either by name (e.g. -HUP) or by number (e.g. -1). 12807 Signal 0 (check if a process exists) can only be specified by number. 12808 12809 If the command name contains a slash (/), processes executing that particular 12810 file will be selected for killing, independent of their name. 12811 12812 killall returns a non-zero return code if no process has been killed for any of 12813 the listed commands. If at least one process has been killed for each command, 12814 killall returns zero. 12815 12816 A killall process never kills itself (but may kill other killall processes). 12817 12818 Standard Options 12819 12820 -e 12821 12822 requires an exact match for very long names. If a command name is longer 12823 than 15 characters, the full name may be unavailable (i.e. it is swapped 12824 out). In this case, killall will kill everything that matches within the 12825 first 15 characters. With -e, such entries are skipped. killall prints a 12826 message for each skipped entry if -v is specified in addition to -e. 12827 12828 -g 12829 12830 kills the process group to which the process belongs. The kill signal is 12831 only sent once per group, even if multiple processes belonging to the same 12832 process group were found. 12833 12834 -i 12835 12836 asks interactively for confirmation before killing. 12837 12838 -l 12839 12840 lists all known signal names. 12841 12842 -q 12843 12844 does not complain if no processes were killed. 12845 12846 -v 12847 12848 reports if the signal was successfully sent. 12849 12850 LSB Deprecated Options 12851 12852 The behaviors specified in this section are expected to disappear from a future 12853 version of the LSB; applications should only use the non-LSB-deprecated 12854 behaviors. 12855 12856 -V 12857 12858 displays version information. 12859 12860 lpr 12861 12862 Name 12863 12864 lpr -- off line print 12865 12866 Synopsis 12867 12868 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] 12869 [-T title] [name ...] 12870 12871 Description 12872 12873 lpr uses a spooling daemon to print the named files when facilities become 12874 available. If no names appear, the standard input is assumed. 12875 12876 Standard Options 12877 12878 -l 12879 12880 identifies binary data that is not to be filtered but sent as raw input to 12881 printer. 12882 12883 -p 12884 12885 formats with "pr" before sending to printer. 12886 12887 -Pprinter 12888 12889 sends output to the printer named printer instead of the default printer. 12890 12891 -h 12892 12893 suppresses header page. 12894 12895 -s 12896 12897 uses symbolic links. 12898 12899 -#copies 12900 12901 specifies copies as the number of copies to print. 12902 12903 -J name 12904 12905 specifies name as the job name for the header page. 12906 12907 -T title 12908 12909 specifies title as the title used for "pr". 12910 12911 ls 12912 12913 Name 12914 12915 ls -- list directory contents 12916 12917 Description 12918 12919 ls is as specified in the Single UNIX Specification, but with differences 12920 listed below. 12921 12922 Differences 12923 12924 -p 12925 12926 in addition to the Single UNIX Specification behavior of printing a slash 12927 for a directory, ls -p may display other characters for other file types. 12928 12929 Certain aspects of internationalized filename globbing are optional; see 12930 Internationalization and Filename Globbing>. 12931 12932 lsb_release 12933 12934 Name 12935 12936 lsb_release -- print distribution specific information 12937 12938 Synopsis 12939 12940 lsb_release [OPTION]... 12941 12942 Description 12943 12944 The lsb_release command prints certain LSB (Linux Standard Base) and 12945 Distribution information. 12946 12947 With no option, same as -v. 12948 12949 Options 12950 12951 -v, --version 12952 12953 displays version of LSB against which distribution is compliant. The 12954 version is expressed as a colon seperated list of LSB module descriptions. 12955 LSB module descriptions are dash seperated tuples containing the module 12956 name, version, and architecture name. The output is a single line of text 12957 of the following format: 12958 12959 LSB Version:\t 12960 12961 -i, --id 12962 12963 displays string id of distributor. The output is a single line of text of 12964 the following format: 12965 12966 Distributor ID:\t 12967 12968 -d, --description 12969 12970 displays single line text description of distribution. The output is of the 12971 following format: 12972 12973 Description:\t 12974 12975 -r, --release 12976 12977 displays release number of distribution. The output is a single line of 12978 text of the following format: 12979 12980 Release:\t 12981 12982 -c, --codename 12983 12984 displays codename according to distribution release. The output is a single 12985 line of text of the following format. 12986 12987 Codename:\t 12988 12989 -a, --all 12990 12991 displays all of the above information. 12992 12993 -s, --short 12994 12995 displays all of the above information in short output format. 12996 12997 -h, --help 12998 12999 displays a human-readable help message. 13000 13001 Examples 13002 13003 The following command will list the LSB Profiles which are currently supported 13004 on this platform. 13005 13006 example% lsb_release -v 13007 LSB Version: core-2.0-ia32:graphics-2.0-ia32 13008 13009 m4 13010 13011 Name 13012 13013 m4 -- macro processor 13014 13015 Description 13016 13017 m4 is as specified in the Single UNIX Specification but with extensions as 13018 listed below. 13019 13020 Extensions 13021 13022 -P 13023 13024 forces a m4_ prefix to all builtins. 13025 13026 -I directory 13027 13028 Add directory to the end of the search path for includes. 13029 13030 md5sum 13031 13032 Name 13033 13034 md5sum -- generates or checks MD5 message digests 13035 13036 Synopsis 13037 13038 md5sum [-b] [-c [file]] | [file...] 13039 13040 Description 13041 13042 For each file, write to standard output a line containing the MD5 checksum of 13043 that file, followed by one or more blank characters, followed by the name of 13044 the file. The MD5 checksum shall be calculated according to RFC1321 and output 13045 as 32 hexadecimal digits (as RFC1321 does). 13046 13047 If no file names are specified as operands, read from standard input and use 13048 "-" as the file name in the output. 13049 13050 Options 13051 13052 -b 13053 13054 uses binary mode. 13055 13056 -c [file] 13057 13058 checks md5sum of all files listed in file against the checksum listed in 13059 the same file. The actual format of that file is the same as output of 13060 md5sum. That is, each line in the file describes a file. 13061 13062 mknod 13063 13064 Name 13065 13066 mknod -- make block or character special files 13067 13068 Synopsis 13069 13070 mknod [OPTION]... NAME TYPE [MAJOR MINOR] 13071 13072 Description 13073 13074 Create the special file NAME of the given TYPE. 13075 13076 MAJOR MINOR are forbidden for TYPE p, mandatory otherwise. TYPE may be: 13077 13078 b 13079 13080 creates a block (buffered) special file. 13081 13082 c, u 13083 13084 creates a character (unbuffered) special file. 13085 13086 p 13087 13088 creates a FIFO. 13089 13090 Standard Options 13091 13092 -m, --mode=MODE 13093 13094 sets permission mode (as in chmod), not a=rw - umask. 13095 13096 --version 13097 13098 outputs version information and exits. 13099 13100 mktemp 13101 13102 Name 13103 13104 mktemp -- make temporary file name (unique) 13105 13106 Synopsis 13107 13108 mktemp [-q] [-u] template 13109 13110 Description 13111 13112 mktemp takes the given file name template and overwrites a portion of it to 13113 create a file name. This file name is unique and suitable for use by the 13114 application. 13115 13116 Options 13117 13118 -q 13119 13120 fails silently if an error occurs. This is useful if a script does not want 13121 error output to go to standard error. 13122 13123 -u 13124 13125 operates in `unsafe' mode. The temp file will be unlinked before mktemp 13126 exits. This is slightly better than mktemp(3) but still introduces a race 13127 condition. Use of this option is not encouraged. 13128 13129 more 13130 13131 Name 13132 13133 more -- file perusal filter for crt viewing 13134 13135 Description 13136 13137 more is as specified in the Single UNIX Specification but with differences as 13138 listed below. 13139 13140 Differences 13141 13142 The more command need not respect the LINES and COLUMNS environment variables. 13143 13144 The more command need not support the following interactive commands: 13145 13146 g 13147 G 13148 u 13149 control u 13150 control f 13151 newline 13152 j 13153 k 13154 r 13155 R 13156 m 13157 ' (return to mark) 13158 /! 13159 ? 13160 N 13161 :e 13162 :t 13163 control g 13164 ZZ 13165 13166 -num 13167 13168 specifies an integer which is the screen size (in lines). 13169 13170 -e 13171 13172 has unspecified behavior. 13173 13174 -i 13175 13176 has unspecified behavior. 13177 13178 -n 13179 13180 has unspecified behavior. 13181 13182 -p 13183 13184 Either (1) clear the whole screen and then display the text (instead of the 13185 usual scrolling behavior), or (2) provide the behavior specified by the 13186 Single UNIX Specification. In the latter case, the syntax is "-p command". 13187 13188 -t 13189 13190 has unspecified behavior. 13191 13192 +num 13193 13194 starts at line number num. 13195 13196 +/string 13197 13198 specifies a string that will be searched for before each file is displayed. 13199 13200 Rationale 13201 13202 The +num and +/string options are deprecated in the Single UNIX Specification, 13203 Version 2; however we shall continue to specify them because util-linux-2.11f 13204 does not support the replacement (-p command). The +command option as found in 13205 the Single UNIX Specification is more general than what we specify, but 13206 util-linux-2.11f appears to only support the more specific +num and +/string 13207 forms. 13208 13209 mount 13210 13211 Name 13212 13213 mount -- mount a file system 13214 13215 Synopsis 13216 13217 mount [-hV] 13218 mount -a [-fFnrsvw] [-t vfstype] 13219 mount [-fnrsvw] [-o options [,...]] device | dir 13220 mount [-fnrsvw] [-t vfstype] [-o options] device dir 13221 13222 Description 13223 13224 Files are named in a big tree, the file hierarchy, rooted at /. These files can 13225 be spread out over several devices. mount serves to attach the file system 13226 found on some device to the big file tree. Conversely, umount(8) will detach it 13227 again. 13228 13229 Standard Options 13230 13231 -v 13232 13233 invokes verbose mode. 13234 13235 -a 13236 13237 mounts all filesystems (of the given types) mentioned in fstab. 13238 13239 -F 13240 13241 combines with -a. to fork off a new incarnation of mount for each device. 13242 This will do the mounts on different devices or different NFS servers in 13243 parallel. 13244 13245 -f 13246 13247 causes everything to be done except for the actual system call; if it's not 13248 obvious, this `fakes' mounting the file system. 13249 13250 -n 13251 13252 mounts without writing in /etc/mtab. This is necessary for example when / 13253 etc is on a read-only file system. 13254 13255 -s 13256 13257 tolerates sloppy mount options rather than failing. This will ignore mount 13258 options not supported by a filesystem type. Not all filesystems support 13259 this option. 13260 13261 -r 13262 13263 mounts the file system read-only. A synonym is -o ro. 13264 13265 -w 13266 13267 mounts the file system read/write. (default) A synonym is -o rw. 13268 13269 -L label 13270 13271 mounts the partition that has the specified label. 13272 13273 -U uuid 13274 13275 mounts the partition that has the specified uuid. These two options require 13276 the file /proc/partitions to exist. 13277 13278 -t vfstype 13279 13280 indicates a file system type of vfstype. 13281 13282 More than one type may be specified in a comma separated list. The list of 13283 file system types can be prefixed with no to specify the file system types 13284 on which no action should be taken. 13285 13286 -o 13287 13288 options are specified with a -o flag followed by a comma-separated string 13289 of options. Some of these options are only useful when they appear in the / 13290 etc/fstab file. The following options apply to any file system that is 13291 being mounted: 13292 13293 async 13294 13295 does all I/O to the file system asynchronously. 13296 13297 atime 13298 13299 updates inode access time for each access. (default) 13300 13301 auto 13302 13303 is mountable with -a. 13304 13305 defaults 13306 13307 uses default options: rw, suid, dev, exec, auto, nouser, and async. 13308 13309 dev 13310 13311 interprets character or block special devices on the file system. 13312 13313 exec 13314 13315 permits execution of binaries. 13316 13317 noatime 13318 13319 does not update inode access times on this file system. 13320 13321 noauto 13322 13323 is only explicitly mountable. 13324 13325 nodev 13326 13327 does not interpret character or block special devices on the file 13328 system. 13329 13330 noexec 13331 13332 does not allow execution of any binaries on the mounted file system. 13333 13334 nosuid 13335 13336 does not allow set-user-identifier or set-group-identifier bits to take 13337 effect. 13338 13339 nouser 13340 13341 forbids an ordinary (i.e., non-root) user to mount the file system. 13342 (default) 13343 13344 remount 13345 13346 attempts to remount an already-mounted file system. This is commonly 13347 used to change the mount flags for a file system, especially to make a 13348 read-only file system writable. 13349 13350 ro 13351 13352 mounts the file system read-only. 13353 13354 rw 13355 13356 mounts the file system read-write. 13357 13358 suid 13359 13360 allows set-user-identifier or set-group-identifier bits to take effect. 13361 13362 sync 13363 13364 does all I/O to the file system synchronously. 13365 13366 user 13367 13368 allows an ordinary user to mount the file system. This option implies 13369 the options noexec, nosuid, and nodev (unless overridden by subsequent 13370 options, as in the option line user,exec,dev,suid). 13371 13372 LSB Deprecated Options 13373 13374 The behaviors specified in this section are expected to disappear from a future 13375 version of the LSB; applications should only use the non-LSB-deprecated 13376 behaviors. 13377 13378 -V 13379 13380 outputs version. 13381 13382 msgfmt 13383 13384 Name 13385 13386 msgfmt -- create a message object from a message file 13387 13388 Synopsis 13389 13390 msgfmt [ options ] filename.po ... 13391 13392 Description 13393 13394 msgfmt creates message object files from portable object files (filename.po), 13395 without changing the portable object files. 13396 13397 The .po file contains messages displayed to users by system utilities or by 13398 application programs. .po files can be edited, and the messages in them can be 13399 rewritten in any language supported by the system. 13400 13401 If input file is -, standard input is read. 13402 13403 The xgettext utility can be used to create .po files from script or programs. 13404 13405 msgfmt interprets data as characters according to the current setting of the 13406 LC_CTYPE locale category. 13407 13408 Options 13409 13410 -D directory, --directory=directory 13411 13412 Add directory to list for input files search. 13413 13414 -f, --use-fuzzy 13415 13416 Use fuzzy entries in output. If this option is not specified, fuzzy entries 13417 are not included into the output. 13418 13419 -o output-file, --output-file=output-file 13420 13421 Specify output file name as output-file. If multiple domains or duplicate 13422 msgids in the .po file are present, the behavior is unspecified. If 13423 output-file is -, output is written to standard output. 13424 13425 --strict 13426 13427 Direct the utility to work strictly following the UniForum/Sun 13428 implementation. Currently this only affects the naming of the output file. 13429 If this option is not given the name of the output file is the same as the 13430 domain name. If the strict UniForum mode is enabled the suffix .mo is added 13431 to the file name if it is not already present. 13432 13433 -v, --verbose 13434 13435 Detect and diagnose input file anomalies which might represent translation 13436 errors. The msgid and msgstr strings are studied and compared. It is 13437 considered abnormal that one string starts or ends with a newline while the 13438 other does not. 13439 13440 Also, if the string represents a format string used in a printf-like 13441 function both strings should have the same number of % format specifiers, 13442 with matching types. If the flag c-format or possible-c-format appears in 13443 the special comment #, for this entry a check is performed. For example, 13444 the check will diagnose using %.*s against %s, or %d against %s, or %d 13445 against %x. It can even handle positional parameters. 13446 13447 Operands 13448 13449 The filename.po operands are treated as portable object files. The format of 13450 portable object files is defined in EXTENDED DESCRIPTION. 13451 13452 Standard Input 13453 13454 The standard input is not used unless a filename.po operand is specified as 13455 "-". 13456 13457 Environment Variables 13458 13459 LANGUAGE 13460 13461 Specifies one or more locale names. See gettext message handling functions 13462 for more information. 13463 13464 LANG 13465 13466 Specifies locale name. 13467 13468 LC_ALL 13469 13470 Specifies locale name for all categories. If defined, overrides LANG, 13471 LC_CTYPE and LC_MESSAGES. 13472 13473 LC_CTYPE 13474 13475 Specifies locale name for character handling. 13476 13477 LC_MESSAGES 13478 13479 Specifies messaging locale, and if present overrides LANG for messages. 13480 13481 Standard Output 13482 13483 The standard output is not used unless the option-argument of the -o option is 13484 specified as -. 13485 13486 Extended Description 13487 13488 The format of portable object files (.po files) is defined as follows. Each .po 13489 file contains one or more lines, with each line containing either a comment or 13490 a statement. Comments start the line with a hash mark (#) and end with the 13491 newline character. All comments and empty lines are ignored. The format of a 13492 statement is: 13493 13494 directive value 13495 13496 Each directive starts at the beginning of the line and is separated from value 13497 by white space (such as one or more space or tab characters). value consists of 13498 one or more quoted strings separated by white space. If two or more strings are 13499 specified as value, they are normalized into single string using the string 13500 normalization syntax the same as the ISO C language. Use any of the following 13501 types of directives: 13502 13503 domain domainname 13504 13505 msgid message_identifier 13506 13507 msgid_plural untranslated_string_plural 13508 13509 msgstr message_string 13510 13511 msgstr[n] message_string 13512 13513 The behavior of the domain directive is affected by the options used. See 13514 OPTIONS for the behavior when the -o option is specified. If the -o option is 13515 not specified, the behavior of the domain directive is as follows: (1) All 13516 msgids from the beginning of each .po file to the first domain directive are 13517 put into a default message object file, messages (or messages.mo if --strict 13518 option is specified). (2) When msgfmt encounters a domain domainname directive 13519 in the .po file, all following msgids until the next domain directive are put 13520 into the message object file domainname (or domainname.mo if --strict option is 13521 specified). (3) Duplicate msgids are defined in the scope of each domain. That 13522 is, a msgid is considered a duplicate only if the identical msgid exists in the 13523 same domain. (4) All duplicate msgids are ignored. 13524 13525 The msgid directive specifies the value of a message identifier associated with 13526 the directive that follows it. The msgid_plural directive specifies the plural 13527 form message specified to the plural message handling functions ngettext(), 13528 dngettext() or dcngettext(). The message_identifier string identifies a target 13529 string to be used at retrieval time. Each statement containing a msgid 13530 directive shall be followed by a statement containing a msgstr directive or 13531 msgstr[n] directives. 13532 13533 The msgstr directive specifies the target string associated with the 13534 message_identifier string declared in the immediately preceding msgid 13535 directive. 13536 13537 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the target string to 13538 be used with plural form handling functions ngettext(), dngettext() and 13539 dcngettext(). 13540 13541 Message strings can contain the escape sequences \n for newline, \t for tab, \v 13542 for vertical tab, \b for backspace, \r for carriage return, \f for formfeed, \\ 13543 for backslash, \" for double quote, \ddd for octal bit pattern, and \xHH for 13544 hexadecimal bit pattern. 13545 13546 Comments should be in one of the following formats: 13547 13548 # translator-comments 13549 13550 #. automatic-comments 13551 13552 #: reference... 13553 13554 #, flag 13555 13556 The comments that starts with #. and #: are automatically generated by xgettext 13557 utility. The #: comments indicate the location of the msgid string in the 13558 source files in filename:line format. The #. comments are generated when -c 13559 option of the xgettext utility is specified. These comments are informative 13560 only and silently ignored by the msgfmt utility. 13561 13562 The #, comments requires one or more flags separated by comma (,) character. 13563 The following flags can be specified: 13564 13565 fuzzy 13566 13567 This flag can be generated by the msgmerge utility or can be inserted by 13568 the translator. It shows that the msgstr string might not be a correct 13569 translation (anymore). Only the translator can judge if the translation 13570 requires further modification, or is acceptable as is. Once satisfied with 13571 the translation, the translator then removes this fuzzy flag. The msgmerge 13572 programs inserts this when it combined the msgid and msgstr entries after 13573 fuzzy search only. 13574 13575 If this flag is specified, the msgfmt utility will not generate the entry 13576 for the immediately following msgid in the output message catalog. 13577 13578 c-format, no-c-format 13579 13580 The flags are automatically added by the xgettext utility and they should 13581 not be added manually. The c-format flag indicates that the msgid string is 13582 used as format string by printf-like functions. In case the c-format flag 13583 is given for a string the msgfmt utility does some more tests to check to 13584 validity of the translation. 13585 13586 The msgid entry with empty string ("") is called the header entry and treated 13587 specially. If the message string for the header entry contains nplurals=value, 13588 the value indicates the number of plural forms. For example, if nplurals=4, 13589 there are 4 plural forms. If nplurals is defined, there should be plural= 13590 expression in the same line, separated by a semicolon (;) character. The 13591 expression is a C language expression to determine which version of msgstr[n] 13592 to be used based on the value of n, the last argument of ngettext(), dngettext 13593 () or dcngettext(). For example: 13594 13595 nplurals=2; plural=n == 1 ? 0 : 1 13596 13597 indicates that there are 2 plural forms in the language; msgstr[0] is used if n 13598 == 1, otherwise msgstr[1] is used. Another example: 13599 13600 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 13601 13602 indicates that there are 3 plural forms in the language; msgstr[0] is used if n 13603 == 1, msgstr[1] is used if n == 2, otherwise msgstr[2] is used. 13604 13605 If the header entry contains charset=codeset string, the codeset is used to 13606 indicate the codeset to be used to encode the message strings. If the output 13607 string's codeset is different from the message string's codeset, codeset 13608 conversion from the message strings's codeset to the output string's codeset 13609 will be performed upon the call of gettext(), dgettext(), dcgettext(), ngettext 13610 (), dngettext(), and dcngettext(). The output string's codeset is determined by 13611 the current locale's codeset (the return value of nl_langinfo(CODESET)) by 13612 default, and can be changed by the call of bind_textdomain_codeset(). 13613 13614 Exit Status 13615 13616 The following exit values are returned: 13617 13618 0 13619 13620 Successful completion. 13621 13622 >0 13623 13624 An error occurred. 13625 13626 Application Usage 13627 13628 Neither msgfmt nor any gettext() routine imposes a limit on the total length of 13629 a message. Installing message catalogs under the C locale is pointless, since 13630 they are ignored for the sake of efficiency. 13631 13632 Examples 13633 13634 Example 1: Examples of creating message objects from message files. 13635 13636 In this example module1.po and module2.po are portable message objects files. 13637 13638 example% cat module1.po 13639 13640 # default domain "messages" 13641 13642 msgid "msg 1" 13643 13644 msgstr "msg 1 translation" 13645 13646 # 13647 13648 domain "help_domain" 13649 13650 msgid "help 2" 13651 13652 msgstr "help 2 translation" 13653 13654 # 13655 13656 domain "error_domain" 13657 13658 msgid "error 3" 13659 13660 msgstr "error 3 translation" 13661 13662 example% cat module2.po 13663 13664 # default domain "messages" 13665 13666 msgid "mesg 4" 13667 13668 msgstr "mesg 4 translation" 13669 13670 # 13671 13672 domain "error_domain" 13673 13674 msgid "error 5" 13675 13676 msgstr "error 5 translation" 13677 13678 # 13679 13680 domain "window_domain" 13681 13682 msgid "window 6" 13683 13684 msgstr "window 6 translation" 13685 13686 The following command will produce the output files, messages, help_domain, and 13687 error_domain. 13688 13689 example% msgfmt module1.po 13690 13691 The following command will produce the output files, messages, help_domain, 13692 error_domain, and window_domain. 13693 13694 example% msgfmt module1.po module2.po 13695 13696 The following example will produce the output file hello.mo. 13697 13698 example% msgfmt -o hello.mo module1.po module2.po 13699 13700 newgrp 13701 13702 Name 13703 13704 newgrp -- change group ID 13705 13706 Synopsis 13707 13708 newgrp [-] [group] 13709 13710 Description 13711 13712 newgrp changes the current group ID during a login session. If the optional - 13713 flag is given, the user's environment will be reinitialized as though the user 13714 had logged in, otherwise the current environment, including current working 13715 directory, remains unchanged. 13716 13717 od 13718 13719 Name 13720 13721 od -- dump files in octal and other formats 13722 13723 Description 13724 13725 od is as specified in the Single UNIX Specification but with extensions as 13726 listed below. 13727 13728 Extensions 13729 13730 -w, --width[=BYTES] 13731 13732 outputs BYTES bytes per output line. 13733 13734 --traditional 13735 13736 accepts arguments in pre-POSIX form. 13737 13738 Pre-POSIX Specifications 13739 13740 The LSB supports option intermixtures with the following pre-POSIX 13741 specifications: 13742 13743 -a 13744 13745 is equivalent to -t a, selects named characters. 13746 13747 -f 13748 13749 is equivalent to -t fF, selects floats. 13750 13751 -h 13752 13753 is equivalent to -t x2, selects hexadecimal shorts. 13754 13755 -i 13756 13757 is equivalent to -t d2, selects decimal shorts. 13758 13759 -l 13760 13761 is equivalent to -t d4, selects decimal longs. 13762 13763 passwd 13764 13765 Name 13766 13767 passwd -- change user password 13768 13769 Synopsis 13770 13771 passwd [-x max] [-n min] [-w warn] [-i inact] name 13772 passwd {-l|-u} name 13773 13774 Description 13775 13776 passwd changes passwords for user and group accounts. A normal user may only 13777 change the password for their own account, the super user may change the 13778 password for any account. passwd also changes password expiry dates and 13779 intervals. Applications may not assume the format of prompts and anticipated 13780 input for user interaction, because they are unspecified. 13781 13782 Options 13783 13784 -x max 13785 13786 sets the maximum number of days a password remains valid. 13787 13788 -n min 13789 13790 sets the minimum number of days before a password may be changed. 13791 13792 -w warn 13793 13794 sets the number of days warning the user will receive before their password 13795 will expire. 13796 13797 -i inactive 13798 13799 disables an account after the password has been expired for the given 13800 number of days. 13801 13802 -l 13803 13804 disables an account by changing the password to a value which matches no 13805 possible encrypted value. 13806 13807 -u 13808 13809 re-enables an account by changing the password back to its previous value. 13810 13811 patch 13812 13813 Name 13814 13815 patch -- apply a diff file to an original 13816 13817 Description 13818 13819 patch is as specified in the Single UNIX Specification but with extensions as 13820 listed below. 13821 13822 Extensions 13823 13824 --binary 13825 13826 reads and write all files in binary mode, except for standard output and / 13827 dev/tty. This option has no effect on POSIX-compliant systems. 13828 13829 -u, --unified 13830 13831 interprets the patch file as a unified context diff. 13832 13833 pidof 13834 13835 Name 13836 13837 pidof -- find the process ID of a running program 13838 13839 Synopsis 13840 13841 pidof [-s] [-x] [-o omitpid..] program [program..] 13842 13843 Description 13844 13845 Return the process ID of a process which is running the program named on the 13846 command line.[22] 13847 13848 Options 13849 13850 -s 13851 13852 instructs the program to only return one pid. 13853 13854 -x 13855 13856 causes the program to also return process id's of shells running the named 13857 scripts. 13858 13859 -o 13860 13861 omits processes with specified process id. 13862 13863 remove_initd 13864 13865 Name 13866 13867 remove_initd -- clean up boot script system modifications introduced by 13868 install_initd 13869 13870 Synopsis 13871 13872 /usr/lib/lsb/remove_initd initd_file 13873 13874 Description 13875 13876 remove_initd processes the removal of the modifications made to a 13877 distribution's boot script system by the install_initd program. This cleanup is 13878 performed in the preuninstall script of a package; however, the package manager 13879 is still responsible for removing the /etc/init.d file. See also the Section 13880 called Installation and Removal of init.d Files in Chapter 13. 13881 13882 renice 13883 13884 Name 13885 13886 renice -- alter priority of running processes 13887 13888 Description 13889 13890 renice is as specified in the Single UNIX Specification but with differences as 13891 listed below. 13892 13893 Differences 13894 13895 -n increment 13896 13897 has unspecified behavior. 13898 13899 sed 13900 13901 Name 13902 13903 sed -- stream editor 13904 13905 Description 13906 13907 sed is as specified in the Single UNIX Specification but with differences as 13908 listed below. 13909 13910 LSB Differences 13911 13912 Certain aspects of internationalized regular expressions are optional; see 13913 Internationalization and Regular Expressions>. 13914 13915 sendmail 13916 13917 Name 13918 13919 sendmail -- an electronic mail transport agent 13920 13921 Synopsis 13922 13923 sendmail [flags] [address ...] 13924 13925 Description 13926 13927 To deliver electronic mail (email), applications shall support the interface 13928 provided by /usr/sbin/sendmail (described here). This interface shall be the 13929 default delivery method for applications. 13930 13931 This program sends an email message to one or more recipients, routing the 13932 message as necessary. This program is not intended as a user interface routine. 13933 13934 With no flags, sendmail reads its standard input up to an end-of-file or a line 13935 consisting only of a single dot and sends a copy of the message found there to 13936 all of the addresses listed. It determines the network(s) to use based on the 13937 syntax and contents of the addresses. 13938 13939 It is recommended that applications use as few flags as necessary, none if 13940 possible. 13941 13942 Some agents allow aliasing on the local system to be prevented by preceding the 13943 address with a backslash. 13944 13945 The format of messages shall be as defined in RFC 2822. 13946 13947 Options 13948 13949 -bm 13950 13951 reads mail from standard input and delivers to the recipient addresses. 13952 This is the default mode of operation. 13953 13954 -bp 13955 13956 lists information about messages currently in the input mail queue. 13957 13958 -bs 13959 13960 uses the SMTP protocol as described in RFC 2821; reads SMTP commands on 13961 standard input and writes SMTP responses on standard output. 13962 13963 Note that RFC 2821 specifies \r\n (CR-LF) be used at the end of each line, 13964 but pipes almost always use \n (LF) instead. To deal with this, agents will 13965 accept both \r\n and \n at the end of each line. When accepting \r\n, the \ 13966 r before the \n is silently discarded. 13967 13968 -F fullname 13969 13970 explicitly sets the full name of the sender for incoming mail unless the 13971 message already contains a From: message header. 13972 13973 If the user running sendmail is not sufficiently trusted, then the actual 13974 sender may be indicated in the message, depending on the behavior of the 13975 agent. 13976 13977 -f name 13978 13979 explicitly sets the envelope sender address for incoming mail. If there is 13980 no From: header, the address specified in the From: header will also be 13981 set. 13982 13983 If the user running sendmail is not sufficiently trusted, then the actual 13984 sender will be indicated in the message. 13985 13986 -i 13987 13988 ignores dots alone on lines by themselves in incoming messages. If -bs is 13989 also used, the behavior is unspecified. 13990 13991 -odb 13992 13993 delivers any mail in background, if supported; otherwise ignored. 13994 13995 -odf 13996 13997 delivers any mail in foreground, if supported; otherwise ignored. 13998 13999 -oem or -em 14000 14001 mails errors back to the sender. (default) 14002 14003 -oep or -ep 14004 14005 writes errors to the standard error output. 14006 14007 -oeq or -eq 14008 14009 does not send notification of errors to the sender. This only works for 14010 mail delivered locally. 14011 14012 -oi 14013 14014 is equivalent to -i. 14015 14016 -om 14017 14018 indicates that the sender of a message should receive a copy of the message 14019 if the sender appears in an alias expansion. Ignored if aliases are not 14020 supported. 14021 14022 -t 14023 14024 reads the message to obtain recipients from the To:, Cc:, and Bcc: headers 14025 in the message instead of from the command arguments. If a Bcc: header is 14026 present, it is removed from the message unless there is no To: or Cc: 14027 header, in which case a Bcc: header with no data is created, in accordance 14028 with RFC 2822. 14029 14030 If there are any arguments, they specify addresses to which the message is 14031 not to be delivered. That is, the argument addresses are removed from the 14032 recipients list obtained from the headers. Note: some agents implement this 14033 behavior in reverse, adding addresses instead of removing them. Others may 14034 disallow addresses in argument list. Therefore, applications should not put 14035 addresses in the argument list if -t is used. 14036 14037 This option is sometimes ignored when not in -bm mode (the default). 14038 14039 Exit status 14040 14041 0 14042 14043 successful completion on all addresses. This does not indicate successful 14044 delivery. 14045 14046 >0 14047 14048 there was an error. 14049 14050 Notes/Rationale 14051 14052 This page is believed to reflect functionality provided by smail, exim and 14053 other implementations, not just the sendmail implementation. 14054 14055 shutdown 14056 14057 Name 14058 14059 shutdown -- bring the system down 14060 14061 Synopsis 14062 14063 /sbin/shutdown [-t sec] [-arkhcfF] time [warning-message] 14064 14065 Description 14066 14067 shutdown brings the system down in a secure way. All logged-in users are 14068 notified that the system is going down, and login(1) is blocked. It is possible 14069 to shut the system down immediately or after a specified delay. All processes 14070 are first notified that the system is going down by the signal SIGTERM. If 14071 neither the -h or the -r argument is used, then the default behavior is to take 14072 the system to runlevel one where administrative tasks can be run. 14073 14074 Standard Options 14075 14076 -a 14077 14078 uses /etc/shutdown.allow. 14079 14080 -t sec 14081 14082 tells init(8) to wait sec seconds between sending processes the warning and 14083 the kill signal, before changing to another runlevel. 14084 14085 -k 14086 14087 doesn't really shutdown; only sends the warning messages to everybody. 14088 14089 -r 14090 14091 reboots after shutdown. 14092 14093 -h 14094 14095 halts after shutdown. Powering off after halting is unspecified. 14096 14097 -f 14098 14099 skips fsck on reboot. 14100 14101 -F 14102 14103 forces fsck on reboot. 14104 14105 -c 14106 14107 cancels an already running shutdown. With this option, it is of course not 14108 possible to give the time argument, but you can enter a explanatory message 14109 on the command line that will be sent to all users. 14110 14111 time 14112 14113 specifies when to shut down. 14114 14115 The time argument can have different formats. First, it can be an absolute 14116 time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm is 14117 the minute of the hour (in two digits). Second, it can be in the format +m, 14118 in which m is the number of minutes to wait. The word now is an alias for 14119 +0. 14120 14121 If shutdown is called with a delay, it creates the advisory file /etc/ 14122 nologin which causes programs such as login(1) to not allow new user 14123 logins. shutdown only removes this file if it is stopped before it can 14124 signal init (i.e. it is cancelled or something goes wrong). Otherwise it is 14125 the responsibility of the system shutdown or startup scripts to remove this 14126 file so that users can login. 14127 14128 warning-message 14129 14130 specifies message to send all users. 14131 14132 su 14133 14134 Name 14135 14136 su -- change user ID or become super-user 14137 14138 Synopsis 14139 14140 su [OPTS] [-] [username [ARGS]] 14141 14142 Description 14143 14144 su is used to become another user during a login session. Invoked without a 14145 username, su defaults to becoming the super user. The optional argument - may 14146 be used to provide an environment similar to what the user would expect had the 14147 user logged in directly. 14148 14149 The user will be prompted for a password, if appropriate. Invalid passwords 14150 will produce an error message. All attempts, both valid and invalid, are logged 14151 to detect abuses of the system. Applications may not assume the format of 14152 prompts and anticipated input for user interaction, because they are 14153 unspecified. 14154 14155 An optional command can be executed. This is done by the shell specified in / 14156 etc/passwd for the target user unless the -s or -m options are used. Any 14157 arguments supplied after the username will be passed to the invoked shell 14158 (shell shall support the -c command line option in order for a command to be 14159 passed to it). 14160 14161 The current environment is passed to the new shell. The value of $PATH is reset 14162 to /bin:/usr/bin for normal users, or /sbin:/bin:/usr/sbin:/usr/bin for the 14163 super user. This may be changed with the ENV_PATH and ENV_SUPATH definitions in 14164 /etc/login.defs. When using the -m or -p options, the user's environment is not 14165 changed. 14166 14167 A subsystem login is indicated by the presense of a "*" as the first character 14168 of the login shell. The given home directory will be used as the root of a new 14169 filesystem which the user is actually logged into. 14170 14171 Standard Options 14172 14173 - 14174 14175 makes this a login shell. 14176 14177 -c, --comand=command 14178 14179 passes command to the invoked shell. It is passed directly to the invoked 14180 shell (using the shell's -c option), so its syntax is whatever that shell 14181 can accept. 14182 14183 -m, -p, --preserve-environment 14184 14185 does not reset environment variables, and keeps the same shell if it is 14186 present in /etc/shells. 14187 14188 -s, --shell=shell 14189 14190 uses shell instead of the default in /etc/passwd. The shell specified shall 14191 be present in /etc/shells. 14192 14193 sync 14194 14195 Name 14196 14197 sync -- flush filesystem buffers 14198 14199 Synopsis 14200 14201 sync 14202 14203 Description 14204 14205 Force changed blocks to disk, update the super block. 14206 14207 tar 14208 14209 Name 14210 14211 tar -- file archiver 14212 14213 Description 14214 14215 tar is as specified in the Single UNIX Specification, Version 2, but with 14216 differences as listed below. 14217 14218 Differences 14219 14220 Certain aspects of internationalized filename globbing are optional; see 14221 Internationalization and Filename Globbing>. 14222 14223 -h 14224 14225 doesn't dump symlinks; dumps the files they point to. 14226 14227 -z 14228 14229 filters the archive through gzip. 14230 14231 umount 14232 14233 Name 14234 14235 umount -- unmount file systems 14236 14237 Synopsis 14238 14239 umount [-hV] 14240 umount -a [-nrv] [-t vfstype] 14241 umount [-nrv] device | dir [...] 14242 14243 Description 14244 14245 umount detaches the file system(s) mentioned from the file hierarchy. A file 14246 system is specified by giving the directory where it has been mounted. 14247 14248 Standard Options 14249 14250 -v 14251 14252 invokes verbose mode. 14253 14254 -n 14255 14256 unmounts without writing in /etc/mtab. 14257 14258 -r 14259 14260 tries to remount read-only if unmounting fails. 14261 14262 -a 14263 14264 unmounts all of the file systems described in /etc/mtab except for the proc 14265 filesystem. 14266 14267 -t vfstype 14268 14269 indicates that the actions should only be taken on file systems of the 14270 specified type. More than one type may be specified in a comma separated 14271 list. The list of file system types can be prefixed with no to specify the 14272 file system types on which no action should be taken. 14273 14274 -f 14275 14276 forces unmount (in case of an unreachable NFS system). 14277 14278 LSB Deprecated Options 14279 14280 The behaviors specified in this section are expected to disappear from a future 14281 version of the LSB; applications should only use the non-LSB-deprecated 14282 behaviors. 14283 14284 -V 14285 14286 print version and exits. 14287 14288 useradd 14289 14290 Name 14291 14292 useradd -- create a new user or update default new user information 14293 14294 Synopsis 14295 14296 useradd [-c comment] [-d home_dir] 14297 [-g initial_group] [-G group[,...]] 14298 [-m [-k skeleton_dir]] [-p passwd] [-r] 14299 [-s shell] [-u uid [ -o]] login 14300 14301 useradd -D [-g default_group] [-b default_home] 14302 [-s default_shell] 14303 14304 Description 14305 14306 When invoked without the -D option, useradd creates a new user account using 14307 the values specified on the command line and the default values from the 14308 system. The new user account will be entered into the system files as needed, 14309 the home directory will be created, and initial files copied, depending on the 14310 command line options. 14311 14312 When invoked with the -D option, useradd will either display the current 14313 default values, or update the default values from the command line. If no 14314 options are specified, useradd displays the current default values. 14315 14316 Standard Options 14317 14318 -c comment 14319 14320 specifies the new user's password file comment field value. 14321 14322 -d home_dir 14323 14324 creates the new user using home_dir as the value for the user's login 14325 directory. The default is to append the login name to default_home and use 14326 that as the login directory name. 14327 14328 -g initial_group 14329 14330 specifies the group name or number of the user's initial login group. The 14331 group name shall exist. A group number shall refer to an already existing 14332 group. If -g is not specified, the implementation will follow the normal 14333 user default for that system. This may create a new group or choose a 14334 default group that normal users are placed in. Applications which require 14335 control of the groups into which a user is placed should specify -g. 14336 14337 -G group,[...] 14338 14339 specifies a list of supplementary groups which the user is also a member 14340 of. Each group is separated from the next by a comma, with no intervening 14341 whitespace. The groups are subject to the same restrictions as the group 14342 given with the -g option. The default is for the user to belong only to the 14343 initial group. 14344 14345 -m [-k skeleton_dir] 14346 14347 specifies the user's home directory will be created if it does not exist. 14348 The files contained in skeleton_dir will be copied to the home directory if 14349 the -k option is used, otherwise the files contained in /etc/skel will be 14350 used instead. Any directories contained in skeleton_dir or /etc/skel will 14351 be created in the user's home directory as well. The -k option is only 14352 valid in conjunction with the -m option. The default is to not create the 14353 directory and to not copy any files. 14354 14355 -p passwd 14356 14357 is the encrypted password, as returned by crypt(3). The default is to 14358 disable the account. 14359 14360 -r 14361 14362 creates a system account, that is, a user with a UID in the range reserved 14363 for system account users. If there is not a UID free in the reserved range 14364 the command will fail. 14365 14366 -s shell 14367 14368 specifies the name of the user's login shell. The default is to leave this 14369 field blank, which causes the system to select the default login shell. 14370 14371 -u uid [-o] 14372 14373 specifies the numerical value of the user's ID. This value shall be unique, 14374 unless the -o option is used. The value shall be non-negative. The default 14375 is the smallest ID value greater than 499 which is not yet used. 14376 14377 Change Default Options 14378 14379 -b default_home 14380 14381 specifies the initial path prefix for a new user's home directory. The 14382 user's name will be affixed to the end of default_home to create the new 14383 directory name if the -d option is not used when creating a new account. 14384 14385 -g default_group 14386 14387 specifies the group name or ID for a new user's initial group. The named 14388 group shall exist, and a numerical group ID shall have an existing entry. 14389 14390 -s default_shell 14391 14392 specifies the name of the new user's login shell. The named program will be 14393 used for all future new user accounts. 14394 14395 -c comment 14396 14397 specifies the new user's password file comment field value. 14398 14399 Application Usage 14400 14401 The -D option will typically be used by system administration packages. Most 14402 applications should not change defaults which will affect other applications 14403 and users. 14404 14405 userdel 14406 14407 Name 14408 14409 userdel -- delete a user account and related files 14410 14411 Synopsis 14412 14413 userdel [-r] login 14414 14415 Description 14416 14417 Delete the user account named login. If there is also a group named login, this 14418 command may delete the group as well, or may leave it alone. 14419 14420 Options 14421 14422 -r 14423 14424 removes files in the user's home directory along with the home directory 14425 itself. Files located in other file system will have to be searched for and 14426 deleted manually. 14427 14428 usermod 14429 14430 Name 14431 14432 usermod -- modify a user account 14433 14434 Synopsis 14435 14436 usermod [-c comment] [-d home_dir [ -m]] 14437 [-g initial_group] [-G group[,...]] 14438 [-l login_name] [-p passwd] 14439 [-s shell] [-u uid [ -o]] login 14440 14441 Options 14442 14443 -c comment 14444 14445 specifies the new value of the user's password file comment field. 14446 14447 -d home_dir 14448 14449 specifies the user's new login directory. If the -m option is given the 14450 contents of the current home directory will be moved to the new home 14451 directory, which is created if it does not already exist. 14452 14453 -g initial_group 14454 14455 specifies the group name or number of the user's new initial login group. 14456 The group name shall exist. A group number shall refer to an already 14457 existing group. 14458 14459 -G group,[...] 14460 14461 specifies a list of supplementary groups which the user is also a member 14462 of. Each group is separated from the next by a comma, with no intervening 14463 whitespace. The groups are subject to the same restrictions as the group 14464 given with the -g option. If the user is currently a member of a group 14465 which is not listed, the user will be removed from the group. 14466 14467 -l login_name 14468 14469 changes the name of the user from login to login_name. Nothing else is 14470 changed. In particular, the user's home directory name should probably be 14471 changed to reflect the new login name. 14472 14473 -p passwd 14474 14475 is the encrypted password, as returned by crypt(3). 14476 14477 -s shell 14478 14479 specifies the name of the user's new login shell. Setting this field to 14480 blank causes the system to select the default login shell. 14481 14482 -u uid [-o] 14483 14484 specifies the numerical value of the user's ID. This value shall be unique, 14485 unless the -o option is used. The value shall be non-negative. Any files 14486 which the user owns and which are located in the directory tree rooted at 14487 the user's home directory will have the file user ID changed automatically. 14488 Files outside of the user's home directory shall be altered manually. 14489 14490 xargs 14491 14492 Name 14493 14494 xargs -- build and execute command lines from standard input 14495 14496 Description 14497 14498 xargs is as specified in the Single UNIX Specification but with differences as 14499 listed below. 14500 14501 Differences 14502 14503 -E 14504 14505 has unspecified behavior. 14506 14507 -I 14508 14509 has unspecified behavior. 14510 14511 -L 14512 14513 has unspecified behavior. 14514 14515 V. Execution Environment 14516 14517 Table of Contents 14518 9. File System Hierarchy 14519 10. Additional Recommendations 14520 11. Additional Behaviors 14521 12. Localization 14522 14523 ------------------------------------------------------------------------------- 14524 14525 Chapter 9. File System Hierarchy 14526 14527 An LSB conforming implementation shall adhere to the Filesystem Hierarchy 14528 Standard (FHS) 2.3 14529 14530 An LSB conforming application shall follow the FHS. 14531 14532 The FHS allows many components or subsystems to be optional. An application 14533 shall check for the existence of an optional component before using it, and 14534 should behave in a reasonable manner if the optional component is not present. 14535 14536 The FHS requirement to locate the operating system kernel in either / or /boot 14537 does not apply if the operating system kernel does not exist as a file in the 14538 filesystem. 14539 14540 The FHS specifies certain behaviors for a variety of commands if they are 14541 present (for example, ping or python). However, LSB applications shall not rely 14542 on any commands beyond those specified by the LSB. The mere existence of a 14543 command may not be used as an indication that the command behaves in any 14544 particular way. 14545 14546 The following directories or links need not be present: /etc/X11 /usr/bin/X11 / 14547 usr/lib/X11 /proc 14548 14549 ------------------------------------------------------------------------------- 14550 14551 /dev 14552 14553 The following shall exist under /dev. Other devices may also exist in /dev. 14554 Device names may exist as symbolic links to other device nodes located in /dev 14555 or subdirectories of /dev. There is no requirement concerning major/minor 14556 number values. 14557 14558 /dev/null 14559 14560 An infinite data source and data sink. Data written to this device shall be 14561 discarded. Reads from this device shall always return end-of-file (EOF). 14562 14563 /dev/zero 14564 14565 This device is a source of zeroed out data. All data written to this device 14566 shall be discarded. A read from this device shall always return the 14567 requested number of bytes, each initialized to the value '\0'. 14568 14569 /dev/tty 14570 14571 In each process, a synonym for the controlling terminal associated with the 14572 process group of that process, if any. All reads and writes to this device 14573 shall behave as if the actual controlling terminal device had been opened. 14574 14575 ------------------------------------------------------------------------------- 14576 14577 Chapter 10. Additional Recommendations 14578 14579 Minimal granted Directory and File permissions 14580 14581 In this Chapter "System" means an "LSB conforming implementation" and 14582 "application" means an "LSB conforming (third party vendor) application". 14583 14584 The system shall grant to the application read and execute permissions needed 14585 to use all system interfaces (ABIs) mentioned in the LSB document and included 14586 standards. 14587 14588 ------------------------------------------------------------------------------- 14589 14590 Recommendations for applications on ownership and permissions 14591 14592 Directory Write Permissions 14593 14594 The application should not depend on having directory write permission outside 14595 /tmp, /var/tmp, invoking user's home directory and /var/opt/package, (where 14596 package is the name of the application package). 14597 14598 The application should not depend on owning these directories. 14599 14600 For these directories the application should be able to work with directory 14601 write permissions restricted by the "sticky bit". (Which prevents the 14602 application from removing files owned by another user. This is classically done 14603 with /tmp, to prevent accidental deletion of "foreign" files.) 14604 14605 ------------------------------------------------------------------------------- 14606 14607 File Write Permissions 14608 14609 The application should not depend on file write permission on files not owned 14610 by the user it runs under with the exception of its personal inbox /var/mail/ 14611 username 14612 14613 ------------------------------------------------------------------------------- 14614 14615 File Read and execute Permissions 14616 14617 The application should not depend on having read permission to every file and 14618 directory. 14619 14620 ------------------------------------------------------------------------------- 14621 14622 Suid and Sgid Permissions 14623 14624 The application should not depend on the suid/sgid permissions of a file not 14625 packaged with the application. Instead, the distribution is responsible for 14626 assuming that all system commands have the required permissions and work 14627 correctly. 14628 14629 Rationale: Let us make security officers happy. Let's give them the freedom to 14630 take sgid/suid perms away, as long as they do not break the system's 14631 functionality. 14632 14633 ------------------------------------------------------------------------------- 14634 14635 Privileged users 14636 14637 "Normal" applications should not depend on running as a privileged user. 14638 14639 Special applications that have a reason to run under a privileged user, should 14640 outline these reasons clearly in their documentation, if they are not obvious 14641 as in the case of a backup/restore program. Users of the application should be 14642 informed, that "this application demands security privileges, which could 14643 interfere with system security". 14644 14645 The application should not contain binary-only software that requires being run 14646 as root, as this makes security auditing harder or even impossible. 14647 14648 ------------------------------------------------------------------------------- 14649 14650 Changing permissions 14651 14652 The application should not change permissions of files and directories that do 14653 not belong to its own package. To do so without a warning notice in the 14654 documentation is regarded as unfriendly act. 14655 14656 ------------------------------------------------------------------------------- 14657 14658 Removable Media (Cdrom, Floppy, etc.) 14659 14660 Applications that expect to be runnable from removable media should not depend 14661 on logging in as a privileged user, and should be prepared to deal with a 14662 restrictive environment. Examples of such restrictions could be default mount 14663 options that disable set-user/group-ID attributes, disabling block or 14664 character-special files on the medium, or remapping the user/group IDs of files 14665 away from 0. [23] 14666 14667 ------------------------------------------------------------------------------- 14668 14669 Installable applications 14670 14671 If the installation of an application requires the execution of programs with 14672 superuser privileges, such programs should also be supplied in a human-readable 14673 form. 14674 14675 Without this, the local system administrator would have to blindly trust a 14676 piece of software, particularly with respect to its security. 14677 14678 ------------------------------------------------------------------------------- 14679 14680 Chapter 11. Additional Behaviors 14681 14682 Mandatory Optional Behaviors 14683 14684 This section specifies behaviors in which there is optional behavior in one of 14685 the standards on which the LSB relies, and where the LSB requires a specific 14686 behavior. [24] 14687 14688 LSB conforming implementations shall support the following options defined 14689 within the ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single 14690 UNIX Specification(SUS) V3: 14691 14692 _POSIX_FSYNC 14693 _POSIX_MAPPED_FILES 14694 _POSIX_MEMLOCK 14695 _POSIX_MEMLOCK_RANGE 14696 _POSIX_MEMORY_PROTECTION 14697 _POSIX_PRIORITY_SCHEDULING 14698 _POSIX_REALTIME_SIGNALS 14699 _POSIX_THREAD_ATTR_STACKADDR 14700 _POSIX_THREAD_ATTR_STACKSIZE 14701 _POSIX_THREAD_PROCESS_SHARED 14702 _POSIX_THREAD_SAFE_FUNCTIONS 14703 _POSIX_THREADS 14704 _XOPEN_UNIX 14705 14706 The opendir() function shall consume a file descriptor in the same fashion as 14707 open, and therefore may fail with EMFILE or ENFILE. 14708 14709 The START and STOP termios characters shall be changeable, as described as 14710 optional behavior in the "General Terminal Interface" section of the ISO/IEC 14711 9945:2003 Portable Operating System(POSIX)and The Single UNIX Specification 14712 (SUS) V3. 14713 14714 The access() function function shall fail with errno set to EINVAL if the amode 14715 argument contains bits other than those set by the bitwise inclusive OR of 14716 R_OK, W_OK, X_OK and F_OK. 14717 14718 The link() function shall require access to the existing file in order to 14719 succeed, as described as optional behavior in the ISO/IEC 9945:2003 Portable 14720 Operating System(POSIX)and The Single UNIX Specification(SUS) V3. 14721 14722 Calling unlink() on a directory shall fail. Calling link() specifying a 14723 directory as the first argument shall fail. See also unlink. [25] 14724 14725 ------------------------------------------------------------------------------- 14726 14727 Special Requirements 14728 14729 LSB conforming systems shall enforce certain special additional restrictions 14730 above and beyond those required by ISO/IEC 9945:2003 Portable Operating System 14731 (POSIX)and The Single UNIX Specification(SUS) V3. [26] 14732 14733 The fcntl() function shall treat the "cmd" value -1 as invalid. 14734 14735 The "whence" value -1 shall be an invalid value for the lseek(), fseek() and 14736 fcntl() functions. 14737 14738 The value "-5" shall be an invalid signal number. 14739 14740 If the sigaddset() or sigdelset() functions are passed an invalid signal 14741 number, they shall return with EINVAL. Implementations are only required to 14742 enforce this requirement for signal numbers which are specified to be invalid 14743 by this specification (such as the -5 mentioned above). 14744 14745 The mode value "-1" to the access() function shall be treated as invalid. 14746 14747 A value of -1 shall be an invalid "_PC_..." value for pathconf(). 14748 14749 A value of -1 shall be an invalid "_SC..." value for sysconf(). 14750 14751 The nl_item value "-1" shall be invalid for nl_langinfo. 14752 14753 The value -1 shall be an invalid "_CS_..." value for confstr(). 14754 14755 The value "z" shall be an invalid mode argument to popen(). 14756 14757 ------------------------------------------------------------------------------- 14758 14759 Chapter 12. Localization 14760 14761 Applications may either install a message catalog in the MO format as specified 14762 by the info page in version 0.10.40 of the gettext source package, or the 14763 application may execute the msgfmt command during it's installation to compile 14764 the message catalog. In either case, the resulting output shall be located in 14765 the package's private area under /opt, and the application may use 14766 bindtextdomain() to specify this location. 14767 14768 Implementations shall support the POSIX and C locales as specified in the 14769 Single UNIX Specification. 14770 14771 ------------------------------------------------------------------------------- 14772 14773 Regular Expressions 14774 14775 Utilities that process regular expressions shall support Basic Regular 14776 Expressions and Extended Regular Expressions as specified in the Single UNIX 14777 Specification, with the following exceptions: 14778 14779 Range expression (such as [a-z]) can be based on code point order instead of 14780 collating element order. 14781 14782 Equivalence class expression (such as [=a=]) and multi-character collating 14783 element expression (such as [.ch.]) are optional. 14784 14785 Handling of a multi-character collating element is optional. 14786 14787 This affects at least the following utilities: grep (grep>) (including egrep), 14788 sed (sed>), and awk (awk>). 14789 14790 ------------------------------------------------------------------------------- 14791 14792 Filename Globbing 14793 14794 Utilities that perform filename globbing (also known as Pattern Matching 14795 Notation) shall do it as specified in the Single UNIX Specification, with the 14796 following exceptions: 14797 14798 Range expression (such as [a-z]) can be based on code point order instead of 14799 collating element order. 14800 14801 Equivalence class expression (such as [=a=]) and multi-character collating 14802 element expression (such as [.ch.]) are optional. 14803 14804 Handling of a multi-character collating element is optional. 14805 14806 This affects at least the following utilities: cpio (cpio>), find (find>), ls ( 14807 ls>) and tar (tar>). 14808 14809 VI. System Initialization 14810 14811 Table of Contents 14812 13. System Initialization 14813 14814 ------------------------------------------------------------------------------- 14815 14816 Chapter 13. System Initialization 14817 14818 Cron Jobs 14819 14820 Packages may not touch the configuration file /etc/crontab, nor may they modify 14821 the files in /var/spool/cron/crontabs. 14822 14823 If a package wants to install a job that has to be executed via cron, it shall 14824 place a file in one of the following directories: 14825 14826 /etc/cron.daily 14827 /etc/cron.weekly 14828 /etc/cron.monthly 14829 14830 As these directory names say, the files within them are executed on a daily, 14831 weekly, or monthly basis, respectively. See below for the rules concerning the 14832 names of these files. 14833 14834 If a certain job has to be executed more frequently than daily, the package 14835 shall install a file /etc/cron.d/cron-name tagged as configuration file. This 14836 file uses the same syntax as /etc/crontab and is processed by cron 14837 automatically. 14838 14839 It is recommended that files installed in any of these directories be scripts 14840 (shell scripts, Perl scripts, etc.) so that they may be modified by the local 14841 system administrator. In addition, they shall be registered as configuration 14842 file. 14843 14844 The scripts in these directories have to check, if all necessary programs are 14845 installed before they try to execute them. Otherwise, problems will arise when 14846 a package was removed (but not purged), since the configuration files are kept 14847 on the system in this situation. 14848 14849 To avoid namespace conflicts in the /etc/cron.* directories, the filenames used 14850 by LSB-compliant packages in /etc/cron.daily, /etc/cron.weekly, /etc/ 14851 cron.monthly, or /etc/cron.d shall come from a managed namespace. These 14852 filenames may be assigned using one of the following methods: 14853 14854 * Assigned namespace. This namespace consists of names which only use the 14855 character set [a-z0-9]. In order to avoid conflicts these cron script names 14856 shall be reserved through the Linux Assigned Names and Numbers Authority 14857 (LANANA). Information about the LANANA may be found at www.lanana.org. 14858 14859 Commonly used names shall be reserved in advance; developers for projects 14860 should be encouraged reserve names from LANA, so that each distribution can 14861 use the same name, and to avoid conflicts with other projects. 14862 14863 * Hierarchical namespace. This namespace consists of scripts names which look 14864 like this: [hier1]-[hier2]-...-[name], where name is again taken the 14865 character set [a-z0-9], and where there may be one or more [hier-n] 14866 components. [hier1] may either be an LSB provider name assigned by the 14867 LANANA, or it may be owners' DNS name in lower case, with at least one '.'. 14868 I.e., "debian.org", "staroffice.sun.com", etc. The LSB provider name 14869 assigned by LANANA shall only consist of the ASCII characters [a-z0-9]. 14870 14871 * Reserved namespace. This namespace consists of script names which begin 14872 with the character '_', and is reserved for distribution use only. This 14873 namespace should be used for core packages only, and in general use of this 14874 namespace is highly discouraged. 14875 14876 ------------------------------------------------------------------------------- 14877 14878 Init Script Actions 14879 14880 Init files provided by LSB applications shall accept one argument, saying what 14881 to do: 14882 14883 start start the service 14884 stop stop the service 14885 restart stop and restart the service if the service is already running, 14886 otherwise start the service 14887 try-restart restart the service if the service is already running 14888 reload cause the configuration of the service to be reloaded without 14889 actually stopping and restarting the service 14890 force-reload cause the configuration to be reloaded if the service supports 14891 this, otherwise restart the service if it is running 14892 status print the current status of the service 14893 14894 The start, stop, restart, force-reload, and status commands shall be supported 14895 by all init files; the reload and the try-restart options are optional. Other 14896 init script actions may be defined by the init script. 14897 14898 Init files shall ensure that they will behave sensibly if invoked with start 14899 when the service is already running, or with stop when it isn't, and that they 14900 don't kill unfortunately-named user processes. The best way to achieve this is 14901 to use the init-script functions provided by /lib/lsb/init-functions. 14902 14903 If a service reloads its configuration automatically (as in the case of cron, 14904 for example), the reload option of the init file shall behave as if the 14905 configuration has been reloaded successfully. The restart, try-restart, reload 14906 and force-reload action may be atomic; i.e. if a service is known not be 14907 operational after a restart or reload, the script may return an error without 14908 any further action. 14909 14910 These executable files shall not fail obscurely when the configuration files 14911 remain but the package has been removed, as the default in [the packaging 14912 system] is to leave configuration files on the system after the package has 14913 been removed. Only when it is executed with the [purge] option will [the 14914 packaging system] remove configuration files. Therefore, you should include a 14915 test statement at the top of the file, like this: 14916 14917 test -f program-executed-later-in-file || exit 5 14918 14919 or take the equivalent action if the init file is not a shell script. 14920 14921 If the status command is given, the init script will return the following exit 14922 status codes. 14923 14924 0 program is running or service is OK 14925 1 program is dead and /var/run pid file exists 14926 2 program is dead and /var/lock lock file exists 14927 3 program is not running 14928 4 program or service status is unknown 14929 5-99 reserved for future LSB use 14930 100-149 reserved for distribution use 14931 150-199 reserved for application use 14932 200-254 reserved 14933 14934 In the case of init script commands other than "status" (i.e., "start", "stop", 14935 "restart", "try-restart", "reload", and "force-reload"), the init script shall 14936 return an exit status of zero if the action described by the argument has been 14937 successful. Otherwise, the exit status shall be non-zero, as defined below. In 14938 addition to straightforward success, the following situations are also to be 14939 considered successful: 14940 14941 * restarting a service (instead of reloading it) with the "force-reload" 14942 argument 14943 14944 * running "start" on a service already running 14945 14946 * running "stop" on a service already stopped or not running 14947 14948 * running "restart" on a service already stopped or not running 14949 14950 * running "try-restart" on a service already stopped or not running 14951 14952 14953 14954 In case of an error, while processing any init script action except for 14955 "status", the init script shall print an error message and return one of the 14956 following non-zero exit status codes. 14957 14958 1 generic or unspecified error (current practice) 14959 2 invalid or excess argument(s) 14960 3 unimplemented feature (for example, "reload") 14961 4 user had insufficient privilege 14962 5 program is not installed 14963 6 program is not configured 14964 7 program is not running 14965 8-99 reserved for future LSB use 14966 100-149 reserved for distribution use 14967 150-199 reserved for application use 14968 200-254 reserved 14969 14970 Error and status messages should be printed with the logging functions such as 14971 log_failure_msg and so on. Scripts may write to standard error or standard 14972 output, but implementations need not present text written to standard error/ 14973 output to the user or do anything else with it. 14974 14975 Since init files may be run manually by a system administrator with 14976 non-standard environment variable values for PATH, USER, LOGNAME, etc. init 14977 files shall not depend on the values of these environment variables. They 14978 should set them to some known/default values if they are needed. 14979 14980 ------------------------------------------------------------------------------- 14981 14982 Comment Conventions for Init Scripts 14983 14984 LSB applications which need to execute script(s) at bootup and/or shutdown may 14985 provide one or more init.d files. These files are installed by the 14986 install_initd program described below, which copies it into a standard 14987 directory and makes whatever other adjustments (creation of symlinks, creation 14988 of entries in a database, etc.) are necessary so that the script can be run at 14989 boot-time. [27] 14990 14991 In the init.d file, information about the shell script shall be delimited by 14992 the lines "### BEGIN INIT INFO" and "### END INIT INFO". These delimiter lines 14993 may containg trailing whitespace, which shall be ignored. Inside this block 14994 there shall be lines of the form "# {keyword}: [arg1] [arg2] ...". (All lines 14995 inside this block start with a hash ('#') character in the first column, so 14996 that shell treats them as comments.) There shall be exactly one space character 14997 between "#" and the keyword.[28] The following keywords, with their arguments 14998 are defined in this specification: 14999 15000 # Provides: boot_facility_1 [ boot_facility_2 ...] 15001 # Required-Start: boot_facility_1 [ boot_facility_2 ...] 15002 # Required-Stop: boot_facility_1 [ boot_facility_2 ...] 15003 # Should-Start: boot_facility_1 [ boot_facility_2 ...] 15004 # Should-Stop: boot_facility_1 [ boot_facility_2 ...] 15005 # Default-Start: run_level_1 [ run_level_2 ...] 15006 # Default-Stop: run_level_1 [ run_level_2 ...] 15007 # Short-Description: short_description 15008 # Description: multiline_description 15009 15010 Additional keywords may be defined in future LSB specifications. Distributions 15011 may define local extensions by using the prefix "X-[distribution name]" --- for 15012 example, "X-RedHat-foobardecl", or "X-Debian-xyzzydecl". 15013 15014 An init.d shell script may declare using the "Required-Start: " header that it 15015 shall not be run until certain boot facilities are provided. This information 15016 is used by the installation tool or the boot-time boot-script execution 15017 facility to assure that init scripts are run in the correct order. When an init 15018 script is run with a "start" argument, the boot facility or facilities 15019 specified in the "Provides" header shall be considered present, and hence init 15020 scripts which require those boot facilities would then be eligble to be run. 15021 When an init script is run with a "stop" argument, the boot facilities 15022 specified in the "Provides" header are considered no longer present. There are 15023 naming conventions for boot facilities and system facilities, as described in a 15024 following section. 15025 15026 Similarly, the "Required-Stop:" header defines which facilities shall still be 15027 available during the shutdown of that service. Hence, the init script system 15028 should avoid stopping shell scripts which provide those facilities until this 15029 shell script is stopped. 15030 15031 The "Should-Start:" header defines which facilities if present should be 15032 started before this service. This allows for weak dependencies which do not 15033 cause the service to fail if a facility is not available. But may cause reduced 15034 functionality of the service. Compliant applications should not rely on the 15035 existence of this feature. 15036 15037 The "Should-Stop:" header defines which facilities should be still available 15038 during the shutdown of that service. 15039 15040 The "Default-Start" and "Default-Stop" headers define which run levels should 15041 by default run the script with a start or stop argument, respectively, to start 15042 or stop the services controlled by the init script. [29] 15043 15044 The "Short-Description" and "Description" header fields are used to provide 15045 text which describes the actions of the init script. The "short_description" 15046 shall be a relatively short, pithy description of the init script, where as the 15047 "multiline_description" can be a much longer piece of text that may span 15048 mulitple lines. In a multiline description, each continuation line shall begin 15049 with a '#' followed by tab character or a '#' followed by at least two space 15050 characters. The multiline description is terminated by the first line that does 15051 not match this criteria. 15052 15053 The comment conventions described in this session are only required for use by 15054 LSB-compliant applications; system init scripts as provided by LSB-compliant 15055 run-time environments are not required to use the scheme outlined here. 15056 15057 ------------------------------------------------------------------------------- 15058 15059 Installation and Removal of init.d Files 15060 15061 An init.d file is installed in /etc/init.d (which may be a symlink to another 15062 location). This can be done by the package installer. See Script Names>. During 15063 the package's postinstall script, the program "/usr/lib/lsb/install_initd" 15064 configures the distribution's boot script system to call the package's init.d 15065 file at the appropriate time. [30] 15066 15067 The install_initd program takes a single argument, the pathname to the /etc/ 15068 init.d file. For example: 15069 15070 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 15071 15072 The install_initd program shall return an exit status of zero if the init.d 15073 file has been successfully installed or if the the init.d file was already 15074 installed. If the required boot facilities cannot be fulfilled an exit status 15075 of one shall be returned and the init.d file shall not be installed. 15076 15077 When a software package is removed, the package's preuninstall script shall 15078 call /usr/lib/lsb/remove_initd and pass the pathname to the /etc/init.d file. 15079 The package manager is still responsible for removing the /etc/init.d file; the 15080 remove_initd program is provided in case the distribution needs to clean up any 15081 other modifications in the distribution's boot script system that might have 15082 been made by the install_initd program. For example: 15083 15084 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 15085 15086 The remove_initd program shall return an exit status of zero if the init.d file 15087 has been successfully removed or if the the init.d file is not installed. If 15088 another init.d file which depends on a boot facility provided by this init.d 15089 file is installed, an exit status of one shall be returned and the init.d file 15090 shall remained installed. 15091 15092 There should be a tool available to the user (e.g., RedHat's chkconfig) which 15093 can be used by the system administrator to easily manipulate at which init 15094 levels a particular init.d script is started or stopped. This specification 15095 currently does not specify such an interface, however. 15096 15097 ------------------------------------------------------------------------------- 15098 15099 Run Levels 15100 15101 The following run levels are specified for use by the "Default-Start:" and 15102 "Default-Stop:" specifiers as defined by the section Comment Conventions for 15103 Init Scripts>. Many LSB run-time environments commonly use these run level 15104 definitions, and in the absence of other considerations, providers of run-time 15105 environments are strongly encouraged to follow this convention to provide 15106 consistency for system administrators who need to work with multiple 15107 distributions. However, it is not required that LSB-compliant run-time 15108 environments use these run levels; the distribution-provided install_initd 15109 script may map the run levels specified below to whatever 15110 distribution-specified run levels are most appropriate. 15111 15112 0 halt 15113 1 single user mode 15114 2 multiuser with no network services exported 15115 3 normal/full multiuser 15116 4 reserved for local use, default is normal/full multiuser 15117 5 multiuser with xdm or equivalent 15118 6 reboot 15119 15120 ------------------------------------------------------------------------------- 15121 15122 Facility Names 15123 15124 Boot facilities are used to indicate dependencies in init scripts, as defined 15125 in a previous section. Facility names that begin with a dollar sign ('$') are 15126 system facility names, defined by the LSB, and SHALL be provided by 15127 distributions. [31] LSB applications shall not provide facilities that begin 15128 with a dollar sign. This document defines the following facility names: 15129 15130 $local_fs all local filesystems are mounted 15131 $network low level networking (ethernet card; may imply PCMCIA running) 15132 $named daemons which may provide hostname resolution (if present) are 15133 running[32] 15134 $portmap daemons providing SunRPC/ONCRPC portmapping service[33] (if present) 15135 are running 15136 $remote_fs all remote filesystems are mounted[34]. 15137 $syslog system logger is operational 15138 $time the system time has been set [35] 15139 15140 Other (non-system) facilities may be defined by other LSB applications. These 15141 facilities shall be named using the same conventions defined for naming init.d 15142 script names. Commonly, the facility provided by an LSB application init.d 15143 script will have the same name as the name assigned to the init.d script. 15144 15145 ------------------------------------------------------------------------------- 15146 15147 Script Names 15148 15149 Since the init.d scripts shall live in a single directory, they shall come from 15150 a single namespace. Three means of assigning names from this namespace are 15151 available: 15152 15153 * Assigned namespace. This namespace consists of names which only use the 15154 character set [a-z0-9]. This space is desirable for scripts which system 15155 administrators may often wish to run manually: e.g., "/etc/init.d/named 15156 restart" In order to avoid conflicts these init.d names shall be reserved 15157 through the Linux Assigned Names and Numbers Authority (LANANA). 15158 Information about the LANANA may be found at www.lanana.org. 15159 15160 Commonly used names shall be reserved in advance; developers for projects 15161 should be encouraged to reserve names from LANANA, so that each 15162 distribution can use the same name, and to avoid conflicts with other 15163 projects. 15164 15165 * Hierarchical namespace. This namespace consists of scripts names which look 15166 like this: [hier1]-[hier2]-...-[name], where name is again taken the 15167 character set [a-z0-9], and where there may be one or more [hier-n] 15168 components. [hier1] may either be an LSB provider name assigned by the 15169 LANANA, or it may be owners' DNS name in lower case, with at least one '.' 15170 (e.g., "debian.org", "staroffice.sun.com"). The LSB provider name assigned 15171 by LANANA shall only consist of the ASCII characters [a-z0-9]. 15172 15173 * Reserved namespace. This namespace consists of script names which begin 15174 with the character '_', and is reserved for distribution use only. This 15175 namespace should be used for core packages only, and in general use of this 15176 namespace is highly discouraged. 15177 15178 In general, if a package or some system function is likely to be used on 15179 multiple systems, the package developers or the distribution SHOULD get a 15180 registered name through LANANA, and distributions should strive to use the same 15181 name whenever possible. For applications which may not be "core" or may not be 15182 commonly installed, the hierarchical namespace may be more appropriate. An 15183 advantage to the hierarchical namespace is that there is no need to consult 15184 with the LANANA before obtaining an assigned name. 15185 15186 Short names are highly desirable, since many system administrators like to use 15187 them to manually start and stop services. Given this, they should be 15188 standardized on a per-package basis. This is the rationale behind having a 15189 LANANA organization to assign these names. The LANANA may be called upon to 15190 handle other namespace issues, such as package/prerequisites naming (which is 15191 essential to making prerequisites to work correctly). 15192 15193 ------------------------------------------------------------------------------- 15194 15195 Init Script Functions 15196 15197 Each LSB-compliant init.d script shall source the file /lib/lsb/init-functions. 15198 This file shall cause the following shell script commands to be defined. This 15199 can be done either by adding a directory to the PATH variable which defines 15200 these commands, or by defining sh aliases. While the distribution-provided 15201 aliases may choose to use shell extensions (at the distribution's option), the 15202 LSB init.d files themselves should only depend in shell features as defined by 15203 the LSB. 15204 15205 The start_daemon, killproc and pidofproc functions shall use this algorithm for 15206 determining the status and the pid(s) of the specified program. They shall read 15207 the pidfile specified or otherwise /var/run/basename.pid and use the pid(s) 15208 herein when determining whether a program is running. The method used to 15209 determine the status is implementation defined, but should allow for non-binary 15210 programs. [36] Compliant implementations may use other mechanisms besides those 15211 based on pidfiles, unless the -p pidfile option has been used. Compliant 15212 applications should not rely on such mechanisms and should always use a 15213 pidfile. When a program is stopped, it should delete its pidfile. Multiple pid 15214 (s) shall be separated by a single space in the pidfile and in the output of 15215 pidofproc. 15216 15217 This runs the specified program as a daemon. start_daemon shall 15218 start_daemon check if the program is already running using the algorithm 15219 [-f] [-n given above. If so, it shall not start another copy of the 15220 nicelevel] [-p daemon unless the -f option is given. The -n option specifies a 15221 pidfile] nice level. See nice(1). start_daemon should return the LSB 15222 pathname [args] defined exit status codes. It shall return 0 if the program has 15223 been successfully started or is running and not 0 otherwise. 15224 This stops the specified program. The program is found using 15225 the algorithm given above. If a signal is specified, using the 15226 -signal_name or -signal_number syntaxes as specified by the 15227 kill command, the program is sent that signal. Otherwise, a 15228 killproc [-p SIGTERM followed by a SIGKILL after some number of seconds 15229 pidfile] shall be sent. If a program has been terminated, the pidfile 15230 pathname should be removed if the terminated process has not already 15231 [signal] done so. Compliant applications may use the basename instead of 15232 the pathname. killproc should return the LSB defined exit 15233 status codes. If called without a signal, it shall return 0 if 15234 the program has been stopped or is not running and not 0 15235 otherwise. If a signal is given, it shall return 0 only if the 15236 program is running. 15237 This function returns one or more pid(s) for a particular 15238 pidofproc [-p daemon using the algorithm given above. Only pids of running 15239 pidfile] processes should be returned. Compliant applications may use 15240 pathname the basename instead of the pathname. pidofproc should return 15241 the LSB defined exit status codes for "status". It shall return 15242 0 if the program is running and not 0 otherwise. 15243 log_success_msg This requests the distribution to print a success message. The 15244 "message" message should be relatively short; no more than 60 characters 15245 is highly desirable. 15246 log_failure_msg This requests the distribution to print a failure message. The 15247 "message" message should be relatively short; no more than 60 characters 15248 is highly desirable. 15249 log_warning_msg This requests the distribution to print a warning message. The 15250 "message" message should be relatively short; no more than 60 characters 15251 is highly desirable. 15252 15253 VII. Users & Groups 15254 15255 Table of Contents 15256 14. Users & Groups 15257 15258 ------------------------------------------------------------------------------- 15259 15260 Chapter 14. Users & Groups 15261 15262 A "user name" is a string that is used to identify a user. A "login name" is a 15263 user name that is associated with a system login. A "user id" is a non negative 15264 integer, which can be contained in an object of type uid_t, that is used to 15265 identify a system user. 15266 15267 When the identity of a user is associated with a process, a user ID value is 15268 referred to as a real user ID, or an effective user ID. [POSIX 1003.1-1996] 15269 15270 A "group name" is a string that is used to identify a set of users. A "group 15271 id" is a non negative integer, which can be contained in a object of type 15272 gid_t, that is used to identify a group of system users. Each system user is a 15273 member of at least one group. When the identity of a group is associated with a 15274 process, a group ID value is referred to as a real group ID, or an effective 15275 group ID. [POSIX 1003.1-1996] 15276 15277 ------------------------------------------------------------------------------- 15278 15279 User and Group Database 15280 15281 The format of the User and Group databases is not specified. Programs may only 15282 read these databases using the provided API. Changes to these databases should 15283 be made using the provided commands. 15284 15285 ------------------------------------------------------------------------------- 15286 15287 User & Group Names 15288 15289 Below is a table of required mnemonic user and group names. This specification 15290 makes no attempt to numerically assign uid or gid numbers. The exception is the 15291 uid and gid for "root" which are equal to 0. 15292 15293 Table 14-1. Required User & Group Names 15294 15295 +-----------------------------------------------------------------------------+ 15296 |User |Group |Comments | 15297 |----------+----------+-------------------------------------------------------| 15298 |root |root |Administrative user with no restrictions | 15299 |----------+----------+-------------------------------------------------------| 15300 |bin |bin |Legacy UID/GID[a] | 15301 |----------+----------+-------------------------------------------------------| 15302 |daemon |daemon |Legacy UID/GID[b] | 15303 |-----------------------------------------------------------------------------| 15304 |Notes: | 15305 |a. The 'bin' UID/GID is included for compatibility with legacy applications. | 15306 |New applications should no longer use the 'bin' UID/GID. | 15307 |b. The 'daemon' UID/GID was used as an unprivileged UID/GID for daemons to | 15308 |execute under in order to limit their access to the system. Generally daemons| 15309 |should now run under individual UID/GIDs in order to further partition | 15310 |daemons from one another. | 15311 +-----------------------------------------------------------------------------+ 15312 15313 Below is a table of optional mnemonic user and group names. This specification 15314 makes no attempt to numerically assign uid or gid numbers. If the username 15315 exists on a system, then they should be in the suggested corresponding group. 15316 These user and group names are for use by distributions, not by applications. 15317 15318 Table 14-2. Optional User & Group Names 15319 15320 +---------------------------------------------------+ 15321 |User |Group |Comments | 15322 |--------+--------+---------------------------------| 15323 |adm |adm |Administrative special privileges| 15324 |--------+--------+---------------------------------| 15325 |lp |lp |Printer special privileges | 15326 |--------+--------+---------------------------------| 15327 |sync |sync |Login to sync the system | 15328 |--------+--------+---------------------------------| 15329 |shutdown|shutdown|Login to shutdown the system | 15330 |--------+--------+---------------------------------| 15331 |halt |halt |Login to halt the system | 15332 |--------+--------+---------------------------------| 15333 |mail |mail |Mail special privileges | 15334 |--------+--------+---------------------------------| 15335 |news |news |News special privileges | 15336 |--------+--------+---------------------------------| 15337 |uucp |uucp |UUCP special privileges | 15338 |--------+--------+---------------------------------| 15339 |operator|root |Operator special privileges | 15340 |--------+--------+---------------------------------| 15341 |man |man |Man special privileges | 15342 |--------+--------+---------------------------------| 15343 |nobody |nobody |Used by NFS | 15344 +---------------------------------------------------+ 15345 15346 The differences in numeric values of the uids and gids between systems on a 15347 network can be reconciled via NIS, rdist(1), rsync(1), or ugidd(8). Only a 15348 minimum working set of "user names" and their corresponding "user groups" are 15349 required. Applications cannot assume non system user or group names will be 15350 defined. 15351 15352 Applications cannot assume any policy for the default umask or the default 15353 directory permissions a user may have. Applications should enforce user only 15354 file permissions on private files such as mailboxes. The location of the users 15355 home directory is also not defined by policy other than the recommendations of 15356 the FHS and shall be obtained by the *pwnam(3) calls. 15357 15358 ------------------------------------------------------------------------------- 15359 15360 UID Ranges 15361 15362 The system UIDs from 0 to 99 should be statically allocated by the system, and 15363 not created by applications. 15364 15365 The system UIDs from 100 to 499 should be reserved for dynamically allocation 15366 by system administrators and post install scripts using useradd(1). 15367 15368 ------------------------------------------------------------------------------- 15369 15370 Rationale 15371 15372 The purpose of specifying optional users and groups is to reduce the potential 15373 for name conflicts between applications and distributions. 15374 15375 Notes 15376 15377 [1] The LSB generally does not include interfaces unlikely to be used by 15378 software applications. 15379 15380 [2] As of spring 2004, we don't know of any Linux kernel patches to switch to 15381 ENXIO, but we believe that such a kernel patch would be accepted if 15382 submitted. 15383 15384 [3] For example, if off_t is 64 bits. 15385 15386 [4] As of spring 2004, we don't know of any Linux kernel patches to switch to 15387 ENXIO, but we believe that such a kernel patch would be accepted if 15388 submitted. 15389 15390 [5] As of spring 2004, we don't know of any Linux kernel patches to switch to 15391 ENXIO, but we believe that such a kernel patch would be accepted if 15392 submitted. 15393 15394 [6] SIOCGIFCONF is similar to the if_nameindex family found in the Single UNIX 15395 Specification, Version 3 or the getifaddrs family found in BSD. 15396 15397 [7] Historical UNIX systems disagree on the meaning of the return value. 15398 15399 [8] This was a deliberate Linus decision after an unpopular experiment in 15400 including the calling process in the 2.5.1 kernel. See "What does it mean 15401 to signal everybody?", Linux Weekly News, 20 December 2001, http://lwn.net 15402 /2001/1220/kernel.php3 15403 15404 [9] As of spring 2004, we don't know of any Linux kernel patches to switch to 15405 ENXIO, but we believe that such a kernel patch would be accepted if 15406 submitted. 15407 15408 [10] Note the optional use of the buffer, unlike the strerror_r found in the 15409 Single UNIX Specification, Version 3, in which the message is always 15410 copied into the supplied buffer. The return types also differ. 15411 15412 [11] A token is a nonempty string of characters not occurring in the string 15413 delim, followed by \0 or by a character occurring in delim. 15414 15415 [12] The Linux kernel has deliberately chosen EISDIR for this case and does not 15416 expect to change (Al Viro, personal communication). 15417 15418 [13] These macros take the stat buffer (an int) as an argument -- not a pointer 15419 to the buffer! 15420 15421 [14] Traditionally, /lib and /usr/lib. This case would also cover cases in 15422 which the system used the mechanism of /etc/ld.so.conf and /etc/ 15423 ld.so.cache to provide access. 15424 15425 Example: An application which is not linked against libm may choose to 15426 dlopen libm. 15427 15428 [15] Future versions of this specification might define additional service 15429 names. 15430 15431 [16] Thus, applications should place options before operands, or use --, as 15432 needed. This text is needed because GNU option parsing differs from POSIX. 15433 For example, ls . -a in GNU ls means to list the current directory, 15434 showing all files (that is, "." is an operand and -a is an option). In 15435 POSIX, "." and -a are both operands, and the command means to list the 15436 current directory, and also the file named -a. Suggesting that 15437 applications rely on the setting of the POSIXLY_CORRECT environment 15438 variable, or try to set it, seems worse than just asking the applictions 15439 to invoke commands in ways which work with either the POSIX or GNU 15440 behaviors. 15441 15442 [17] Linux Standard Base 15443 15444 [18] ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX 15445 Specification(SUS) V3 15446 15447 [19] The LSB generally does not include software development utilities nor does 15448 it specify .o and .a file formats. 15449 15450 [20] The following two options are expected to be added in a future version of 15451 the LSB: 15452 15453 -o office 15454 15455 sets the user's office room number. 15456 15457 -p office-phone 15458 15459 sets the user's office phone number. 15460 15461 Note that some implementations contain a "-o other" option which specifies 15462 an additional field called "other". Traditionally, this field is not 15463 subject to the constraints about legitimate characters in fields. Also, 15464 one traditionally shall have appropriate privileges to change the other 15465 field. At this point there is no consensus about whether it is desirable 15466 to specify the other field; applications may wish to avoid using it. 15467 15468 The "-w work_phone" field found in some implementations should be replaced 15469 by the "-p office_phone" field. The "-r room_number" field found in some 15470 implementations is the equivalent of the "-o office" option mentioned 15471 above; which one of these two options to specify will depend on 15472 implementation experience and the decision regarding the other field. 15473 15474 The intention is for chfn to match the behavior of finger; some historical 15475 implementations have been broken in the sense that finger and chfn do not 15476 agree on what the fields are. 15477 15478 [21] The behavior specified here is similar to that specified by the Single 15479 UNIX Specification version 3 without the XSI option. However, the LSB 15480 forbids all options and the latter forbids only -n. 15481 15482 [22] Need further investigation on the behavior of various implementations 15483 concerning whether program is a full pathname, the basename only, the 15484 program as named by argv[0], or what. 15485 15486 [23] Rationale: System vendors and local system administrators want to run 15487 applications from removable media, but want the possibility to control 15488 what the application can do. 15489 15490 [24] The LSB does not require the kernel to be Linux; the set of mandated 15491 options reflects current existing practice, but may be modified in future 15492 releases. 15493 15494 [25] Linux allows rename() on a directory without having write access, but the 15495 LSB does not require this. 15496 15497 [26] These additional restrictions are required in order to support the testing 15498 and certification programs associated with the LSB. In each case, these 15499 are values that defined macros must not have; conforming applications that 15500 use these values shall trigger a failure in the interface that is 15501 otherwise described as a "may fail". 15502 15503 [27] This specification does not require, but is designed to allow, the 15504 development of a system which runs boot scripts in parallel. Hence, 15505 enforced-serialization of scripts is avoided unless it is explicitly 15506 necessary. 15507 15508 [28] More than one space, or a tab character, indicates the continuation line. 15509 15510 [29] For example, if you want a service to run in runlevels 3, 4, and 5 (only), 15511 specify "Default-Start: 3 4 5" and "Default-Stop: 0 1 2 6". 15512 15513 [30] For example, install_initd might create symbolic links in /etc/rc2.d and 15514 other such directories which point to the files in /etc/init.d (or it 15515 might update a database, or some other mechanism). The init.d files 15516 themselves should already be in /etc/init.d before running install_initd. 15517 15518 [31] The dollar sign does not indicate variable expansion as in many Linux 15519 utilities. Starting a facility name with a dollar sign is merely a way of 15520 dividing the namespace between the system and applications. 15521 15522 [32] For example, daemons to query DNS, NIS+, or LDAP 15523 15524 [33] as defined in RFC 1833 15525 15526 [34] In some LSB run-time environments, filesystems such as /usr may be remote. 15527 Many applications that require $local_fs will probably require also 15528 require $remote_fs 15529 15530 [35] i.e., using a network-based time program such as ntp or rdate, or via the 15531 hardware Real Time Clock 15532 15533 [36] This note is only informative. Commonly used methods check either for the 15534 existence of the /proc/pid directory or use /proc/pid/exe and /proc/pid/ 15535 cmdline. Relying only on /proc/pid/exe is discouraged since this results 15536 in a not-running status for daemons that are written in a script language. 15537