1 2 Linux Standard Base Core Specification 2.1 3 4 Copyright © 2004 Free Standards Group 5 6 Permission is granted to copy, distribute and/or modify this 7 document under the terms of the GNU Free Documentation 8 License, Version 1.1; with no Invariant Sections, with no 9 Front-Cover Texts, and with no Back-Cover Texts. A copy of the 10 license is included in the section entitled "GNU Free 11 Documentation License". 12 13 Portions of the text are copyrighted by the following parties: 14 15 * The Regents of the University of California 16 * Free Software Foundation 17 * Ian F. Darwin 18 * Paul Vixie 19 * BSDI (now Wind River) 20 * Andrew G Morgan 21 * Jean-loup Gailly and Mark Adler 22 * Massachusetts Institute of Technology 23 24 These excerpts are being used in accordance with their 25 respective licenses. 26 27 Linux is a trademark of Linus Torvalds. 28 29 UNIX a registered trademark of the Open Group in the United 30 States and other countries. 31 32 LSB is a trademark of the Free Standards Group in the USA and 33 other countries. 34 35 AMD is a trademark of Advanced Micro Devices, Inc. 36 37 Intel and Itanium are registered trademarks and Intel386 is a 38 trademarks of Intel Corporation. 39 40 OpenGL is a registered trademark of Silicon Graphics, Inc. 41 42 Table of Contents 43 Specification Introduction 44 ELF Specification 45 Linux Standard Base Specification 46 Linux Packaging Specification 47 Free Documentation License 48 49 Specification Introduction 50 _________________________________________________________ 51 52 Table of Contents 53 Foreword 54 Introduction 55 I. Introductory Elements 56 57 1. Scope 58 59 1.1. General 60 1.2. Module Specific Scope 61 62 2. Normative References 63 3. Requirements 64 65 3.1. Relevant Libraries 66 3.2. LSB Implementation Conformance 67 3.3. LSB Application Conformance 68 69 4. Definitions 70 5. Terminology 71 6. Documentation Conventions 72 73 List of Tables 74 2-1. Normative References 75 3-1. Standard Library Names 76 3-2. Standard Library Names defined in the Architecture 77 Specific Supplement 78 _________________________________________________________ 79 80 Foreword 81 82 This is version 2.1 of the Linux Standard Base Core 83 Specification. An implementation of this version of the 84 specification may not claim to be an implementation of the 85 Linux Standard Base unless it has successfully completed the 86 compliance process as defined by the Free Standards Group. 87 _________________________________________________________ 88 89 Introduction 90 91 The LSB defines a binary interface for application programs 92 that are compiled and packaged for LSB-conforming 93 implementations on many different hardware architectures. 94 Since a binary specification shall include information 95 specific to the computer processor architecture for which it 96 is intended, it is not possible for a single document to 97 specify the interface for all possible LSB-conforming 98 implementations. Therefore, the LSB is a family of 99 specifications, rather than a single one. 100 101 This document should be used in conjunction with the documents 102 it references. This document enumerates the system components 103 it includes, but descriptions of those components may be 104 included entirely or partly in this document, partly in other 105 documents, or entirely in other reference documents. For 106 example, the section that describes system service routines 107 includes a list of the system routines supported in this 108 interface, formal declarations of the data structures they use 109 that are visible to applications, and a pointer to the 110 underlying referenced specification for information about the 111 syntax and semantics of each call. Only those routines not 112 described in standards referenced by this document, or 113 extensions to those standards, are described in the detail. 114 Information referenced in this way is as much a part of this 115 document as is the information explicitly included here. 116 117 The specification carries a version number of either the form 118 x.y or x.y.z. This version number carries the following 119 meaning: 120 121 * The first number (x) is the major version number. All 122 versions with the same major version number should share 123 binary compatibility. Any addition or deletion of a new 124 library results in a new version number. Interfaces marked 125 as deprecated may be removed from the specification at a 126 major version change. 127 * The second number (y) is the minor version number. 128 Individual interfaces may be added if all certified 129 implementations already had that (previously undocumented) 130 interface. Interfaces may be marked as deprecated at a 131 minor version change. Other minor changes may be permitted 132 at the discretion of the LSB workgroup. 133 * The third number (z), if present, is the editorial level. 134 Only editorial changes should be included in such 135 versions. 136 137 I. Introductory Elements 138 139 Table of Contents 140 1. Scope 141 2. Normative References 142 3. Requirements 143 4. Definitions 144 5. Terminology 145 6. Documentation Conventions 146 _________________________________________________________ 147 148 Chapter 1. Scope 149 150 1.1. General 151 152 The Linux Standard Base (LSB) defines a system interface for 153 compiled applications and a minimal environment for support of 154 installation scripts. Its purpose is to enable a uniform 155 industry standard environment for high-volume applications 156 conforming to the LSB. 157 158 These specifications are composed of two basic parts: A common 159 specification ("LSB-generic") describing those parts of the 160 interface that remain constant across all implementations of 161 the LSB, and an architecture-specific specification 162 ("LSB-arch") describing the parts of the interface that vary 163 by processor architecture. Together, the LSB-generic and the 164 architecture-specific supplement for a single hardware 165 architecture provide a complete interface specification for 166 compiled application programs on systems that share a common 167 hardware architecture. 168 169 The LSB-generic document shall be used in conjunction with an 170 architecture-specific supplement. Whenever a section of the 171 LSB-generic specification shall be supplemented by 172 architecture-specific information, the LSB-generic document 173 includes a reference to the architecture supplement. 174 Architecture supplements may also contain additional 175 information that is not referenced in the LSB-generic 176 document. 177 178 The LSB contains both a set of Application Program Interfaces 179 (APIs) and Application Binary Interfaces (ABIs). APIs may 180 appear in the source code of portable applications, while the 181 compiled binary of that application may use the larger set of 182 ABIs. A conforming implementation shall provide all of the 183 ABIs listed here. The compilation system may replace (e.g. by 184 macro definition) certain APIs with calls to one or more of 185 the underlying binary interfaces, and may insert calls to 186 binary interfaces as needed. 187 188 The LSB is primarily a binary interface definition. Not all of 189 the source level APIs available to applications may be 190 contained in this specification. 191 _________________________________________________________ 192 193 1.2. Module Specific Scope 194 195 This is the Core module of the Linux Standards Base (LSB). 196 This module provides the fundamental system interfaces, 197 libraries, and runtime environment upon which all conforming 198 applications and libraries depend. 199 200 Interfaces described in this module are mandatory except where 201 explicitly listed otherwise. Core interfaces may be 202 supplemented by other modules; all modules are built upon the 203 core. 204 _________________________________________________________ 205 206 Chapter 2. Normative References 207 208 The specifications listed below are referenced in whole or in 209 part by the Linux Standard Base. In this specification, where 210 only a particular section of one of these references is 211 identified, then the normative reference is to that section 212 alone, and the rest of the referenced document is informative. 213 214 Table 2-1. Normative References 215 Name Title URL 216 DWARF Debugging Information Format DWARF Debugging Information 217 Format, Revision 2.0.0 (July 27, 1993) 218 http://www.eagercon.com/dwarf/dwarf-2.0.0.pdf 219 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 220 (FHS) 2.3 http://www.pathname.com/fhs/ 221 IEEE Std 754-1985 IEEE Standard 754 for Binary Floating-Point 222 Arithmetic http://www.ieee.org/ 223 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 224 ISO POSIX (2003) 225 226 ISO/IEC 9945-1:2003 Information technology -- Portable 227 Operating System Interface (POSIX) -- Part 1: Base Definitions 228 229 ISO/IEC 9945-2:2003 Information technology -- Portable 230 Operating System Interface (POSIX) -- Part 2: System 231 Interfaces 232 233 ISO/IEC 9945-3:2003 Information technology -- Portable 234 Operating System Interface (POSIX) -- Part 3: Shell and 235 Utilities 236 237 ISO/IEC 9945-4:2003 Information technology -- Portable 238 Operating System Interface (POSIX) -- Part 4: Rationale 239 http://www.unix.org/version3/ 240 ITU-T V.42 International Telecommunication Union 241 Recommendation V.42 (2002): Error-correcting procedures for 242 DCEs using asynchronous-to-synchronous conversionITUV 243 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e& 244 parent=T-REC-V.42 245 Large File Support Large File Support 246 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 247 Li18nux Globalization Specification LI18NUX 2000 Globalization 248 Specification, Version 1.0 with Amendment 4 249 http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm 250 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 251 http://www.lanana.org/docs/device-list/devices.txt 252 PAM Open Software Foundation, Request For Comments: 86.0 , 253 October 1995, V. Samar & R.Schemers (SunSoft) 254 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 255 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 256 MD5 Message-Digest Algorithm 257 http://www.ietf.org/rfc/rfc1321.txt 258 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 259 1833: Binding Protocols for ONC RPC Version 2 260 http://www.ietf.org/rfc/rfc1833.txt 261 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 262 1950: ZLIB Compressed Data Format Specification 263 http://www.ietf.org/rfc/rfc1950.txt 264 RFC 1951: DEFLATE Compressed Data Format Specification IETF 265 RFC 1951: DEFLATE Compressed Data Format Specification version 266 1.3 http://www.ietf.org/rfc/rfc1951.txt 267 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 268 file format specification version 4.3 269 http://www.ietf.org/rfc/rfc1952.txt 270 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP 271 Message Format http://www.ietf.org/rfc/rfc2440.txt 272 SUSv2 CAE Specification, January 1997, System Interfaces and 273 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 274 http://www.opengroup.org/publications/catalog/un.htm 275 SUSv2 Command and Utilities The Single UNIX® 276 Specification(SUS) Version 2, Commands and Utilities (XCU), 277 Issue 5 (ISBN: 1-85912-191-8, C604) 278 http://www.opengroup.org/publications/catalog/un.htm 279 SVID Issue 3 American Telephone and Telegraph Company, System 280 V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 281 1989.(ISBN 0201566524) 282 SVID Issue 4 System V Interface Definition,Fourth Edition 283 System V ABI System V Application Binary Interface, Edition 284 4.1 http://www.caldera.com/developers/devspecs/gabi41.pdf 285 System V ABI Update System V Application Binary Interface - 286 DRAFT - 17 December 2003 287 http://www.caldera.com/developers/gabi/2003-12-17/contents.htm 288 l 289 this specification Linux Standard Base 290 http://www.linuxbase.org/spec/ 291 X/Open Curses CAE Specification, May 1996, X/Open Curses, 292 Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus 293 Corrigendum U018 294 http://www.opengroup.org/publications/catalog/un.htm 295 _________________________________________________________ 296 297 Chapter 3. Requirements 298 299 3.1. Relevant Libraries 300 301 The libraries listed in Table 3-1 shall be available on a 302 Linux Standard Base system, with the specified runtime names. 303 The libraries listed in Table 3-2 are architecture specific, 304 but shall be available on all LSB conforming systems. This 305 list may be supplemented or amended by the 306 architecture-specific specification. 307 308 Table 3-1. Standard Library Names 309 Library Runtime Name 310 libdl libdl.so.2 311 libcrypt libcrypt.so.1 312 libz libz.so.1 313 libncurses libncurses.so.5 314 libutil libutil.so.1 315 libpthread libpthread.so.0 316 libpam libpam.so.0 317 libgcc_s libgcc_s.so.1 318 319 Table 3-2. Standard Library Names defined in the Architecture 320 Specific Supplement 321 Library Runtime Name 322 libm See archLSB 323 libc See archLSB 324 proginterp See archLSB 325 326 These libraries will be in an implementation-defined directory 327 which the dynamic linker shall search by default. 328 _________________________________________________________ 329 330 3.2. LSB Implementation Conformance 331 332 A conforming implementation shall satisfy the following 333 requirements: 334 335 * The implementation shall implement fully the architecture 336 described in the hardware manual for the target processor 337 architecture. 338 * The implementation shall be capable of executing compiled 339 applications having the format and using the system 340 interfaces described in this document. 341 * The implementation shall provide libraries containing the 342 interfaces specified by this document, and shall provide a 343 dynamic linking mechanism that allows these interfaces to 344 be attached to applications at runtime. All the interfaces 345 shall behave as specified in this document. 346 * The map of virtual memory provided by the implementation 347 shall conform to the requirements of this document. 348 * The implementation's low-level behavior with respect to 349 function call linkage, system traps, signals, and other 350 such activities shall conform to the formats described in 351 this document. 352 * The implementation shall provide all of the mandatory 353 interfaces in their entirety. 354 * The implementation may provide one or more of the optional 355 interfaces. Each optional interface that is provided shall 356 be provided in its entirety. The product documentation 357 shall state which optional interfaces are provided. 358 * The implementation shall provide all files and utilities 359 specified as part of this document in the format defined 360 here and in other referenced documents. All commands and 361 utilities shall behave as required by this document. The 362 implementation shall also provide all mandatory components 363 of an application's runtime environment that are included 364 or referenced in this document. 365 * The implementation, when provided with standard data 366 formats and values at a named interface, shall provide the 367 behavior defined for those values and data formats at that 368 interface. However, a conforming implementation may 369 consist of components which are separately packaged and/or 370 sold. For example, a vendor of a conforming implementation 371 might sell the hardware, operating system, and windowing 372 system as separately packaged items. 373 * The implementation may provide additional interfaces with 374 different names. It may also provide additional behavior 375 corresponding to data values outside the standard ranges, 376 for standard named interfaces. 377 _________________________________________________________ 378 379 3.3. LSB Application Conformance 380 381 A conforming application shall satisfy the following 382 requirements: 383 384 * Its executable files are either shell scripts or object 385 files in the format defined for the Object File Format 386 system interface. 387 * Its object files participate in dynamic linking as defined 388 in the Program Loading and Linking System interface. 389 * It employs only the instructions, traps, and other 390 low-level facilities defined in the Low-Level System 391 interface as being for use by applications. 392 * If it requires any optional interface defined in this 393 document in order to be installed or to execute 394 successfully, the requirement for that optional interface 395 is stated in the application's documentation. 396 * It does not use any interface or data format that is not 397 required to be provided by a conforming implementation, 398 unless: 399 + If such an interface or data format is supplied by 400 another application through direct invocation of that 401 application during execution, that application is in 402 turn an LSB conforming application. 403 + The use of that interface or data format, as well as 404 its source, is identified in the documentation of the 405 application. 406 * It shall not use any values for a named interface that are 407 reserved for vendor extensions. 408 409 A strictly conforming application does not require or use any 410 interface, facility, or implementation-defined extension that 411 is not defined in this document in order to be installed or to 412 execute successfully. 413 _________________________________________________________ 414 415 Chapter 4. Definitions 416 417 For the purposes of this document, the following definitions, 418 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 419 Edition, apply: 420 421 can 422 be able to; there is a possibility of; it is possible 423 to 424 425 cannot 426 be unable to; there is no possibilty of; it is not 427 possible to 428 429 may 430 is permitted; is allowed; is permissible 431 432 need not 433 it is not required that; no...is required 434 435 shall 436 is to; is required to; it is required that; has to; 437 only...is permitted; it is necessary 438 439 shall not 440 is not allowed [permitted] [acceptable] [permissible]; 441 is required to be not; is required that...be not; is 442 not to be 443 444 should 445 it is recommended that; ought to 446 447 should not 448 it is not recommended that; ought not to 449 _________________________________________________________ 450 451 Chapter 5. Terminology 452 453 For the purposes of this document, the following terms apply: 454 455 archLSB 456 The architectural part of the LSB Specification which 457 describes the specific parts of the interface that are 458 platform specific. The archLSB is complementary to the 459 gLSB. 460 461 Binary Standard 462 The total set of interfaces that are available to be 463 used in the compiled binary code of a conforming 464 application. 465 466 gLSB 467 The common part of the LSB Specification that describes 468 those parts of the interface that remain constant 469 across all hardware implementations of the LSB. 470 471 implementation-defined 472 Describes a value or behavior that is not defined by 473 this document but is selected by an implementor. The 474 value or behavior may vary among implementations that 475 conform to this document. An application should not 476 rely on the existence of the value or behavior. An 477 application that relies on such a value or behavior 478 cannot be assured to be portable across conforming 479 implementations. The implementor shall document such a 480 value or behavior so that it can be used correctly by 481 an application. 482 483 Shell Script 484 A file that is read by an interpreter (e.g., awk). The 485 first line of the shell script includes a reference to 486 its interpreter binary. 487 488 Source Standard 489 The set of interfaces that are available to be used in 490 the source code of a conforming application. 491 492 undefined 493 Describes the nature of a value or behavior not defined 494 by this document which results from use of an invalid 495 program construct or invalid data input. The value or 496 behavior may vary among implementations that conform to 497 this document. An application should not rely on the 498 existence or validity of the value or behavior. An 499 application that relies on any particular value or 500 behavior cannot be assured to be portable across 501 conforming implementations. 502 503 unspecified 504 Describes the nature of a value or behavior not 505 specified by this document which results from use of a 506 valid program construct or valid data input. The value 507 or behavior may vary among implementations that conform 508 to this document. An application should not rely on the 509 existence or validity of the value or behavior. An 510 application that relies on any particular value or 511 behavior cannot be assured to be portable across 512 conforming implementations. 513 514 Other terms and definitions used in this document shall have 515 the same meaning as defined in Chapter 3 of the Base 516 Definitions volume of ISO POSIX (2003). 517 _________________________________________________________ 518 519 Chapter 6. Documentation Conventions 520 521 Throughout this document, the following typographic 522 conventions are used: 523 524 function() 525 the name of a function 526 527 command 528 the name of a command or utility 529 530 CONSTANT 531 a constant value 532 533 parameter 534 a parameter 535 536 variable 537 a variable 538 539 Throughout this specification, several tables of interfaces 540 are presented. Each entry in these tables has the following 541 format: 542 543 name 544 the name of the interface 545 546 (symver) 547 An optional symbol version identifier, if required. 548 549 [refno] 550 A reference number indexing the table of referenced 551 specifications that follows this table. 552 553 For example, 554 555 forkpty(GLIBC_2.0) [1] 556 557 refers to the interface named forkpty() with symbol version 558 GLIBC_2.0 that is defined in the first of the listed 559 references below the table. 560 561 ELF Specification 562 _________________________________________________________ 563 564 Table of Contents 565 I. Low Level System Information 566 567 1. Operating System Interface 568 569 II. Object Format 570 571 2. Object Files 572 3. Sections 573 574 3.1. Introduction 575 3.2. Sections Types 576 577 4. Special Sections 578 579 4.1. Special Sections 580 581 5. Symbol Mapping 582 583 5.1. Introduction 584 5.2. Symbol Mapping 585 586 6. DWARF Extensions 587 7. EH Frame Header 588 589 7.1. Introduction 590 7.2. DWARF Exception Header Encoding 591 592 8. Symbol Versioning 593 594 8.1. Introduction 595 8.2. Symbol Version Table 596 8.3. Version Definitions 597 8.4. Version Requirements 598 8.5. Startup Sequence 599 8.6. Symbol Resolution 600 601 9. ABI note tag 602 603 III. Dynamic Linking 604 605 10. Program Loading and Dynamic Linking 606 11. Program Header 607 12. Dynamic Entries 608 609 12.1. Introduction 610 12.2. Dynamic Entries 611 612 List of Figures 613 8-1. Version Definition Entries 614 8-2. Version Definition Auxiliary Entries 615 8-3. Version Needed Entries 616 8-4. Version Needed Auxiliary Entries 617 618 List of Tables 619 3-1. ELF Section Types 620 3-2. Additional Section Types 621 4-1. ELF Special Sections 622 4-2. Additional Special Sections 623 6-1. Additional DWARF Call Frame Instructions 624 7-1. .eh_frame_hdr Section Format 625 7-2. DWARF Exception Header value format 626 7-3. DWARF Exception Header application 627 11-1. Linux Segment Types 628 629 I. Low Level System Information 630 631 Table of Contents 632 1. Operating System Interface 633 _________________________________________________________ 634 635 Chapter 1. Operating System Interface 636 637 LSB-conforming applications shall assume that stack, heap and 638 other allocated memory regions will be non-executable. The 639 application must take steps to make them executable if needed. 640 641 II. Object Format 642 643 Table of Contents 644 2. Object Files 645 3. Sections 646 4. Special Sections 647 5. Symbol Mapping 648 6. DWARF Extensions 649 7. EH Frame Header 650 8. Symbol Versioning 651 9. ABI note tag 652 _________________________________________________________ 653 654 Chapter 2. Object Files 655 656 LSB-conforming implementations shall support the object file 657 Executable and Linking Format (ELF), which is defined by the 658 following documents: 659 660 * System V ABI 661 * System V ABI Update 662 * this document 663 * an architecture-specific LSB specification 664 665 Conforming implementations may also support other unspecified 666 object file formats. 667 _________________________________________________________ 668 669 Chapter 3. Sections 670 671 3.1. Introduction 672 673 As described in System V ABI, an ELF object file contains a 674 number of sections. 675 _________________________________________________________ 676 677 3.2. Sections Types 678 679 The section header table is an array of Elf32_Shdr or 680 Elf64_Shdr structures as described in System V ABI. The 681 sh_type member shall be either a value from Table 3-1, drawn 682 from the System V ABI, or one of the additional values 683 specified in Table 3-2. 684 685 A section header's sh_type member specifies the sections's 686 semantics. 687 _________________________________________________________ 688 689 3.2.1. ELF Section Types 690 691 The following section types are defined in the System V ABI 692 and the System V ABI Update. 693 694 Table 3-1. ELF Section Types 695 Name Value Description 696 SHT_DYNAMIC 0x6 The section holds information for dynamic 697 linking. Currently, an object file shall have only one dynamic 698 section, but this restriction may be relaxed in the future. 699 See `Dynamic Section' in Chapter 5 for details. 700 SHT_DYNSYM 0xb This section holds a minimal set of symbols 701 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 702 an object file may have either a section of SHT_SYMTAB type or 703 a section of SHT_DYNSYM type, but not both. This restriction 704 may be relaxed in the future. 705 SHT_FINI_ARRAY 0xf This section contains an array of pointers 706 to termination functions, as described in `Initialization and 707 Termination Functions' in Chapter 5. Each pointer in the array 708 is taken as a parameterless procedure with a void return. 709 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 710 an object file shall have only one hash table, but this 711 restriction may be relaxed in the future. See `Hash Table' in 712 the Chapter 5 for details. 713 SHT_HIPROC 0x7fffffff Values in this inclusive range are 714 reserved for processor-specific semantics. 715 SHT_HIUSER 0xffffffff This value specifies the upper bound of 716 the range of indexes reserved for application programs. 717 Section types between SHT_LOUSER and SHT_HIUSER can be used by 718 the application, without conflicting with current or future 719 system-defined section types. 720 SHT_INIT_ARRAY 0xe This section contains an array of pointers 721 to initialization functions, as described in `Initialization 722 and Termination Functions' in Chapter 5. Each pointer in the 723 array is taken as a parameterless procedure with a void 724 return. 725 SHT_LOPROC 0x70000000 Values in this inclusive range are 726 reserved for processor-specific semantics. 727 SHT_LOUSER 0x80000000 This value specifies the lower bound of 728 the range of indexes reserved for application programs. 729 SHT_NOBITS 0x8 A section of this type occupies no space in the 730 file but otherwise resembles SHT_PROGBITS. Although this 731 section contains no bytes, the sh_offset member contains the 732 conceptual file offset. 733 SHT_NOTE 0x7 The section holds information that marks the file 734 in some way. See `Note Section' in Chapter 5 for details. 735 SHT_NULL 0x0 This value marks the section header as inactive; 736 it does not have an associated section. Other members of the 737 section header have undefined values. 738 SHT_PREINIT_ARRAY 0x10 This section contains an array of 739 pointers to functions that are invoked before all other 740 initialization functions, as described in `Initialization and 741 Termination Functions' in Chapter 5. Each pointer in the array 742 is taken as a parameterless proceure with a void return. 743 SHT_PROGBITS 0x1 The section holds information defined by the 744 program, whose format and meaning are determined solely by the 745 program. 746 SHT_REL 0x9 The section holds relocation entries without 747 explicit addends, such as type Elf32_Rel for the 32-bit class 748 of object files or type Elf64_Rel for the 64-bit class of 749 object files. An object file may have multiple relocation 750 sections. See "Relocation" 751 SHT_RELA 0x4 The section holds relocation entries with 752 explicit addends, such as type Elf32_Rela for the 32-bit class 753 of object files or type Elf64_Rela for the 64-bit class of 754 object files. An object file may have multiple relocation 755 sections. `Relocation' b 756 SHT_SHLIB 0xa This section type is reserved but has 757 unspecified semantics. 758 SHT_STRTAB 0x3 The section holds a string table. An object 759 file may have multiple string table sections. See `String 760 Table' below for details. 761 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, 762 an object file may have either a section of SHT_SYMTAB type or 763 a section of SHT_DYNSYM type, but not both. This restriction 764 may be relaxed in the future. Typically, SHT_SYMTAB provides 765 symbols for link editing, though it may also be used for 766 dynamic linking. As a complete symbol table, it may contain 767 many symbols unnecessary for dynamic linking. 768 _________________________________________________________ 769 770 3.2.2. Additional Section Types 771 772 The following additional section types are defined here. 773 774 Table 3-2. Additional Section Types 775 Name Value Description 776 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 777 versions that are provided. 778 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 779 versions that are required. 780 SHT_GNU_versym 0x6fffffff This section contains the Symbol 781 Version Table. 782 _________________________________________________________ 783 784 Chapter 4. Special Sections 785 786 4.1. Special Sections 787 788 Various sections hold program and control information. 789 Sections in the lists below are used by the system and have 790 the indicated types and attributes. 791 _________________________________________________________ 792 793 4.1.1. ELF Special Sections 794 795 The following sections are defined in the System V ABI and the 796 System V ABI Update. 797 798 Table 4-1. ELF Special Sections 799 Name Type Attributes 800 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 801 .comment SHT_PROGBITS 0 802 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 803 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 804 .debug SHT_PROGBITS 0 805 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 806 .dynstr SHT_STRTAB SHF_ALLOC 807 .dynsym SHT_DYNSYM SHF_ALLOC 808 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 809 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 810 .hash SHT_HASH SHF_ALLOC 811 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 812 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 813 .interp SHT_PROGBITS SHF_ALLOC 814 .line SHT_PROGBITS 0 815 .note SHT_NOTE 0 816 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 817 .rodata SHT_PROGBITS SHF_ALLOC 818 .rodata1 SHT_PROGBITS SHF_ALLOC 819 .shstrtab SHT_STRTAB 0 820 .strtab SHT_STRTAB SHF_ALLOC 821 .symtab SHT_SYMTAB SHF_ALLOC 822 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 823 824 .bss 825 This section holds data that contributes to the 826 program's memory image. The program may treat this data 827 as uninitialized. However, the system shall initialize 828 this data with zeroes when the program begins to run. 829 The section occupies no file space, as indicated by the 830 section type, SHT_NOBITS 831 832 .comment 833 This section holds version control information. 834 835 .data 836 This section holds initialized data that contribute to 837 the program's memory image. 838 839 .data1 840 This section holds initialized data that contribute to 841 the program's memory image. 842 843 .debug 844 This section holds information for symbolic debugging. 845 The contents are unspecified. All section names with 846 the prefix .debug hold information for symbolic 847 debugging. The contents of these sections are 848 unspecified. 849 850 .dynamic 851 This section holds dynamic linking information. The 852 section's attributes will include the SHF_ALLOC bit. 853 Whether the SHF_WRITE bit is set is processor specific. 854 See Chapter 5 for more information. 855 856 .dynstr 857 This section holds strings needed for dynamic linking, 858 most commonly the strings that represent the names 859 associated with symbol table entries. See Chapter 5 for 860 more information. 861 862 .dynsym 863 This section holds the dynamic linking symbol table, as 864 described in `Symbol Table'. See Chapter 5 for more 865 information. 866 867 .fini 868 This section holds executable instructions that 869 contribute to the process termination code. That is, 870 when a program exits normally, the system arranges to 871 execute the code in this section. 872 873 .fini_array 874 This section holds an array of function pointers that 875 contributes to a single termination array for the 876 executable or shared object containing the section. 877 878 .hash 879 This section holds a symbol hash table. See `Hash 880 Table' in Chapter 5 for more information. 881 882 .init 883 This section holds executable instructions that 884 contribute to the process initialization code. When a 885 program starts to run, the system arranges to execute 886 the code in this section before calling the main 887 program entry point (called main for C programs) 888 889 .init_array 890 This section holds an array of function pointers that 891 contributes to a single initialization array for the 892 executable or shared object containing the section. 893 894 .interp 895 This section holds the path name of a program 896 interpreter. If the file has a loadable segment that 897 includes relocation, the sections' attributes will 898 include the SHF_ALLOC bit; otherwise, that bit will be 899 off. See Chapter 5 for more information. 900 901 .line 902 This section holds line number information for symbolic 903 debugging, which describes the correspondence between 904 the source program and the machine code. The contents 905 are unspecified. 906 907 .note 908 This section holds information in the format that `Note 909 Section' in Chapter 5 describes of the System V 910 Application Binary Interface, Edition 4.1. 911 912 .preinit_array 913 This section holds an array of function pointers that 914 contributes to a single pre-initialization array for 915 the executable or shared object containing the section. 916 917 .rodata 918 This section holds read-only data that typically 919 contribute to a non-writable segment in the process 920 image. See `Program Header' in Chapter 5 for more 921 information. 922 923 .rodata1 924 This section hold sread-only data that typically 925 contribute to a non-writable segment in the process 926 image. See `Program Header' in Chapter 5 for more 927 information. 928 929 .shstrtab 930 This section holds section names. 931 932 .strtab 933 This section holds strings, most commonly the strings 934 that represent the names associated with symbol table 935 entries. If the file has a loadable segment that 936 includes the symbol string table, the section's 937 attributes will include the SHF_ALLOC bit; otherwi 938 939 .symtab 940 This section holds a symbol table, as `Symbol Table'. 941 in this chapter describes. If the file has a loadable 942 segment that includes the symbol table, the section's 943 attributes will include the SHF_ALLOC bit; otherwise, 944 that bit will be off. 945 946 .text 947 This section holds the `text,' or executable 948 instructions, of a program. 949 _________________________________________________________ 950 951 4.1.2. Additional Special Sections 952 953 Object files in an LSB conforming application may also contain 954 one or more of the additional special sections described 955 below. 956 957 Table 4-2. Additional Special Sections 958 Name Type Attributes 959 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 960 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 961 .eh_frame SHT_PROGBITS SHF_ALLOC 962 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 963 .gnu.version SHT_GNU_versym SHF_ALLOC 964 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 965 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 966 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 967 .note.ABI-tag SHT_NOTE SHF_ALLOC 968 .stab SHT_PROGBITS 0 969 .stabstr SHT_STRTAB 0 970 971 .ctors 972 This section contains a list of global constructor 973 function pointers. 974 975 .dtors 976 This section contains a list of global destructor 977 function pointers. 978 979 .eh_frame 980 This section contains information necessary for frame 981 unwinding during exception handling. 982 983 .eh_frame_hdr 984 This section contains a pointer to the .eh_frame 985 section which is accessible to the runtime support code 986 of a C++ application. This section may also contain a 987 binary search table which may be used by the runtime 988 support code to more efficiently access records in the 989 .eh_frame section. 990 991 .gnu.version 992 This section contains the Symbol Version Table. 993 994 .gnu.version_d 995 This section contains the Version Definitions. 996 997 .gnu.version_r 998 This section contains the Version Requirments. 999 1000 .jcr 1001 This section contains information necessary for 1002 registering compiled Java classes. The contents are 1003 compiler-specific and used by compiler initialization 1004 functions. 1005 1006 .note.ABI-tag 1007 Specify ABI details. 1008 1009 .stab 1010 This section contains debugging information. The 1011 contents are not specified as part of the LSB. 1012 1013 .stabstr 1014 This section contains strings associated with the 1015 debugging infomation contained in the .stab section. 1016 _________________________________________________________ 1017 1018 Chapter 5. Symbol Mapping 1019 1020 5.1. Introduction 1021 1022 This chapter defines how names are mapped from the source 1023 symbol to the object symbol. 1024 _________________________________________________________ 1025 1026 5.2. Symbol Mapping 1027 1028 Symbols in a source program are translated by the compilation 1029 system into symbols that exist in the object file. The rules 1030 for this translation are defined here. 1031 _________________________________________________________ 1032 1033 5.2.1. C Language 1034 1035 External C symbols have the same names in C and object files' 1036 symbol tables. 1037 _________________________________________________________ 1038 1039 Chapter 6. DWARF Extensions 1040 1041 In addition to the Call Frame Instructions defined in section 1042 6.4.2 of DWARF Debugging Information Format, the following 1043 Call Frame Instructions may also be used. 1044 1045 Table 6-1. Additional DWARF Call Frame Instructions 1046 Name Value Meaning 1047 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1048 two operands: an unsigned LEB128 value representing a register 1049 number, and a DW_FORM_block value representing a DWARF 1050 expression. The required action is to establish the DWARF 1051 expression as the means by which the address in which the 1052 given register contents are found may be computed. The value 1053 of the CFA is pushed on the DWARF evaluation stack prior to 1054 execution of the DWARF expression. The DW_OP_call2, 1055 DW_OP_call4, DW_OP_call_ref and DW_OP_push_object_address 1056 DWARF operators (see Section 2.4.1 of DWARF Debugging 1057 Information Format) cannot be used in such a DWARF expression. 1058 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1059 instruction takes two operands: an unsigned LEB128 value 1060 representing a register number and a signed LEB128 factored 1061 offset. This instruction is identical to 1062 DW_CFA_offset_extended except that the second operand is 1063 signed. 1064 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1065 two operands: an unsigned LEB128 value representing a register 1066 number and a signed LEB128 factored offset. This instruction 1067 is identical to DW_CFA_def_cfa except that the second operand 1068 is signed and factored. 1069 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1070 instruction takes a signed LEB128 operand representing a 1071 factored offset. This instruction is identical to 1072 DW_CFA_def_cfa_offset except that the operand is signed and 1073 factored. 1074 DW_CFA_GNU_args_size 0x2e The DW_CFA_def_cfa_offset_sf 1075 instruction takes an unsigned LEB128 operand representing an 1076 argument size. 1077 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1078 instruction takes two operands: an unsigned LEB128 value 1079 representing a register number and an unsigned LEB128 which 1080 represents the magnitude of the offset. This instruction is 1081 identical to DW_CFA_offset_extended_sf except that the operand 1082 is subtracted to produce the offset. This instructions is 1083 obsoleted by DW_CFA_offset_extended_sf. 1084 _________________________________________________________ 1085 1086 Chapter 7. EH Frame Header 1087 1088 7.1. Introduction 1089 1090 The .eh_frame_hdr section contains additional information 1091 about the .eh_frame section. A pointer to the start of the 1092 .eh_frame data, and optionally, a binary search table of 1093 pointers to the .eh_frame records are found in this section. 1094 1095 Data in this section is encoded according to the DWARF 1096 Exception Header Encoding described below. 1097 1098 Table 7-1. .eh_frame_hdr Section Format 1099 Encoding Field 1100 unsigned byte version 1101 unsigned byte eh_frame_ptr_enc 1102 unsigned byte fde_count_enc 1103 unsigned byte table_enc 1104 encoded eh_frame_ptr 1105 encoded fde_count 1106 binary search table 1107 1108 version 1109 Version of the .eh_frame_hdr format. This value shall 1110 be 1. 1111 1112 eh_frame_ptr_enc 1113 The encoding format of the eh_frame_ptr field. 1114 1115 fde_count_enc 1116 The encoding format of the fde_count field. A value of 1117 DW_EH_PE_omit indicates the binary search table is not 1118 present. 1119 1120 table_enc 1121 The encoding format of the entries in the binary search 1122 table. A value of DW_EH_PE_omit indicates the binary 1123 search table is not present. 1124 1125 eh_frame_ptr 1126 The encoded value of the pointer to the start of the 1127 .eh_frame section. 1128 1129 fde_count 1130 The encoded value of the count of entries in the binary 1131 search table. 1132 1133 binary search table 1134 A binary search table containing fde_count entries. 1135 Each entry of the table consist of two encoded values, 1136 the initial location, and the address. The entries are 1137 sorted in an increasing order by the initial location 1138 value. 1139 _________________________________________________________ 1140 1141 7.2. DWARF Exception Header Encoding 1142 1143 The DWARF Exception Header Encoding is used to describe the 1144 type of data used in the .eh_frame_hdr section. The upper 4 1145 bits indicate how the value is to be applied. The lower 4 bits 1146 indicate the format of the data. 1147 1148 Table 7-2. DWARF Exception Header value format 1149 Name Value Meaning 1150 DW_EH_PE_omit 0xff No value is present. 1151 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1152 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1153 Information Format. 1154 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1155 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1156 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1157 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1158 Endian Base 128 (LEB128) as defined by DWARF Debugging 1159 Information Format. 1160 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1161 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1162 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1163 1164 Table 7-3. DWARF Exception Header application 1165 Name Value Meaning 1166 DW_EH_PE_absptr 0x00 Value is used with no modification. 1167 DW_EH_PE_pcrel 0x10 Value is reletive to the current program 1168 counter. 1169 DW_EH_PE_datarel 0x30 Value is reletive to the beginning of 1170 the .eh_frame_hdr section. 1171 DW_EH_PE_omit 0xff No value is present. 1172 _________________________________________________________ 1173 1174 Chapter 8. Symbol Versioning 1175 1176 8.1. Introduction 1177 1178 This chapter describes the Symbol Versioning mechanism. All 1179 ELF objects may provide or depend on versioned symbols. Symbol 1180 Versioning is implemented by 3 section types: SHT_GNU_versym, 1181 SHT_GNU_verdef, and SHT_GNU_verneed. 1182 1183 The prefix Elfxx in the following descriptions and code 1184 fragments stands for either "Elf32" or "Elf64", depending on 1185 the architecture. 1186 1187 Versions are described by strings. The structures that are 1188 used for symbol versions also contain a member that holds the 1189 ELF hashing values of the strings. This allows for more 1190 efficient processing. 1191 _________________________________________________________ 1192 1193 8.2. Symbol Version Table 1194 1195 The Symbol Version Table is contained in the special section 1196 .gnu.version which has a section type of SHT_GNU_versym. This 1197 section has the same number of entries as the Dynamic Symbol 1198 Table. 1199 1200 This section contains an array of elements of type Elfxx_Half. 1201 Each entry specifies the version defined for or required by 1202 the corresponding symbol in the Dynamic Symbol Table. 1203 1204 The values in the Symbol Version Table are unique to the 1205 object in which they are located. These values are identifiers 1206 that are provided by the the vna_other member of the 1207 Elfxx_Vernaux structure or the vd_ndx member of the 1208 Elfxx_Verdef structure. 1209 1210 The values 0 and 1 are reserved. 1211 1212 0 1213 The symbol is local, not available outside the object. 1214 1215 1 1216 The symbol is defined in this object and is globally 1217 available. 1218 1219 All other values are used to identify version strings located 1220 in one of the other Symbol Version sections. The value itself 1221 is not the version associated with the symbol. The string 1222 identified by the value defines the version of the symbol. 1223 _________________________________________________________ 1224 1225 8.3. Version Definitions 1226 1227 Symbol definitions are contained in the special section 1228 .gnu.version_d which has a section type of SHT_GNU_verdef. The 1229 number of entries in this section is contained in the 1230 DT_VERDEFNUM entry of the Dynamic Section. The sh_link member 1231 of the section header points to the section that contains the 1232 strings referenced by this section. 1233 typedef struct { 1234 Elfxx_Half vd_version; 1235 Elfxx_Half vd_flags; 1236 Elfxx_Half vd_ndx; 1237 Elfxx_Half vd_cnt; 1238 Elfxx_Word vd_hash; 1239 Elfxx_Word vd_aux; 1240 Elfxx_Word vd_next; 1241 } Elfxx_Verdef; 1242 1243 Figure 8-1. Version Definition Entries 1244 1245 vd_version 1246 Version revision. This value is currently set to 1, and 1247 will be reset if the versioning implementation is 1248 incompatibly altered. 1249 1250 vd_flags 1251 Version information flag bitmask. 1252 1253 vd_ndx 1254 Version index numeric value referencing the 1255 SHT_GNU_versym section. 1256 1257 vd_cnt 1258 Number of associated verdaux array entries. 1259 1260 vd_hash 1261 Version name hash value (ELF hash function). 1262 1263 vd_aux 1264 Offset to a corresponding entry in the verdaux array, 1265 in bytes. 1266 1267 vd_next 1268 Offset to the next verdef entry, in bytes. 1269 1270 typedef struct { 1271 Elfxx_Word vda_name; 1272 Elfxx_Word vda_next; 1273 } Elfxx_Verdaux; 1274 1275 Figure 8-2. Version Definition Auxiliary Entries 1276 1277 vda_name 1278 Offset to the version or dependency name string in the 1279 section header, in bytes. 1280 1281 vda_next 1282 Offset to the next verdaux entry, in bytes. 1283 _________________________________________________________ 1284 1285 8.4. Version Requirements 1286 1287 Symbol definitions are contained in the special section 1288 .gnu.version_r which has a section type of SHT_GNU_verneed. 1289 The number of entries in this section is contained in the 1290 DT_VERNEEDNUM entry of the Dynamic Section. The sh_link member 1291 of the section header points to the section that contains the 1292 strings referenced by this section. 1293 typedef struct { 1294 Elfxx_Half vn_version; 1295 Elfxx_Half vn_cnt; 1296 Elfxx_Word vn_file; 1297 Elfxx_Word vn_aux; 1298 Elfxx_Word vn_next; 1299 } Elfxx_Verneed; 1300 1301 Figure 8-3. Version Needed Entries 1302 1303 vn_version 1304 Version of structure. This value is currently set to 1, 1305 and will be reset if the versioning implementation is 1306 incompatibly altered. 1307 1308 vn_cnt 1309 Number of associated verneed array entries. 1310 1311 vn_file 1312 Offset to the file name string in the section header, 1313 in bytes. 1314 1315 vn_aux 1316 Offset to a corresponding entry in the vernaux array, 1317 in bytes. 1318 1319 vn_next 1320 Offset to the next verneed entry, in bytes. 1321 1322 typedef struct { 1323 Elfxx_Word vna_hash; 1324 Elfxx_Half vna_flags; 1325 Elfxx_Half vna_other; 1326 Elfxx_Word vna_name; 1327 Elfxx_Word vna_next; 1328 } Elfxx_Vernaux; 1329 1330 Figure 8-4. Version Needed Auxiliary Entries 1331 1332 vna_hash 1333 Dependency name hash value (ELF hash function). 1334 1335 vna_flags 1336 Dependency information flag bitmask. 1337 1338 vna_other 1339 Object file version identifier used in the .gnu.version 1340 symbol version array. Bit number 15 controls whether or 1341 not the object is hidden; if this bit is set, the 1342 object cannot be used and the static linker will ignore 1343 the symbol's presence in the object. 1344 1345 vna_name 1346 Offset to the dependency name string in the section 1347 header, in bytes. 1348 1349 vna_next 1350 Offset to the next vernaux entry, in bytes. 1351 _________________________________________________________ 1352 1353 8.5. Startup Sequence 1354 1355 When loading a sharable object, version definition data from 1356 the loaded object is analyzed to assure that it meets the 1357 version requirements of the calling object. The dynamic loader 1358 retrieves the entries in the caller's Elfxx_Verneed array and 1359 attempts to find matching definition information in the loaded 1360 Elfxx_Verdef table. 1361 1362 Each object and dependency is tested in turn. If a symbol 1363 definition is missing, the loader returns an error. A warning 1364 is issued instead of a hard error when the vna_flags bit for 1365 VER_FLG_WEAK is set in the Elfxx_Vernaux entry. 1366 1367 When the versions referenced by undefined symbols in the 1368 loaded object are found, version availability is certified. 1369 The test completes without error and the object is made 1370 available. 1371 _________________________________________________________ 1372 1373 8.6. Symbol Resolution 1374 1375 When symbol versioning is used in an object, relocations 1376 extend the performance of definition testing beyond the simple 1377 match of symbol name strings: the version of the reference 1378 shall also equal the name of the definition. The same index 1379 that is used in the symbol table can be referenced in the 1380 SHT_GNU_versym section, and the value of this index is then 1381 used to acquire name data. The corresponding requirement 1382 string is retrieved from the Elfxx_Verneed array, and 1383 likewise, the corresponding definition string from the 1384 Elfxx_Verdef table. 1385 1386 Bit number 15 of the version symbol controls whether or not 1387 the object is hidden; if this bit is set, the object cannot be 1388 used and the static linker will ignore the symbol's presence 1389 in the object. 1390 1391 Results differ in the interaction of objects that variously 1392 use symbol versioning. 1393 1394 * The object with the reference and the object with the 1395 definitions may both use versioning. All described 1396 matching is processed in this case. A fatal error is 1397 triggered when no matching definition can be found in the 1398 object whose name is the one referenced by the vn_name 1399 element in the Elfxx_Verneed entry. 1400 * The object with the reference may not use versioning, 1401 while the object with the definitions does. In this 1402 instance, only the definition with index numbers 1 and 2 1403 will be used in the reference match, the same identified 1404 by the static linker as the base definition. In infrequent 1405 cases where the static linker was not used, as in calls to 1406 dlopen(), a version that does not have the base definition 1407 index is acceptable as long as it is the only version for 1408 which the symbol is defined. 1409 * The object with the reference may use versioning, but the 1410 object with the definitions specifies none. A matching 1411 symbol is accepted in this case. A fatal error is 1412 triggered in the unlikely event that a corruption in the 1413 required symbols list obscured an outdated object file and 1414 caused a match on the object filename in the Elfxx_Verneed 1415 entry. 1416 * Finally, both the object with the reference and the object 1417 with the definitions may not use versioning. The behavior 1418 in this instance defaults to pre-existing symbol rules. 1419 _________________________________________________________ 1420 1421 Chapter 9. ABI note tag 1422 1423 Every executable shall contain a section named .note.ABI-tag 1424 of type SHT_NOTE. This section is structured as a note section 1425 as documented in the ELF spec. The section shall contain at 1426 least the following entry. The name field (namesz/name) 1427 contains the string "GNU". The type field shall be 1. The 1428 descsz field shall be at least 16, and the first 16 bytes of 1429 the desc field shall be as follows. 1430 1431 The first 32-bit word of the desc field shall be 0 (this 1432 signifies a Linux executable). The second, third, and fourth 1433 32-bit words of the desc field contain the earliest compatible 1434 kernel version. For example, if the 3 words are 2, 2, and 5, 1435 this signifies a 2.2.5 kernel. 1436 1437 III. Dynamic Linking 1438 1439 Table of Contents 1440 10. Program Loading and Dynamic Linking 1441 11. Program Header 1442 12. Dynamic Entries 1443 _________________________________________________________ 1444 1445 Chapter 10. Program Loading and Dynamic Linking 1446 1447 LSB-conforming implementations shall support the object file 1448 information and system actions that create running programs as 1449 specified in the System V ABI and System V ABI Update and as 1450 supplemented by this document and an architecture-specific LSB 1451 specification. 1452 1453 Any shared object that is loaded shall contain sufficient 1454 DT_NEEDED records to satisfy the symbols on the shared 1455 library. 1456 _________________________________________________________ 1457 1458 Chapter 11. Program Header 1459 1460 In addition to the Segment Types defined in the System V ABI 1461 and System V ABI Update the following Segment Types shall also 1462 be supported. 1463 1464 Table 11-1. Linux Segment Types 1465 Name Value 1466 PT_GNU_EH_FRAME 0x6474e550 1467 PT_GNU_STACK 0x6474e551 1468 1469 PT_GNU_EH_FRAME 1470 The array element specifies the location and size of 1471 the exception handling information as defined by the 1472 .eh_frame_hdr section. 1473 1474 PT_GNU_STACK 1475 The p_flags member specifies the permissions on the 1476 segment containing the stack and is used to indicate 1477 wether the stack should be executable. The absense of 1478 this header indicates indicates that the stack will be 1479 executable. 1480 _________________________________________________________ 1481 1482 Chapter 12. Dynamic Entries 1483 1484 12.1. Introduction 1485 1486 A dynamic entry's d_tag member controls the interpretation of 1487 d_un. 1488 _________________________________________________________ 1489 1490 12.2. Dynamic Entries 1491 _________________________________________________________ 1492 1493 12.2.1. ELF Dynamic Entries 1494 1495 The following dynamic entries are defined in the System V ABI 1496 and System V ABI Update. 1497 1498 DT_BIND_NOW 1499 Process relocations of object 1500 1501 DT_DEBUG 1502 For debugging; unspecified 1503 1504 DT_FINI 1505 Address of termination function 1506 1507 DT_HASH 1508 Address of symbol hash table 1509 1510 DT_HIPROC 1511 End of processor-specific 1512 1513 DT_INIT 1514 Address of init function 1515 1516 DT_JMPREL 1517 Address of PLT relocs 1518 1519 DT_LOPROC 1520 Start of processor-specific 1521 1522 DT_NEEDED 1523 Name of needed library 1524 1525 DT_NULL 1526 Marks end of dynamic section 1527 1528 DT_PLTREL 1529 Type of reloc in PLT 1530 1531 DT_PLTRELSZ 1532 Size in bytes of PLT relocs 1533 1534 DT_REL 1535 Address of Rel relocs 1536 1537 DT_RELA 1538 Address of Rela relocs 1539 1540 DT_RELAENT 1541 Size of one Rela reloc 1542 1543 DT_RELASZ 1544 Total size of Rela relocs 1545 1546 DT_RELENT 1547 Size of one Rel reloc 1548 1549 DT_RELSZ 1550 Total size of Rel relocs 1551 1552 DT_RPATH 1553 Library search path 1554 1555 DT_SONAME 1556 Name of shared object 1557 1558 DT_STRSZ 1559 Size of string table 1560 1561 DT_STRTAB 1562 Address of string table 1563 1564 DT_SYMBOLIC 1565 Start symbol search here 1566 1567 DT_SYMENT 1568 Size of one symbol table entry 1569 1570 DT_SYMTAB 1571 Address of symbol table 1572 1573 DT_TEXTREL 1574 Reloc might modify .text 1575 _________________________________________________________ 1576 1577 12.2.2. Additional Dynamic Entries 1578 1579 An LSB conforming object may also use the following additional 1580 Dynamic Entry types. 1581 1582 DT_ADDRRNGHI 1583 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are 1584 reserved for definition by an archLSB. 1585 1586 DT_ADDRRNGLO 1587 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are 1588 reserved for definition by an archLSB. 1589 1590 DT_AUXILIARY 1591 Shared object to load before self 1592 1593 DT_FILTER 1594 Shared object to get values from 1595 1596 DT_FINI_ARRAY 1597 The address of an array of pointers to termination 1598 functions. 1599 1600 DT_FINI_ARRAYSZ 1601 Size in bytes of DT_FINI_ARRAY 1602 1603 DT_HIOS 1604 Values from DT_LOOS through DT_HIOS are reserved for 1605 definition by specific operating systems. 1606 1607 DT_INIT_ARRAY 1608 The address of an array of pointers to initialization 1609 functions. 1610 1611 DT_INIT_ARRAYSZ 1612 Size in bytes of DT_INIT_ARRAY 1613 1614 DT_LOOS 1615 Values from DT_LOOS through DT_HIOS are reserved for 1616 definition by specific operating systems. 1617 1618 DT_NUM 1619 Number of dynamic entry tags defined (excepting 1620 reserved ranges). 1621 1622 DT_POSFLAG_1 1623 Flags for DT_* entries, effecting the following DT_* 1624 entry 1625 1626 DT_RELCOUNT 1627 All Elf32_Rel R_*_RELATIVE relocations have been placed 1628 into a single block and this entry specifies the number 1629 of entries in that block. This permits ld.so.1 to 1630 streamline the processing of RELATIVE relocations. 1631 1632 DT_SYMINENT 1633 Entry size of syminfo 1634 1635 DT_SYMINFO 1636 Address of the Syminfo table. 1637 1638 DT_SYMINSZ 1639 Size of syminfo table (in bytes) 1640 1641 DT_VALRNGHI 1642 Entries which fall between DT_VALRNGHI & DT_VALRNGLO 1643 use the Dyn.d_un.d_val field of the Elf*_Dyn structure. 1644 1645 DT_VALRNGLO 1646 Entries which fall between DT_VALRNGHI & DT_VALRNGLO 1647 use the Dyn.d_un.d_val field of the Elf*_Dyn structure. 1648 1649 DT_VERDEF 1650 Address of version definition table 1651 1652 DT_VERDEFNUM 1653 Number of version definitions 1654 1655 DT_VERNEED 1656 Address of table with needed versions 1657 1658 DT_VERNEEDNUM 1659 Number of needed versions 1660 1661 DT_VERSYM 1662 Address of the table provided by the .gnu.version 1663 section. 1664 1665 Linux Standard Base Specification 1666 _________________________________________________________ 1667 1668 Table of Contents 1669 I. Base Libraries 1670 1671 1. Libraries 1672 1673 1.1. Introduction 1674 1.2. Program Interpreter 1675 1.3. Interfaces for libc 1676 1.4. Data Definitions for libc 1677 1.5. Interface Definitions for libc 1678 1.6. Interfaces for libm 1679 1.7. Data Definitions for libm 1680 1.8. Interface Definitions for libm 1681 1.9. Interfaces for libpthread 1682 1.10. Data Definitions for libpthread 1683 1.11. Interface Definitions for libpthread 1684 1.12. Interfaces for libgcc_s 1685 1.13. Data Definitions for libgcc_s 1686 1.14. Interfaces for libdl 1687 1.15. Data Definitions for libdl 1688 1.16. Interface Definitions for libdl 1689 1.17. Interfaces for libcrypt 1690 1.18. Interfaces for libpam 1691 1.19. Data Definitions for libpam 1692 1.20. Interface Definitions for libpam 1693 1694 II. Utility Libraries 1695 1696 2. Utility Libraries 1697 1698 2.1. Interfaces for libz 1699 2.2. Data Definitions for libz 1700 2.3. Interface Definitions for libz 1701 2.4. Interfaces for libncurses 1702 2.5. Data Definitions for libncurses 1703 2.6. Interfaces for libutil 1704 2.7. Interface Definitions for libutil 1705 1706 III. Commands and Utilities 1707 1708 3. Commands and Utilities 1709 1710 3.1. Commands and Utilities 1711 3.2. Command Behavior 1712 1713 IV. Execution Environment 1714 1715 4. File System Hierarchy 1716 1717 4.1. /dev 1718 4.2. User Accounting Databases 1719 1720 5. Additional Recommendations 1721 1722 5.1. Minimal granted Directory and File permissions 1723 5.2. Recommendations for applications on ownership 1724 and permissions 1725 1726 6. Additional Behaviors 1727 1728 6.1. Mandatory Optional Behaviors 1729 1730 7. Localization 1731 1732 7.1. Regular Expressions 1733 7.2. Pattern Matching Notation 1734 1735 V. System Initialization 1736 1737 8. System Initialization 1738 1739 8.1. Cron Jobs 1740 8.2. Init Script Actions 1741 8.3. Comment Conventions for Init Scripts 1742 8.4. Installation and Removal of init.d Files 1743 8.5. Run Levels 1744 8.6. Facility Names 1745 8.7. Script Names 1746 8.8. Init Script Functions 1747 1748 VI. Users & Groups 1749 1750 9. Users & Groups 1751 1752 9.1. User and Group Database 1753 9.2. User & Group Names 1754 9.3. UID Ranges 1755 9.4. Rationale 1756 1757 A. Alphabetical Listing of Interfaces 1758 1759 A.1. libc 1760 A.2. libcrypt 1761 A.3. libdl 1762 A.4. libm 1763 A.5. libncurses 1764 A.6. libpam 1765 A.7. libpthread 1766 A.8. libutil 1767 A.9. libz 1768 1769 List of Tables 1770 1-1. libc Definition 1771 1-2. libc - RPC Function Interfaces 1772 1-3. libc - RPC Deprecated Function Interfaces 1773 1-4. libc - System Calls Function Interfaces 1774 1-5. libc - System Calls Deprecated Function Interfaces 1775 1-6. libc - Standard I/O Function Interfaces 1776 1-7. libc - Standard I/O Data Interfaces 1777 1-8. libc - Signal Handling Function Interfaces 1778 1-9. libc - Signal Handling Deprecated Function Interfaces 1779 1-10. libc - Signal Handling Data Interfaces 1780 1-11. libc - Localization Functions Function Interfaces 1781 1-12. libc - Localization Functions Data Interfaces 1782 1-13. libc - Socket Interface Function Interfaces 1783 1-14. libc - Socket Interface Deprecated Function Interfaces 1784 1-15. libc - Wide Characters Function Interfaces 1785 1-16. libc - String Functions Function Interfaces 1786 1-17. libc - String Functions Deprecated Function Interfaces 1787 1-18. libc - IPC Functions Function Interfaces 1788 1-19. libc - Regular Expressions Function Interfaces 1789 1-20. libc - Regular Expressions Deprecated Function 1790 Interfaces 1791 1792 1-21. libc - Regular Expressions Deprecated Data Interfaces 1793 1-22. libc - Character Type Functions Function Interfaces 1794 1-23. libc - Time Manipulation Function Interfaces 1795 1-24. libc - Time Manipulation Deprecated Function Interfaces 1796 1-25. libc - Time Manipulation Data Interfaces 1797 1-26. libc - Terminal Interface Functions Function Interfaces 1798 1-27. libc - System Database Interface Function Interfaces 1799 1-28. libc - System Database Interface Deprecated Function 1800 Interfaces 1801 1802 1-29. libc - Language Support Function Interfaces 1803 1-30. libc - Large File Support Function Interfaces 1804 1-31. libc - Standard Library Function Interfaces 1805 1-32. libc - Standard Library Deprecated Function Interfaces 1806 1-33. libc - Standard Library Data Interfaces 1807 1-1. Examples 1808 1-35. libm Definition 1809 1-36. libm - Math Function Interfaces 1810 1-37. libm - Math Data Interfaces 1811 1-38. libpthread Definition 1812 1-39. libpthread - Posix Threads Function Interfaces 1813 1-40. libgcc_s Definition 1814 1-41. libdl Definition 1815 1-42. libdl - Dynamic Loader Function Interfaces 1816 1-43. libcrypt Definition 1817 1-44. libcrypt - Encryption Function Interfaces 1818 1-45. libpam Definition 1819 1-46. libpam - Pluggable Authentication API Function 1820 Interfaces 1821 1822 2-1. libz Definition 1823 2-2. libz - Compression Library Function Interfaces 1824 2-3. libncurses Definition 1825 2-4. libncurses - Curses Function Interfaces 1826 2-5. libncurses - Curses Data Interfaces 1827 2-6. libutil Definition 1828 2-7. libutil - Utility Functions Function Interfaces 1829 3-1. Commands and Utilities 1830 3-1. Escape Sequences 1831 9-1. Required User & Group Names 1832 9-2. Optional User & Group Names 1833 A-1. libc Function Interfaces 1834 A-2. libc Data Interfaces 1835 A-3. libcrypt Function Interfaces 1836 A-4. libdl Function Interfaces 1837 A-5. libm Function Interfaces 1838 A-6. libm Data Interfaces 1839 A-7. libncurses Function Interfaces 1840 A-8. libncurses Data Interfaces 1841 A-9. libpam Function Interfaces 1842 A-10. libpthread Function Interfaces 1843 A-11. libutil Function Interfaces 1844 A-12. libz Function Interfaces 1845 1846 I. Base Libraries 1847 1848 Table of Contents 1849 1. Libraries 1850 _________________________________________________________ 1851 1852 Chapter 1. Libraries 1853 1854 1.1. Introduction 1855 1856 An LSB-conforming implementation shall support some base 1857 libraries which provide interfaces for accessing the operating 1858 system, processor and other hardware in the system. 1859 _________________________________________________________ 1860 1861 1.2. Program Interpreter 1862 1863 The Program Interpreter is specified in the appropriate 1864 architecture-specific LSB specification. 1865 _________________________________________________________ 1866 1867 1.3. Interfaces for libc 1868 1869 Table 1-1 defines the library name and shared object name for 1870 the libc library 1871 1872 Table 1-1. libc Definition 1873 Library: libc 1874 SONAME: See archLSB. 1875 1876 The behavior of the interfaces in this library is specified by 1877 the following specifications: 1878 1879 Large File Support 1880 this specification 1881 SUSv2 1882 ISO POSIX (2003) 1883 SVID Issue 3 1884 SVID Issue 4 1885 _________________________________________________________ 1886 1887 1.3.1. RPC 1888 _________________________________________________________ 1889 1890 1.3.1.1. Interfaces for RPC 1891 1892 An LSB conforming implementation shall provide the generic 1893 functions for RPC specified in Table 1-2, with the full 1894 functionality as described in the referenced underlying 1895 specification. 1896 1897 Table 1-2. libc - RPC Function Interfaces 1898 authnone_create [1] svc_getreqset [2] svcudp_create [3] 1899 xdr_int [2] xdr_u_long [2] 1900 clnt_create [1] svc_register [3] xdr_accepted_reply [2] 1901 xdr_long [2] xdr_u_short [2] 1902 clnt_pcreateerror [1] svc_run [3] xdr_array [2] xdr_opaque [2] 1903 xdr_union [2] 1904 clnt_perrno [1] svc_sendreply [3] xdr_bool [2] xdr_opaque_auth 1905 [2] xdr_vector [2] 1906 clnt_perror [1] svcerr_auth [2] xdr_bytes [2] xdr_pointer [2] 1907 xdr_void [2] 1908 clnt_spcreateerror [1] svcerr_decode [2] xdr_callhdr [2] 1909 xdr_reference [2] xdr_wrapstring [2] 1910 clnt_sperrno [1] svcerr_noproc [2] xdr_callmsg [2] 1911 xdr_rejected_reply [2] xdrmem_create [2] 1912 clnt_sperror [1] svcerr_noprog [2] xdr_char [2] xdr_replymsg 1913 [2] xdrrec_create [2] 1914 key_decryptsession [2] svcerr_progvers [2] xdr_double [2] 1915 xdr_short [2] xdrrec_eof [2] 1916 pmap_getport [3] svcerr_systemerr [2] xdr_enum [2] xdr_string 1917 [2] 1918 pmap_set [3] svcerr_weakauth [2] xdr_float [2] xdr_u_char [2] 1919 1920 pmap_unset [3] svctcp_create [3] xdr_free [2] xdr_u_int [3] 1921 1922 Referenced Specification(s) 1923 1924 [1]. SVID Issue 4 1925 1926 [2]. SVID Issue 3 1927 1928 [3]. this specification 1929 1930 An LSB conforming implementation shall provide the generic 1931 deprecated functions for RPC specified in Table 1-3, with the 1932 full functionality as described in the referenced underlying 1933 specification. 1934 1935 Note: These interfaces are deprecated, and applications 1936 should avoid using them. These interfaces may be withdrawn 1937 in future releases of this specification. 1938 1939 Table 1-3. libc - RPC Deprecated Function Interfaces 1940 getdomainname [1] setdomainname [1] 1941 1942 Referenced Specification(s) 1943 1944 [1]. this specification 1945 _________________________________________________________ 1946 1947 1.3.2. System Calls 1948 _________________________________________________________ 1949 1950 1.3.2.1. Interfaces for System Calls 1951 1952 An LSB conforming implementation shall provide the generic 1953 functions for System Calls specified in Table 1-4, with the 1954 full functionality as described in the referenced underlying 1955 specification. 1956 1957 Table 1-4. libc - System Calls Function Interfaces 1958 __fxstat [1] fchmod [2] getwd [2] read [2] setrlimit [2] 1959 __getpgid [1] fchown [2] initgroups [1] readdir [2] 1960 setrlimit64 [3] 1961 __lxstat [1] fcntl [1] ioctl [1] readdir_r [2] setsid [2] 1962 __xmknod [1] fdatasync [2] kill [1] readlink [2] setuid [2] 1963 __xstat [1] flock [1] killpg [2] readv [2] sleep [2] 1964 access [2] fork [2] lchown [2] rename [2] statvfs [2] 1965 acct [1] fstatvfs [2] link [2] rmdir [2] stime [1] 1966 alarm [2] fsync [2] lockf [2] sbrk [4] symlink [2] 1967 brk [4] ftime [2] lseek [2] sched_get_priority_max [2] sync 1968 [2] 1969 chdir [2] ftruncate [2] mkdir [2] sched_get_priority_min [2] 1970 sysconf [2] 1971 chmod [2] getcontext [2] mkfifo [2] sched_getparam [2] time 1972 [2] 1973 chown [2] getegid [2] mlock [2] sched_getscheduler [2] times 1974 [2] 1975 chroot [4] geteuid [2] mlockall [2] sched_rr_get_interval [2] 1976 truncate [2] 1977 clock [2] getgid [2] mmap [2] sched_setparam [2] ulimit [2] 1978 close [2] getgroups [2] mprotect [2] sched_setscheduler [2] 1979 umask [2] 1980 closedir [2] getitimer [2] msync [2] sched_yield [2] uname [2] 1981 creat [1] getloadavg [1] munlock [2] select [2] unlink [1] 1982 dup [2] getpagesize [4] munlockall [2] setcontext [2] utime 1983 [2] 1984 dup2 [2] getpgid [2] munmap [2] setegid [2] utimes [2] 1985 execl [2] getpgrp [2] nanosleep [2] seteuid [2] vfork [2] 1986 execle [2] getpid [2] nice [2] setgid [2] wait [2] 1987 execlp [2] getppid [2] open [1] setitimer [2] wait4 [1] 1988 execv [2] getpriority [2] opendir [2] setpgid [2] waitpid [1] 1989 execve [2] getrlimit [2] pathconf [2] setpgrp [2] write [2] 1990 execvp [2] getrusage [2] pause [2] setpriority [2] writev [2] 1991 exit [2] getsid [2] pipe [2] setregid [2] 1992 fchdir [2] getuid [2] poll [2] setreuid [2] 1993 1994 Referenced Specification(s) 1995 1996 [1]. this specification 1997 1998 [2]. ISO POSIX (2003) 1999 2000 [3]. Large File Support 2001 2002 [4]. SUSv2 2003 2004 An LSB conforming implementation shall provide the generic 2005 deprecated functions for System Calls specified in Table 1-5, 2006 with the full functionality as described in the referenced 2007 underlying specification. 2008 2009 Note: These interfaces are deprecated, and applications 2010 should avoid using them. These interfaces may be withdrawn 2011 in future releases of this specification. 2012 2013 Table 1-5. libc - System Calls Deprecated Function Interfaces 2014 wait3 [1] 2015 2016 Referenced Specification(s) 2017 2018 [1]. this specification 2019 _________________________________________________________ 2020 2021 1.3.3. Standard I/O 2022 _________________________________________________________ 2023 2024 1.3.3.1. Interfaces for Standard I/O 2025 2026 An LSB conforming implementation shall provide the generic 2027 functions for Standard I/O specified in Table 1-6, with the 2028 full functionality as described in the referenced underlying 2029 specification. 2030 2031 Table 1-6. libc - Standard I/O Function Interfaces 2032 _IO_feof [1] fgetpos [2] fsetpos [2] putchar [2] sscanf [2] 2033 _IO_getc [1] fgets [2] ftell [2] putchar_unlocked [2] telldir 2034 [2] 2035 _IO_putc [1] fgetwc_unlocked [1] ftello [2] puts [2] tempnam 2036 [2] 2037 _IO_puts [1] fileno [2] fwrite [2] putw [3] ungetc [2] 2038 asprintf [1] flockfile [2] getc [2] remove [2] vasprintf [1] 2039 clearerr [2] fopen [1] getc_unlocked [2] rewind [2] vdprintf 2040 [1] 2041 ctermid [2] fprintf [2] getchar [2] rewinddir [2] vfprintf [2] 2042 fclose [2] fputc [2] getchar_unlocked [2] scanf [2] vprintf 2043 [2] 2044 fdopen [2] fputs [2] getw [3] seekdir [2] vsnprintf [2] 2045 feof [2] fread [2] pclose [2] setbuf [2] vsprintf [2] 2046 ferror [2] freopen [1] popen [2] setbuffer [1] 2047 fflush [2] fscanf [2] printf [2] setvbuf [2] 2048 fflush_unlocked [1] fseek [2] putc [2] snprintf [2] 2049 fgetc [2] fseeko [2] putc_unlocked [2] sprintf [2] 2050 2051 Referenced Specification(s) 2052 2053 [1]. this specification 2054 2055 [2]. ISO POSIX (2003) 2056 2057 [3]. SUSv2 2058 2059 An LSB conforming implementation shall provide the generic 2060 data interfaces for Standard I/O specified in Table 1-7, with 2061 the full functionality as described in the referenced 2062 underlying specification. 2063 2064 Table 1-7. libc - Standard I/O Data Interfaces 2065 stderr [1] stdin [1] stdout [1] 2066 2067 Referenced Specification(s) 2068 2069 [1]. ISO POSIX (2003) 2070 _________________________________________________________ 2071 2072 1.3.4. Signal Handling 2073 _________________________________________________________ 2074 2075 1.3.4.1. Interfaces for Signal Handling 2076 2077 An LSB conforming implementation shall provide the generic 2078 functions for Signal Handling specified in Table 1-8, with the 2079 full functionality as described in the referenced underlying 2080 specification. 2081 2082 Table 1-8. libc - Signal Handling Function Interfaces 2083 __libc_current_sigrtmax [1] sigaction [2] sighold [2] sigorset 2084 [1] sigset [2] 2085 __libc_current_sigrtmin [1] sigaddset [2] sigignore [2] 2086 sigpause [2] sigsuspend [2] 2087 __sigsetjmp [1] sigaltstack [2] siginterrupt [2] sigpending 2088 [2] sigtimedwait [2] 2089 __sysv_signal [1] sigandset [1] sigisemptyset [1] sigprocmask 2090 [2] sigwait [2] 2091 bsd_signal [2] sigdelset [2] sigismember [2] sigqueue [2] 2092 sigwaitinfo [2] 2093 psignal [1] sigemptyset [2] siglongjmp [2] sigrelse [2] 2094 raise [2] sigfillset [2] signal [2] sigreturn [1] 2095 2096 Referenced Specification(s) 2097 2098 [1]. this specification 2099 2100 [2]. ISO POSIX (2003) 2101 2102 An LSB conforming implementation shall provide the generic 2103 deprecated functions for Signal Handling specified in Table 2104 1-9, with the full functionality as described in the 2105 referenced underlying specification. 2106 2107 Note: These interfaces are deprecated, and applications 2108 should avoid using them. These interfaces may be withdrawn 2109 in future releases of this specification. 2110 2111 Table 1-9. libc - Signal Handling Deprecated Function 2112 Interfaces 2113 sigblock [1] siggetmask [1] sigstack [2] 2114 2115 Referenced Specification(s) 2116 2117 [1]. this specification 2118 2119 [2]. SUSv2 2120 2121 An LSB conforming implementation shall provide the generic 2122 data interfaces for Signal Handling specified in Table 1-10, 2123 with the full functionality as described in the referenced 2124 underlying specification. 2125 2126 Table 1-10. libc - Signal Handling Data Interfaces 2127 _sys_siglist [1] 2128 2129 Referenced Specification(s) 2130 2131 [1]. this specification 2132 _________________________________________________________ 2133 2134 1.3.5. Localization Functions 2135 _________________________________________________________ 2136 2137 1.3.5.1. Interfaces for Localization Functions 2138 2139 An LSB conforming implementation shall provide the generic 2140 functions for Localization Functions specified in Table 1-11, 2141 with the full functionality as described in the referenced 2142 underlying specification. 2143 2144 Table 1-11. libc - Localization Functions Function Interfaces 2145 bind_textdomain_codeset [1] catopen [2] dngettext [1] 2146 iconv_open [2] setlocale [2] 2147 bindtextdomain [1] dcgettext [1] gettext [1] localeconv [2] 2148 textdomain [1] 2149 catclose [2] dcngettext [1] iconv [2] ngettext [1] 2150 catgets [2] dgettext [1] iconv_close [2] nl_langinfo [2] 2151 2152 Referenced Specification(s) 2153 2154 [1]. this specification 2155 2156 [2]. ISO POSIX (2003) 2157 2158 An LSB conforming implementation shall provide the generic 2159 data interfaces for Localization Functions specified in Table 2160 1-12, with the full functionality as described in the 2161 referenced underlying specification. 2162 2163 Table 1-12. libc - Localization Functions Data Interfaces 2164 _nl_msg_cat_cntr [1] 2165 2166 Referenced Specification(s) 2167 2168 [1]. this specification 2169 _________________________________________________________ 2170 2171 1.3.6. Socket Interface 2172 _________________________________________________________ 2173 2174 1.3.6.1. Interfaces for Socket Interface 2175 2176 An LSB conforming implementation shall provide the generic 2177 functions for Socket Interface specified in Table 1-13, with 2178 the full functionality as described in the referenced 2179 underlying specification. 2180 2181 Table 1-13. libc - Socket Interface Function Interfaces 2182 __h_errno_location [1] gethostname [2] if_nameindex [2] send 2183 [2] socket [2] 2184 accept [2] getpeername [2] if_nametoindex [2] sendmsg [2] 2185 socketpair [2] 2186 bind [2] getsockname [2] listen [2] sendto [2] 2187 bindresvport [1] getsockopt [2] recv [2] setsockopt [1] 2188 connect [2] if_freenameindex [2] recvfrom [2] shutdown [2] 2189 gethostid [2] if_indextoname [2] recvmsg [2] sockatmark [2] 2190 2191 Referenced Specification(s) 2192 2193 [1]. this specification 2194 2195 [2]. ISO POSIX (2003) 2196 2197 An LSB conforming implementation shall provide the generic 2198 deprecated functions for Socket Interface specified in Table 2199 1-14, with the full functionality as described in the 2200 referenced underlying specification. 2201 2202 Note: These interfaces are deprecated, and applications 2203 should avoid using them. These interfaces may be withdrawn 2204 in future releases of this specification. 2205 2206 Table 1-14. libc - Socket Interface Deprecated Function 2207 Interfaces 2208 gethostbyname_r [1] 2209 2210 Referenced Specification(s) 2211 2212 [1]. this specification 2213 _________________________________________________________ 2214 2215 1.3.7. Wide Characters 2216 _________________________________________________________ 2217 2218 1.3.7.1. Interfaces for Wide Characters 2219 2220 An LSB conforming implementation shall provide the generic 2221 functions for Wide Characters specified in Table 1-15, with 2222 the full functionality as described in the referenced 2223 underlying specification. 2224 2225 Table 1-15. libc - Wide Characters Function Interfaces 2226 __wcstod_internal [1] mbsinit [2] vwscanf [2] wcsnlen [1] 2227 wcstoumax [2] 2228 __wcstof_internal [1] mbsnrtowcs [1] wcpcpy [1] wcsnrtombs [1] 2229 wcstouq [1] 2230 __wcstol_internal [1] mbsrtowcs [2] wcpncpy [1] wcspbrk [2] 2231 wcswcs [2] 2232 __wcstold_internal [1] mbstowcs [2] wcrtomb [2] wcsrchr [2] 2233 wcswidth [2] 2234 __wcstoul_internal [1] mbtowc [2] wcscasecmp [1] wcsrtombs [2] 2235 wcsxfrm [2] 2236 btowc [2] putwc [2] wcscat [2] wcsspn [2] wctob [2] 2237 fgetwc [2] putwchar [2] wcschr [2] wcsstr [2] wctomb [2] 2238 fgetws [2] swprintf [2] wcscmp [2] wcstod [2] wctrans [2] 2239 fputwc [2] swscanf [2] wcscoll [2] wcstof [2] wctype [2] 2240 fputws [2] towctrans [2] wcscpy [2] wcstoimax [2] wcwidth [2] 2241 fwide [2] towlower [2] wcscspn [2] wcstok [2] wmemchr [2] 2242 fwprintf [2] towupper [2] wcsdup [1] wcstol [2] wmemcmp [2] 2243 fwscanf [2] ungetwc [2] wcsftime [2] wcstold [2] wmemcpy [2] 2244 getwc [2] vfwprintf [2] wcslen [2] wcstoll [2] wmemmove [2] 2245 getwchar [2] vfwscanf [2] wcsncasecmp [1] wcstombs [2] wmemset 2246 [2] 2247 mblen [2] vswprintf [2] wcsncat [2] wcstoq [1] wprintf [2] 2248 mbrlen [2] vswscanf [2] wcsncmp [2] wcstoul [2] wscanf [2] 2249 mbrtowc [2] vwprintf [2] wcsncpy [2] wcstoull [2] 2250 2251 Referenced Specification(s) 2252 2253 [1]. this specification 2254 2255 [2]. ISO POSIX (2003) 2256 _________________________________________________________ 2257 2258 1.3.8. String Functions 2259 _________________________________________________________ 2260 2261 1.3.8.1. Interfaces for String Functions 2262 2263 An LSB conforming implementation shall provide the generic 2264 functions for String Functions specified in Table 1-16, with 2265 the full functionality as described in the referenced 2266 underlying specification. 2267 2268 Table 1-16. libc - String Functions Function Interfaces 2269 __mempcpy [1] bzero [2] strcasestr [1] strncat [2] strtok [2] 2270 __rawmemchr [1] ffs [2] strcat [2] strncmp [2] strtok_r [2] 2271 __stpcpy [1] index [2] strchr [2] strncpy [2] strtold [2] 2272 __strdup [1] memccpy [2] strcmp [2] strndup [1] strtoll [2] 2273 __strtod_internal [1] memchr [2] strcoll [2] strnlen [1] 2274 strtoq [1] 2275 __strtof_internal [1] memcmp [2] strcpy [2] strpbrk [2] 2276 strtoull [2] 2277 __strtok_r [1] memcpy [2] strcspn [2] strptime [1] strtoumax 2278 [2] 2279 __strtol_internal [1] memmove [2] strdup [2] strrchr [2] 2280 strtouq [1] 2281 __strtold_internal [1] memrchr [1] strerror [2] strsep [1] 2282 strxfrm [2] 2283 __strtoll_internal [1] memset [2] strerror_r [1] strsignal [1] 2284 swab [2] 2285 __strtoul_internal [1] rindex [2] strfmon [2] strspn [2] 2286 __strtoull_internal [1] stpcpy [1] strftime [2] strstr [2] 2287 bcmp [2] stpncpy [1] strlen [2] strtof [2] 2288 bcopy [2] strcasecmp [2] strncasecmp [2] strtoimax [2] 2289 2290 Referenced Specification(s) 2291 2292 [1]. this specification 2293 2294 [2]. ISO POSIX (2003) 2295 2296 An LSB conforming implementation shall provide the generic 2297 deprecated functions for String Functions specified in Table 2298 1-17, with the full functionality as described in the 2299 referenced underlying specification. 2300 2301 Note: These interfaces are deprecated, and applications 2302 should avoid using them. These interfaces may be withdrawn 2303 in future releases of this specification. 2304 2305 Table 1-17. libc - String Functions Deprecated Function 2306 Interfaces 2307 strfry [1] strverscmp [1] 2308 2309 Referenced Specification(s) 2310 2311 [1]. this specification 2312 _________________________________________________________ 2313 2314 1.3.9. IPC Functions 2315 _________________________________________________________ 2316 2317 1.3.9.1. Interfaces for IPC Functions 2318 2319 An LSB conforming implementation shall provide the generic 2320 functions for IPC Functions specified in Table 1-18, with the 2321 full functionality as described in the referenced underlying 2322 specification. 2323 2324 Table 1-18. libc - IPC Functions Function Interfaces 2325 ftok [1] msgrcv [1] semget [1] shmctl [1] 2326 msgctl [1] msgsnd [1] semop [1] shmdt [1] 2327 msgget [1] semctl [1] shmat [1] shmget [1] 2328 2329 Referenced Specification(s) 2330 2331 [1]. ISO POSIX (2003) 2332 _________________________________________________________ 2333 2334 1.3.10. Regular Expressions 2335 _________________________________________________________ 2336 2337 1.3.10.1. Interfaces for Regular Expressions 2338 2339 An LSB conforming implementation shall provide the generic 2340 functions for Regular Expressions specified in Table 1-19, 2341 with the full functionality as described in the referenced 2342 underlying specification. 2343 2344 Table 1-19. libc - Regular Expressions Function Interfaces 2345 regcomp [1] regerror [1] regexec [1] regfree [1] 2346 2347 Referenced Specification(s) 2348 2349 [1]. ISO POSIX (2003) 2350 2351 An LSB conforming implementation shall provide the generic 2352 deprecated functions for Regular Expressions specified in 2353 Table 1-20, with the full functionality as described in the 2354 referenced underlying specification. 2355 2356 Note: These interfaces are deprecated, and applications 2357 should avoid using them. These interfaces may be withdrawn 2358 in future releases of this specification. 2359 2360 Table 1-20. libc - Regular Expressions Deprecated Function 2361 Interfaces 2362 advance [1] re_comp [1] re_exec [1] step [1] 2363 2364 Referenced Specification(s) 2365 2366 [1]. SUSv2 2367 2368 An LSB conforming implementation shall provide the generic 2369 deprecated data interfaces for Regular Expressions specified 2370 in Table 1-21, with the full functionality as described in the 2371 referenced underlying specification. 2372 2373 Note: These interfaces are deprecated, and applications 2374 should avoid using them. These interfaces may be withdrawn 2375 in future releases of this specification. 2376 2377 Table 1-21. libc - Regular Expressions Deprecated Data 2378 Interfaces 2379 loc1 [1] loc2 [1] locs [1] 2380 2381 Referenced Specification(s) 2382 2383 [1]. SUSv2 2384 _________________________________________________________ 2385 2386 1.3.11. Character Type Functions 2387 _________________________________________________________ 2388 2389 1.3.11.1. Interfaces for Character Type Functions 2390 2391 An LSB conforming implementation shall provide the generic 2392 functions for Character Type Functions specified in Table 2393 1-22, with the full functionality as described in the 2394 referenced underlying specification. 2395 2396 Table 1-22. libc - Character Type Functions Function 2397 Interfaces 2398 __ctype_b_loc(GLIBC_2.3) [1] isalpha [2] ispunct [2] iswctype 2399 [2] iswupper [2] 2400 __ctype_get_mb_cur_max [1] isascii [2] isspace [2] iswdigit 2401 [2] iswxdigit [2] 2402 __ctype_tolower_loc(GLIBC_2.3) [1] iscntrl [2] isupper [2] 2403 iswgraph [2] isxdigit [2] 2404 __ctype_toupper_loc(GLIBC_2.3) [1] isdigit [2] iswalnum [2] 2405 iswlower [2] toascii [2] 2406 _tolower [2] isgraph [2] iswalpha [2] iswprint [2] tolower [2] 2407 _toupper [2] islower [2] iswblank [2] iswpunct [2] toupper [2] 2408 isalnum [2] isprint [2] iswcntrl [2] iswspace [2] 2409 2410 Referenced Specification(s) 2411 2412 [1]. this specification 2413 2414 [2]. ISO POSIX (2003) 2415 _________________________________________________________ 2416 2417 1.3.12. Time Manipulation 2418 _________________________________________________________ 2419 2420 1.3.12.1. Interfaces for Time Manipulation 2421 2422 An LSB conforming implementation shall provide the generic 2423 functions for Time Manipulation specified in Table 1-23, with 2424 the full functionality as described in the referenced 2425 underlying specification. 2426 2427 Table 1-23. libc - Time Manipulation Function Interfaces 2428 adjtime [1] ctime [2] gmtime [2] localtime_r [2] ualarm [2] 2429 asctime [2] ctime_r [2] gmtime_r [2] mktime [2] 2430 asctime_r [2] difftime [2] localtime [2] tzset [2] 2431 2432 Referenced Specification(s) 2433 2434 [1]. this specification 2435 2436 [2]. ISO POSIX (2003) 2437 2438 An LSB conforming implementation shall provide the generic 2439 deprecated functions for Time Manipulation specified in Table 2440 1-24, with the full functionality as described in the 2441 referenced underlying specification. 2442 2443 Note: These interfaces are deprecated, and applications 2444 should avoid using them. These interfaces may be withdrawn 2445 in future releases of this specification. 2446 2447 Table 1-24. libc - Time Manipulation Deprecated Function 2448 Interfaces 2449 adjtimex [1] 2450 2451 Referenced Specification(s) 2452 2453 [1]. this specification 2454 2455 An LSB conforming implementation shall provide the generic 2456 data interfaces for Time Manipulation specified in Table 1-25, 2457 with the full functionality as described in the referenced 2458 underlying specification. 2459 2460 Table 1-25. libc - Time Manipulation Data Interfaces 2461 __daylight [1] __tzname [1] timezone [2] 2462 __timezone [1] daylight [2] tzname [2] 2463 2464 Referenced Specification(s) 2465 2466 [1]. this specification 2467 2468 [2]. ISO POSIX (2003) 2469 _________________________________________________________ 2470 2471 1.3.13. Terminal Interface Functions 2472 _________________________________________________________ 2473 2474 1.3.13.1. Interfaces for Terminal Interface Functions 2475 2476 An LSB conforming implementation shall provide the generic 2477 functions for Terminal Interface Functions specified in Table 2478 1-26, with the full functionality as described in the 2479 referenced underlying specification. 2480 2481 Table 1-26. libc - Terminal Interface Functions Function 2482 Interfaces 2483 cfgetispeed [1] cfsetispeed [1] tcdrain [1] tcgetattr [1] 2484 tcsendbreak [1] 2485 cfgetospeed [1] cfsetospeed [1] tcflow [1] tcgetpgrp [1] 2486 tcsetattr [1] 2487 cfmakeraw [2] cfsetspeed [2] tcflush [1] tcgetsid [1] 2488 tcsetpgrp [1] 2489 2490 Referenced Specification(s) 2491 2492 [1]. ISO POSIX (2003) 2493 2494 [2]. this specification 2495 _________________________________________________________ 2496 2497 1.3.14. System Database Interface 2498 _________________________________________________________ 2499 2500 1.3.14.1. Interfaces for System Database Interface 2501 2502 An LSB conforming implementation shall provide the generic 2503 functions for System Database Interface specified in Table 2504 1-27, with the full functionality as described in the 2505 referenced underlying specification. 2506 2507 Table 1-27. libc - System Database Interface Function 2508 Interfaces 2509 endgrent [1] getgrgid_r [1] getpwent [1] getutent [2] 2510 setprotoent [1] 2511 endprotoent [1] getgrnam [1] getpwnam [1] getutent_r [2] 2512 setpwent [1] 2513 endpwent [1] getgrnam_r [1] getpwnam_r [1] getutxent [1] 2514 setservent [1] 2515 endservent [1] gethostbyaddr [1] getpwuid [1] getutxid [1] 2516 setutent [2] 2517 endutent [3] gethostbyname [1] getpwuid_r [1] getutxline [1] 2518 setutxent [1] 2519 endutxent [1] getprotobyname [1] getservbyname [1] pututxline 2520 [1] utmpname [2] 2521 getgrent [1] getprotobynumber [1] getservbyport [1] setgrent 2522 [1] 2523 getgrgid [1] getprotoent [1] getservent [1] setgroups [2] 2524 2525 Referenced Specification(s) 2526 2527 [1]. ISO POSIX (2003) 2528 2529 [2]. this specification 2530 2531 [3]. SUSv2 2532 2533 An LSB conforming implementation shall provide the generic 2534 deprecated functions for System Database Interface specified 2535 in Table 1-28, with the full functionality as described in the 2536 referenced underlying specification. 2537 2538 Note: These interfaces are deprecated, and applications 2539 should avoid using them. These interfaces may be withdrawn 2540 in future releases of this specification. 2541 2542 Table 1-28. libc - System Database Interface Deprecated 2543 Function Interfaces 2544 endnetent [1] getnetbyaddr [1] setnetent [1] 2545 2546 Referenced Specification(s) 2547 2548 [1]. ISO POSIX (2003) 2549 _________________________________________________________ 2550 2551 1.3.15. Language Support 2552 _________________________________________________________ 2553 2554 1.3.15.1. Interfaces for Language Support 2555 2556 An LSB conforming implementation shall provide the generic 2557 functions for Language Support specified in Table 1-29, with 2558 the full functionality as described in the referenced 2559 underlying specification. 2560 2561 Table 1-29. libc - Language Support Function Interfaces 2562 __libc_start_main [1] __register_atfork(GLIBC_2.3.2) [1] 2563 2564 Referenced Specification(s) 2565 2566 [1]. this specification 2567 _________________________________________________________ 2568 2569 1.3.16. Large File Support 2570 _________________________________________________________ 2571 2572 1.3.16.1. Interfaces for Large File Support 2573 2574 An LSB conforming implementation shall provide the generic 2575 functions for Large File Support specified in Table 1-30, with 2576 the full functionality as described in the referenced 2577 underlying specification. 2578 2579 Table 1-30. libc - Large File Support Function Interfaces 2580 __fxstat64 [1] fopen64 [2] ftello64 [2] lseek64 [2] readdir64 2581 [2] 2582 __lxstat64 [1] freopen64 [2] ftruncate64 [2] mkstemp64 [2] 2583 statvfs64 [2] 2584 __xstat64 [1] fseeko64 [2] ftw64 [2] mmap64 [2] tmpfile64 [2] 2585 creat64 [2] fsetpos64 [2] getrlimit64 [2] nftw64 [2] 2586 truncate64 [2] 2587 fgetpos64 [2] fstatvfs64 [2] lockf64 [2] open64 [2] 2588 2589 Referenced Specification(s) 2590 2591 [1]. this specification 2592 2593 [2]. Large File Support 2594 _________________________________________________________ 2595 2596 1.3.17. Standard Library 2597 _________________________________________________________ 2598 2599 1.3.17.1. Interfaces for Standard Library 2600 2601 An LSB conforming implementation shall provide the generic 2602 functions for Standard Library specified in Table 1-31, with 2603 the full functionality as described in the referenced 2604 underlying specification. 2605 2606 Table 1-31. libc - Standard Library Function Interfaces 2607 _Exit [1] dirname [1] glob [1] lsearch [1] srandom [1] 2608 __assert_fail [2] div [1] glob64 [2] makecontext [1] strtod 2609 [1] 2610 __cxa_atexit [2] drand48 [1] globfree [1] malloc [1] strtol 2611 [1] 2612 __errno_location [2] ecvt [1] globfree64 [2] memmem [2] 2613 strtoul [1] 2614 __fpending [2] erand48 [1] grantpt [1] mkstemp [1] swapcontext 2615 [1] 2616 __getpagesize [2] err [2] hcreate [1] mktemp [1] syslog [1] 2617 __isinf [2] error [2] hdestroy [1] mrand48 [1] system [2] 2618 __isinff [2] errx [2] hsearch [1] nftw [1] tdelete [1] 2619 __isinfl [2] fcvt [1] htonl [1] nrand48 [1] tfind [1] 2620 __isnan [2] fmtmsg [1] htons [1] ntohl [1] tmpfile [1] 2621 __isnanf [2] fnmatch [1] imaxabs [1] ntohs [1] tmpnam [1] 2622 __isnanl [2] fpathconf [1] imaxdiv [1] openlog [1] tsearch [1] 2623 __sysconf [2] free [1] inet_addr [1] perror [1] ttyname [1] 2624 _exit [1] freeaddrinfo [1] inet_ntoa [1] posix_memalign [1] 2625 ttyname_r [1] 2626 _longjmp [1] ftrylockfile [1] inet_ntop [1] ptsname [1] twalk 2627 [1] 2628 _setjmp [1] ftw [1] inet_pton [1] putenv [1] unlockpt [1] 2629 a64l [1] funlockfile [1] initstate [1] qsort [1] unsetenv [1] 2630 abort [1] gai_strerror [1] insque [1] rand [1] usleep [1] 2631 abs [1] gcvt [1] isatty [1] rand_r [1] verrx [2] 2632 atof [1] getaddrinfo [1] isblank [1] random [1] vfscanf [1] 2633 atoi [1] getcwd [1] jrand48 [1] realloc [1] vscanf [1] 2634 atol [1] getdate [1] l64a [1] realpath [1] vsscanf [1] 2635 atoll [1] getenv [1] labs [1] remque [1] vsyslog [2] 2636 basename [1] getlogin [1] lcong48 [1] seed48 [1] warn [2] 2637 bsearch [1] getnameinfo [1] ldiv [1] setenv [1] warnx [2] 2638 calloc [1] getopt [2] lfind [1] sethostname [2] wordexp [1] 2639 closelog [1] getopt_long [2] llabs [1] setlogmask [1] wordfree 2640 [1] 2641 confstr [1] getopt_long_only [2] lldiv [1] setstate [1] 2642 cuserid [3] getsubopt [1] longjmp [1] srand [1] 2643 daemon [2] gettimeofday [1] lrand48 [1] srand48 [1] 2644 2645 Referenced Specification(s) 2646 2647 [1]. ISO POSIX (2003) 2648 2649 [2]. this specification 2650 2651 [3]. SUSv2 2652 2653 An LSB conforming implementation shall provide the generic 2654 deprecated functions for Standard Library specified in Table 2655 1-32, with the full functionality as described in the 2656 referenced underlying specification. 2657 2658 Note: These interfaces are deprecated, and applications 2659 should avoid using them. These interfaces may be withdrawn 2660 in future releases of this specification. 2661 2662 Table 1-32. libc - Standard Library Deprecated Function 2663 Interfaces 2664 random_r [1] sethostid [1] 2665 2666 Referenced Specification(s) 2667 2668 [1]. this specification 2669 2670 An LSB conforming implementation shall provide the generic 2671 data interfaces for Standard Library specified in Table 1-33, 2672 with the full functionality as described in the referenced 2673 underlying specification. 2674 2675 Table 1-33. libc - Standard Library Data Interfaces 2676 __environ [1] _sys_errlist [1] getdate_err [2] opterr [1] 2677 optopt [1] 2678 _environ [1] environ [2] optarg [2] optind [1] 2679 2680 Referenced Specification(s) 2681 2682 [1]. this specification 2683 2684 [2]. ISO POSIX (2003) 2685 _________________________________________________________ 2686 2687 1.4. Data Definitions for libc 2688 2689 This section defines global identifiers and their values that 2690 are associated with interfaces contained in libc. These 2691 definitions are organized into groups that correspond to 2692 system headers. This convention is used as a convenience for 2693 the reader, and does not imply the existence of these headers, 2694 or their content. 2695 2696 These definitions are intended to supplement those provided in 2697 the referenced underlying specifications. 2698 2699 This specification uses ISO/IEC 9899 C Language as the 2700 reference programming language, and data definitions are 2701 specified in ISO C format. The C language is used here as a 2702 convenient notation. Using a C language description of these 2703 data objects does not preclude their use by other programming 2704 languages. 2705 _________________________________________________________ 2706 2707 1.4.1. ctype.h 2708 2709 enum 2710 { 2711 _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint 2712 , 2713 _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum 2714 } 2715 ; 2716 _________________________________________________________ 2717 2718 1.4.2. dirent.h 2719 2720 typedef struct __dirstream DIR; 2721 2722 struct dirent 2723 { 2724 long d_ino; 2725 off_t d_off; 2726 unsigned short d_reclen; 2727 unsigned char d_type; 2728 char d_name[256]; 2729 } 2730 ; 2731 struct dirent64 2732 { 2733 uint64_t d_ino; 2734 int64_t d_off; 2735 unsigned short d_reclen; 2736 unsigned char d_type; 2737 char d_name[256]; 2738 } 2739 ; 2740 _________________________________________________________ 2741 2742 1.4.3. errno.h 2743 2744 #define errno (*__errno_location()) 2745 2746 #define EPERM 1 2747 #define ECHILD 10 2748 #define ENETDOWN 100 2749 #define ENETUNREACH 101 2750 #define ENETRESET 102 2751 #define ECONNABORTED 103 2752 #define ECONNRESET 104 2753 #define ENOBUFS 105 2754 #define EISCONN 106 2755 #define ENOTCONN 107 2756 #define ESHUTDOWN 108 2757 #define ETOOMANYREFS 109 2758 #define EAGAIN 11 2759 #define ETIMEDOUT 110 2760 #define ECONNREFUSED 111 2761 #define EHOSTDOWN 112 2762 #define EHOSTUNREACH 113 2763 #define EALREADY 114 2764 #define EINPROGRESS 115 2765 #define ESTALE 116 2766 #define EUCLEAN 117 2767 #define ENOTNAM 118 2768 #define ENAVAIL 119 2769 #define ENOMEM 12 2770 #define EISNAM 120 2771 #define EREMOTEIO 121 2772 #define EDQUOT 122 2773 #define ENOMEDIUM 123 2774 #define EMEDIUMTYPE 124 2775 #define ECANCELED 125 2776 #define EACCES 13 2777 #define EFAULT 14 2778 #define ENOTBLK 15 2779 #define EBUSY 16 2780 #define EEXIST 17 2781 #define EXDEV 18 2782 #define ENODEV 19 2783 #define ENOENT 2 2784 #define ENOTDIR 20 2785 #define EISDIR 21 2786 #define EINVAL 22 2787 #define ENFILE 23 2788 #define EMFILE 24 2789 #define ENOTTY 25 2790 #define ETXTBSY 26 2791 #define EFBIG 27 2792 #define ENOSPC 28 2793 #define ESPIPE 29 2794 #define ESRCH 3 2795 #define EROFS 30 2796 #define EMLINK 31 2797 #define EPIPE 32 2798 #define EDOM 33 2799 #define ERANGE 34 2800 #define EDEADLK 35 2801 #define ENAMETOOLONG 36 2802 #define ENOLCK 37 2803 #define ENOSYS 38 2804 #define ENOTEMPTY 39 2805 #define EINTR 4 2806 #define ELOOP 40 2807 #define ENOMSG 42 2808 #define EIDRM 43 2809 #define ECHRNG 44 2810 #define EL2NSYNC 45 2811 #define EL3HLT 46 2812 #define EL3RST 47 2813 #define ELNRNG 48 2814 #define EUNATCH 49 2815 #define EIO 5 2816 #define ENOANO 55 2817 #define EBADRQC 56 2818 #define EBADSLT 57 2819 #define EBFONT 59 2820 #define ENXIO 6 2821 #define ENOSTR 60 2822 #define ENODATA 61 2823 #define ETIME 62 2824 #define ENOSR 63 2825 #define ENONET 64 2826 #define ENOPKG 65 2827 #define EREMOTE 66 2828 #define ENOLINK 67 2829 #define EADV 68 2830 #define ESRMNT 69 2831 #define E2BIG 7 2832 #define ECOMM 70 2833 #define EPROTO 71 2834 #define EMULTIHOP 72 2835 #define EDOTDOT 73 2836 #define EBADMSG 74 2837 #define EOVERFLOW 75 2838 #define ENOTUNIQ 76 2839 #define EBADFD 77 2840 #define EREMCHG 78 2841 #define ELIBACC 79 2842 #define ENOEXEC 8 2843 #define ELIBBAD 80 2844 #define ELIBSCN 81 2845 #define ELIBMAX 82 2846 #define ELIBEXEC 83 2847 #define EILSEQ 84 2848 #define ERESTART 85 2849 #define ESTRPIPE 86 2850 #define EUSERS 87 2851 #define ENOTSOCK 88 2852 #define EDESTADDRREQ 89 2853 #define EBADF 9 2854 #define EMSGSIZE 90 2855 #define EPROTOTYPE 91 2856 #define ENOPROTOOPT 92 2857 #define EPROTONOSUPPORT 93 2858 #define ESOCKTNOSUPPORT 94 2859 #define EOPNOTSUPP 95 2860 #define EPFNOSUPPORT 96 2861 #define EAFNOSUPPORT 97 2862 #define EADDRINUSE 98 2863 #define EADDRNOTAVAIL 99 2864 #define EWOULDBLOCK EAGAIN 2865 #define ENOTSUP EOPNOTSUPP 2866 _________________________________________________________ 2867 2868 1.4.4. fcntl.h 2869 2870 #define O_RDONLY 00 2871 #define O_ACCMODE 0003 2872 #define O_WRONLY 01 2873 #define O_CREAT 0100 2874 #define O_TRUNC 01000 2875 #define O_SYNC 010000 2876 #define O_RDWR 02 2877 #define O_EXCL 0200 2878 #define O_APPEND 02000 2879 #define O_ASYNC 020000 2880 #define O_NOCTTY 0400 2881 #define O_NDELAY 04000 2882 #define O_NONBLOCK 04000 2883 #define FD_CLOEXEC 1 2884 2885 struct flock 2886 { 2887 short l_type; 2888 short l_whence; 2889 off_t l_start; 2890 off_t l_len; 2891 pid_t l_pid; 2892 } 2893 ; 2894 struct flock64 2895 { 2896 short l_type; 2897 short l_whence; 2898 loff_t l_start; 2899 loff_t l_len; 2900 pid_t l_pid; 2901 } 2902 ; 2903 2904 #define F_DUPFD 0 2905 #define F_RDLCK 0 2906 #define F_GETFD 1 2907 #define F_WRLCK 1 2908 #define F_SETFD 2 2909 #define F_UNLCK 2 2910 #define F_GETFL 3 2911 #define F_SETFL 4 2912 #define F_GETLK 5 2913 #define F_SETLK 6 2914 #define F_SETLKW 7 2915 #define F_SETOWN 8 2916 #define F_GETOWN 9 2917 _________________________________________________________ 2918 2919 1.4.5. fmtmsg.h 2920 2921 #define MM_HARD 1 2922 #define MM_NRECOV 128 2923 #define MM_UTIL 16 2924 #define MM_SOFT 2 2925 #define MM_OPSYS 32 2926 #define MM_FIRM 4 2927 #define MM_RECOVER 64 2928 #define MM_APPL 8 2929 2930 #define MM_NOSEV 0 2931 #define MM_HALT 1 2932 #define MM_ERROR 2 2933 2934 #define MM_NULLLBL ((char *) 0) 2935 _________________________________________________________ 2936 2937 1.4.6. fnmatch.h 2938 2939 #define FNM_PATHNAME (1<<0) 2940 #define FNM_NOESCAPE (1<<1) 2941 #define FNM_PERIOD (1<<2) 2942 #define FNM_NOMATCH 1 2943 _________________________________________________________ 2944 2945 1.4.7. ftw.h 2946 2947 #define FTW_D FTW_D 2948 #define FTW_DNR FTW_DNR 2949 #define FTW_DP FTW_DP 2950 #define FTW_F FTW_F 2951 #define FTW_NS FTW_NS 2952 #define FTW_SL FTW_SL 2953 #define FTW_SLN FTW_SLN 2954 2955 enum 2956 { 2957 FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN 2958 } 2959 ; 2960 2961 enum 2962 { 2963 FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH 2964 } 2965 ; 2966 2967 struct FTW 2968 { 2969 int base; 2970 int level; 2971 } 2972 ; 2973 2974 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 2975 int __flag); 2976 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __stat 2977 us, 2978 int __flag); 2979 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 2980 int __flag, struct FTW * __info); 2981 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __sta 2982 tus, 2983 int __flag, struct FTW * __info); 2984 _________________________________________________________ 2985 2986 1.4.8. getopt.h 2987 2988 #define no_argument 0 2989 #define required_argument 1 2990 #define optional_argument 2 2991 2992 struct option 2993 { 2994 char *name; 2995 int has_arg; 2996 int *flag; 2997 int val; 2998 } 2999 ; 3000 _________________________________________________________ 3001 3002 1.4.9. glob.h 3003 3004 #define GLOB_ERR (1<<0) 3005 #define GLOB_MARK (1<<1) 3006 #define GLOB_BRACE (1<<10) 3007 #define GLOB_NOMAGIC (1<<11) 3008 #define GLOB_TILDE (1<<12) 3009 #define GLOB_ONLYDIR (1<<13) 3010 #define GLOB_TILDE_CHECK (1<<14) 3011 #define GLOB_NOSORT (1<<2) 3012 #define GLOB_DOOFFS (1<<3) 3013 #define GLOB_NOCHECK (1<<4) 3014 #define GLOB_APPEND (1<<5) 3015 #define GLOB_NOESCAPE (1<<6) 3016 #define GLOB_PERIOD (1<<7) 3017 #define GLOB_MAGCHAR (1<<8) 3018 #define GLOB_ALTDIRFUNC (1<<9) 3019 3020 #define GLOB_NOSPACE 1 3021 #define GLOB_ABORTED 2 3022 #define GLOB_NOMATCH 3 3023 #define GLOB_NOSYS 4 3024 3025 typedef struct 3026 { 3027 size_t gl_pathc; 3028 char **gl_pathv; 3029 size_t gl_offs; 3030 int gl_flags; 3031 void (*gl_closedir) (void *); 3032 struct dirent *(*gl_readdir) (void *); 3033 void *(*gl_opendir) (const char *); 3034 int (*gl_lstat) (const char *, struct stat *); 3035 int (*gl_stat) (const char *, struct stat *); 3036 } 3037 glob_t; 3038 3039 typedef struct 3040 { 3041 size_t gl_pathc; 3042 char **gl_pathv; 3043 size_t gl_offs; 3044 int gl_flags; 3045 void (*gl_closedir) (void *); 3046 struct dirent64 *(*gl_readdir64) (void *); 3047 void *(*gl_opendir) (const char *); 3048 int (*gl_lstat) (const char *, struct stat *); 3049 int (*gl_stat) (const char *, struct stat *); 3050 } 3051 glob64_t; 3052 _________________________________________________________ 3053 3054 1.4.10. grp.h 3055 3056 struct group 3057 { 3058 char *gr_name; 3059 char *gr_passwd; 3060 gid_t gr_gid; 3061 char **gr_mem; 3062 } 3063 ; 3064 _________________________________________________________ 3065 3066 1.4.11. iconv.h 3067 3068 typedef void *iconv_t; 3069 _________________________________________________________ 3070 3071 1.4.12. inttypes.h 3072 3073 typedef lldiv_t imaxdiv_t; 3074 typedef unsigned char uint8_t; 3075 typedef unsigned short uint16_t; 3076 typedef unsigned int uint32_t; 3077 _________________________________________________________ 3078 3079 1.4.13. langinfo.h 3080 3081 #define ABDAY_1 0x20000 3082 #define ABDAY_2 0x20001 3083 #define ABDAY_3 0x20002 3084 #define ABDAY_4 0x20003 3085 #define ABDAY_5 0x20004 3086 #define ABDAY_6 0x20005 3087 #define ABDAY_7 0x20006 3088 3089 #define DAY_1 0x20007 3090 #define DAY_2 0x20008 3091 #define DAY_3 0x20009 3092 #define DAY_4 0x2000A 3093 #define DAY_5 0x2000B 3094 #define DAY_6 0x2000C 3095 #define DAY_7 0x2000D 3096 3097 #define ABMON_1 0x2000E 3098 #define ABMON_2 0x2000F 3099 #define ABMON_3 0x20010 3100 #define ABMON_4 0x20011 3101 #define ABMON_5 0x20012 3102 #define ABMON_6 0x20013 3103 #define ABMON_7 0x20014 3104 #define ABMON_8 0x20015 3105 #define ABMON_9 0x20016 3106 #define ABMON_10 0x20017 3107 #define ABMON_11 0x20018 3108 #define ABMON_12 0x20019 3109 3110 #define MON_1 0x2001A 3111 #define MON_2 0x2001B 3112 #define MON_3 0x2001C 3113 #define MON_4 0x2001D 3114 #define MON_5 0x2001E 3115 #define MON_6 0x2001F 3116 #define MON_7 0x20020 3117 #define MON_8 0x20021 3118 #define MON_9 0x20022 3119 #define MON_10 0x20023 3120 #define MON_11 0x20024 3121 #define MON_12 0x20025 3122 3123 #define AM_STR 0x20026 3124 #define PM_STR 0x20027 3125 3126 #define D_T_FMT 0x20028 3127 #define D_FMT 0x20029 3128 #define T_FMT 0x2002A 3129 #define T_FMT_AMPM 0x2002B 3130 3131 #define ERA 0x2002C 3132 #define ERA_D_FMT 0x2002E 3133 #define ALT_DIGITS 0x2002F 3134 #define ERA_D_T_FMT 0x20030 3135 #define ERA_T_FMT 0x20031 3136 3137 #define CODESET 14 3138 3139 #define CRNCYSTR 0x4000F 3140 3141 #define RADIXCHAR 0x10000 3142 #define THOUSEP 0x10001 3143 #define YESEXPR 0x50000 3144 #define NOEXPR 0x50001 3145 #define YESSTR 0x50002 3146 #define NOSTR 0x50003 3147 _________________________________________________________ 3148 3149 1.4.14. limits.h 3150 3151 #define LLONG_MIN (-LLONG_MAX-1LL) 3152 #define ULLONG_MAX 18446744073709551615ULL 3153 #define OPEN_MAX 256 3154 #define PATH_MAX 4096 3155 #define LLONG_MAX 9223372036854775807LL 3156 #define SSIZE_MAX LONG_MAX 3157 3158 #define MB_LEN_MAX 16 3159 3160 #define SCHAR_MIN (-128) 3161 #define SCHAR_MAX 127 3162 #define UCHAR_MAX 255 3163 #define CHAR_BIT 8 3164 3165 #define SHRT_MIN (-32768) 3166 #define SHRT_MAX 32767 3167 #define USHRT_MAX 65535 3168 3169 #define INT_MIN (-INT_MAX-1) 3170 #define INT_MAX 2147483647 3171 #define __INT_MAX__ 2147483647 3172 #define UINT_MAX 4294967295U 3173 3174 #define LONG_MIN (-LONG_MAX-1L) 3175 _________________________________________________________ 3176 3177 1.4.15. locale.h 3178 3179 #define LC_CTYPE 0 3180 #define LC_NUMERIC 1 3181 #define LC_TELEPHONE 10 3182 #define LC_MEASUREMENT 11 3183 #define LC_IDENTIFICATION 12 3184 #define LC_TIME 2 3185 #define LC_COLLATE 3 3186 #define LC_MONETARY 4 3187 #define LC_MESSAGES 5 3188 #define LC_ALL 6 3189 #define LC_PAPER 7 3190 #define LC_NAME 8 3191 #define LC_ADDRESS 9 3192 3193 struct lconv 3194 { 3195 char *decimal_point; 3196 char *thousands_sep; 3197 char *grouping; 3198 char *int_curr_symbol; 3199 char *currency_symbol; 3200 char *mon_decimal_point; 3201 char *mon_thousands_sep; 3202 char *mon_grouping; 3203 char *positive_sign; 3204 char *negative_sign; 3205 char int_frac_digits; 3206 char frac_digits; 3207 char p_cs_precedes; 3208 char p_sep_by_space; 3209 char n_cs_precedes; 3210 char n_sep_by_space; 3211 char p_sign_posn; 3212 char n_sign_posn; 3213 char int_p_cs_precedes; 3214 char int_p_sep_by_space; 3215 char int_n_cs_precedes; 3216 char int_n_sep_by_space; 3217 char int_p_sign_posn; 3218 char int_n_sign_posn; 3219 } 3220 ; 3221 3222 typedef struct __locale_struct 3223 { 3224 struct locale_data *__locales[13]; 3225 const unsigned short *__ctype_b; 3226 const int *__ctype_tolower; 3227 const int *__ctype_toupper; 3228 const char *__names[13]; 3229 } 3230 *__locale_t; 3231 _________________________________________________________ 3232 3233 1.4.16. net/if.h 3234 3235 #define IF_NAMESIZE 16 3236 3237 #define IFF_UP 0x01 3238 #define IFF_BROADCAST 0x02 3239 #define IFF_DEBUG 0x04 3240 #define IFF_LOOPBACK 0x08 3241 #define IFF_POINTOPOINT 0x10 3242 #define IFF_PROMISC 0x100 3243 #define IFF_MULTICAST 0x1000 3244 #define IFF_NOTRAILERS 0x20 3245 #define IFF_RUNNING 0x40 3246 #define IFF_NOARP 0x80 3247 3248 struct if_nameindex 3249 { 3250 unsigned int if_index; 3251 char *if_name; 3252 } 3253 ; 3254 3255 struct ifaddr 3256 { 3257 struct sockaddr ifa_addr; 3258 union 3259 { 3260 struct sockaddr ifu_broadaddr; 3261 struct sockaddr ifu_dstaddr; 3262 } 3263 ifa_ifu; 3264 void *ifa_ifp; 3265 void *ifa_next; 3266 } 3267 ; 3268 #define IFNAMSIZ IF_NAMESIZE 3269 3270 struct ifreq 3271 { 3272 union 3273 { 3274 char ifrn_name[IFNAMSIZ]; 3275 } 3276 ifr_ifrn; 3277 union 3278 { 3279 struct sockaddr ifru_addr; 3280 struct sockaddr ifru_dstaddr; 3281 struct sockaddr ifru_broadaddr; 3282 struct sockaddr ifru_netmask; 3283 struct sockaddr ifru_hwaddr; 3284 short ifru_flags; 3285 int ifru_ivalue; 3286 int ifru_mtu; 3287 char ifru_slave[IFNAMSIZ]; 3288 char ifru_newname[IFNAMSIZ]; 3289 caddr_t ifru_data; 3290 struct ifmap ifru_map; 3291 } 3292 ifr_ifru; 3293 } 3294 ; 3295 3296 struct ifconf 3297 { 3298 int ifc_len; 3299 union 3300 { 3301 caddr_t ifcu_buf; 3302 struct ifreq *ifcu_req; 3303 } 3304 ifc_ifcu; 3305 } 3306 ; 3307 _________________________________________________________ 3308 3309 1.4.17. netdb.h 3310 3311 #define NETDB_INTERNAL -1 3312 #define NETDB_SUCCESS 0 3313 #define HOST_NOT_FOUND 1 3314 #define IPPORT_RESERVED 1024 3315 #define NI_MAXHOST 1025 3316 #define TRY_AGAIN 2 3317 #define NO_RECOVERY 3 3318 #define NI_MAXSERV 32 3319 #define NO_DATA 4 3320 #define h_addr h_addr_list[0] 3321 #define NO_ADDRESS NO_DATA 3322 3323 struct servent 3324 { 3325 char *s_name; 3326 char **s_aliases; 3327 int s_port; 3328 char *s_proto; 3329 } 3330 ; 3331 struct hostent 3332 { 3333 char *h_name; 3334 char **h_aliases; 3335 int h_addrtype; 3336 int h_length; 3337 char **h_addr_list; 3338 } 3339 ; 3340 struct protoent 3341 { 3342 char *p_name; 3343 char **p_aliases; 3344 int p_proto; 3345 } 3346 ; 3347 struct netent 3348 { 3349 char *n_name; 3350 char **n_aliases; 3351 int n_addrtype; 3352 unsigned int n_net; 3353 } 3354 ; 3355 #define AI_PASSIVE 0x0001 3356 #define AI_CANONNAME 0x0002 3357 #define AI_NUMERICHOST 0x0004 3358 3359 struct addrinfo 3360 { 3361 int ai_flags; 3362 int ai_family; 3363 int ai_socktype; 3364 int ai_protocol; 3365 socklen_t ai_addrlen; 3366 struct sockaddr *ai_addr; 3367 char *ai_canonname; 3368 struct addrinfo *ai_next; 3369 } 3370 ; 3371 #define NI_NUMERICHOST 1 3372 #define NI_DGRAM 16 3373 #define NI_NUMERICSERV 2 3374 #define NI_NOFQDN 4 3375 #define NI_NAMEREQD 8 3376 3377 #define EAI_BADFLAGS -1 3378 #define EAI_MEMORY -10 3379 #define EAI_SYSTEM -11 3380 #define EAI_NONAME -2 3381 #define EAI_AGAIN -3 3382 #define EAI_FAIL -4 3383 #define EAI_NODATA -5 3384 #define EAI_FAMILY -6 3385 #define EAI_SOCKTYPE -7 3386 #define EAI_SERVICE -8 3387 #define EAI_ADDRFAMILY -9 3388 _________________________________________________________ 3389 3390 1.4.18. netinet/in.h 3391 3392 #define IPPROTO_IP 0 3393 #define IPPROTO_ICMP 1 3394 #define IPPROTO_UDP 17 3395 #define IPPROTO_IGMP 2 3396 #define IPPROTO_RAW 255 3397 #define IPPROTO_IPV6 41 3398 #define IPPROTO_ICMPV6 58 3399 #define IPPROTO_TCP 6 3400 3401 typedef uint16_t in_port_t; 3402 3403 struct in_addr 3404 { 3405 uint32_t s_addr; 3406 } 3407 ; 3408 typedef uint32_t in_addr_t; 3409 #define INADDR_NONE ((in_addr_t) 0xffffffff) 3410 #define INADDR_BROADCAST (0xffffffff) 3411 #define INADDR_ANY 0 3412 3413 struct in6_addr 3414 { 3415 union 3416 { 3417 uint8_t u6_addr8[16]; 3418 uint16_t u6_addr16[8]; 3419 uint32_t u6_addr32[4]; 3420 } 3421 in6_u; 3422 } 3423 ; 3424 #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } 3425 } } 3426 #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } 3427 } } 3428 3429 #define INET_ADDRSTRLEN 16 3430 3431 struct sockaddr_in 3432 { 3433 sa_family_t sin_family; 3434 unsigned short sin_port; 3435 struct in_addr sin_addr; 3436 unsigned char sin_zero[8]; 3437 } 3438 ; 3439 #define INET6_ADDRSTRLEN 46 3440 3441 struct sockaddr_in6 3442 { 3443 unsigned short sin6_family; 3444 uint16_t sin6_port; 3445 uint32_t sin6_flowinfo; 3446 struct in6_addr sin6_addr; 3447 uint32_t sin6_scope_id; 3448 } 3449 ; 3450 #define SOL_IP 0 3451 #define IP_TOS 1 3452 #define IPV6_UNICAST_HOPS 16 3453 #define IPV6_MULTICAST_IF 17 3454 #define IPV6_MULTICAST_HOPS 18 3455 #define IPV6_MULTICAST_LOOP 19 3456 #define IPV6_JOIN_GROUP 20 3457 #define IPV6_LEAVE_GROUP 21 3458 #define IPV6_V6ONLY 26 3459 #define IP_MULTICAST_IF 32 3460 #define IP_MULTICAST_TTL 33 3461 #define IP_MULTICAST_LOOP 34 3462 #define IP_ADD_MEMBERSHIP 35 3463 #define IP_DROP_MEMBERSHIP 36 3464 3465 struct ipv6_mreq 3466 { 3467 struct in6_addr ipv6mr_multiaddr; 3468 int ipv6mr_interface; 3469 } 3470 ; 3471 struct ip_mreq 3472 { 3473 struct in_addr imr_multiaddr; 3474 struct in_addr imr_interface; 3475 } 3476 ; 3477 _________________________________________________________ 3478 3479 1.4.19. netinet/tcp.h 3480 3481 #define TCP_NODELAY 1 3482 #define SOL_TCP 6 3483 _________________________________________________________ 3484 3485 1.4.20. netinet/udp.h 3486 3487 #define SOL_UDP 17 3488 _________________________________________________________ 3489 3490 1.4.21. nl_types.h 3491 3492 #define NL_CAT_LOCALE 1 3493 #define NL_SETD 1 3494 3495 typedef void *nl_catd; 3496 3497 typedef int nl_item; 3498 _________________________________________________________ 3499 3500 1.4.22. pty.h 3501 3502 struct winsize 3503 { 3504 unsigned short ws_row; 3505 unsigned short ws_col; 3506 unsigned short ws_xpixel; 3507 unsigned short ws_ypixel; 3508 } 3509 ; 3510 _________________________________________________________ 3511 3512 1.4.23. pwd.h 3513 3514 struct passwd 3515 { 3516 char *pw_name; 3517 char *pw_passwd; 3518 uid_t pw_uid; 3519 gid_t pw_gid; 3520 char *pw_gecos; 3521 char *pw_dir; 3522 char *pw_shell; 3523 } 3524 ; 3525 _________________________________________________________ 3526 3527 1.4.24. regex.h 3528 3529 typedef unsigned long reg_syntax_t; 3530 3531 typedef struct re_pattern_buffer 3532 { 3533 unsigned char *buffer; 3534 unsigned long allocated; 3535 unsigned long used; 3536 reg_syntax_t syntax; 3537 char *fastmap; 3538 char *translate; 3539 size_t re_nsub; 3540 unsigned int can_be_null:1; 3541 unsigned int regs_allocated:2; 3542 unsigned int fastmap_accurate:1; 3543 unsigned int no_sub:1; 3544 unsigned int not_bol:1; 3545 unsigned int not_eol:1; 3546 unsigned int newline_anchor:1; 3547 } 3548 regex_t; 3549 typedef int regoff_t; 3550 typedef struct 3551 { 3552 regoff_t rm_so; 3553 regoff_t rm_eo; 3554 } 3555 regmatch_t; 3556 #define REG_ICASE (REG_EXTENDED<<1) 3557 #define REG_NEWLINE (REG_ICASE<<1) 3558 #define REG_NOSUB (REG_NEWLINE<<1) 3559 #define REG_EXTENDED 1 3560 3561 #define REG_NOTEOL (1<<1) 3562 #define REG_NOTBOL 1 3563 3564 typedef enum 3565 { 3566 REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE, REG_E 3567 CTYPE, 3568 REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN, REG_EBRACE, REG_B 3569 ADBR, 3570 REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND, REG_ESIZE, REG_ERPARE 3571 N 3572 } 3573 reg_errcode_t; 3574 _________________________________________________________ 3575 3576 1.4.25. rpc/auth.h 3577 3578 enum auth_stat 3579 { 3580 AUTH_OK, AUTH_BADCRED = 1, AUTH_REJECTEDCRED = 2, AUTH_BADVERF = 3581 3, AUTH_REJECTEDVERF = 4, AUTH_TOOWEAK = 5, AUTH_INVALIDRESP = 3582 6, AUTH_FAILED = 7 3583 } 3584 ; 3585 3586 union des_block 3587 { 3588 struct 3589 { 3590 u_int32_t high; 3591 u_int32_t low; 3592 } 3593 key; 3594 char c[8]; 3595 } 3596 ; 3597 3598 struct opaque_auth 3599 { 3600 enum_t oa_flavor; 3601 caddr_t oa_base; 3602 u_int oa_length; 3603 } 3604 ; 3605 3606 typedef struct AUTH 3607 { 3608 struct opaque_auth ah_cred; 3609 struct opaque_auth ah_verf; 3610 union des_block ah_key; 3611 struct auth_ops *ah_ops; 3612 caddr_t ah_private; 3613 } 3614 AUTH; 3615 3616 struct auth_ops 3617 { 3618 void (*ah_nextverf) (struct AUTH *); 3619 int (*ah_marshal) (struct AUTH *, XDR *); 3620 int (*ah_validate) (struct AUTH *, struct opaque_auth *); 3621 int (*ah_refresh) (struct AUTH *); 3622 void (*ah_destroy) (struct AUTH *); 3623 } 3624 ; 3625 _________________________________________________________ 3626 3627 1.4.26. rpc/clnt.h 3628 3629 #define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) 3630 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 3631 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) ((*(rh) 3632 ->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 3633 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 3634 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh 3635 ,xres,resp)) 3636 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 3637 #define NULLPROC ((u_long)0) 3638 #define CLSET_TIMEOUT 1 3639 #define CLGET_XID 10 3640 #define CLSET_XID 11 3641 #define CLGET_VERS 12 3642 #define CLSET_VERS 13 3643 #define CLGET_PROG 14 3644 #define CLSET_PROG 15 3645 #define CLGET_TIMEOUT 2 3646 #define CLGET_SERVER_ADDR 3 3647 #define CLSET_RETRY_TIMEOUT 4 3648 #define CLGET_RETRY_TIMEOUT 5 3649 #define CLGET_FD 6 3650 #define CLGET_SVC_ADDR 7 3651 #define CLSET_FD_CLOSE 8 3652 #define CLSET_FD_NCLOSE 9 3653 3654 enum clnt_stat 3655 { 3656 RPC_SUCCESS, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 2, RPC_CANTS 3657 END = 3658 3, RPC_CANTRECV = 4, RPC_TIMEDOUT = 5, RPC_VERSMISMATCH = 3659 6, RPC_AUTHERROR = 7, RPC_PROGUNAVAIL = 8, RPC_PROGVERSMISMATCH = 3660 9, RPC_PROCUNAVAIL = 10, RPC_CANTDECODEARGS = 11, RPC_SYSTEMERROR = 3661 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 3662 17, RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 14, RPC_PROGNOTREGISTER 3663 ED = 3664 15, RPC_N2AXLATEFAILURE = 22, RPC_FAILED = 16, RPC_INTR = 3665 18, RPC_TLIERROR = 20, RPC_UDERROR = 23, RPC_INPROGRESS = 3666 24, RPC_STALERACHANDLE = 25 3667 } 3668 ; 3669 struct rpc_err 3670 { 3671 enum clnt_stat re_status; 3672 union 3673 { 3674 int RE_errno; 3675 enum auth_stat RE_why; 3676 struct 3677 { 3678 u_long low; 3679 u_long high; 3680 } 3681 RE_vers; 3682 struct 3683 { 3684 long s1; 3685 long s2; 3686 } 3687 RE_lb; 3688 } 3689 ru; 3690 } 3691 ; 3692 3693 typedef struct CLIENT 3694 { 3695 struct AUTH *cl_auth; 3696 struct clnt_ops *cl_ops; 3697 caddr_t cl_private; 3698 } 3699 CLIENT; 3700 3701 struct clnt_ops 3702 { 3703 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_ 3704 t, 3705 xdrproc_t, caddr_t, struct timeval); 3706 void (*cl_abort) (void); 3707 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 3708 bool_t (*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 3709 void (*cl_destroy) (struct CLIENT *); 3710 bool_t (*cl_control) (struct CLIENT *, int, char *); 3711 } 3712 ; 3713 _________________________________________________________ 3714 3715 1.4.27. rpc/rpc_msg.h 3716 3717 enum msg_type 3718 { 3719 CALL, REPLY = 1 3720 } 3721 ; 3722 enum reply_stat 3723 { 3724 MSG_ACCEPTED, MSG_DENIED = 1 3725 } 3726 ; 3727 enum accept_stat 3728 { 3729 SUCCESS, PROG_UNAVAIL = 1, PROG_MISMATCH = 2, PROC_UNAVAIL = 3730 3, GARBAGE_ARGS = 4, SYSTEM_ERR = 5 3731 } 3732 ; 3733 enum reject_stat 3734 { 3735 RPC_MISMATCH, AUTH_ERROR = 1 3736 } 3737 ; 3738 3739 struct accepted_reply 3740 { 3741 struct opaque_auth ar_verf; 3742 enum accept_stat ar_stat; 3743 union 3744 { 3745 struct 3746 { 3747 unsigned long low; 3748 unsigned long high; 3749 } 3750 AR_versions; 3751 struct 3752 { 3753 caddr_t where; 3754 xdrproc_t proc; 3755 } 3756 AR_results; 3757 } 3758 ru; 3759 } 3760 ; 3761 3762 struct rejected_reply 3763 { 3764 enum reject_stat rj_stat; 3765 union 3766 { 3767 struct 3768 { 3769 unsigned long low; 3770 unsigned long high; 3771 } 3772 RJ_versions; 3773 enum auth_stat RJ_why; 3774 } 3775 ru; 3776 } 3777 ; 3778 3779 struct reply_body 3780 { 3781 enum reply_stat rp_stat; 3782 union 3783 { 3784 struct accepted_reply RP_ar; 3785 struct rejected_reply RP_dr; 3786 } 3787 ru; 3788 } 3789 ; 3790 3791 struct call_body 3792 { 3793 unsigned long cb_rpcvers; 3794 unsigned long cb_prog; 3795 unsigned long cb_vers; 3796 unsigned long cb_proc; 3797 struct opaque_auth cb_cred; 3798 struct opaque_auth cb_verf; 3799 } 3800 ; 3801 3802 struct rpc_msg 3803 { 3804 unsigned long rm_xid; 3805 enum msg_type rm_direction; 3806 union 3807 { 3808 struct call_body RM_cmb; 3809 struct reply_body RM_rmb; 3810 } 3811 ru; 3812 } 3813 ; 3814 _________________________________________________________ 3815 3816 1.4.28. rpc/svc.h 3817 3818 #define svc_freeargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_freeargs)( 3819 (xprt), (xargs), (argsp)) 3820 #define svc_getargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_getargs)(( 3821 xprt), (xargs), (argsp)) 3822 #define RPC_ANYSOCK -1 3823 3824 typedef struct SVCXPRT 3825 { 3826 int xp_sock; 3827 u_short xp_port; 3828 struct xp_ops *xp_ops; 3829 int xp_addrlen; 3830 struct sockaddr_in xp_raddr; 3831 struct opaque_auth xp_verf; 3832 caddr_t xp_p1; 3833 caddr_t xp_p2; 3834 char xp_pad[256]; 3835 } 3836 SVCXPRT; 3837 3838 struct svc_req 3839 { 3840 rpcprog_t rq_prog; 3841 rpcvers_t rq_vers; 3842 rpcproc_t rq_proc; 3843 struct opaque_auth rq_cred; 3844 caddr_t rq_clntcred; 3845 SVCXPRT *rq_xprt; 3846 } 3847 ; 3848 3849 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 3850 3851 struct xp_ops 3852 { 3853 bool_t (*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 3854 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 3855 bool_t (*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 3856 caddr_t args_ptr); 3857 bool_t (*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 3858 bool_t (*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 3859 caddr_t args_ptr); 3860 void (*xp_destroy) (SVCXPRT * __xprt); 3861 } 3862 ; 3863 _________________________________________________________ 3864 3865 1.4.29. rpc/types.h 3866 3867 typedef int bool_t; 3868 typedef int enum_t; 3869 typedef unsigned long rpcprog_t; 3870 typedef unsigned long rpcvers_t; 3871 typedef unsigned long rpcproc_t; 3872 typedef unsigned long rpcprot_t; 3873 _________________________________________________________ 3874 3875 1.4.30. rpc/xdr.h 3876 3877 enum xdr_op 3878 { 3879 XDR_ENCODE, XDR_DECODE, XDR_FREE 3880 } 3881 ; 3882 typedef struct XDR 3883 { 3884 enum xdr_op x_op; 3885 struct xdr_ops *x_ops; 3886 caddr_t x_public; 3887 caddr_t x_private; 3888 caddr_t x_base; 3889 int x_handy; 3890 } 3891 XDR; 3892 3893 struct xdr_ops 3894 { 3895 bool_t (*x_getlong) (XDR * __xdrs, long *__lp); 3896 bool_t (*x_putlong) (XDR * __xdrs, long *__lp); 3897 bool_t (*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 3898 bool_t (*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 3899 u_int (*x_getpostn) (XDR * __xdrs); 3900 bool_t (*x_setpostn) (XDR * __xdrs, u_int __pos); 3901 int32_t *(*x_inline) (XDR * __xdrs, int __len); 3902 void (*x_destroy) (XDR * __xdrs); 3903 bool_t (*x_getint32) (XDR * __xdrs, int32_t * __ip); 3904 bool_t (*x_putint32) (XDR * __xdrs, int32_t * __ip); 3905 } 3906 ; 3907 3908 typedef bool_t (*xdrproc_t) (XDR *, void *, ...); 3909 3910 struct xdr_discrim 3911 { 3912 int value; 3913 xdrproc_t proc; 3914 } 3915 ; 3916 _________________________________________________________ 3917 3918 1.4.31. sched.h 3919 3920 #define SCHED_OTHER 0 3921 #define SCHED_FIFO 1 3922 #define SCHED_RR 2 3923 3924 struct sched_param 3925 { 3926 int sched_priority; 3927 } 3928 ; 3929 _________________________________________________________ 3930 3931 1.4.32. search.h 3932 3933 typedef struct entry 3934 { 3935 char *key; 3936 void *data; 3937 } 3938 ENTRY; 3939 typedef enum 3940 { 3941 FIND, ENTER 3942 } 3943 ACTION; 3944 typedef enum 3945 { 3946 preorder, postorder, endorder, leaf 3947 } 3948 VISIT; 3949 3950 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __leve 3951 l); 3952 _________________________________________________________ 3953 3954 1.4.33. setjmp.h 3955 3956 #define setjmp(env) _setjmp(env) 3957 #define sigsetjmp(a,b) __sigsetjmp(a,b) 3958 3959 struct __jmp_buf_tag 3960 { 3961 __jmp_buf __jmpbuf; 3962 int __mask_was_saved; 3963 sigset_t __saved_mask; 3964 } 3965 ; 3966 3967 typedef struct __jmp_buf_tag jmp_buf[1]; 3968 typedef jmp_buf sigjmp_buf; 3969 _________________________________________________________ 3970 3971 1.4.34. signal.h 3972 3973 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 3974 #define SIGRTMAX (__libc_current_sigrtmax ()) 3975 #define SIGRTMIN (__libc_current_sigrtmin ()) 3976 #define SIG_BLOCK 0 3977 #define SIG_UNBLOCK 1 3978 #define SIG_SETMASK 2 3979 #define NSIG 65 3980 3981 typedef int sig_atomic_t; 3982 3983 typedef void (*sighandler_t) (int); 3984 #define SIG_HOLD ((sighandler_t) 2) 3985 #define SIG_ERR ((sighandler_t)-1) 3986 #define SIG_DFL ((sighandler_t)0) 3987 #define SIG_IGN ((sighandler_t)1) 3988 3989 #define SIGHUP 1 3990 #define SIGUSR1 10 3991 #define SIGSEGV 11 3992 #define SIGUSR2 12 3993 #define SIGPIPE 13 3994 #define SIGALRM 14 3995 #define SIGTERM 15 3996 #define SIGSTKFLT 16 3997 #define SIGCHLD 17 3998 #define SIGCONT 18 3999 #define SIGSTOP 19 4000 #define SIGINT 2 4001 #define SIGTSTP 20 4002 #define SIGTTIN 21 4003 #define SIGTTOU 22 4004 #define SIGURG 23 4005 #define SIGXCPU 24 4006 #define SIGXFSZ 25 4007 #define SIGVTALRM 26 4008 #define SIGPROF 27 4009 #define SIGWINCH 28 4010 #define SIGIO 29 4011 #define SIGQUIT 3 4012 #define SIGPWR 30 4013 #define SIGSYS 31 4014 #define SIGUNUSED 31 4015 #define SIGILL 4 4016 #define SIGTRAP 5 4017 #define SIGABRT 6 4018 #define SIGIOT 6 4019 #define SIGBUS 7 4020 #define SIGFPE 8 4021 #define SIGKILL 9 4022 #define SIGCLD SIGCHLD 4023 #define SIGPOLL SIGIO 4024 4025 #define SV_ONSTACK (1<<0) 4026 #define SV_INTERRUPT (1<<1) 4027 #define SV_RESETHAND (1<<2) 4028 4029 typedef union sigval 4030 { 4031 int sival_int; 4032 void *sival_ptr; 4033 } 4034 sigval_t; 4035 #define SIGEV_SIGNAL 0 4036 #define SIGEV_NONE 1 4037 #define SIGEV_THREAD 2 4038 #define SIGEV_MAX_SIZE 64 4039 4040 typedef struct sigevent 4041 { 4042 sigval_t sigev_value; 4043 int sigev_signo; 4044 int sigev_notify; 4045 union 4046 { 4047 int _pad[SIGEV_PAD_SIZE]; 4048 struct 4049 { 4050 void (*sigev_thread_func) (sigval_t); 4051 void *_attribute; 4052 } 4053 _sigev_thread; 4054 } 4055 _sigev_un; 4056 } 4057 sigevent_t; 4058 #define SI_MAX_SIZE 128 4059 #define si_pid _sifields._kill._pid 4060 #define si_uid _sifields._kill._uid 4061 #define si_value _sifields._rt._sigval 4062 #define si_int _sifields._rt._sigval.sival_int 4063 #define si_ptr _sifields._rt._sigval.sival_ptr 4064 #define si_status _sifields._sigchld._status 4065 #define si_stime _sifields._sigchld._stime 4066 #define si_utime _sifields._sigchld._utime 4067 #define si_addr _sifields._sigfault._addr 4068 #define si_band _sifields._sigpoll._band 4069 #define si_fd _sifields._sigpoll._fd 4070 #define si_timer1 _sifields._timer._timer1 4071 #define si_timer2 _sifields._timer._timer2 4072 4073 typedef struct siginfo 4074 { 4075 int si_signo; 4076 int si_errno; 4077 int si_code; 4078 union 4079 { 4080 int _pad[SI_PAD_SIZE]; 4081 struct 4082 { 4083 pid_t _pid; 4084 uid_t _uid; 4085 } 4086 _kill; 4087 struct 4088 { 4089 unsigned int _timer1; 4090 unsigned int _timer2; 4091 } 4092 _timer; 4093 struct 4094 { 4095 pid_t _pid; 4096 uid_t _uid; 4097 sigval_t _sigval; 4098 } 4099 _rt; 4100 struct 4101 { 4102 pid_t _pid; 4103 uid_t _uid; 4104 int _status; 4105 clock_t _utime; 4106 clock_t _stime; 4107 } 4108 _sigchld; 4109 struct 4110 { 4111 void *_addr; 4112 } 4113 _sigfault; 4114 struct 4115 { 4116 int _band; 4117 int _fd; 4118 } 4119 _sigpoll; 4120 } 4121 _sifields; 4122 } 4123 siginfo_t; 4124 #define SI_QUEUE -1 4125 #define SI_TIMER -2 4126 #define SI_MESGQ -3 4127 #define SI_ASYNCIO -4 4128 #define SI_SIGIO -5 4129 #define SI_TKILL -6 4130 #define SI_ASYNCNL -60 4131 #define SI_USER 0 4132 #define SI_KERNEL 0x80 4133 4134 #define ILL_ILLOPC 1 4135 #define ILL_ILLOPN 2 4136 #define ILL_ILLADR 3 4137 #define ILL_ILLTRP 4 4138 #define ILL_PRVOPC 5 4139 #define ILL_PRVREG 6 4140 #define ILL_COPROC 7 4141 #define ILL_BADSTK 8 4142 4143 #define FPE_INTDIV 1 4144 #define FPE_INTOVF 2 4145 #define FPE_FLTDIV 3 4146 #define FPE_FLTOVF 4 4147 #define FPE_FLTUND 5 4148 #define FPE_FLTRES 6 4149 #define FPE_FLTINV 7 4150 #define FPE_FLTSUB 8 4151 4152 #define SEGV_MAPERR 1 4153 #define SEGV_ACCERR 2 4154 4155 #define BUS_ADRALN 1 4156 #define BUS_ADRERR 2 4157 #define BUS_OBJERR 3 4158 4159 #define TRAP_BRKPT 1 4160 #define TRAP_TRACE 2 4161 4162 #define CLD_EXITED 1 4163 #define CLD_KILLED 2 4164 #define CLD_DUMPED 3 4165 #define CLD_TRAPPED 4 4166 #define CLD_STOPPED 5 4167 #define CLD_CONTINUED 6 4168 4169 #define POLL_IN 1 4170 #define POLL_OUT 2 4171 #define POLL_MSG 3 4172 #define POLL_ERR 4 4173 #define POLL_PRI 5 4174 #define POLL_HUP 6 4175 4176 typedef struct 4177 { 4178 unsigned long sig[_SIGSET_NWORDS]; 4179 } 4180 sigset_t; 4181 #define SA_NOCLDSTOP 0x00000001 4182 #define SA_NOCLDWAIT 0x00000002 4183 #define SA_SIGINFO 0x00000004 4184 #define SA_ONSTACK 0x08000000 4185 #define SA_RESTART 0x10000000 4186 #define SA_INTERRUPT 0x20000000 4187 #define SA_NODEFER 0x40000000 4188 #define SA_RESETHAND 0x80000000 4189 #define SA_NOMASK SA_NODEFER 4190 #define SA_ONESHOT SA_RESETHAND 4191 4192 typedef struct sigaltstack 4193 { 4194 void *ss_sp; 4195 int ss_flags; 4196 size_t ss_size; 4197 } 4198 stack_t; 4199 #define SS_ONSTACK 1 4200 #define SS_DISABLE 2 4201 _________________________________________________________ 4202 4203 1.4.35. stddef.h 4204 4205 #define offsetof(TYPE,MEMBER) ((size_t)& ((TYPE*)0)->MEMBER) 4206 #define NULL (0L) 4207 4208 typedef int wchar_t; 4209 _________________________________________________________ 4210 4211 1.4.36. stdio.h 4212 4213 #define EOF (-1) 4214 #define P_tmpdir "/tmp" 4215 #define FOPEN_MAX 16 4216 #define L_tmpnam 20 4217 #define FILENAME_MAX 4096 4218 #define BUFSIZ 8192 4219 #define L_ctermid 9 4220 #define L_cuserid 9 4221 4222 typedef struct 4223 { 4224 off_t __pos; 4225 mbstate_t __state; 4226 } 4227 fpos_t; 4228 typedef struct 4229 { 4230 off64_t __pos; 4231 mbstate_t __state; 4232 } 4233 fpos64_t; 4234 4235 typedef struct _IO_FILE FILE; 4236 #define _IOFBF 0 4237 #define _IOLBF 1 4238 #define _IONBF 2 4239 _________________________________________________________ 4240 4241 1.4.37. stdlib.h 4242 4243 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 4244 #define EXIT_SUCCESS 0 4245 #define EXIT_FAILURE 1 4246 #define RAND_MAX 2147483647 4247 4248 typedef int (*__compar_fn_t) (const void *, const void *); 4249 struct random_data 4250 { 4251 int32_t *fptr; 4252 int32_t *rptr; 4253 int32_t *state; 4254 int rand_type; 4255 int rand_deg; 4256 int rand_sep; 4257 int32_t *end_ptr; 4258 } 4259 ; 4260 4261 typedef struct 4262 { 4263 int quot; 4264 int rem; 4265 } 4266 div_t; 4267 4268 typedef struct 4269 { 4270 long quot; 4271 long rem; 4272 } 4273 ldiv_t; 4274 4275 typedef struct 4276 { 4277 long long quot; 4278 long long rem; 4279 } 4280 lldiv_t; 4281 _________________________________________________________ 4282 4283 1.4.38. sys/file.h 4284 4285 #define LOCK_SH 1 4286 #define LOCK_EX 2 4287 #define LOCK_NB 4 4288 #define LOCK_UN 8 4289 _________________________________________________________ 4290 4291 1.4.39. sys/ipc.h 4292 4293 #define IPC_PRIVATE ((key_t)0) 4294 #define IPC_RMID 0 4295 #define IPC_CREAT 00001000 4296 #define IPC_EXCL 00002000 4297 #define IPC_NOWAIT 00004000 4298 #define IPC_SET 1 4299 #define IPC_STAT 2 4300 _________________________________________________________ 4301 4302 1.4.40. sys/mman.h 4303 4304 #define MAP_FAILED ((void*)-1) 4305 #define PROT_NONE 0x0 4306 #define MAP_SHARED 0x01 4307 #define MAP_PRIVATE 0x02 4308 #define PROT_READ 0x1 4309 #define MAP_FIXED 0x10 4310 #define PROT_WRITE 0x2 4311 #define MAP_ANONYMOUS 0x20 4312 #define PROT_EXEC 0x4 4313 #define MS_ASYNC 1 4314 #define MS_INVALIDATE 2 4315 #define MS_SYNC 4 4316 #define MAP_ANON MAP_ANONYMOUS 4317 _________________________________________________________ 4318 4319 1.4.41. sys/msg.h 4320 4321 #define MSG_NOERROR 010000 4322 _________________________________________________________ 4323 4324 1.4.42. sys/param.h 4325 4326 #define NOFILE 256 4327 #define MAXPATHLEN 4096 4328 _________________________________________________________ 4329 4330 1.4.43. sys/poll.h 4331 4332 #define POLLIN 0x0001 4333 #define POLLPRI 0x0002 4334 #define POLLOUT 0x0004 4335 #define POLLERR 0x0008 4336 #define POLLHUP 0x0010 4337 #define POLLNVAL 0x0020 4338 4339 struct pollfd 4340 { 4341 int fd; 4342 short events; 4343 short revents; 4344 } 4345 ; 4346 typedef unsigned long nfds_t; 4347 _________________________________________________________ 4348 4349 1.4.44. sys/resource.h 4350 4351 #define RUSAGE_CHILDREN (-1) 4352 #define RUSAGE_BOTH (-2) 4353 #define RLIM_INFINITY (~0UL) 4354 #define RLIM_SAVED_CUR -1 4355 #define RLIM_SAVED_MAX -1 4356 #define RLIMIT_CPU 0 4357 #define RUSAGE_SELF 0 4358 #define RLIMIT_FSIZE 1 4359 #define RLIMIT_DATA 2 4360 #define RLIMIT_STACK 3 4361 #define RLIMIT_CORE 4 4362 #define RLIMIT_NOFILE 7 4363 #define RLIMIT_AS 9 4364 4365 typedef unsigned long rlim_t; 4366 typedef unsigned long long rlim64_t; 4367 typedef int __rlimit_resource_t; 4368 4369 struct rlimit 4370 { 4371 rlim_t rlim_cur; 4372 rlim_t rlim_max; 4373 } 4374 ; 4375 struct rlimit64 4376 { 4377 rlim64_t rlim_cur; 4378 rlim64_t rlim_max; 4379 } 4380 ; 4381 4382 struct rusage 4383 { 4384 struct timeval ru_utime; 4385 struct timeval ru_stime; 4386 long ru_maxrss; 4387 long ru_ixrss; 4388 long ru_idrss; 4389 long ru_isrss; 4390 long ru_minflt; 4391 long ru_majflt; 4392 long ru_nswap; 4393 long ru_inblock; 4394 long ru_oublock; 4395 long ru_msgsnd; 4396 long ru_msgrcv; 4397 long ru_nsignals; 4398 long ru_nvcsw; 4399 long ru_nivcsw; 4400 } 4401 ; 4402 4403 enum __priority_which 4404 { 4405 PRIO_PROCESS, PRIO_PGRP = 1, PRIO_USER = 2 4406 } 4407 ; 4408 #define PRIO_PGRP PRIO_PGRP 4409 #define PRIO_PROCESS PRIO_PROCESS 4410 #define PRIO_USER PRIO_USER 4411 4412 typedef enum __priority_which __priority_which_t; 4413 _________________________________________________________ 4414 4415 1.4.45. sys/sem.h 4416 4417 #define SEM_UNDO 0x1000 4418 #define GETPID 11 4419 #define GETVAL 12 4420 #define GETALL 13 4421 #define GETNCNT 14 4422 #define GETZCNT 15 4423 #define SETVAL 16 4424 #define SETALL 17 4425 4426 struct sembuf 4427 { 4428 short sem_num; 4429 short sem_op; 4430 short sem_flg; 4431 } 4432 ; 4433 _________________________________________________________ 4434 4435 1.4.46. sys/shm.h 4436 4437 #define SHM_RDONLY 010000 4438 #define SHM_W 0200 4439 #define SHM_RND 020000 4440 #define SHM_R 0400 4441 #define SHM_REMAP 040000 4442 #define SHM_LOCK 11 4443 #define SHM_UNLOCK 12 4444 _________________________________________________________ 4445 4446 1.4.47. sys/socket.h 4447 4448 #define SCM_RIGHTS 0x01 4449 #define SOL_SOCKET 1 4450 #define SOMAXCONN 128 4451 #define SOL_RAW 255 4452 4453 struct linger 4454 { 4455 int l_onoff; 4456 int l_linger; 4457 } 4458 ; 4459 struct cmsghdr 4460 { 4461 size_t cmsg_len; 4462 int cmsg_level; 4463 int cmsg_type; 4464 } 4465 ; 4466 struct iovec 4467 { 4468 void *iov_base; 4469 size_t iov_len; 4470 } 4471 ; 4472 4473 typedef unsigned short sa_family_t; 4474 typedef unsigned int socklen_t; 4475 4476 struct sockaddr 4477 { 4478 sa_family_t sa_family; 4479 char sa_data[14]; 4480 } 4481 ; 4482 struct sockaddr_storage 4483 { 4484 sa_family_t ss_family; 4485 __ss_aligntype __ss_align; 4486 char __ss_padding[(128 - (2 * sizeof (__ss_aligntype)))]; 4487 } 4488 ; 4489 4490 struct msghdr 4491 { 4492 void *msg_name; 4493 int msg_namelen; 4494 struct iovec *msg_iov; 4495 size_t msg_iovlen; 4496 void *msg_control; 4497 size_t msg_controllen; 4498 unsigned int msg_flags; 4499 } 4500 ; 4501 #define AF_UNSPEC 0 4502 #define AF_UNIX 1 4503 #define AF_INET6 10 4504 #define AF_INET 2 4505 4506 #define PF_INET AF_INET 4507 #define PF_INET6 AF_INET6 4508 #define PF_UNIX AF_UNIX 4509 #define PF_UNSPEC AF_UNSPEC 4510 4511 #define SOCK_STREAM 1 4512 #define SOCK_PACKET 10 4513 #define SOCK_DGRAM 2 4514 #define SOCK_RAW 3 4515 #define SOCK_RDM 4 4516 #define SOCK_SEQPACKET 5 4517 4518 #define SO_DEBUG 1 4519 #define SO_OOBINLINE 10 4520 #define SO_NO_CHECK 11 4521 #define SO_PRIORITY 12 4522 #define SO_LINGER 13 4523 #define SO_REUSEADDR 2 4524 #define SO_TYPE 3 4525 #define SO_ACCEPTCONN 30 4526 #define SO_ERROR 4 4527 #define SO_DONTROUTE 5 4528 #define SO_BROADCAST 6 4529 #define SO_SNDBUF 7 4530 #define SO_RCVBUF 8 4531 #define SO_KEEPALIVE 9 4532 4533 #define SIOCGIFCONF 0x8912 4534 #define SIOCGIFFLAGS 0x8913 4535 #define SIOCGIFADDR 0x8915 4536 #define SIOCGIFNETMASK 0x891b 4537 4538 #define SHUT_RD 0 4539 #define SHUT_WR 1 4540 #define SHUT_RDWR 2 4541 #define MSG_DONTROUTE 4 4542 4543 #define MSG_WAITALL 0x100 4544 #define MSG_TRUNC 0x20 4545 #define MSG_EOR 0x80 4546 #define MSG_OOB 1 4547 #define MSG_PEEK 2 4548 #define MSG_CTRUNC 8 4549 _________________________________________________________ 4550 4551 1.4.48. sys/stat.h 4552 4553 #define S_ISBLK(m) (((m)& S_IFMT)==S_IFBLK) 4554 #define S_ISCHR(m) (((m)& S_IFMT)==S_IFCHR) 4555 #define S_ISDIR(m) (((m)& S_IFMT)==S_IFDIR) 4556 #define S_ISFIFO(m) (((m)& S_IFMT)==S_IFIFO) 4557 #define S_ISLNK(m) (((m)& S_IFMT)==S_IFLNK) 4558 #define S_ISREG(m) (((m)& S_IFMT)==S_IFREG) 4559 #define S_ISSOCK(m) (((m)& S_IFMT)==S_IFSOCK) 4560 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 4561 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 4562 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 4563 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 4564 #define S_IROTH (S_IRGRP>>3) 4565 #define S_IRGRP (S_IRUSR>>3) 4566 #define S_IRWXO (S_IRWXG>>3) 4567 #define S_IRWXG (S_IRWXU>>3) 4568 #define S_IWOTH (S_IWGRP>>3) 4569 #define S_IWGRP (S_IWUSR>>3) 4570 #define S_IXOTH (S_IXGRP>>3) 4571 #define S_IXGRP (S_IXUSR>>3) 4572 #define S_ISVTX 01000 4573 #define S_IXUSR 0x0040 4574 #define S_IWUSR 0x0080 4575 #define S_IRUSR 0x0100 4576 #define S_ISGID 0x0400 4577 #define S_ISUID 0x0800 4578 #define S_IFIFO 0x1000 4579 #define S_IFCHR 0x2000 4580 #define S_IFDIR 0x4000 4581 #define S_IFBLK 0x6000 4582 #define S_IFREG 0x8000 4583 #define S_IFLNK 0xa000 4584 #define S_IFSOCK 0xc000 4585 #define S_IFMT 0xf000 4586 #define st_atime st_atim.tv_sec 4587 #define st_ctime st_ctim.tv_sec 4588 #define st_mtime st_mtim.tv_sec 4589 #define S_IREAD S_IRUSR 4590 #define S_IWRITE S_IWUSR 4591 #define S_IEXEC S_IXUSR 4592 _________________________________________________________ 4593 4594 1.4.49. sys/time.h 4595 4596 #define ITIMER_REAL 0 4597 #define ITIMER_VIRTUAL 1 4598 #define ITIMER_PROF 2 4599 4600 struct timezone 4601 { 4602 int tz_minuteswest; 4603 int tz_dsttime; 4604 } 4605 ; 4606 4607 typedef int __itimer_which_t; 4608 4609 struct timespec 4610 { 4611 time_t tv_sec; 4612 long tv_nsec; 4613 } 4614 ; 4615 4616 struct timeval 4617 { 4618 time_t tv_sec; 4619 suseconds_t tv_usec; 4620 } 4621 ; 4622 4623 struct itimerval 4624 { 4625 struct timeval it_interval; 4626 struct timeval it_value; 4627 } 4628 ; 4629 _________________________________________________________ 4630 4631 1.4.50. sys/timeb.h 4632 4633 struct timeb 4634 { 4635 time_t time; 4636 unsigned short millitm; 4637 short timezone; 4638 short dstflag; 4639 } 4640 ; 4641 _________________________________________________________ 4642 4643 1.4.51. sys/times.h 4644 4645 struct tms 4646 { 4647 clock_t tms_utime; 4648 clock_t tms_stime; 4649 clock_t tms_cutime; 4650 clock_t tms_cstime; 4651 } 4652 ; 4653 _________________________________________________________ 4654 4655 1.4.52. sys/types.h 4656 4657 #define FD_ISSET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& (1<<( 4658 (d)%(8*sizeof(long))))) 4659 #define FD_CLR(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& =~(1< 4660 <((d)%(8*sizeof(long))))) 4661 #define FD_SET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<( 4662 (d)%(8*sizeof(long))))) 4663 #define FALSE 0 4664 #define TRUE 1 4665 #define FD_SETSIZE 1024 4666 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 4667 4668 typedef signed char int8_t; 4669 typedef short int16_t; 4670 typedef int int32_t; 4671 typedef unsigned char u_int8_t; 4672 typedef unsigned short u_int16_t; 4673 typedef unsigned int u_int32_t; 4674 typedef unsigned int uid_t; 4675 typedef int pid_t; 4676 typedef unsigned long off_t; 4677 typedef int key_t; 4678 typedef long suseconds_t; 4679 typedef unsigned int u_int; 4680 typedef struct 4681 { 4682 int __val[2]; 4683 } 4684 fsid_t; 4685 typedef unsigned int useconds_t; 4686 typedef unsigned long blksize_t; 4687 typedef long fd_mask; 4688 typedef int timer_t; 4689 typedef int clockid_t; 4690 4691 typedef unsigned int id_t; 4692 4693 typedef unsigned long long ino64_t; 4694 typedef long long loff_t; 4695 typedef unsigned long blkcnt_t; 4696 typedef unsigned long fsblkcnt_t; 4697 typedef unsigned long fsfilcnt_t; 4698 typedef unsigned long long blkcnt64_t; 4699 typedef unsigned long long fsblkcnt64_t; 4700 typedef unsigned long long fsfilcnt64_t; 4701 typedef unsigned char u_char; 4702 typedef unsigned short u_short; 4703 typedef unsigned long u_long; 4704 4705 typedef unsigned long ino_t; 4706 typedef unsigned int gid_t; 4707 typedef unsigned long long dev_t; 4708 typedef unsigned int mode_t; 4709 typedef unsigned long nlink_t; 4710 typedef char *caddr_t; 4711 4712 typedef struct 4713 { 4714 unsigned long fds_bits[__FDSET_LONGS]; 4715 } 4716 fd_set; 4717 4718 typedef long clock_t; 4719 typedef long time_t; 4720 _________________________________________________________ 4721 4722 1.4.53. sys/un.h 4723 4724 #define UNIX_PATH_MAX 108 4725 4726 struct sockaddr_un 4727 { 4728 sa_family_t sun_family; 4729 char sun_path[UNIX_PATH_MAX]; 4730 } 4731 ; 4732 _________________________________________________________ 4733 4734 1.4.54. sys/utsname.h 4735 4736 #define SYS_NMLN 65 4737 4738 struct utsname 4739 { 4740 char sysname[65]; 4741 char nodename[65]; 4742 char release[65]; 4743 char version[65]; 4744 char machine[65]; 4745 char domainname[65]; 4746 } 4747 ; 4748 _________________________________________________________ 4749 4750 1.4.55. sys/wait.h 4751 4752 #define WIFSIGNALED(status) (!WIFSTOPPED(status) & & !WIFEXITED(sta 4753 tus)) 4754 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 4755 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 4756 #define WTERMSIG(status) ((status) & 0x7f) 4757 #define WCOREDUMP(status) ((status) & 0x80) 4758 #define WIFEXITED(status) (WTERMSIG(status) == 0) 4759 #define WNOHANG 0x00000001 4760 #define WUNTRACED 0x00000002 4761 #define WCOREFLAG 0x80 4762 #define WSTOPSIG(status) WEXITSTATUS(status) 4763 4764 typedef enum 4765 { 4766 P_ALL, P_PID, P_PGID 4767 } 4768 idtype_t; 4769 _________________________________________________________ 4770 4771 1.4.56. syslog.h 4772 4773 #define LOG_EMERG 0 4774 #define LOG_PRIMASK 0x07 4775 #define LOG_ALERT 1 4776 #define LOG_CRIT 2 4777 #define LOG_ERR 3 4778 #define LOG_WARNING 4 4779 #define LOG_NOTICE 5 4780 #define LOG_INFO 6 4781 #define LOG_DEBUG 7 4782 4783 #define LOG_KERN (0<<3) 4784 #define LOG_AUTHPRIV (10<<3) 4785 #define LOG_FTP (11<<3) 4786 #define LOG_USER (1<<3) 4787 #define LOG_MAIL (2<<3) 4788 #define LOG_DAEMON (3<<3) 4789 #define LOG_AUTH (4<<3) 4790 #define LOG_SYSLOG (5<<3) 4791 #define LOG_LPR (6<<3) 4792 #define LOG_NEWS (7<<3) 4793 #define LOG_UUCP (8<<3) 4794 #define LOG_CRON (9<<3) 4795 #define LOG_FACMASK 0x03f8 4796 4797 #define LOG_LOCAL0 (16<<3) 4798 #define LOG_LOCAL1 (17<<3) 4799 #define LOG_LOCAL2 (18<<3) 4800 #define LOG_LOCAL3 (19<<3) 4801 #define LOG_LOCAL4 (20<<3) 4802 #define LOG_LOCAL5 (21<<3) 4803 #define LOG_LOCAL6 (22<<3) 4804 #define LOG_LOCAL7 (23<<3) 4805 4806 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 4807 #define LOG_MASK(pri) (1 << (pri)) 4808 4809 #define LOG_PID 0x01 4810 #define LOG_CONS 0x02 4811 #define LOG_ODELAY 0x04 4812 #define LOG_NDELAY 0x08 4813 #define LOG_NOWAIT 0x10 4814 #define LOG_PERROR 0x20 4815 _________________________________________________________ 4816 4817 1.4.57. termios.h 4818 4819 #define TCIFLUSH 0 4820 #define TCOOFF 0 4821 #define TCSANOW 0 4822 #define BS0 0000000 4823 #define CR0 0000000 4824 #define FF0 0000000 4825 #define NL0 0000000 4826 #define TAB0 0000000 4827 #define VT0 0000000 4828 #define OPOST 0000001 4829 #define OCRNL 0000010 4830 #define ONOCR 0000020 4831 #define ONLRET 0000040 4832 #define OFILL 0000100 4833 #define OFDEL 0000200 4834 #define NL1 0000400 4835 #define TCOFLUSH 1 4836 #define TCOON 1 4837 #define TCSADRAIN 1 4838 #define TCIOFF 2 4839 #define TCIOFLUSH 2 4840 #define TCSAFLUSH 2 4841 #define TCION 3 4842 4843 typedef unsigned int speed_t; 4844 typedef unsigned char cc_t; 4845 typedef unsigned int tcflag_t; 4846 #define NCCS 32 4847 4848 struct termios 4849 { 4850 tcflag_t c_iflag; 4851 tcflag_t c_oflag; 4852 tcflag_t c_cflag; 4853 tcflag_t c_lflag; 4854 cc_t c_line; 4855 cc_t c_cc[NCCS]; 4856 speed_t c_ispeed; 4857 speed_t c_ospeed; 4858 } 4859 ; 4860 #define VINTR 0 4861 #define VQUIT 1 4862 #define VLNEXT 15 4863 #define VERASE 2 4864 #define VKILL 3 4865 #define VEOF 4 4866 4867 #define IGNBRK 0000001 4868 #define BRKINT 0000002 4869 #define IGNPAR 0000004 4870 #define PARMRK 0000010 4871 #define INPCK 0000020 4872 #define ISTRIP 0000040 4873 #define INLCR 0000100 4874 #define IGNCR 0000200 4875 #define ICRNL 0000400 4876 #define IXANY 0004000 4877 #define IMAXBEL 0020000 4878 4879 #define CS5 0000000 4880 4881 #define ECHO 0000010 4882 4883 #define B0 0000000 4884 #define B50 0000001 4885 #define B75 0000002 4886 #define B110 0000003 4887 #define B134 0000004 4888 #define B150 0000005 4889 #define B200 0000006 4890 #define B300 0000007 4891 #define B600 0000010 4892 #define B1200 0000011 4893 #define B1800 0000012 4894 #define B2400 0000013 4895 #define B4800 0000014 4896 #define B9600 0000015 4897 #define B19200 0000016 4898 #define B38400 0000017 4899 _________________________________________________________ 4900 4901 1.4.58. time.h 4902 4903 #define CLK_TCK ((clock_t)__sysconf(2)) 4904 #define CLOCK_REALTIME 0 4905 #define TIMER_ABSTIME 1 4906 #define CLOCKS_PER_SEC 1000000l 4907 4908 struct tm 4909 { 4910 int tm_sec; 4911 int tm_min; 4912 int tm_hour; 4913 int tm_mday; 4914 int tm_mon; 4915 int tm_year; 4916 int tm_wday; 4917 int tm_yday; 4918 int tm_isdst; 4919 long tm_gmtoff; 4920 char *tm_zone; 4921 } 4922 ; 4923 struct itimerspec 4924 { 4925 struct timespec it_interval; 4926 struct timespec it_value; 4927 } 4928 ; 4929 _________________________________________________________ 4930 4931 1.4.59. ulimit.h 4932 4933 #define UL_GETFSIZE 1 4934 #define UL_SETFSIZE 2 4935 _________________________________________________________ 4936 4937 1.4.60. unistd.h 4938 4939 #define SEEK_SET 0 4940 #define STDIN_FILENO 0 4941 #define SEEK_CUR 1 4942 #define STDOUT_FILENO 1 4943 #define SEEK_END 2 4944 #define STDERR_FILENO 2 4945 4946 typedef long long off64_t; 4947 #define F_OK 0 4948 #define X_OK 1 4949 #define W_OK 2 4950 #define R_OK 4 4951 4952 #define _POSIX_VDISABLE '\0' 4953 #define _POSIX_CHOWN_RESTRICTED 1 4954 #define _POSIX_JOB_CONTROL 1 4955 #define _POSIX_NO_TRUNC 1 4956 #define _POSIX_SHELL 1 4957 #define _POSIX_FSYNC 200112 4958 #define _POSIX_MAPPED_FILES 200112 4959 #define _POSIX_MEMLOCK 200112 4960 #define _POSIX_MEMLOCK_RANGE 200112 4961 #define _POSIX_MEMORY_PROTECTION 200112 4962 #define _POSIX_SEMAPHORES 200112 4963 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 4964 #define _POSIX_TIMERS 200112 4965 #define _POSIX2_C_BIND 200112L 4966 #define _POSIX_THREADS 200112L 4967 4968 #define _PC_LINK_MAX 0 4969 #define _PC_MAX_CANON 1 4970 #define _PC_ASYNC_IO 10 4971 #define _PC_PRIO_IO 11 4972 #define _PC_FILESIZEBITS 13 4973 #define _PC_REC_INCR_XFER_SIZE 14 4974 #define _PC_REC_MIN_XFER_SIZE 16 4975 #define _PC_REC_XFER_ALIGN 17 4976 #define _PC_ALLOC_SIZE_MIN 18 4977 #define _PC_MAX_INPUT 2 4978 #define _PC_2_SYMLINKS 20 4979 #define _PC_NAME_MAX 3 4980 #define _PC_PATH_MAX 4 4981 #define _PC_PIPE_BUF 5 4982 #define _PC_CHOWN_RESTRICTED 6 4983 #define _PC_NO_TRUNC 7 4984 #define _PC_VDISABLE 8 4985 #define _PC_SYNC_IO 9 4986 4987 #define _SC_ARG_MAX 0 4988 #define _SC_CHILD_MAX 1 4989 #define _SC_PRIORITY_SCHEDULING 10 4990 #define _SC_TIMERS 11 4991 #define _SC_ASYNCHRONOUS_IO 12 4992 #define _SC_XBS5_ILP32_OFF32 125 4993 #define _SC_XBS5_ILP32_OFFBIG 126 4994 #define _SC_XBS5_LP64_OFF64 127 4995 #define _SC_XBS5_LPBIG_OFFBIG 128 4996 #define _SC_XOPEN_LEGACY 129 4997 #define _SC_PRIORITIZED_IO 13 4998 #define _SC_XOPEN_REALTIME 130 4999 #define _SC_XOPEN_REALTIME_THREADS 131 5000 #define _SC_ADVISORY_INFO 132 5001 #define _SC_BARRIERS 133 5002 #define _SC_CLOCK_SELECTION 137 5003 #define _SC_CPUTIME 138 5004 #define _SC_THREAD_CPUTIME 139 5005 #define _SC_SYNCHRONIZED_IO 14 5006 #define _SC_MONOTONIC_CLOCK 149 5007 #define _SC_FSYNC 15 5008 #define _SC_READER_WRITER_LOCKS 153 5009 #define _SC_SPIN_LOCKS 154 5010 #define _SC_REGEXP 155 5011 #define _SC_SHELL 157 5012 #define _SC_SPAWN 159 5013 #define _SC_MAPPED_FILES 16 5014 #define _SC_SPORADIC_SERVER 160 5015 #define _SC_THREAD_SPORADIC_SERVER 161 5016 #define _SC_TIMEOUTS 164 5017 #define _SC_TYPED_MEMORY_OBJECTS 165 5018 #define _SC_2_PBS_ACCOUNTING 169 5019 #define _SC_MEMLOCK 17 5020 #define _SC_2_PBS_LOCATE 170 5021 #define _SC_2_PBS_MESSAGE 171 5022 #define _SC_2_PBS_TRACK 172 5023 #define _SC_SYMLOOP_MAX 173 5024 #define _SC_2_PBS_CHECKPOINT 175 5025 #define _SC_V6_ILP32_OFF32 176 5026 #define _SC_V6_ILP32_OFFBIG 177 5027 #define _SC_V6_LP64_OFF64 178 5028 #define _SC_V6_LPBIG_OFFBIG 179 5029 #define _SC_MEMLOCK_RANGE 18 5030 #define _SC_HOST_NAME_MAX 180 5031 #define _SC_TRACE 181 5032 #define _SC_TRACE_EVENT_FILTER 182 5033 #define _SC_TRACE_INHERIT 183 5034 #define _SC_TRACE_LOG 184 5035 #define _SC_MEMORY_PROTECTION 19 5036 #define _SC_CLK_TCK 2 5037 #define _SC_MESSAGE_PASSING 20 5038 #define _SC_SEMAPHORES 21 5039 #define _SC_SHARED_MEMORY_OBJECTS 22 5040 #define _SC_AIO_LISTIO_MAX 23 5041 #define _SC_AIO_MAX 24 5042 #define _SC_AIO_PRIO_DELTA_MAX 25 5043 #define _SC_DELAYTIMER_MAX 26 5044 #define _SC_MQ_OPEN_MAX 27 5045 #define _SC_MQ_PRIO_MAX 28 5046 #define _SC_VERSION 29 5047 #define _SC_NGROUPS_MAX 3 5048 #define _SC_PAGESIZE 30 5049 #define _SC_PAGE_SIZE 30 5050 #define _SC_RTSIG_MAX 31 5051 #define _SC_SEM_NSEMS_MAX 32 5052 #define _SC_SEM_VALUE_MAX 33 5053 #define _SC_SIGQUEUE_MAX 34 5054 #define _SC_TIMER_MAX 35 5055 #define _SC_BC_BASE_MAX 36 5056 #define _SC_BC_DIM_MAX 37 5057 #define _SC_BC_SCALE_MAX 38 5058 #define _SC_BC_STRING_MAX 39 5059 #define _SC_OPEN_MAX 4 5060 #define _SC_COLL_WEIGHTS_MAX 40 5061 #define _SC_EXPR_NEST_MAX 42 5062 #define _SC_LINE_MAX 43 5063 #define _SC_RE_DUP_MAX 44 5064 #define _SC_2_VERSION 46 5065 #define _SC_2_C_BIND 47 5066 #define _SC_2_C_DEV 48 5067 #define _SC_2_FORT_DEV 49 5068 #define _SC_STREAM_MAX 5 5069 #define _SC_2_FORT_RUN 50 5070 #define _SC_2_SW_DEV 51 5071 #define _SC_2_LOCALEDEF 52 5072 #define _SC_TZNAME_MAX 6 5073 #define _SC_IOV_MAX 60 5074 #define _SC_THREADS 67 5075 #define _SC_THREAD_SAFE_FUNCTIONS 68 5076 #define _SC_GETGR_R_SIZE_MAX 69 5077 #define _SC_JOB_CONTROL 7 5078 #define _SC_GETPW_R_SIZE_MAX 70 5079 #define _SC_LOGIN_NAME_MAX 71 5080 #define _SC_TTY_NAME_MAX 72 5081 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 5082 #define _SC_THREAD_KEYS_MAX 74 5083 #define _SC_THREAD_STACK_MIN 75 5084 #define _SC_THREAD_THREADS_MAX 76 5085 #define _SC_THREAD_ATTR_STACKADDR 77 5086 #define _SC_THREAD_ATTR_STACKSIZE 78 5087 #define _SC_THREAD_PRIORITY_SCHEDULING 79 5088 #define _SC_SAVED_IDS 8 5089 #define _SC_THREAD_PRIO_INHERIT 80 5090 #define _SC_THREAD_PRIO_PROTECT 81 5091 #define _SC_THREAD_PROCESS_SHARED 82 5092 #define _SC_ATEXIT_MAX 87 5093 #define _SC_PASS_MAX 88 5094 #define _SC_XOPEN_VERSION 89 5095 #define _SC_REALTIME_SIGNALS 9 5096 #define _SC_XOPEN_UNIX 91 5097 #define _SC_XOPEN_CRYPT 92 5098 #define _SC_XOPEN_ENH_I18N 93 5099 #define _SC_XOPEN_SHM 94 5100 #define _SC_2_CHAR_TERM 95 5101 #define _SC_2_C_VERSION 96 5102 #define _SC_2_UPE 97 5103 5104 #define _CS_PATH 0 5105 #define _POSIX_REGEXP 1 5106 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 5107 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 5108 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 5109 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 5110 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 5111 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 5112 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 5113 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 5114 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 5115 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 5116 #define _CS_XBS5_LP64_OFF64_LIBS 1110 5117 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 5118 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 5119 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 5120 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 5121 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 5122 5123 #define _XOPEN_REALTIME 1 5124 #define _XOPEN_XPG4 1 5125 5126 #define F_ULOCK 0 5127 #define F_LOCK 1 5128 #define F_TLOCK 2 5129 #define F_TEST 3 5130 _________________________________________________________ 5131 5132 1.4.61. utime.h 5133 5134 struct utimbuf 5135 { 5136 time_t actime; 5137 time_t modtime; 5138 } 5139 ; 5140 _________________________________________________________ 5141 5142 1.4.62. utmp.h 5143 5144 #define UT_HOSTSIZE 256 5145 #define UT_LINESIZE 32 5146 #define UT_NAMESIZE 32 5147 5148 struct exit_status 5149 { 5150 short e_termination; 5151 short e_exit; 5152 } 5153 ; 5154 5155 #define EMPTY 0 5156 #define RUN_LVL 1 5157 #define BOOT_TIME 2 5158 #define NEW_TIME 3 5159 #define OLD_TIME 4 5160 #define INIT_PROCESS 5 5161 #define LOGIN_PROCESS 6 5162 #define USER_PROCESS 7 5163 #define DEAD_PROCESS 8 5164 #define ACCOUNTING 9 5165 _________________________________________________________ 5166 5167 1.4.63. wchar.h 5168 5169 #define WEOF (0xffffffffu) 5170 #define WCHAR_MAX 0x7FFFFFFF 5171 #define WCHAR_MIN 0x80000000 5172 _________________________________________________________ 5173 5174 1.4.64. wctype.h 5175 5176 typedef unsigned long wctype_t; 5177 typedef unsigned int wint_t; 5178 typedef const int32_t *wctrans_t; 5179 typedef struct 5180 { 5181 int count; 5182 wint_t value; 5183 } 5184 __mbstate_t; 5185 5186 typedef __mbstate_t mbstate_t; 5187 _________________________________________________________ 5188 5189 1.4.65. wordexp.h 5190 5191 enum 5192 { 5193 WRDE_DOOFFS, WRDE_APPEND, WRDE_NOCMD, WRDE_REUSE, WRDE_SHOWERR, WRDE_ 5194 UNDEF, 5195 __WRDE_FLAGS 5196 } 5197 ; 5198 5199 typedef struct 5200 { 5201 int we_wordc; 5202 char **we_wordv; 5203 int we_offs; 5204 } 5205 wordexp_t; 5206 5207 enum 5208 { 5209 WRDE_NOSYS, WRDE_NOSPACE, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB, 5210 WRDE_SYNTAX 5211 } 5212 ; 5213 _________________________________________________________ 5214 5215 1.5. Interface Definitions for libc 5216 5217 Table of Contents 5218 _IO_feof -- alias for feof 5219 _IO_getc -- alias for getc 5220 _IO_putc -- alias for putc 5221 _IO_puts -- alias for puts 5222 __assert_fail -- abort the program after false assertion 5223 __ctype_b_loc -- accessor function for __ctype_b array for 5224 ctype functions 5225 5226 __ctype_get_mb_cur_max -- maximum length of a multibyte 5227 character in the current locale 5228 5229 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 5230 array for ctype tolower() function 5231 5232 __ctype_toupper_loc -- accessor function for 5233 __ctype_b_toupper() array for ctype toupper() function 5234 5235 __cxa_atexit -- register a function to be called by exit or 5236 when a shared library is unloaded 5237 5238 __daylight -- Daylight savings time flag 5239 __environ -- alias for environ - user environment 5240 __errno_location -- address of errno variable 5241 __fpending -- returns in bytes the amount of output pending on 5242 a stream 5243 5244 __getpagesize -- alias for getpagesize - get current page size 5245 5246 __getpgid -- get the process group id 5247 __h_errno_location -- address of h_errno variable 5248 __isinf -- test for infinity 5249 __isinff -- test for infinity 5250 __isinfl -- test for infinity 5251 __isnan -- test for infinity 5252 __isnanf -- test for infinity 5253 __isnanl -- test for infinity 5254 __libc_current_sigrtmax -- return number of available 5255 real-time signal with lowest priority 5256 5257 __libc_current_sigrtmin -- return number of available 5258 real-time signal with highest priority 5259 5260 __libc_start_main -- initialization routine 5261 __lxstat -- inline wrapper around call to lxstat 5262 __mempcpy -- copy given number of bytes of source to 5263 destination 5264 5265 __rawmemchr -- scan memory 5266 __register_atfork -- alias for register_atfork 5267 __sigsetjmp -- save stack context for non-local goto 5268 __stpcpy -- copy a string returning a pointer to its end 5269 __strdup -- alias for strdup 5270 __strtod_internal -- underlying function for strtod 5271 __strtof_internal -- underlying function for strtof 5272 __strtok_r -- alias for strtok_r 5273 __strtol_internal -- alias for strtol 5274 __strtold_internal -- underlying function for strtold 5275 __strtoll_internal -- underlying function for strtoll 5276 __strtoul_internal -- underlying function for strtoul 5277 __strtoull_internal -- underlying function for strtoull 5278 __sysconf -- get configuration information at runtime 5279 __sysv_signal -- signal handling 5280 __timezone -- global variable containing timezone 5281 __tzname -- global variable containing the timezone 5282 __wcstod_internal -- underlying function for wcstod 5283 __wcstof_internal -- underlying function for wcstof 5284 __wcstol_internal -- underlying function for wcstol 5285 __wcstold_internal -- underlying function for wcstold 5286 __wcstoul_internal -- underlying function for wcstoul 5287 __xmknod -- make block or character special file 5288 __xstat -- Get File Status 5289 __xstat64 -- Get File Status 5290 _environ -- alias for environ - user environment 5291 _nl_msg_cat_cntr -- new catalog load counter 5292 _sys_errlist -- array containing the "C" locale strings used 5293 by strerror() 5294 5295 _sys_siglist -- array containing the names of the signal names 5296 acct -- switch process accounting on or off 5297 adjtime -- correct the time to allow synchronization of the 5298 system clock 5299 5300 adjtimex -- tune kernel clock (DEPRECATED) 5301 asprintf -- write formatted output to a dynamically allocated 5302 string 5303 5304 bind_textdomain_codeset -- specify encoding for message 5305 retrieval 5306 5307 bindresvport -- bind socket to privileged IP port 5308 bindtextdomain -- specify the location of a message catalog 5309 cfmakeraw -- get and set terminal attributes 5310 cfsetspeed -- set terminal input and output data rate 5311 creat -- open a file 5312 daemon -- run in the background 5313 dcgettext -- perform domain and category specific lookup in 5314 message catalog 5315 5316 dcngettext -- perform domain and category specific lookup in 5317 message catalog with plural 5318 5319 dgettext -- perform lookup in message catalog for the current 5320 LC_MESSAGES locale 5321 5322 dngettext -- perform lookup in message catalog for the current 5323 locale 5324 5325 err -- display formatted error messages 5326 error -- print error message 5327 errx -- display formatted error message and exit 5328 fcntl -- file control 5329 fflush_unlocked -- non thread safe fflush 5330 fgetwc_unlocked -- non thread safe fgetwc 5331 flock -- apply or remove an advisory lock on an open file 5332 fopen -- open a file 5333 freopen -- open a file 5334 getdomainname -- get NIS domain name (DEPRECATED). 5335 gethostbyname_r -- find network host database entry matching 5336 host name (DEPRECATED) 5337 5338 getloadavg -- get system load averages 5339 getopt -- parse command line options 5340 getopt_long -- parse command line options 5341 getopt_long_only -- parse command line options 5342 gettext -- Search message catalogs for a string 5343 getutent -- access user accounting database entries 5344 getutent_r -- access user accounting database entries 5345 glob64 -- find pathnames matching a pattern (Large File 5346 Support) 5347 5348 globfree64 -- free memory from glob64() (Large File Support) 5349 initgroups -- initialize the supplementary group access list 5350 ioctl -- control device 5351 sockio -- socket ioctl commands 5352 ttyio -- tty ioctl commands 5353 kill -- send a signal 5354 mbsnrtowcs -- convert a multibyte string to a wide character 5355 string 5356 5357 memmem -- locate bytes 5358 memrchr -- scan memory for a character 5359 ngettext -- Search message catalogs for plural string 5360 open -- open a file 5361 opterr -- external variable used in getopt() 5362 optind -- external variable used in getopt() 5363 optopt -- external variable used in getopt() 5364 pmap_getport -- Find the port number assigned to a service 5365 registered with a portmapper. 5366 5367 pmap_set -- Establishes mapping to machine's RPC Bind service. 5368 pmap_unset -- Destroys RPC Binding 5369 psignal -- print signal message 5370 random_r -- generate random number (DEPRECATED) 5371 setbuffer -- stream buffering operation 5372 setdomainname -- set NIS domain name (DEPRECATED). 5373 setgroups -- set list of supplementary group IDs 5374 sethostid -- set the unique identifier of the current host 5375 (DEPRECATED) 5376 5377 sethostname -- set host name 5378 setsockopt -- set options on sockets 5379 setutent -- access user accounting database entries 5380 sigandset -- build a new signal set by combining the two input 5381 sets using logical AND 5382 5383 sigblock -- manipulate the signal mask (DEPRECATED) 5384 siggetmask -- manipulate the signal mask (DEPRECATED) 5385 sigisemptyset -- check for empty signal set 5386 sigorset -- build a new signal set by combining the two input 5387 sets using logical OR 5388 5389 sigreturn -- return from signal handler and cleanup stack 5390 frame 5391 5392 stime -- set time 5393 stpcpy -- copy a string returning a pointer to its end 5394 stpncpy -- copy a fixed-size string, returning a pointer to 5395 its end 5396 5397 strcasestr -- locate a substring ignoring case 5398 strerror_r -- reentrant version of strerror 5399 strfry -- randomize a string (DEPRECATED) 5400 strndup -- return a malloc'd copy of at most the specified 5401 number of bytes of a string 5402 5403 strnlen -- determine the length of a fixed-size string 5404 strptime -- parse a time string 5405 strsep -- extract token from string 5406 strsignal -- return string describing signal 5407 strtoq -- convert string value to a long or quad_t integer 5408 strtouq -- convert a string to an unsigned long long 5409 strverscmp -- compare strings holding name and indices/version 5410 numbers (DEPRECATED) 5411 5412 svc_register -- Register Remote Procedure Call Interface 5413 svc_run -- Waits for RPC requests to arrive and calls service 5414 procedure. 5415 5416 svc_sendreply -- called by RPC service's dispatch routine 5417 svctcp_create -- Creates a TCP/IP-based RPC service transport. 5418 svcudp_create -- Creates a UDP-based RPC service transport. 5419 system -- execute a shell command 5420 textdomain -- set the current default message domain 5421 unlink -- remove a directory entry 5422 utmpname -- set user accounting database 5423 vasprintf -- write formatted output to a dynamically allocated 5424 string 5425 5426 vdprintf -- write formatted output to a file descriptor 5427 verrx -- display formatted error message and exit 5428 vsyslog -- log to system log 5429 wait3 -- wait for child process (DEPRECATED) 5430 wait4 -- wait for process termination, BSD style 5431 waitpid -- wait for child process 5432 warn -- formatted error messages 5433 warnx -- formatted error messages 5434 wcpcpy -- copy a wide character string, returning a pointer to 5435 its end 5436 5437 wcpncpy -- copy a fixed-size string of wide characters, 5438 returning a pointer to its end 5439 5440 wcscasecmp -- compare two wide-character strings, ignoring 5441 case 5442 5443 wcsdup -- duplicate a wide-character string 5444 wcsncasecmp -- compare two fixed-size wide-character strings, 5445 ignoring case 5446 5447 wcsnlen -- determine the length of a fixed-size wide-character 5448 string 5449 5450 wcsnrtombs -- convert a wide character string to a multi-byte 5451 string 5452 5453 wcstoq -- convert wide string to long long int representation 5454 wcstouq -- convert wide string to unsigned long long int 5455 representation 5456 5457 xdr_u_int -- library routines for external data representation 5458 5459 The following interfaces are included in libc and are defined 5460 by this specification. Unless otherwise noted, these 5461 interfaces shall be included in the source standard. 5462 5463 Other interfaces listed above for libc shall behave as 5464 described in the referenced base document. 5465 5466 _IO_feof 5467 5468 Name 5469 5470 _IO_feof -- alias for feof 5471 5472 Synopsis 5473 5474 int _IO_feof(_IO_FILE * __fp); 5475 5476 Description 5477 5478 _IO_feof() tests the end-of-file indicator for the stream 5479 pointed to by __fp, returning a non-zero value if it is set. 5480 5481 _IO_feof() is not in the source standard; it is only in the 5482 binary standard. 5483 5484 _IO_getc 5485 5486 Name 5487 5488 _IO_getc -- alias for getc 5489 5490 Synopsis 5491 5492 int _IO_getc(_IO_FILE * __fp); 5493 5494 Description 5495 5496 _IO_getc() reads the next character from __fp and returns it 5497 as an unsigned char cast to an int, or EOF on end-of-file or 5498 error. 5499 5500 _IO_getc() is not in the source standard; it is only in the 5501 binary standard. 5502 5503 _IO_putc 5504 5505 Name 5506 5507 _IO_putc -- alias for putc 5508 5509 Synopsis 5510 5511 int _IO_putc(int __c, _IO_FILE * __fp); 5512 5513 Description 5514 5515 _IO_putc() writes the character __c, cast to an unsigned char, 5516 to __fp. 5517 5518 _IO_putc() is not in the source standard; it is only in the 5519 binary standard. 5520 5521 _IO_puts 5522 5523 Name 5524 5525 _IO_puts -- alias for puts 5526 5527 Synopsis 5528 5529 int _IO_puts(const char * __c); 5530 5531 Description 5532 5533 _IO_puts() writes the string __s and a trailing newline to 5534 stdout. 5535 5536 _IO_puts() is not in the source standard; it is only in the 5537 binary standard. 5538 5539 __assert_fail 5540 5541 Name 5542 5543 __assert_fail -- abort the program after false assertion 5544 5545 Synopsis 5546 5547 void __assert_fail(const char * assertion, const char * file, 5548 unsigned int line, const char * function); 5549 5550 Description 5551 5552 The __assert_fail() function is used to implement the assert() 5553 interface of ISO POSIX (2003). The __assert_fail() function 5554 shall print the given file filename, line line number, 5555 function function name and a message on the standard error 5556 stream in an unspecified format, and abort program execution 5557 via the abort() function. For example: 5558 5559 a.c:10: foobar: Assertion a == b failed. 5560 5561 If function is NULL, __assert_fail() shall omit information 5562 about the function. 5563 5564 assertion, file, and line shall be non-NULL. 5565 5566 The __assert_fail() function is not in the source standard; it 5567 is only in the binary standard. The assert() interface is not 5568 in the binary standard; it is only in the source standard. The 5569 assert() may be implemented as a macro. 5570 5571 __ctype_b_loc 5572 5573 Name 5574 5575 __ctype_b_loc -- accessor function for __ctype_b array for 5576 ctype functions 5577 5578 Synopsis 5579 5580 #include 5581 5582 const unsigned short * * __ctype_b_loc (void); 5583 5584 Description 5585 5586 The __ctype_b_loc() function shall return a pointer into an 5587 array of characters in the current locale that contains 5588 characteristics for each character in the current character 5589 set. The array shall contain a total of 384 characters, and 5590 can be indexed with any signed or unsigned char (i.e. with an 5591 index value between -128 and 255). If the application is 5592 multithreaded, the array shall be local to the current thread. 5593 5594 This interface is not in the source standard; it is only in 5595 the binary standard. 5596 5597 Return Value 5598 5599 The __ctype_b_loc() function shall return a pointer to the 5600 array of characters to be used for the ctype() family of 5601 functions (see ). 5602 5603 __ctype_get_mb_cur_max 5604 5605 Name 5606 5607 __ctype_get_mb_cur_max -- maximum length of a multibyte 5608 character in the current locale 5609 5610 Synopsis 5611 5612 size_t __ctype_get_mb_cur_max(void); 5613 5614 Description 5615 5616 __ctype_get_mb_cur_max() returns the maximum length of a 5617 multibyte character in the current locale. 5618 5619 __ctype_get_mb_cur_max() is not in the source standard; it is 5620 only in the binary standard. 5621 5622 __ctype_tolower_loc 5623 5624 Name 5625 5626 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 5627 array for ctype tolower() function 5628 5629 Synopsis 5630 5631 #include 5632 5633 int32_t * * __ctype_tolower_loc(void); 5634 5635 Description 5636 5637 The __ctype_tolower_loc() function shall return a pointer into 5638 an array of characters in the current locale that contains 5639 lower case equivalents for each character in the current 5640 character set. The array shall contain a total of 384 5641 characters, and can be indexed with any signed or unsigned 5642 char (i.e. with an index value between -128 and 255). If the 5643 application is multithreaded, the array shall be local to the 5644 current thread. 5645 5646 This interface is not in the source standard; it is only in 5647 the binary standard. 5648 5649 Return Value 5650 5651 The __ctype_tolower_loc() function shall return a pointer to 5652 the array of characters to be used for the ctype() family of 5653 functions (see ). 5654 5655 __ctype_toupper_loc 5656 5657 Name 5658 5659 __ctype_toupper_loc -- accessor function for 5660 __ctype_b_toupper() array for ctype toupper() function 5661 5662 Synopsis 5663 5664 #include 5665 5666 int32_t * * __ctype_toupper_loc(void); 5667 5668 Description 5669 5670 The __ctype_toupper_loc() function shall return a pointer into 5671 an array of characters in the current locale that contains 5672 upper case equivalents for each character in the current 5673 character set. The array shall contain a total of 384 5674 characters, and can be indexed with any signed or unsigned 5675 char (i.e. with an index value between -128 and 255). If the 5676 application is multithreaded, the array shall be local to the 5677 current thread. 5678 5679 This interface is not in the source standard; it is only in 5680 the binary standard. 5681 5682 Return Value 5683 5684 The __ctype_toupper_loc() function shall return a pointer to 5685 the array of characters to be used for the ctype() family of 5686 functions (see ). 5687 5688 __cxa_atexit 5689 5690 Name 5691 5692 __cxa_atexit -- register a function to be called by exit or 5693 when a shared library is unloaded 5694 5695 Synopsis 5696 5697 int __cxa_atexit(void (*func) (void *), void * arg, void * 5698 dso_handle); 5699 5700 Description 5701 5702 __cxa_atexit() registers a function to be called by exit or 5703 when a shared library is unloaded. 5704 5705 The __cxa_atexit() function is used to implement atexit(), as 5706 described in ISO POSIX (2003). Calling 5707 atexit(func) 5708 5709 from the statically linked part of an application shall be 5710 equivalent to 5711 __cxa_atexit(func, NULL, NULL) 5712 5713 . 5714 5715 __cxa_atexit() is not in the source standard; it is only in 5716 the binary standard. atexit() is not in the binary standard; 5717 it is only in the source standard. 5718 5719 __daylight 5720 5721 Name 5722 5723 __daylight -- Daylight savings time flag 5724 5725 Synopsis 5726 5727 int __daylight; 5728 5729 Description 5730 5731 The integer variable __daylight shall implement the daylight 5732 savings time flag daylight as specified in the ISO POSIX 5733 (2003) header file . 5734 5735 __daylight is not in the source standard; it is only in the 5736 binary standard. daylight is not in the binary standard; it is 5737 only in the source standard. 5738 5739 __environ 5740 5741 Name 5742 5743 __environ -- alias for environ - user environment 5744 5745 Synopsis 5746 5747 extern char * *__environ; 5748 5749 Description 5750 5751 __environ is an alias for environ - user environment. 5752 5753 __environ has the same specification as environ. 5754 5755 __environ is not in the source standard; it is only in the 5756 binary standard. 5757 5758 __errno_location 5759 5760 Name 5761 5762 __errno_location -- address of errno variable 5763 5764 Synopsis 5765 5766 int * __errno_location(void); 5767 5768 Description 5769 5770 __errno_location() is not in the source standard; it is only 5771 in the binary standard. 5772 5773 __fpending 5774 5775 Name 5776 5777 __fpending -- returns in bytes the amount of output pending on 5778 a stream 5779 5780 Synopsis 5781 5782 #include 5783 5784 size_t __fpending(FILE * stream); 5785 5786 Description 5787 5788 __fpending() returns the amount of output in bytes pending on 5789 a stream. 5790 5791 __fpending() is not in the source standard; it is only in the 5792 binary standard. 5793 5794 __getpagesize 5795 5796 Name 5797 5798 __getpagesize -- alias for getpagesize - get current page size 5799 5800 Synopsis 5801 5802 int __getpagesize(void); 5803 5804 Description 5805 5806 __getpagesize() is an alias for getpagesize() - get current 5807 page size. 5808 5809 __getpagesize() has the same specification as getpagesize(). 5810 5811 __getpagesize() is not in the source standard; it is only in 5812 the binary standard. 5813 5814 __getpgid 5815 5816 Name 5817 5818 __getpgid -- get the process group id 5819 5820 Synopsis 5821 5822 pid_t __getpgid(pid_t pid); 5823 5824 Description 5825 5826 __getpgid() has the same specification as getpgid(). 5827 5828 __getpgid() is not in the source standard; it is only in the 5829 binary standard. 5830 5831 __h_errno_location 5832 5833 Name 5834 5835 __h_errno_location -- address of h_errno variable 5836 5837 Synopsis 5838 5839 int * __h_errno_location(void); 5840 5841 Description 5842 5843 __h_errno_location() returns the address of the h_errno 5844 variable, where h_errno is as specified in ISO POSIX (2003). 5845 5846 __h_errno_location() is not in the source standard; it is only 5847 in the binary standard. Note that h_errno itself is only in 5848 the source standard; it is not in the binary standard. 5849 5850 __isinf 5851 5852 Name 5853 5854 __isinf -- test for infinity 5855 5856 Synopsis 5857 5858 int __isinf(double arg); 5859 5860 Description 5861 5862 __isinf() has the same specification as isinf() in ISO POSIX 5863 (2003), except that the argument type for __isinf() is known 5864 to be double. 5865 5866 __isinf() is not in the source standard; it is only in the 5867 binary standard. 5868 5869 __isinff 5870 5871 Name 5872 5873 __isinff -- test for infinity 5874 5875 Synopsis 5876 5877 int __isinff(float arg); 5878 5879 Description 5880 5881 __isinff() has the same specification as isinf() in ISO POSIX 5882 (2003) except that the argument type for __isinff() is known 5883 to be float. 5884 5885 __isinff() is not in the source standard; it is only in the 5886 binary standard. 5887 5888 __isinfl 5889 5890 Name 5891 5892 __isinfl -- test for infinity 5893 5894 Synopsis 5895 5896 int __isinfl(long double arg); 5897 5898 Description 5899 5900 __isinfl() has the same specification as isinf() in the ISO 5901 POSIX (2003), except that the argument type for __isinfl() is 5902 known to be long double. 5903 5904 __isinfl() is not in the source standard; it is only in the 5905 binary standard. 5906 5907 __isnan 5908 5909 Name 5910 5911 __isnan -- test for infinity 5912 5913 Synopsis 5914 5915 int __isnan(double arg); 5916 5917 Description 5918 5919 __isnan() has the same specification as isnan() in ISO POSIX 5920 (2003), except that the argument type for __isnan() is known 5921 to be double. 5922 5923 __isnan() is not in the source standard; it is only in the 5924 binary standard. 5925 5926 __isnanf 5927 5928 Name 5929 5930 __isnanf -- test for infinity 5931 5932 Synopsis 5933 5934 int __isnanf(float arg); 5935 5936 Description 5937 5938 __isnanf() has the same specification as isnan() in ISO POSIX 5939 (2003), except that the argument type for __isnanf() is known 5940 to be float. 5941 5942 __isnanf() is not in the source standard; it is only in the 5943 binary standard. 5944 5945 __isnanl 5946 5947 Name 5948 5949 __isnanl -- test for infinity 5950 5951 Synopsis 5952 5953 int __isnanl(long double arg); 5954 5955 Description 5956 5957 __isnanl() has the same specification as isnan() in ISO POSIX 5958 (2003), except that the argument type for __isnanl() is known 5959 to be long double. 5960 5961 __isnanl() is not in the source standard; it is only in the 5962 binary standard. 5963 5964 __libc_current_sigrtmax 5965 5966 Name 5967 5968 __libc_current_sigrtmax -- return number of available 5969 real-time signal with lowest priority 5970 5971 Synopsis 5972 5973 int __libc_current_sigrtmax(void); 5974 5975 Description 5976 5977 __libc_current_sigrtmax() returns the number of an available 5978 real-time signal with the lowest priority. 5979 5980 __libc_current_sigrtmax() is not in the source standard; it is 5981 only in the binary standard. 5982 5983 __libc_current_sigrtmin 5984 5985 Name 5986 5987 __libc_current_sigrtmin -- return number of available 5988 real-time signal with highest priority 5989 5990 Synopsis 5991 5992 int __libc_current_sigrtmin(void); 5993 5994 Description 5995 5996 __libc_current_sigrtmin() returns the number of an available 5997 real-time signal with the highest priority. 5998 5999 __libc_current_sigrtmin() is not in the source standard; it is 6000 only in the binary standard. 6001 6002 __libc_start_main 6003 6004 Name 6005 6006 __libc_start_main -- initialization routine 6007 6008 Synopsis 6009 6010 int __libc_start_main(int *(main) (int, char * *, char * *), 6011 int argc, char * * ubp_av, void (*init) (void), void (*fini) 6012 (void), void (*rtld_fini) (void), void (* stack_end)); 6013 6014 Description 6015 6016 The __libc_start_main() function shall initialize the process, 6017 call the main function with appropriate arguments, and handle 6018 the return from main(). 6019 6020 __libc_start_main() is not in the source standard; it is only 6021 in the binary standard. 6022 6023 __lxstat 6024 6025 Name 6026 6027 __lxstat -- inline wrapper around call to lxstat 6028 6029 Synopsis 6030 6031 #include 6032 6033 int __lxstat(int version, char * __path, struct stat 6034 __statbuf); 6035 6036 Description 6037 6038 __lxstat() is an inline wrapper around call to lxstat(). 6039 6040 __lxstat() is not in the source standard; it is only in the 6041 binary standard. 6042 6043 __mempcpy 6044 6045 Name 6046 6047 __mempcpy -- copy given number of bytes of source to 6048 destination 6049 6050 Synopsis 6051 6052 #include 6053 6054 ptr_t __mempcpy(ptr_t restrict dest, const ptr_t restrict src, 6055 size_t n); 6056 6057 Description 6058 6059 __mempcpy() copies n bytes of source to destination, returning 6060 pointer to bytes after the last written byte. 6061 6062 __mempcpy() is not in the source standard; it is only in the 6063 binary standard. 6064 6065 __rawmemchr 6066 6067 Name 6068 6069 __rawmemchr -- scan memory 6070 6071 Synopsis 6072 6073 #include 6074 6075 ptr_t __rawmemchr(const ptr_t s, int c); 6076 6077 Description 6078 6079 __rawmemchr() searches in s for c. 6080 6081 __rawmemchr() is a weak alias to rawmemchr(). It is similar to 6082 memchr(), but it has no length limit. 6083 6084 __rawmemchr() is not in the source standard; it is only in the 6085 binary standard. 6086 6087 __register_atfork 6088 6089 Name 6090 6091 __register_atfork -- alias for register_atfork 6092 6093 Synopsis 6094 6095 int __register_atfork(void (*prepare) (void), void (*parent) 6096 (void), void (*child) (void), void * __dso_handle); 6097 6098 Description 6099 6100 __register_atfork() implements pthread_atfork() as specified 6101 in ISO POSIX (2003). The additional parameter __dso_handle 6102 allows a shared object to pass in it's handle so that 6103 functions registered by __register_atfork() can be 6104 unregistered by the runtime when the shared object is 6105 unloaded. 6106 6107 __sigsetjmp 6108 6109 Name 6110 6111 __sigsetjmp -- save stack context for non-local goto 6112 6113 Synopsis 6114 6115 int __sigsetjmp(jmp_buf env, int savemask); 6116 6117 Description 6118 6119 __sigsetjmp() has the same behavior as sigsetjmp() as 6120 specified by ISO POSIX (2003). 6121 6122 __sigsetjmp() is not in the source standard; it is only in the 6123 binary standard. 6124 6125 __stpcpy 6126 6127 Name 6128 6129 __stpcpy -- copy a string returning a pointer to its end 6130 6131 Synopsis 6132 6133 #include 6134 6135 char * __stpcpy(char * dest, const char * src); 6136 6137 Description 6138 6139 __stpcpy() copies the string src (including the terminating /0 6140 character) to the array dest. The strings may not overlap, and 6141 dest must be large enough to receive the copy. 6142 6143 Return Value 6144 6145 __stpcpy() returns a pointer to the end of the string dest 6146 (that is, the address of the terminating NULL character) 6147 rather than the beginning. 6148 6149 __stpcpy() has the same specification as stpcpy(). 6150 6151 __stpcpy() is not in the source standard; it is only in the 6152 binary standard. 6153 6154 __strdup 6155 6156 Name 6157 6158 __strdup -- alias for strdup 6159 6160 Synopsis 6161 6162 char * __strdup(const char string); 6163 6164 Description 6165 6166 __strdup() has the same specification as strdup(). 6167 6168 __strdup() is not in the source standard; it is only in the 6169 binary standard. 6170 6171 __strtod_internal 6172 6173 Name 6174 6175 __strtod_internal -- underlying function for strtod 6176 6177 Synopsis 6178 6179 double __strtod_internal(const char * __nptr, char * * 6180 __endptr, int __group); 6181 6182 Description 6183 6184 __group shall be 0 or the behavior of __strtod_internal() is 6185 undefined. 6186 6187 __strtod_internal(__nptr, __endptr, 0)() has the same 6188 specification as strtod(__nptr, __endptr)(). 6189 6190 __strtod_internal() is not in the source standard; it is only 6191 in the binary standard. 6192 6193 __strtof_internal 6194 6195 Name 6196 6197 __strtof_internal -- underlying function for strtof 6198 6199 Synopsis 6200 6201 float __strtof_internal(const char * __nptr, char * * 6202 __endptr, int __group); 6203 6204 Description 6205 6206 __group shall be 0 or the behavior of __strtof_internal() is 6207 undefined. 6208 6209 __strtof_internal(__nptr, __endptr, 0)() has the same 6210 specification as strtof(__nptr, __endptr)(). 6211 6212 __strtof_internal() is not in the source standard; it is only 6213 in the binary standard. 6214 6215 __strtok_r 6216 6217 Name 6218 6219 __strtok_r -- alias for strtok_r 6220 6221 Synopsis 6222 6223 char * __strtok_r(char * restrict s, const char * restrict 6224 delim, char * * restrict save_ptr); 6225 6226 Description 6227 6228 __strtok_r() has the same specification as strtok_r(). 6229 6230 __strtok_r() is not in the source standard; it is only in the 6231 binary standard. 6232 6233 __strtol_internal 6234 6235 Name 6236 6237 __strtol_internal -- alias for strtol 6238 6239 Synopsis 6240 6241 long int __strtol_internal(const char * __nptr, char * * 6242 __endptr, int __base, int __group); 6243 6244 Description 6245 6246 __group shall be 0 or the behavior of __strtol_internal() is 6247 undefined. 6248 6249 __strtol_internal(__nptr, __endptr, __base, 0) has the same 6250 specification as strtol(__nptr, __endptr, __base). 6251 6252 __strtol_internal() is not in the source standard; it is only 6253 in the binary standard. 6254 6255 __strtold_internal 6256 6257 Name 6258 6259 __strtold_internal -- underlying function for strtold 6260 6261 Synopsis 6262 6263 long double __strtold_internal(const char * __nptr, char * * 6264 __endptr, int __group); 6265 6266 Description 6267 6268 __group shall be 0 or the behavior of __strtold_internal() is 6269 undefined. 6270 6271 __strtold_internal(__nptr, __endptr, 0) has the same 6272 specification as strtold(__nptr, __endptr). 6273 6274 __strtold_internal() is not in the source standard; it is only 6275 in the binary standard. 6276 6277 __strtoll_internal 6278 6279 Name 6280 6281 __strtoll_internal -- underlying function for strtoll 6282 6283 Synopsis 6284 6285 long long __strtoll_internal(const char * __nptr, char * * 6286 __endptr, int __base, int __group); 6287 6288 Description 6289 6290 __group shall be 0 or the behavior of __strtoll_internal() is 6291 undefined. 6292 6293 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 6294 specification as strtoll(__nptr, __endptr, __base). 6295 6296 __strtoll_internal() is not in the source standard; it is only 6297 in the binary standard. 6298 6299 __strtoul_internal 6300 6301 Name 6302 6303 __strtoul_internal -- underlying function for strtoul 6304 6305 Synopsis 6306 6307 unsigned long int __strtoul_internal(const char * __nptr, char 6308 * * __endptr, int __base, int __group); 6309 6310 Description 6311 6312 __group shall be 0 or the behavior of __strtoul_internal() is 6313 undefined. 6314 6315 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 6316 specification as strtoul(__nptr, __endptr, __base). 6317 6318 __strtoul_internal() is not in the source standard; it is only 6319 in the binary standard. 6320 6321 __strtoull_internal 6322 6323 Name 6324 6325 __strtoull_internal -- underlying function for strtoull 6326 6327 Synopsis 6328 6329 unsigned long long __strtoull_internal(const char * __nptr, 6330 char * * __endptr, int __base, int __group); 6331 6332 Description 6333 6334 __group shall be 0 or the behavior of __strtoull_internal() is 6335 undefined. 6336 6337 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 6338 specification as strtoull(__nptr, __endptr, __base). 6339 6340 __strtoull_internal() is not in the source standard; it is 6341 only in the binary standard. 6342 6343 __sysconf 6344 6345 Name 6346 6347 __sysconf -- get configuration information at runtime 6348 6349 Synopsis 6350 6351 #include 6352 6353 long __sysconf(int name); 6354 6355 Description 6356 6357 __sysconf() gets configuration information at runtime. 6358 6359 __sysconf() is weak alias to sysconf(). 6360 6361 __sysconf() has the same specification as sysconf(). 6362 6363 __sysconf() is not in the source standard; it is only in the 6364 binary standard. 6365 6366 __sysv_signal 6367 6368 Name 6369 6370 __sysv_signal -- signal handling 6371 6372 Synopsis 6373 6374 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 6375 6376 Description 6377 6378 __sysv_signal() has the same behavior as signal() as specified 6379 by ISO POSIX (2003). 6380 6381 __sysv_signal() is not in the source standard; it is only in 6382 the binary standard. 6383 6384 __timezone 6385 6386 Name 6387 6388 -- global variable containing timezone 6389 6390 Synopsis 6391 6392 long int __timezone; 6393 6394 Description 6395 6396 __timezone() has the same specification as timezone() in the 6397 ISO POSIX (2003) 6398 6399 __tzname 6400 6401 Name 6402 6403 -- global variable containing the timezone 6404 6405 Synopsis 6406 6407 char * __tzname[2]; 6408 6409 Description 6410 6411 __tzname has the same specification as tzname in the ISO POSIX 6412 (2003). 6413 6414 Note that the array size of 2 is explicit in the ISO POSIX 6415 (2003), but not in the SUSv2. 6416 6417 __wcstod_internal 6418 6419 Name 6420 6421 __wcstod_internal -- underlying function for wcstod 6422 6423 Synopsis 6424 6425 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 6426 endptr, int group); 6427 6428 Description 6429 6430 group shall be 0 or the behavior of __wcstod_internal() is 6431 undefined. 6432 6433 __wcstod_internal(nptr, endptr, 0) has the same specification 6434 as wcstod(nptr, endptr). 6435 6436 __wcstod_internal() is not in the source standard; it is only 6437 in the binary standard. 6438 6439 __wcstof_internal 6440 6441 Name 6442 6443 __wcstof_internal -- underlying function for wcstof 6444 6445 Synopsis 6446 6447 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 6448 endptr, int group); 6449 6450 Description 6451 6452 group shall be 0 or the behavior of __wcstof_internal() is 6453 undefined. 6454 6455 __wcstof_internal(nptr, endptr, 0) has the same specification 6456 as wcstof(nptr, endptr). 6457 6458 __wcstof_internal() is not in the source standard; it is only 6459 in the binary standard. 6460 6461 __wcstol_internal 6462 6463 Name 6464 6465 __wcstol_internal -- underlying function for wcstol 6466 6467 Synopsis 6468 6469 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 6470 endptr, int base, int group); 6471 6472 Description 6473 6474 group shall be 0 or the behavior of __wcstol_internal() is 6475 undefined. 6476 6477 __wcstol_internal(nptr, endptr, base, 0) has the same 6478 specification as wcstol(nptr, endptr, base). 6479 6480 __wcstol_internal() is not in the source standard; it is only 6481 in the binary standard. 6482 6483 __wcstold_internal 6484 6485 Name 6486 6487 __wcstold_internal -- underlying function for wcstold 6488 6489 Synopsis 6490 6491 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 6492 * endptr, int group); 6493 6494 Description 6495 6496 group shall be 0 or the behavior of __wcstold_internal() is 6497 undefined. 6498 6499 __wcstold_internal(nptr, endptr, 0) has the same specification 6500 as wcstold(nptr, endptr). 6501 6502 __wcstold_internal() is not in the source standard; it is only 6503 in the binary standard. 6504 6505 __wcstoul_internal 6506 6507 Name 6508 6509 __wcstoul_internal -- underlying function for wcstoul 6510 6511 Synopsis 6512 6513 unsigned long __wcstoul_internal(const wchar_t * restrict 6514 nptr, wchar_t * * restrict endptr, int base, int group); 6515 6516 Description 6517 6518 group shall be 0 or the behavior of __wcstoul_internal() is 6519 undefined. 6520 6521 __wcstoul_internal(nptr, endptr, base, 0)() has the same 6522 specification as wcstoul(nptr, endptr, base)(). 6523 6524 __wcstoul_internal() is not in the source standard; it is only 6525 in the binary standard. 6526 6527 __xmknod 6528 6529 Name 6530 6531 __xmknod -- make block or character special file 6532 6533 Synopsis 6534 6535 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 6536 dev); 6537 6538 Description 6539 6540 The __xmknod() shall implement the mknod() interface from ISO 6541 POSIX (2003). 6542 6543 __xmknod(1, path, mode, dev) has the same specification as 6544 mknod(path, mode, dev). 6545 6546 ver shall be 1 or the behavior of __xmknod() is undefined. 6547 6548 The __xmknod() function is not in the source standard; it is 6549 only in the binary standard. The mknod() function is not in 6550 the binary standard; it is only in the source standard. 6551 6552 __xstat 6553 6554 Name 6555 6556 __xstat -- Get File Status 6557 6558 Synopsis 6559 6560 #include 6561 #include 6562 6563 int __xstat(int ver, const char * path, struct stat * 6564 stat_buf); 6565 6566 int __lxstat(int ver, const char * path, struct stat * 6567 stat_buf); 6568 6569 int __fxstat(int ver, int fildes, struct stat * stat_buf); 6570 6571 Description 6572 6573 The functions __xstat(), __lxstat(), and __fxstat() shall 6574 implement the ISO POSIX (2003) functions stat(), lstat(), and 6575 fstat() respectively. 6576 6577 ver shall be 3 or the behavior of these functions is 6578 undefined. 6579 6580 __xstat(3, path, stat_buf) shall behave as stat(path, 6581 stat_buf) as specified by ISO POSIX (2003). 6582 6583 __lxstat(3, path, stat_buf) shall behave as lstat(path, 6584 stat_buf) as specified by ISO POSIX (2003). 6585 6586 __fxstat(3, fildes, stat_buf) shall behave as fstat(fildes, 6587 stat_buf) as specified by ISO POSIX (2003). 6588 6589 __xstat(), __lxstat(), and __fxstat() are not in the source 6590 standard; they are only in the binary standard. 6591 6592 stat(), lstat(), and fstat() are not in the binary standard; 6593 they are only in the source standard. 6594 6595 __xstat64 6596 6597 Name 6598 6599 __xstat64 -- Get File Status 6600 6601 Synopsis 6602 6603 #define _LARGEFILE_SOURCE 1 6604 #include 6605 #include 6606 6607 int __xstat64(int ver, const char * path, struct stat64 * 6608 stat_buf); 6609 6610 int __lxstat64(int ver, const char * path, struct stat64 * 6611 stat_buf); 6612 6613 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 6614 6615 Description 6616 6617 The functions __xstat64(), __lxstat64(), and __fxstat64() 6618 shall implement the Large File Support functions stat64(), 6619 lstat64(), and fstat64() respectively. 6620 6621 ver shall be 3 or the behavior of these functions is 6622 undefined. 6623 6624 __xstat64(3, path, stat_buf) shall behave as stat(path, 6625 stat_buf) as specified by Large File Support. 6626 6627 __lxstat64(3, path, stat_buf) shall behave as lstat(path, 6628 stat_buf) as specified by Large File Support. 6629 6630 __fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, 6631 stat_buf) as specified by Large File Support. 6632 6633 __xstat64(), __lxstat64(), and __fxstat64() are not in the 6634 source standard; they are only in the binary standard. 6635 6636 stat64(), lstat64(), and fstat64() are not in the binary 6637 standard; they are only in the source standard. 6638 6639 _environ 6640 6641 Name 6642 6643 _environ -- alias for environ - user environment 6644 6645 Synopsis 6646 6647 extern char * *_environ; 6648 6649 Description 6650 6651 _environ is an alias for environ - user environment. 6652 6653 _nl_msg_cat_cntr 6654 6655 Name 6656 6657 _nl_msg_cat_cntr -- new catalog load counter 6658 6659 Synopsis 6660 6661 #include 6662 6663 extern int _nl_msg_cat_cntr; 6664 6665 Description 6666 6667 _nl_msg_cat_cntr is incremented each time a new catalong is 6668 loaded. It is a variable defined in loadmsgcat.c and is used 6669 by Message catalogs for internationalization. 6670 6671 _sys_errlist 6672 6673 Name 6674 6675 _sys_errlist -- array containing the "C" locale strings used 6676 by strerror() 6677 6678 Synopsis 6679 6680 #include 6681 6682 extern const char *const _sys_errlist[]; 6683 6684 Description 6685 6686 _sys_errlist is an array containing the "C" locale strings 6687 used by strerror(). This normally should not be used directly. 6688 strerror() provides all of the needed functionality. 6689 6690 _sys_siglist 6691 6692 Name 6693 6694 _sys_siglist -- array containing the names of the signal names 6695 6696 Synopsis 6697 6698 #include 6699 6700 extern const char *const _sys_siglist[NSIG]; 6701 6702 Description 6703 6704 _sys_siglist is an array containing the names of the signal 6705 names. 6706 6707 The _sys_siglist array is only in the binary standard; it is 6708 not in the source standard. Applications wishing to access the 6709 names of signals should use the strsignal() function. 6710 6711 acct 6712 6713 Name 6714 6715 acct -- switch process accounting on or off 6716 6717 Synopsis 6718 6719 #include 6720 6721 int acct(const char * filename); 6722 6723 Description 6724 6725 When filename is the name of an existing file, acct() turns 6726 accounting on and appends a record to filename for each 6727 terminating process. When filename is NULL, acct() turns 6728 accounting off. 6729 6730 Return Value 6731 6732 On success, 0 is returned. On error, -1 is returned and the 6733 global variable errno is set appropriately. 6734 6735 Errors 6736 6737 ENOSYS 6738 BSD process accounting has not been enabled when the 6739 operating system kernel was compiled. The kernel 6740 configuration parameter controlling this feature is 6741 CONFIG_BSD_PROCESS_ACCT. 6742 6743 ENOMEM 6744 Out of memory. 6745 6746 EPERM 6747 The calling process has no permission to enable process 6748 accounting. 6749 6750 EACCES 6751 filename is not a regular file. 6752 6753 EIO 6754 Error writing to the filename. 6755 6756 EUSERS 6757 There are no more free file structures or we run out of 6758 memory. 6759 6760 adjtime 6761 6762 Name 6763 6764 adjtime -- correct the time to allow synchronization of the 6765 system clock 6766 6767 Synopsis 6768 6769 #include 6770 6771 int adjtime(const struct timeval * delta, struct timeval * 6772 olddelta); 6773 6774 Description 6775 6776 adjtime() makes small adjustments to the system time as 6777 returned by gettimeofday()(2), advancing or retarding it by 6778 the time specified by the timeval delta. If delta is negative, 6779 the clock is slowed down by incrementing it more slowly than 6780 normal until the correction is complete. If delta is positive, 6781 a larger increment than normal is used. The skew used to 6782 perform the correction is generally a fraction of one percent. 6783 Thus, the time is always a monotonically increasing function. 6784 A time correction from an earlier call to adjtime() may not be 6785 finished when adjtime() is called again. If olddelta is 6786 non-NULL, the structure pointed to will contain, upon return, 6787 the number of microseconds still to be corrected from the 6788 earlier call. 6789 6790 adjtime() may be used by time servers that synchronize the 6791 clocks of computers in a local area network. Such time servers 6792 would slow down the clocks of some machines and speed up the 6793 clocks of others to bring them to the average network time. 6794 6795 The adjtime() is restricted to the super-user. 6796 6797 Return Value 6798 6799 On success, 0 is returned. On error, -1 is returned and the 6800 global variable errno is set appropriately. 6801 6802 Errors 6803 6804 EFAULT 6805 An argument points outside the process's allocated 6806 address space. 6807 6808 EPERM 6809 The process's effective user ID is not that of the 6810 super-user. 6811 6812 adjtimex 6813 6814 Name 6815 6816 adjtimex -- tune kernel clock (DEPRECATED) 6817 6818 Synopsis 6819 6820 #include 6821 6822 int adjtimex(struct timex * buf); 6823 6824 Description 6825 6826 The adjtimex() function is deprecated from the LSB and is 6827 expected to disappear from a future version of the LSB. 6828 6829 Note: The LSB generally does not include interfaces 6830 unlikely to be used by software applications. 6831 6832 Linux uses David L. Mills' clock adjustment algorithm (see RFC 6833 1305). adjtimex() reads and optionally sets adjustment 6834 parameters for this algorithm. adjtimex() takes a pointer to a 6835 timex structure, updates kernel parameters from field values, 6836 and returns the same structure with current kernel values. 6837 This structure is declared as follows: 6838 struct timex { 6839 int modes; /* mode selector */ 6840 long offset; /* time offset (usec) */ 6841 long freq; /* frequency offset (scaled ppm) */ 6842 long maxerror; /* maximum error (usec) */ 6843 long esterror; /* estimated error (usec) */ 6844 int status; /* clock command/status */ 6845 long constant; /* pll time constant */ 6846 long precision; /* clock precision (usec) (read only) 6847 */ 6848 long tolerance; /* clock frequency tolerance (ppm) 6849 (read only) */ 6850 struct timeval time; /* current time (read only) */ 6851 long tick; /* usecs between clock ticks */ 6852 }; 6853 6854 modes determines which parameters, if any, to set. modes may 6855 contain a bitwise-or combination of zero or more of the 6856 following bits: 6857 #define ADJ_OFFSET 0x0001 /* time offset */ 6858 #define ADJ_FREQUENCY 0x0002 /* frequency offset */ 6859 #define ADJ_MAXERROR 0x0004 /* maximum time error */ 6860 #define ADJ_ESTERROR 0x0008 /* estimated time error */ 6861 #define ADJ_STATUS 0x0010 /* clock status */ 6862 #define ADJ_TIMECONST 0x0020 /* pll time constant */ 6863 #define ADJ_TICK 0x4000 /* tick value */ 6864 #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ 6865 6866 Ordinary users are restricted to a 0 value for modes. Only the 6867 superuser may set any parameters. 6868 6869 Return Value 6870 6871 On success, adjtimex() returns the clock state: 6872 #define TIME_OK 0 /* clock synchronized */ 6873 #define TIME_INS 1 /* insert leap second */ 6874 #define TIME_DEL 2 /* delete leap second */ 6875 #define TIME_OOP 3 /* leap second in progress */ 6876 #define TIME_WAIT 4 /* leap second has occurred */ 6877 #define TIME_BAD 5 /* clock not synchronized */ 6878 6879 On error, the global variable errno is set to -1. 6880 6881 Errors 6882 6883 EFAULT 6884 buf does not point to writable memory. 6885 6886 EPERM 6887 buf.mode is nonzero and the user is not super-user. 6888 6889 EINVAL 6890 An attempt is made to set buf.offset to a value outside 6891 of the range -131071 to +131071, or to set buf.status 6892 to a value other than those listed above, or to set 6893 buf.tick to a value outside of the range 900000/HZ to 6894 1100000/HZ, where HZ is the system timer interrupt 6895 frequency. 6896 6897 asprintf 6898 6899 Name 6900 6901 asprintf -- write formatted output to a dynamically allocated 6902 string 6903 6904 Synopsis 6905 6906 #include 6907 6908 int asprintf(char ** restrict ptr, const char * restrict 6909 format, ...); 6910 6911 Description 6912 6913 The asprintf() function shall behave as sprintf(), except that 6914 the output string shall be dynamically allocated space of 6915 sufficient length to hold the resulting string. The address of 6916 this dynamically allocated string shall be stored in the 6917 location referenced by ptr. 6918 6919 Return Value 6920 6921 Refer to fprintf(). 6922 6923 Errors 6924 6925 Refer to fprintf(). 6926 6927 bind_textdomain_codeset 6928 6929 Name 6930 6931 bind_textdomain_codeset -- specify encoding for message 6932 retrieval 6933 6934 Synopsis 6935 6936 #include 6937 6938 char * bind_textdomain_codeset (const char * domainname , 6939 const char * codeset ); 6940 6941 Description 6942 6943 The bind_textdomain_codeset function can be used to specify 6944 the output codeset for message catalogs for domain domainname. 6945 The codeset argument shall be a valid codeset name which can 6946 be used tor the iconv_open function, or a null pointer. If the 6947 codeset argument is the null pointer, then function returns 6948 the currently selected codeset for the domain with the name 6949 domainname. It shall return a null pointer if no codeset has 6950 yet been selected 6951 6952 Each successive call to bind_textdomain_codeset() function 6953 overrrides the settings made by the preceding call with the 6954 same domainname. 6955 6956 The bind_textdomain_codeset() function shall return a pointer 6957 to a string containing the name of the selected codeset. The 6958 string shall be allocated internally in the function and shall 6959 not be changed or freed by the user. 6960 6961 The bind_textdomain_codeset() function returns a pointer to a 6962 string containing the name of the selected codeset. The string 6963 is allocated internally in the function and shall not be 6964 changed by the user. 6965 6966 Parameters 6967 6968 domainname 6969 The domainname argument is applied to the currently 6970 active LC_MESSAGE locale. It is equivalent in syntax 6971 and meaning to the domainname argument to textdomain, 6972 except that the selection of the domain is valid only 6973 for the duration of the call. 6974 6975 codeset 6976 The name of the output codeset for the selected domain, 6977 or NULL to select the current codeset. 6978 6979 If domainname is the null pointer, or is an empty 6980 string, bind_textdomain_codeset() shall fail, but need 6981 not set errno. 6982 6983 Return Value 6984 6985 Returns the currently selected codeset name. It returns a null 6986 pointer if no codeset has yet been selected. 6987 6988 Errors 6989 6990 ENOMEM 6991 Insufficient memory available to allocate return value. 6992 6993 See Also 6994 6995 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 6996 textdomain, bindtextdomain 6997 6998 bindresvport 6999 7000 Name 7001 7002 bindresvport -- bind socket to privileged IP port 7003 7004 Synopsis 7005 7006 #include 7007 #include 7008 7009 int bindresvport(int sd, struct sockaddr_in * sin); 7010 7011 Description 7012 7013 If the process has appropriate privilege, the bindresvport() 7014 function shall bind a socket to a privileged IP port. 7015 7016 Return Value 7017 7018 On success, 0 is returned. On error, -1 is returned and the 7019 global variable errno is set appropriately. 7020 7021 Errors 7022 7023 EPERM 7024 The process did not have appropriate privilege. 7025 7026 EPFNOSUPPORT 7027 Address of sin did not match address family of sd. 7028 7029 bindtextdomain 7030 7031 Name 7032 7033 bindtextdomain -- specify the location of a message catalog 7034 7035 Synopsis 7036 7037 #include 7038 7039 char * bindtextdomain(const char * domainname, const char * 7040 dirname); 7041 7042 Description 7043 7044 The bindtextdomain() shall set the the base directory of the 7045 hierarchy containing message catalogs for a given message 7046 domain. 7047 7048 The bindtextdomain() function specifies that the domainname 7049 message catalog can be found in the dirname directory 7050 hierarchy, rather than in the system default locale data base. 7051 7052 If dirname is not NULL, the base directory for message 7053 catalogs belonging to domain domainname shall be set to 7054 dirname. If dirname is NULL, the base directory for message 7055 catalogs shall not be altered. 7056 7057 The function shall make copies of the argument strings as 7058 needed. 7059 7060 dirname can be an absolute or relative pathname. 7061 7062 Note: Applications that wish to use chdir() should always 7063 use absolute pathnames to avoid misadvertently selecting 7064 the wrong or non-existant directory. 7065 7066 If domainname is the null pointer, or is an empty string, 7067 bindtextdomain() shall fail, but need not set errno. 7068 7069 The bindtextdomain() function shall return a pointer to a 7070 string containing the name of the selected directory. The 7071 string shall be allocated internally in the function and shall 7072 not be changed or freed by the user. 7073 7074 Return Value 7075 7076 On success, bindtextdomain() shall return a pointer to a 7077 string containing the directory pathname currently bound to 7078 the domain. On failure, a NULL pointer is returned, and the 7079 global variable errno may be set to indicate the error. 7080 7081 Errors 7082 7083 ENOMEM 7084 Insufficient memory was available. 7085 7086 See Also 7087 7088 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 7089 textdomain, bind_textdomain_codeset 7090 7091 cfmakeraw 7092 7093 Name 7094 7095 cfmakeraw -- get and set terminal attributes 7096 7097 Synopsis 7098 7099 #include 7100 7101 void cfmakeraw(struct termios * termios_p); 7102 7103 Description 7104 7105 The cfmakeraw() function shall set the attributes of the 7106 termios structure referenced by termios_p as follows: 7107 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 7108 |INLCR|IGNCR|ICRNL|IXON); 7109 7110 termios_p->c_oflag &= ~OPOST; 7111 7112 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 7113 7114 termios_p->c_cflag &= ~(CSIZE|PARENB); 7115 7116 termios_p->c_cflag |= CS8; 7117 7118 termios_p shall point to a termios structure that contains the 7119 following members: 7120 tcflag_t c_iflag; /* input modes */ 7121 tcflag_t c_oflag; /* output modes */ 7122 tcflag_t c_cflag; /* control modes */ 7123 tcflag_t c_lflag; /* local modes */ 7124 cc_t c_cc[NCCS]; /* control chars */ 7125 7126 cfsetspeed 7127 7128 Name 7129 7130 cfsetspeed -- set terminal input and output data rate 7131 7132 Synopsis 7133 7134 #include 7135 7136 int cfsetspeed(struct termios *t, speed_t speed); 7137 7138 Description 7139 7140 cfsetspeed() sets the baud rate values in the termios 7141 structure. The effects of the function on the terminal as 7142 described below do not become effective, nor are all errors 7143 detected, until the tcsetattr() function is called. Certain 7144 values for baud rates set in termios and passed to tcsetattr() 7145 have special meanings. 7146 7147 Getting and Setting the Baud Rate 7148 7149 Input and output baud rates are found in the termios 7150 structure. The unsigned integer speed_t is typdef'd in the 7151 include file termios.h. The value of the integer corresponds 7152 directly to the baud rate being represented; however, the 7153 following symbolic values are defined. 7154 #define B0 0 7155 #define B50 50 7156 #define B75 75 7157 #define B110 110 7158 #define B134 134 7159 #define B150 150 7160 #define B200 200 7161 #define B300 300 7162 #define B600 600 7163 #define B1200 1200 7164 #define B1800 1800 7165 #define B2400 2400 7166 #define B4800 4800 7167 #define B9600 9600 7168 #define B19200 19200 7169 #define B38400 38400 7170 #ifndef _POSIX_SOURCE 7171 #define EXTA 19200 7172 #define EXTB 38400 7173 #endif /*_POSIX_SOURCE */ 7174 7175 cfsetspeed() sets both the input and output baud rates in the 7176 termios structure referenced by t to speed. 7177 7178 Return Value 7179 7180 On success, 0 is returned. On error, -1 is returned and the 7181 global variable errno is set appropriately. 7182 7183 Errors 7184 7185 EINVAL 7186 Invalid speed argument 7187 7188 creat 7189 7190 Name 7191 7192 creat -- open a file 7193 7194 Description 7195 7196 creat() is as specified in ISO POSIX (2003), but with 7197 differences as listed below. 7198 7199 May return ENODEV in place of ENXIO 7200 7201 Where the ISO POSIX (2003) specifies an ENXIO return, the 7202 implementation may return either ENXIO or ENODEV. 7203 Implementations are encouraged to return ENXIO. 7204 7205 Note: As of spring 2004, we don't know of any Linux kernel 7206 patches to switch to ENXIO, but we believe that such a 7207 kernel patch would be accepted if submitted. 7208 7209 daemon 7210 7211 Name 7212 7213 daemon -- run in the background 7214 7215 Synopsis 7216 7217 #include 7218 7219 int daemon(int nochdir, int noclose); 7220 7221 Description 7222 7223 The daemon() function shall create a new process, detached 7224 from the controlling terminal. If successful, the calling 7225 process shall exit and the new process shall continue to 7226 execute the application in the background. If nochdir 7227 evaluates to true, the current directory shall not be changed. 7228 Otherwise, daemon() shall change the current working directory 7229 to the root (`/'). If noclose evaluates to true the standard 7230 input, standard output, and standard error file descriptors 7231 shall not be altered. Otherwise, daemon() shall close the 7232 standard input, standard output and standard error file 7233 descriptors and reopen them attached to /dev/null. 7234 7235 Return Value 7236 7237 On error, -1 is returned, and the global variable errno is set 7238 to any of the errors specified for the library functions 7239 fork() and setsid(). 7240 7241 dcgettext 7242 7243 Name 7244 7245 dcgettext -- perform domain and category specific lookup in 7246 message catalog 7247 7248 Synopsis 7249 7250 #include 7251 #include 7252 7253 char * dcgettext(const char * domainname, const char * msgid, 7254 int category); 7255 7256 Description 7257 7258 The dcgettext() function is a domain specified version of 7259 gettext(). 7260 7261 The dcgettext() function shall lookup the translation in the 7262 current locale of the message identified by msgid in the 7263 domain specified by domainname and in the locale category 7264 specified by category. If domainname is NULL, the current 7265 default domain shall be used. The msgid argument shall be a 7266 NULL-terminated string to be matched in the catalogue. 7267 category shall specify the locale category to be used for 7268 retrieving message strings. The category parameter shall be 7269 one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, 7270 LC_NUMERIC, or LC_TIME. The default domain shall not be 7271 changed by a call to dcgettext. 7272 7273 Return Value 7274 7275 If a translation was found in one of the specified catalogs, 7276 it shall be converted to the current locale's codeset and 7277 returned. The resulting NULL-terminated string shall be 7278 allocated by the dcgettext function, and must not be modified 7279 or freed. If no translation was found, or category was 7280 invalid, msgid shall be returned. 7281 7282 Errors 7283 7284 dcgettext() shall not modify the errno global variable. 7285 7286 See Also 7287 7288 gettext, dgettext, ngettext, dngettext, dcngettext, 7289 textdomain, bindtextdomain, bind_textdomain_codeset 7290 7291 dcngettext 7292 7293 Name 7294 7295 dcngettext -- perform domain and category specific lookup in 7296 message catalog with plural 7297 7298 Synopsis 7299 7300 #include 7301 #include 7302 7303 char * dcngettext(const char * domainname, const char * 7304 msgid1, const char * msgid2, unsigned long int n, int 7305 category); 7306 7307 Description 7308 7309 The dcngettext() function is a domain specific version of 7310 gettext, capable of returning either a singular or plural form 7311 of the message. The dcngettext() function shall lookup the 7312 translation in the current locale of the message identified by 7313 msgid1 in the domain specified by domainname and in the locale 7314 category specified by category. If domainname is NULL, the 7315 current default domain shall be used. The msgid1 argument 7316 shall be a NULL-terminated string to be matched in the 7317 catalogue. category shall specify the locale category to be 7318 used for retrieving message strings. The category parameter 7319 shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, 7320 LC_MONETARY, LC_NUMERIC, or LC_TIME. The default domain shall 7321 not be changed by a call to dcgettext(). If n is 1 then the 7322 singular version of the message is returned, otherwise one of 7323 the plural forms is returned, depending on the value of n and 7324 the current locale settings. 7325 7326 Return Value 7327 7328 If a translation corresponding to the value of n was found in 7329 one of the specified catalogs for msgid1, it shall be 7330 converted to the current locale's codeset and returned. The 7331 resulting NULL-terminated string shall be allocated by the 7332 dcngettext() function, and must not be modified or freed. If 7333 no translation was found, or category was invalid, msgid1 7334 shall be returned if n has the value 1, otherwise msgid2 shall 7335 be returned. 7336 7337 Errors 7338 7339 dcngettext() shall not modify the errno global variable. 7340 7341 See Also 7342 7343 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 7344 bindtextdomain, bind_textdomain_codeset 7345 7346 dgettext 7347 7348 Name 7349 7350 dgettext -- perform lookup in message catalog for the current 7351 LC_MESSAGES locale 7352 7353 Synopsis 7354 7355 #include 7356 7357 char * dgettext(const char * domainname, const char * msgid); 7358 7359 Description 7360 7361 dgettext() is a domain specified version of gettext(). 7362 7363 Parameters 7364 7365 domainname 7366 dgettext() applies domainname to the currently active 7367 LC_MESSAGE locale. This usage is equivalent in syntax 7368 and meaning to the textdomain() function's application 7369 of domainname, except that the selection of the domain 7370 in dgettext() is valid only for the duration of the 7371 call. 7372 7373 msgid 7374 a NULL-terminated string to be matched in the catalogue 7375 with respect to a specific domain and the current 7376 locale. 7377 7378 Return Value 7379 7380 On success of a msgid query, the translated NULL-terminated 7381 string is returned. On error, the original msgid is returned. 7382 The length of the string returned is undetermined until 7383 dgettext() is called. 7384 7385 Errors 7386 7387 dgettext() will not modify the errno global variable. 7388 7389 See Also 7390 7391 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 7392 textdomain, bindtextdomain, bind_textdomain_codeset 7393 7394 dngettext 7395 7396 Name 7397 7398 dngettext -- perform lookup in message catalog for the current 7399 locale 7400 7401 Synopsis 7402 7403 #include 7404 7405 char * dngettext(const char * domainname, const char * msgid1, 7406 const char * msgid2, unsigned long int n); 7407 7408 Description 7409 7410 dngettext() shall be equivalent to a call to 7411 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 7412 7413 See dgettext() for more information. 7414 7415 See Also 7416 7417 gettext, dgettext, ngettext, dcgettext, dcngettext, 7418 textdomain, bindtextdomain, bind_textdomain_codeset 7419 7420 err 7421 7422 Name 7423 7424 err -- display formatted error messages 7425 7426 Synopsis 7427 7428 #include 7429 7430 void err(int eval, const char * fmt, ...); 7431 7432 Description 7433 7434 The err() function shall display a formatted error message on 7435 the standard error stream. First, err() shall write the last 7436 component of the program name, a colon character, and a space 7437 character. If fmt is non-NULL, it shall be used as a format 7438 string for the printf() family of functions, and err() shall 7439 write the formatted message, a colon character, and a space. 7440 Finally, the error message string affiliated with the current 7441 value of the global variable errno shall be written, followed 7442 by a newline character. 7443 7444 The err() function shall not return, the program shall 7445 terminate with the exit value of eval. 7446 7447 See Also 7448 7449 error(), errx() 7450 7451 Return Value 7452 7453 None. 7454 7455 Errors 7456 7457 None. 7458 7459 error 7460 7461 Name 7462 7463 error -- print error message 7464 7465 Synopsis 7466 7467 void error(int exitstatus, int errnum, const char * format, 7468 ...); 7469 7470 Description 7471 7472 error() shall print a message to standard error. 7473 7474 error() shall build the message from the following elements in 7475 their specified order: 7476 7477 1. the program name. If the application has provided a 7478 function named error_print_progname(), error() shall call 7479 this to supply the program name; otherwise, error() uses 7480 the content of the global variable program_name. 7481 2. the colon and space characters, then the result of using 7482 the printf-style format and the optional arguments. 7483 3. if errnum is nonzero, error() shall add the colon and 7484 space characters, then the result of strerror(errnum). 7485 4. a newline. 7486 7487 If exitstatus is nonzero, error() shall call exit(exitstatus). 7488 7489 See Also 7490 7491 err(), errx() 7492 7493 errx 7494 7495 Name 7496 7497 errx -- display formatted error message and exit 7498 7499 Synopsis 7500 7501 #include 7502 7503 void errx(int eval, const char * fmt, ...); 7504 7505 Description 7506 7507 The errx() function shall display a formatted error message on 7508 the standard error stream. The last component of the program 7509 name, a colon character, and a space shall be output. If fmt 7510 is non-NULL, it shall be used as the format string for the 7511 printf() family of functions, and the formatted error message, 7512 a colon character, and a space shall be output. The output 7513 shall be followed by a newline character. 7514 7515 errx() does not return, but shall exit with the value of eval. 7516 7517 Return Value 7518 7519 None. 7520 7521 Errors 7522 7523 None. 7524 7525 See Also 7526 7527 error(), err() 7528 7529 fcntl 7530 7531 Name 7532 7533 fcntl -- file control 7534 7535 Description 7536 7537 fcntl() is as specified in ISO POSIX (2003), but with 7538 differences as listed below. 7539 7540 Implementation may set O_LARGEFILE 7541 7542 According to ISO POSIX (2003), only an application sets 7543 fcntl() flags, for example O_LARGEFILE. However, this 7544 specification also allows an implementation to set O_LARGEFILE 7545 in the case where the system default behavior matches the 7546 O_LARGEFILE behavior, for example if sizeof(off_t) is 8. Thus, 7547 calling fcntl() with the F_GETFL command may return 7548 O_LARGEFILE as well as flags explicitly set by the 7549 application. 7550 7551 fflush_unlocked 7552 7553 Name 7554 7555 fflush_unlocked -- non thread safe fflush 7556 7557 Description 7558 7559 fflush_unlocked() is the same as fflush() except that it need 7560 not be thread safe. That is, it may only be invoked in the 7561 ways which are legal for getc_unlocked(). 7562 7563 fgetwc_unlocked 7564 7565 Name 7566 7567 fgetwc_unlocked -- non thread safe fgetwc 7568 7569 Description 7570 7571 fgetwc_unlocked() is the same as fgetwc() except that it need 7572 not be thread safe. That is, it may only be invoked in the 7573 ways which are legal for getc_unlocked(). 7574 7575 flock 7576 7577 Name 7578 7579 flock -- apply or remove an advisory lock on an open file 7580 7581 Synopsis 7582 7583 int flock(int fd, int operation); 7584 7585 Description 7586 7587 flock() applies or removes an advisory lock on the open file 7588 fd. Valid operation types are: 7589 7590 LOCK_SH 7591 Shared lock. More than one process may hold a shared 7592 lock for a given file at a given time. 7593 7594 LOCK_EX 7595 Exclusive lock. Only one process may hold an exclusive 7596 lock for a given file at a given time. 7597 7598 LOCK_UN 7599 Unlock. 7600 7601 LOCK_NB 7602 Don't block when locking. May be specified (by oring) 7603 along with one of the other operations. 7604 7605 A single file may not simultaneously have both shared and 7606 exclusive locks. 7607 7608 Return Value 7609 7610 On success, 0 is returned. On error, -1 is returned and the 7611 global variable errno is set appropriately. 7612 7613 Errors 7614 7615 EWOULDBLOCK 7616 The file is locked and the LOCK_NB flag was selected. 7617 7618 fopen 7619 7620 Name 7621 7622 fopen -- open a file 7623 7624 Description 7625 7626 fopen() is as specified in ISO POSIX (2003), but with 7627 differences as listed below. 7628 7629 May return ENODEV in place of ENXIO 7630 7631 Where the ISO POSIX (2003) specifies an ENXIO return, the 7632 implementation may return either ENXIO or ENODEV. 7633 Implementations are encouraged to return ENXIO. 7634 7635 Note: As of spring 2004, we don't know of any Linux kernel 7636 patches to switch to ENXIO, but we believe that such a 7637 kernel patch would be accepted if submitted. 7638 7639 freopen 7640 7641 Name 7642 7643 freopen -- open a file 7644 7645 Description 7646 7647 freopen() is as specified in ISO POSIX (2003), but with 7648 differences as listed below. 7649 7650 May return ENODEV in place of ENXIO 7651 7652 Where the ISO POSIX (2003) specifies an ENXIO return, the 7653 implementation may return either ENXIO or ENODEV. 7654 Implementations are encouraged to return ENXIO. 7655 7656 Note: As of spring 2004, we don't know of any Linux kernel 7657 patches to switch to ENXIO, but we believe that such a 7658 kernel patch would be accepted if submitted. 7659 7660 getdomainname 7661 7662 Name 7663 7664 getdomainname -- get NIS domain name (DEPRECATED). 7665 7666 Synopsis 7667 7668 #include 7669 7670 int getdomainname (char * name , size_t namelen ); 7671 7672 Description 7673 7674 If the Network Information System (NIS) is in use, 7675 getdomainname() shall copy the NIS domain name to the supplied 7676 buffer identified by name, with maximum length namelen. If the 7677 NIS domain name is not currently set, getdomainname() shall 7678 copy the string "(none)" to the name. If namelen is less the 7679 length of the string to be copied, getdomainname() may either 7680 truncate the string to namelen characters and place it in name 7681 (without a terminating null character), or may fail with 7682 EINVAL. 7683 7684 Note that the NIS domain name is not the same as the domain 7685 portion of a fully qualified domain name (for example, in 7686 DNS). 7687 7688 Return Value 7689 7690 On success, getdomainname() shall return 0. Otherwise, it 7691 shall return -1 and set errno to indicate the error). 7692 7693 Errors 7694 7695 EINVAL 7696 name was a null pointer. 7697 7698 EINVAL 7699 The buffer identified by name and namelen is of 7700 insufficient size to store the NIS domain name string, 7701 and the implementation considers this an error. 7702 7703 Future Directions 7704 7705 The LSB does not include other NIS interfaces, and a future 7706 version of this specification may deprecate this interface. 7707 Application developers should avoid using this interface where 7708 possible. 7709 7710 gethostbyname_r 7711 7712 Name 7713 7714 gethostbyname_r -- find network host database entry matching 7715 host name (DEPRECATED) 7716 7717 Synopsis 7718 7719 int gethostbyname_r(const char * restrict name, struct hostent 7720 * restrict result_buf, char * restrict buf, size_t buflen, 7721 struct hostent ** restrict result, int * restrict h_errnop); 7722 7723 Description 7724 7725 The gethostbyname_r() function is deprecated; applications 7726 should call getaddrinfo() instead. 7727 7728 gethostbyname_r() is a reentrant version of gethostbyname() 7729 that searches the network host database for a host name match. 7730 7731 getloadavg 7732 7733 Name 7734 7735 getloadavg -- get system load averages 7736 7737 Synopsis 7738 7739 #include 7740 7741 int getloadavg(double loadavg[], int nelem); 7742 7743 Description 7744 7745 getloadavg() returns the number of processes in the system run 7746 queue averaged over various periods of time. Up to nelem 7747 samples are retrieved and assigned to successive elements of 7748 loadavg[]. The system imposes a maximum of 3 samples, 7749 representing averages over the last 1, 5, and 15 minutes, 7750 respectively. 7751 7752 getopt 7753 7754 Name 7755 7756 getopt -- parse command line options 7757 7758 Synopsis 7759 7760 #include 7761 7762 int getopt(int argc, char * const argv[], const char * 7763 optstring); 7764 7765 extern char *optarg; 7766 extern int optind, opterr, optopt; 7767 7768 Description 7769 7770 The getopt() function shall parse command line arguments as 7771 described in ISO POSIX (2003), with the following exceptions, 7772 where LSB and POSIX specifications vary. LSB systems shall 7773 implement the modified behaviors described below. 7774 7775 Argument Ordering 7776 7777 The getopt() function can process command line arguments 7778 referenced by argv in one of three ways: 7779 7780 PERMUTE 7781 the order of arguments in argv is altered so that all 7782 options (and their arguments) are moved in front of all 7783 of the operands. This is the default behavior. 7784 7785 Note: This behavior has undefined results if argv is not 7786 modifiable. This is to support historic behavior predating 7787 the use of const and ISO C (1999). The function prototype 7788 was aligned with ISO POSIX (2003) despite the fact that it 7789 modifies argv, and the library maintainers are unwilling to 7790 change this. 7791 7792 REQUIRE_ORDER 7793 The arguments in argv are processed in exactly the 7794 order given, and option processing stops when the first 7795 non-option argument is reached, or when the element of 7796 argv is "--". This ordering can be enforced either by 7797 setting the environment variable POSIXLY_CORRECT, or by 7798 setting the first character of optstring to '+'. 7799 7800 RETURN_IN_ORDER 7801 The order of arguments is not altered, and all 7802 arguments are processed. Non-option arguments 7803 (operands) are handled as if they were the argument to 7804 an option with the value 1 ('\001'). This ordering is 7805 selected by setting the first character of optstring to 7806 '-'; 7807 7808 Option Characteristics 7809 7810 LSB specifies that: 7811 7812 * an element of argv that starts with "-" (and is not 7813 exactly "-" or "--") is an option element. 7814 * characters of an option element, aside from the initial 7815 "-", are option characters. 7816 7817 POSIX specifies that: 7818 7819 * applications using getopt() shall obey the following 7820 syntax guidelines: 7821 + option name is a single alphanumeric character from 7822 the portable character set 7823 + option is preceded by the '-' delimiter character 7824 + options without option-arguments should be accepted 7825 when grouped behind one '-' delimiter 7826 + each option and option-argument is a separate 7827 argument 7828 + option-arguments are not optional 7829 + all options should precede operands on the command 7830 line 7831 + the argument "--" is accepted as a delimiter 7832 indicating the end of options and the consideration 7833 of subsequent arguments, if any, as operands 7834 * historical implementations of getopt() support other 7835 characters as options as an allowed extension, but 7836 applications that use extensions are not maximally 7837 portable. 7838 * support for multi-byte option characters is only possible 7839 when such characters can be represented as type int. 7840 * applications that call any utility with a first operand 7841 starting with '-' should usually specify "--" to mark the 7842 end of the options. Standard utilities that do not support 7843 this guideline indicate that fact in the OPTIONS section 7844 of the utility description. 7845 7846 Extensions 7847 7848 LSB specifies that: 7849 7850 * if a character is followed by two colons, the option takes 7851 an optional argument; if there is text in the current argv 7852 element, it is returned in optarg, otherwise optarg is set 7853 to 0. 7854 * if optstring contains W followed by a semi-colon (;), then 7855 -W foo is treated as the long option --foo. 7856 7857 Note: See getopt_long() for a description of long options. 7858 * The first character of optstring shall modify the behavior 7859 of getopt() as follows: 7860 + if the first character is '+', then REQUIRE_ORDER 7861 processing shall be in effect (see above) 7862 + if the first character is '-', then RETURN_IN_ORDER 7863 processing shall be in effect (see above) 7864 + if the first character is ':', then getopt() shall 7865 return ':' instead of '?' to indicate a missing 7866 option argument, and shall not print any diagnostic 7867 message to stderr. 7868 7869 POSIX specifies that: 7870 7871 * the -W option is reserved for implementation extensions. 7872 7873 Return Values 7874 7875 LSB specifies the following additional getopt() return values: 7876 7877 * '\001' is returned if RETURN_IN_ORDER argument ordering is 7878 in effect, and the next argument is an operand, not an 7879 option. The argument is available in optarg. 7880 7881 Any other return value has the same meaning as for POSIX. 7882 7883 POSIX specifies the following getopt() return values: 7884 7885 * the next option character is returned, if found 7886 successfully. 7887 * ':' is returned if a parameter is missing for one of the 7888 options and the first character of optstring is ':'. 7889 * '?' is returned if an unknown option character not in 7890 optstring is encountered, or if getopt() detects a missing 7891 argument and the first character of optstring is not ':'. 7892 * -1 is returned for the end of the option list. 7893 7894 Environment Variables 7895 7896 LSB specifies that: 7897 7898 * if the variable POSIXLY_CORRECT is set, option processing 7899 stops as soon as a non-option argument is encountered. 7900 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 7901 is the process ID for the current process), contains a 7902 space separated list of arguments that should not be 7903 treated as arguments even though they appear to be so. 7904 7905 Rationale: This was used by bash 2.0 to communicate to GNU 7906 libc which arguments resulted from wildcard expansion and 7907 so should not be considered as options. This behavior was 7908 removed in bash version 2.01, but the support remains in 7909 GNU libc. 7910 This behavior is DEPRECATED in this version of the LSB; 7911 future revisions of this specification may not include 7912 this requirement. 7913 7914 getopt_long 7915 7916 Name 7917 7918 getopt_long -- parse command line options 7919 7920 Synopsis 7921 7922 #define _GNU_SOURCE 7923 #include 7924 7925 int getopt_long(int argc, char * const argv[], const char * 7926 opstring, const struct option * longopts, int * longindex); 7927 7928 Description 7929 7930 getopt_long() works like getopt() except that it also accepts 7931 long options, started out by two dashes. Long option names may 7932 be abbreviated if the abbreviation is unique or is an exact 7933 match for some defined option. A long option may take a 7934 parameter, of the form --arg=param or --arg param. 7935 7936 longopts is a pointer to the first element of an array of 7937 struct option declared in getopt.h as: 7938 struct option { 7939 const char *name; 7940 int has_arg; 7941 int *flag; 7942 int val; 7943 }; 7944 7945 The fields in this structure have the following meaning: 7946 7947 name 7948 The name of the long option. 7949 7950 has_arg 7951 One of: 7952 7953 no_argument (or 0) if the option does not take an argument, 7954 required_argument (or 1) if the option requires an argument, 7955 or 7956 optional_argument (or 2) if the option takes an optional 7957 argument. 7958 7959 flag 7960 specifies how results are returned for a long option. 7961 If flag is NULL, then getopt_long() shall return val. 7962 (For example, the calling program may set val to the 7963 equivalent short option character.) Otherwise, 7964 getopt_long() returns 0, and flag shall point to a 7965 variable which shall be set to val if the option is 7966 found, but left unchanged if the option is not found. 7967 7968 val 7969 The value to return, or to load into the variable 7970 pointed to by flag. 7971 7972 Return Value 7973 7974 getopt_long() returns the option character if a short option 7975 was found successfully, or ":" if there was a missing 7976 parameter for one of the options, or "?" for an unknown option 7977 character, or -1 for the end of the option list. 7978 7979 For a long option, getopt_long() returns val if flag is NULL, 7980 and 0 otherwise. Error and -1 returns are the same as for 7981 getopt(), plus "?" for an ambiguous match or an extraneous 7982 parameter. 7983 7984 getopt_long_only 7985 7986 Name 7987 7988 getopt_long_only -- parse command line options 7989 7990 Synopsis 7991 7992 #define _GNU_SOURCE 7993 #include 7994 7995 int getopt_long_only(int argc, char * const argv[], const char 7996 * optstring, const struct option * longopts, int * longindex); 7997 7998 Description 7999 8000 getopt_long_only() is like getopt_long(), but "-" as well as 8001 "--" can indicate a long option. If an option that starts with 8002 "-" (not "--") doesn't match a long option, but does match a 8003 short option, it is parsed as a short option instead. 8004 8005 Note: The getopt_long_only() function is intended only for 8006 supporting certain programs whose command line syntax was 8007 designed before the Utility Syntax Guidelines of ISO POSIX 8008 (2003) were developed. New programs should generally call 8009 getopt_long() instead, which provides the --option syntax 8010 for long options, which is preferred by GNU and consistent 8011 with ISO POSIX (2003). 8012 8013 Return Value 8014 8015 getopt_long_only() returns the option character if the option 8016 was found successfully, or ":" if there was a missing 8017 parameter for one of the options, or "?" for an unknown option 8018 character, or -1 for the end of the option list. 8019 8020 getopt_long_only() also returns the option character when a 8021 short option is recognized. For a long option, they return val 8022 if flag is NULL, and 0 otherwise. Error and -1 returns are the 8023 same as for getopt(), plus "?" for an ambiguous match or an 8024 extraneous parameter. 8025 8026 gettext 8027 8028 Name 8029 8030 gettext -- Search message catalogs for a string 8031 8032 Synopsis 8033 8034 #include 8035 8036 char * gettext(const char * msgid); 8037 8038 Description 8039 8040 The gettext() function shall search the currently selected 8041 message catalogs for a string identified by the string msgid. 8042 If a string is located, that string shall be returned. 8043 8044 The gettext() function is equivalent to dcgettext(NULL, msgid, 8045 LC_MESSAGES). 8046 8047 Return Value 8048 8049 If a string is found in the currently selected message 8050 catalogs for msgid, then a pointer to that string shall be 8051 returned. Otherwise, a pointer to msgid shall be returned. 8052 8053 Applications shall not modify the string returned by 8054 gettext(). 8055 8056 Errors 8057 8058 None. 8059 8060 The gettext() function shall not modify errno. 8061 8062 See Also 8063 8064 dgettext, ngettext, dngettext, dcgettext, dcngettext, 8065 textdomain, bindtextdomain, bind_textdomain_codeset 8066 8067 getutent 8068 8069 Name 8070 8071 getutent -- access user accounting database entries 8072 8073 Synopsis 8074 8075 #include 8076 8077 struct utmp *getutent(void); 8078 8079 Description 8080 8081 The getutent() function shall read the next entry from the 8082 user accounting database. 8083 8084 Return Value 8085 8086 Upon successful completion, getutent() shall return a pointer 8087 to a utmp structure containing a copy of the requested entry 8088 in the user accounting database. Otherwise, a null pointer 8089 shall be returned. The return value may point to a static area 8090 which is overwritten by a subsequent call to getutent(). 8091 8092 Errors 8093 8094 None defined. 8095 8096 getutent_r 8097 8098 Name 8099 8100 getutent_r -- access user accounting database entries 8101 8102 Synopsis 8103 8104 int getutent_r(struct utmp * buffer, struct utmp ** result); 8105 8106 Description 8107 8108 The getutent_r() function is a reentrant version of the 8109 getutent() function. On entry, buffer should point to a user 8110 supplied buffer to which the next entry in the database will 8111 be copied, and result should point to a location where the 8112 result will be stored. 8113 8114 Return Value 8115 8116 On success, getutent_r() shall return 0 and set the location 8117 referenced by result to a pointer to buffer. Otherwise, 8118 getutent_r() shall return -1 and set the location referenced 8119 by result to NULL. 8120 8121 glob64 8122 8123 Name 8124 8125 glob64 -- find pathnames matching a pattern (Large File 8126 Support) 8127 8128 Synopsis 8129 8130 #include 8131 8132 int glob64(const char * pattern, int flags, int (*errfunc) 8133 (const char *, int), glob64_t * pglob); 8134 8135 Description 8136 8137 The glob64() function is a large-file version of the glob() 8138 defined in ISO POSIX (2003). It shall search for pathnames 8139 matching pattern according to the rules used by the shell, 8140 /bin/sh. No tilde expansion or parameter substitution is done; 8141 see wordexp(). 8142 8143 The results of a glob64() call are stored in the structure 8144 pointed to by pglob, which is a glob64_t declared in glob.h 8145 with the following members: 8146 typedef struct 8147 { 8148 size_t gl_pathc; 8149 char **gl_pathv; 8150 size_t gl_offs; 8151 int gl_flags; 8152 void (*gl_closedir) (void *); 8153 struct dirent64 *(*gl_readdir64) (void *); 8154 void *(*gl_opendir) (const char *); 8155 int (*gl_lstat) (const char *, struct stat *); 8156 int (*gl_stat) (const char *, struct stat *); 8157 } 8158 glob64_t; 8159 8160 Structure members with the same name as corresponding members 8161 of a glob_t as defined in ISO POSIX (2003) shall have the same 8162 purpose. 8163 8164 Other members are defined as follows: 8165 8166 gl_flags 8167 reserved for internal use 8168 8169 gl_closedir 8170 pointer to a function capable of closing a directory 8171 opened by gl_opendir 8172 8173 gl_readdir64 8174 pointer to a function capable of reading entries in a 8175 large directory 8176 8177 gl_opendir 8178 pointer to a function capable of opening a large 8179 directory 8180 8181 gl_stat 8182 pointer to a function capable of returning file status 8183 for a large file 8184 8185 gl_lstat 8186 pointer to a function capable of returning file status 8187 information for a large file or symbolic link 8188 8189 A large file or large directory is one with a size which 8190 cannot be represented by a variable of type off_t. 8191 8192 Return Value 8193 8194 On success, 0 is returned. Other possible returns are: 8195 8196 GLOB_NOSPACE 8197 out of memory 8198 8199 GLOB_ABORTED 8200 read error 8201 8202 GLOB_NOMATCH 8203 no match found 8204 8205 globfree64 8206 8207 Name 8208 8209 globfree64 -- free memory from glob64() (Large File Support) 8210 8211 Synopsis 8212 8213 #include 8214 8215 void globfree64(glob64_t * pglob); 8216 8217 Description 8218 8219 globfree64() frees the dynamically allocated storage from an 8220 earlier call to glob64(). 8221 8222 globfree64() is a 64-bit version of globfree(). 8223 8224 initgroups 8225 8226 Name 8227 8228 initgroups -- initialize the supplementary group access list 8229 8230 Synopsis 8231 8232 #include 8233 #include 8234 8235 int initgroups(const char * user, gid_t group); 8236 8237 Description 8238 8239 If the process has appropriate privilege, the initgroups() 8240 function shall initialize the Supplementary Group IDs for the 8241 current process by reading the group database and using all 8242 groups of which user is a member. The additional group group 8243 is also added to the list. 8244 8245 Return Value 8246 8247 On success, 0 is returned. On error, -1 is returned and the 8248 global variable errno is set appropriately. 8249 8250 Errors 8251 8252 EPERM 8253 The calling process does not have sufficient 8254 privileges. 8255 8256 ENOMEM 8257 Insufficient memory to allocate group information 8258 structure. 8259 8260 See Also 8261 8262 setgroups() 8263 8264 ioctl 8265 8266 Name 8267 8268 ioctl -- control device 8269 8270 Synopsis 8271 8272 #include 8273 8274 int ioctl (int d , int request , ...); 8275 8276 Description 8277 8278 The ioctl() function shall manipulate the underlying device 8279 parameters of special files. d shall be an open file 8280 descriptor referring to a special file. The ioctl() function 8281 shall take three parameters; the type and value of the third 8282 parameter is dependent on the device and request. 8283 8284 Conforming LSB applications shall not call ioctl() except in 8285 situations explicitly stated in this specification. 8286 8287 Return Value 8288 8289 On success, 0 is returned. An ioctl() may use the return value 8290 as an output parameter and return a non-negative value on 8291 success. On error, -1 is returned and the global variable 8292 errno is set appropriately. 8293 8294 Errors 8295 8296 EBADF 8297 d is not a valid descriptor. 8298 8299 EFAULT 8300 The third parameter references an inaccessible memory 8301 area. 8302 8303 ENOTTY 8304 d is not associated with a character special device. 8305 8306 ENOTTY 8307 The specified request does not apply to the kind of 8308 object that d references. 8309 8310 EINVAL 8311 request or the third parameter is not valid. 8312 8313 sockio 8314 8315 Name 8316 8317 sockio -- socket ioctl commands 8318 8319 Synopsis 8320 8321 #include 8322 #include 8323 #include 8324 8325 int ioctl(int sockfd, int request, char * argp); 8326 8327 Description 8328 8329 Socket ioctl() commands are a subset of the ioctl() calls, 8330 which can perform a variety of functions on sockets. sockfd 8331 shall contain the value of a file descriptor that was created 8332 with the socket() or accept() calls. 8333 8334 Socket ioctl() commands apply to the underlying network 8335 interfaces, and affect the entire system, not just the file 8336 descriptor used to issue the ioctl(). 8337 8338 The following values for request are accepted: 8339 8340 SIOCGIFCONF 8341 Gets the interface configuration list for the system. 8342 8343 Note: SIOCGIFCONF is similar to the if_nameindex() family 8344 found in the ISO POSIX (2003) or the getifaddrs() family 8345 found in BSD derived systems. 8346 8347 argp shall point to a ifconf structure, as described in 8348 . Before calling, the caller shall set the 8349 ifc_ifcu.ifcu_req field to point to an array of ifreq 8350 structures, and set ifc_len to the size in bytes of 8351 this allocated array. Upon return, ifc_len will contain 8352 the size in bytes of the array which was actually used. 8353 If it is the same as the length upon calling, the 8354 caller should assume that the array was too small and 8355 try again with a larger array. 8356 8357 On success, SIOCGIFCONF can return any nonnegative 8358 value. 8359 8360 Rationale: Historical UNIX systems disagree on the meaning 8361 of the return value. 8362 8363 SIOCGIFFLAGS 8364 Gets the interface flags for the indicated interface. 8365 argp shall point to a ifreq structure. Before calling, 8366 the caller should fill in the ifr_name field with the 8367 interface name, and upon return, the 8368 ifr_ifru.ifru_flags field is set with the interface 8369 flags. 8370 8371 SIOCGIFADDR 8372 Gets the interface address for the given interface. 8373 argp shall point to a ifreq structure. Before calling, 8374 the caller should fill in the ifr_name field with the 8375 interface name, and upon return, the ifr_ifru.ifru_addr 8376 field is set with the interface address. 8377 8378 SIOCGIFBRADDR 8379 Gets the interface broadcast address for the given 8380 interface. argp shall point to a ifreq structure. 8381 Before calling, the caller should fill in the ifr_name 8382 field with the interface name, and upon return, the 8383 ifr_ifru.ifru_broadcast field is set with the interface 8384 broadcast address. 8385 8386 SIOCGIFNETMASK 8387 Gets the network mask for the given interface. argp 8388 shall point to a ifreq structure. Before calling, the 8389 caller should fill in the ifr_name field with the 8390 interface name, and upon return, the 8391 ifr_ifru.ifru_netmask field is set with the network 8392 mask. 8393 8394 SIOCGIFMTU 8395 Gets the MTU for the given interface. argp shall point 8396 to a ifreq structure. Before calling, the caller should 8397 fill in the ifr_name field with the interface name, and 8398 upon return, the ifr_ifru.ifru_mtu field is set with 8399 the MTU. 8400 8401 FIONREAD 8402 Returns the amount of queued unread data in the receive 8403 buffer. argp shall point to an integer where the result 8404 is to be placed. 8405 8406 Return Value 8407 8408 On success, if request is SIOCGIFCONF, a non-negative integer 8409 shall be returned. If request is not SIOCGIFCONF, on success 0 8410 is returned. On error, -1 is returned and the global variable 8411 errno is set appropriately. 8412 8413 Errors 8414 8415 EBADF 8416 sockfd is not a valid descriptor. 8417 8418 EFAULT 8419 argp references an inaccessible memory area. 8420 8421 ENOTTY 8422 The specified request does not apply to the kind of 8423 object that the descriptor sockfd references. 8424 8425 EINVAL 8426 Either request or argp is invalid. 8427 8428 ENOTCONN 8429 The operation is only defined on a connected socket, 8430 but the socket wasn't connected. 8431 8432 ttyio 8433 8434 Name 8435 8436 ttyio -- tty ioctl commands 8437 8438 Synopsis 8439 8440 #include 8441 8442 int ioctl(int fd, unsigned long request, int * argp); 8443 8444 Description 8445 8446 Tty ioctl commands are a subset of the ioctl() calls, which 8447 can perform a variety of functions on tty devices. fd shall 8448 contain the value of a file descriptor that was created with 8449 the open() call. 8450 8451 The following ioctl()s are provided: 8452 8453 TIOCGWINSZ 8454 Gets the size attributes of the tty. argp is a pointer 8455 to a winsize structure. 8456 8457 Return Value 8458 8459 On success, 0 is returned. On error, -1 is returned and the 8460 global variable errno is set appropriately. 8461 8462 Errors 8463 8464 EBADF 8465 fd is not a valid descriptor. 8466 8467 EFAULT 8468 argp references an inaccessible memory area. 8469 8470 EINVAL 8471 request and argp are not valid. 8472 8473 kill 8474 8475 Name 8476 8477 kill -- send a signal 8478 8479 Synopsis 8480 8481 #include 8482 8483 int kill(pid_t pid, int sig); 8484 8485 Description 8486 8487 kill() is as specified in the ISO POSIX (2003), but with 8488 differences as listed below. 8489 8490 Process ID -1 doesn't affect calling process 8491 8492 If pid is specified as -1, sig shall not be sent to the 8493 calling process. Other than this, the rules in the ISO POSIX 8494 (2003) apply. 8495 8496 Rationale: This was a deliberate Linus decision after an 8497 unpopular experiment in including the calling process in 8498 the 2.5.1 kernel. See "What does it mean to signal 8499 everybody?", Linux Weekly News, 20 December 2001, 8500 http://lwn.net/2001/1220/kernel.php3 8501 8502 mbsnrtowcs 8503 8504 Name 8505 8506 mbsnrtowcs -- convert a multibyte string to a wide character 8507 string 8508 8509 Synopsis 8510 8511 #include 8512 8513 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 8514 nms, size_t len, mbstate_t * ps); 8515 8516 Description 8517 8518 mbsnrtowcs() is like mbsrtowcs(), except that the number of 8519 bytes to be converted, starting at src, is limited to nms. 8520 8521 If dest is not a NULL pointer, mbsnrtowcs() converts at most 8522 nms bytes from the multibyte string src to a wide-character 8523 string starting at dest. At most, len wide characters are 8524 written to dest. The state ps is updated. 8525 8526 The conversion is effectively performed by repeatedly calling: 8527 8528 mbrtowc(dest, *src, n, ps) 8529 8530 where n is some positive number, as long as this call 8531 succeeds, and then incrementing dest by one and src by the 8532 number of bytes consumed. 8533 8534 The conversion can stop for three reasons: 8535 8536 * An invalid multibyte sequence has been encountered. In 8537 this case src is left pointing to the invalid multibyte 8538 sequence, (size_t)(-1) is returned, and errno is set to 8539 EILSEQ. 8540 * The nms limit forces a stop, or len non-L'\0' wide 8541 characters have been stored at dest. In this case, src is 8542 left pointing to the next multibyte sequence to be 8543 converted, and the number of wide characters written to 8544 dest is returned. 8545 * The multibyte string has been completely converted, 8546 including the terminating '\0' (which has the side effect 8547 of bringing back ps to the initial state). In this case, 8548 src is set to NULL, and the number of wide characters 8549 written to dest, excluding the terminating L'\0' 8550 character, is returned. 8551 8552 If dest is NULL, len is ignored, and the conversion proceeds 8553 as above, except that the converted wide characters are not 8554 written out to memory, and that no destination length limit 8555 exists. 8556 8557 In both of the above cases, if ps is a NULL pointer, a static 8558 anonymous state only known to mbsnrtowcs() is used instead. 8559 8560 The programmer shall ensure that there is room for at least 8561 len wide characters at dest. 8562 8563 Return Value 8564 8565 mbsnrtowcs() returns the number of wide characters that make 8566 up the converted part of the wide character string, not 8567 including the terminating null wide character. If an invalid 8568 multibyte sequence was encountered, (size_t)(-1) is returned, 8569 and the global variable errno is set to EILSEQ. 8570 8571 Notes 8572 8573 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 8574 of the current locale. 8575 8576 Passing NULL as ps is not multi-thread safe. 8577 8578 memmem 8579 8580 Name 8581 8582 memmem -- locate bytes 8583 8584 Synopsis 8585 8586 #define _GNU_SOURCE 8587 #include 8588 8589 void * memmem(const void * haystack, size_t haystacklen, const 8590 void * needle, size_t needlelen); 8591 8592 Description 8593 8594 memmem() finds the start of the first occurrence of the byte 8595 array referenced by needle of length needlelen in the memory 8596 area haystack of length haystacklen. 8597 8598 Return Value 8599 8600 memmem() returns a pointer to the beginning of the byte array, 8601 or NULL if the byte array is not found. 8602 8603 Notes 8604 8605 Earlier versions of the C library (prior to glibc 2.1) 8606 contained a memmem() with various problems, and application 8607 developers should treat this function with care. 8608 8609 memrchr 8610 8611 Name 8612 8613 memrchr -- scan memory for a character 8614 8615 Synopsis 8616 8617 #include 8618 8619 void * memrchr(const void * s, int c, size_t n); 8620 8621 Description 8622 8623 The memrchr() function shall locate the last occurence of c 8624 (converted to an unsigned char) in the initial n bytes (each 8625 interpreted as an unsigned char) of the object pointed to by 8626 s. 8627 8628 Return Value 8629 8630 The memrchr() shall return a pointer to the located byte, or a 8631 null pointer if the byte does not occur in the object. 8632 8633 Errors 8634 8635 No errors are defined. 8636 8637 See Also 8638 8639 memchr() 8640 8641 ngettext 8642 8643 Name 8644 8645 ngettext -- Search message catalogs for plural string 8646 8647 Synopsis 8648 8649 #include 8650 8651 char * ngettext(const char * msgid1, const char * msgid2, 8652 unsigned long int n); 8653 8654 Description 8655 8656 The ngettext() function shall search the currently selected 8657 message catalogs for a string matching the singular string 8658 msgid1. If a string is located, and if n is 1, that string 8659 shall be returned. If n is not 1, a pluralized version 8660 (dependant on n) of the string shall be returned. 8661 8662 The ngettext() function is equivalent to dcngettext(NULL, 8663 msgid1, msgid2, n, LC_MESSAGES)(). 8664 8665 Return Value 8666 8667 If a string is found in the currently selected message 8668 catalogs for msgid1, then if n is 1 a pointer to the located 8669 string shall be returned. If n is not 1, a pointer to an 8670 appropriately pluralized version of the string shall be 8671 returned. If no message could be found in the currently 8672 selected mesage catalogs, then if n is 1, a pointer to msgid1 8673 shall be returned, otherwise a pointer to msgid2 shall be 8674 returned. 8675 8676 Applications shall not modify the string returned by 8677 ngettext(). 8678 8679 Errors 8680 8681 None. 8682 8683 The ngettext() function shall not modify errno. 8684 8685 See Also 8686 8687 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8688 textdomain, bindtextdomain, bind_textdomain_codeset 8689 8690 open 8691 8692 Name 8693 8694 open -- open a file 8695 8696 Description 8697 8698 The open() function shall behave as specified in ISO POSIX 8699 (2003), except with differences as listed below. 8700 8701 May return ENODEV in place of ENXIO 8702 8703 Where ISO POSIX (2003) specifies an ENXIO return, a conforming 8704 implementation may return either ENXIO or ENODEV. 8705 Implementations are encouraged to return ENXIO. 8706 8707 Rationale: As of spring 2004, no Linux kernel patches to 8708 switch to ENXIO are known, but it is believed that such a 8709 kernel patch would be accepted if submitted. 8710 8711 opterr 8712 8713 Name 8714 8715 opterr -- external variable used in getopt() 8716 8717 Synopsis 8718 8719 extern int opterr; 8720 8721 Description 8722 8723 opterr is used as a flag to suppress an error message 8724 generated by getopt(). When opterr is set to 0, it suppresses 8725 the error message generated by getopt() when that function 8726 does not recognize an option character. 8727 8728 optind 8729 8730 Name 8731 8732 optind -- external variable used in getopt() 8733 8734 Synopsis 8735 8736 extern int optind; 8737 8738 Description 8739 8740 optind holds the current index of the array argv[], which 8741 contains the command line options being parsed by getopt(). 8742 8743 optopt 8744 8745 Name 8746 8747 optopt -- external variable used in getopt() 8748 8749 Synopsis 8750 8751 extern int optopt; 8752 8753 Description 8754 8755 optopt holds the unknown option character when that option 8756 character is not recognized by getopt(). 8757 8758 pmap_getport 8759 8760 Name 8761 8762 pmap_getport -- Find the port number assigned to a service 8763 registered with a portmapper. 8764 8765 Synopsis 8766 8767 #include 8768 8769 u_short * pmap_getport(struct sockaddr_in * address, const 8770 u_long program, const u_long * version, u_int protocol); 8771 8772 Description 8773 8774 The pmap_getport() function shall return the port number 8775 assigned to a service registered with a RPC Binding service 8776 running on a given target system, using the protocol described 8777 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 8778 pmap_getport() function shall be called given the RPC program 8779 number program, the program version version, and transport 8780 protocol protocol. Conforming implementations shall support 8781 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 8782 shall specify the address of the system on which the 8783 portmapper to be contacted resides. The value of 8784 address->sin_port shall be ignored, and the standard value for 8785 the portmapper port shall always be used. 8786 8787 Note: Security and network restrictions may prevent a 8788 conforming application from contacting a remote RPC Binding 8789 Service. 8790 8791 Return Value 8792 8793 On success, the pmap_getport() function shall return the port 8794 number in host byte order of the RPC application registered 8795 with the remote portmapper. On failure, if either the program 8796 was not registered or the remote portmapper service could not 8797 be reached, the pmap_getport() function shall return 0. If the 8798 remote portmap service could not be reached, the status is 8799 left in the global variable rpc_createerr. 8800 8801 pmap_set 8802 8803 Name 8804 8805 pmap_set -- Establishes mapping to machine's RPC Bind service. 8806 8807 Synopsis 8808 8809 #include 8810 8811 bool_t pmap_set(const u_long program, const u_long version, 8812 int protocol, u_short port); 8813 8814 Description 8815 8816 pmap_set() establishes a mapping between the triple 8817 [program,version,protocol] and port on the machine's RPC Bind 8818 service. The value of protocol is most likely IPPROTO_UDP or 8819 IPPROTO_TCP. Automatically done by svc_register(). 8820 8821 Return Value 8822 8823 pmap_set() returns 1 if it suceeds, 0 otherwise. 8824 8825 pmap_unset 8826 8827 Name 8828 8829 pmap_unset -- Destroys RPC Binding 8830 8831 Synopsis 8832 8833 #include 8834 8835 bool_t pmap_unset(u_long prognum, u_long versnum); 8836 8837 Description 8838 8839 As a user interface to the RPC Bind service, pmap_unset() 8840 destroys all mapping between the triple [prognum,versnum, *] 8841 and ports on the machine's RPC Bind service. 8842 8843 Return Value 8844 8845 pmap_unset() returns 1 if it succeeds, zero otherwise. 8846 8847 psignal 8848 8849 Name 8850 8851 psignal -- print signal message 8852 8853 Synopsis 8854 8855 #include 8856 8857 void psignal(int sig, const char * s); 8858 8859 extern const char *const sys_siglist[] 8860 8861 Description 8862 8863 The psignal() function shall display a message on the stderr 8864 stream. If s is not the null pointer, and does not point to an 8865 empty string (e.g. "\0"), the message shall consist of the 8866 string s, a colon, a space, and a string describing the signal 8867 number sig; otherwise psignal() shall display only a message 8868 describing the signal number sig. If sig is invalid, the 8869 message displayed shall indicate an unknown signal. 8870 8871 The array sys_siglist holds the signal description strings 8872 indexed by signal number. 8873 8874 Return Value 8875 8876 psignal() returns no value. 8877 8878 random_r 8879 8880 Name 8881 8882 random_r -- generate random number (DEPRECATED) 8883 8884 Synopsis 8885 8886 int random_r(struct random_data * restrict buf, int32_t * 8887 restrict result); 8888 8889 Description 8890 8891 random_r() is a reentrant version of random(), which generates 8892 a pseudorandom number. 8893 8894 Future Directions 8895 8896 Since this function requires support from other functions not 8897 specified in this specification (most notably initstate_r()), 8898 a future version of this specification may remove this 8899 interface. 8900 8901 setbuffer 8902 8903 Name 8904 8905 setbuffer -- stream buffering operation 8906 8907 Synopsis 8908 8909 #include 8910 8911 void setbuffer(FILE * stream, char * buf, size_t size); 8912 8913 Description 8914 8915 setbuffer() is an alias for the call to setvbuf(). It works 8916 the same, except that the size of the buffer in setbuffer() is 8917 up to the caller, rather than being determined by the default 8918 BUFSIZ. 8919 8920 setdomainname 8921 8922 Name 8923 8924 setdomainname -- set NIS domain name (DEPRECATED). 8925 8926 Synopsis 8927 8928 #include 8929 8930 int setdomainname (const char * name , size_t namelen ); 8931 8932 Description 8933 8934 If NIS is in use, set the NIS domain name. Note that this is 8935 not the same as the domain name which provides the domain 8936 portion of a fully qualified domain name (for example, in 8937 DNS). If NIS is not in use, this function may set the domain 8938 name anyway, or it may fail. 8939 8940 This call shall fail unless the caller has appropriate 8941 privileges. 8942 8943 namelen shall be the length of the string pointed to by name. 8944 8945 Return Value 8946 8947 On success, setdomainname() shall return 0. Otherwise, it 8948 shall return -1 and set errno to indicate the error. 8949 8950 Errors 8951 8952 EPERM 8953 The process did not have sufficient privilege to set 8954 the domain name. 8955 8956 EINVAL 8957 name is a null pointer. 8958 8959 setgroups 8960 8961 Name 8962 8963 setgroups -- set list of supplementary group IDs 8964 8965 Synopsis 8966 8967 #include 8968 8969 int setgroups(size_t size, const gid_t * list); 8970 8971 Description 8972 8973 If the process has appropriate privilege, the setgroups() 8974 function shall set the supplementary group IDs for the current 8975 process. list shall reference an array of size group IDs. A 8976 process may have at most NGROUPS_MAX supplementary group IDs. 8977 8978 Return Value 8979 8980 On successful completion, 0 is returned. On error, -1 is 8981 returned and the errno is set to indicate the error. 8982 8983 Errors 8984 8985 EFAULT 8986 list has an invalid address. 8987 8988 EPERM 8989 The process does not have appropriate privileges. 8990 8991 EINVAL 8992 size is greater than NGROUPS_MAX. 8993 8994 sethostid 8995 8996 Name 8997 8998 sethostid -- set the unique identifier of the current host 8999 (DEPRECATED) 9000 9001 Synopsis 9002 9003 #include 9004 9005 int sethostid(long int hostid); 9006 9007 Description 9008 9009 sethostid() sets a unique 32-bit identifier for the current 9010 machine. The 32-bit identifier is intended to be unique among 9011 all UNIX systems in existence. This normally resembles the 9012 Internet address for the local machine as returned by 9013 gethostbyname()(3), and thus usually never needs to be set. 9014 9015 The sethostid() call is restricted to the superuser. 9016 9017 hostid is stored in the file /etc/hostid. 9018 9019 The sethostid() function is deprecated from the LSB and is 9020 expected to disappear from a future version of the LSB. 9021 9022 Return Value 9023 9024 gethostid() returns the 32-bit identifier for the current host 9025 as set by sethostid()(2). 9026 9027 Files 9028 9029 /etc/hostid 9030 9031 sethostname 9032 9033 Name 9034 9035 sethostname -- set host name 9036 9037 Synopsis 9038 9039 #include 9040 #include 9041 #include 9042 9043 int sethostname(const char * name, size_t len); 9044 9045 Description 9046 9047 If the process has appropriate privileges, the sethostname() 9048 function shall change the host name for the current macine. 9049 The name shall point to a null-terminated string of at most 9050 len bytes that holds the new hostname. 9051 9052 If the symbol HOST_NAME_MAX is defined, or if 9053 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 9054 this value shall represent the maximum length of the new 9055 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 9056 value shall represent the maximum length for the new hostname. 9057 If none of these values are defined, the maximum length shall 9058 be the size of the nodename field of the utsname structure. 9059 9060 Return Value 9061 9062 On success, 0 is returned. On error, -1 is returned and the 9063 global variable errno is set appropriately. 9064 9065 Errors 9066 9067 EINVAL 9068 len is negative or larger than the maximum allowed 9069 size. 9070 9071 EPERM 9072 the process did not have appropriate privilege. 9073 9074 EFAULT 9075 name is an invalid address. 9076 9077 Rationale 9078 9079 ISO POSIX (2003) guarantees that: 9080 9081 Maximum length of a host name (not including the 9082 terminating null) as returned from the gethostname() 9083 function shall be at least 255 bytes. 9084 9085 The glibc C library does not currently define HOST_NAME_MAX, 9086 and although it provides the name _SC_HOST_NAME_MAX a call to 9087 sysconf() returns -1 and does not alter errno in this case 9088 (indicating that there is no restriction on the hostname 9089 length). However, the glibc manual idicates that some 9090 implementations may have MAXHOSTNAMELEN as a means of 9091 detecting the maximum length, while the Linux kernel at 9092 release 2.4 and 2.6 stores this hostname in the utsname 9093 structure. While the glibc manual suggests simply shortening 9094 the name until sethostname() succeeds, the LSB requires that 9095 one of the first four mechanisms works. Future versions of 9096 glibc may provide a more reasonable result from 9097 sysconf(_SC_HOST_NAME_MAX). 9098 9099 setsockopt 9100 9101 Name 9102 9103 setsockopt -- set options on sockets 9104 9105 Synopsis 9106 9107 #include 9108 #include 9109 9110 int setsockopt(int sockfd, int level, int optname, const void 9111 * optval, socklen_t optlen); 9112 9113 Description 9114 9115 In addition to the setsockopt() options specified in SUSv3, 9116 setsockopt() also supports the options specified here. 9117 9118 The following setsockopt() operations are provided for level 9119 IPPROTO_IP: 9120 9121 IP_MULTICAST_TTL 9122 Set or reads the time-to-live value of outgoing 9123 multicast packets for this socket. optval is a pointer 9124 to an integer which contains the new TTL value. 9125 9126 IP_MULTICAST_LOOP 9127 Sets a boolean flag indicating whether multicast 9128 packets originating locally should be looped back to 9129 the local sockets. optval is a pointer to an integer 9130 which contains the new flag value. 9131 9132 IP_ADD_MEMBERSHIP 9133 Join a multicast group. optval is a pointer to a 9134 ip_mreq structure. Before calling, the caller should 9135 fill in the imr_multiaddr field with the multicast 9136 group address and the imr_address field with the 9137 address of the local interface. If imr_address is set 9138 to INADDR_ANY, then an appropriate interface is chosen 9139 by the system. 9140 9141 IP_DROP_MEMBERSHIP 9142 Leave a multicast group. optval is a pointer to a 9143 ip_mreq structure containing the same values as were 9144 used with IP_ADD_MEMBERSHIP. 9145 9146 IP_MULTICAST_IF 9147 Set the local device for a multicast socket. optval is 9148 a pointer to a ip_mreq structure initialized in the 9149 same manner as with IP_ADD_MEMBERSHIP. 9150 9151 The ip_mreq structure contains two struct in_addr fields: 9152 imr_multiaddr and imr_address. 9153 9154 Return Value 9155 9156 On success, 0 is returned. On error, -1 is returned and the 9157 global variable errno is set appropriately. 9158 9159 setutent 9160 9161 Name 9162 9163 setutent -- access user accounting database entries 9164 9165 Synopsis 9166 9167 #include 9168 9169 void setutent(void); 9170 9171 Description 9172 9173 The setutent() function shall reset the user accounting 9174 database such that the next call to getutent() shall be return 9175 the first record in the database. It is recommended to call it 9176 before any of the other functions that operate on the user 9177 accounting databases (e.g. getutent()) 9178 9179 Return Value 9180 9181 None. 9182 9183 sigandset 9184 9185 Name 9186 9187 sigandset -- build a new signal set by combining the two input 9188 sets using logical AND 9189 9190 Synopsis 9191 9192 #include 9193 9194 int sigandset(sigset_t * set, const sigset_t * left, const 9195 sigset_t * right); 9196 9197 Description 9198 9199 The sigandset() shall combine the two signal sets referenced 9200 by left and right, using a logical AND operation, and shall 9201 place the result in the location referenced by set, The 9202 resulting signal set shall contain only signals that are in 9203 both the set referenced by left and the set referenced by 9204 right. 9205 9206 Return Value 9207 9208 On success, sigandset() shall return 0. Otherise, sigandset() 9209 shall return -1 and set errno to indicate the error. 9210 9211 Errors 9212 9213 EINVAL 9214 One or more of set, left, or right was a null pointer. 9215 9216 See Also 9217 9218 sigorset() 9219 9220 sigblock 9221 9222 Name 9223 9224 sigblock -- manipulate the signal mask (DEPRECATED) 9225 9226 Synopsis 9227 9228 #include _BSD_SOURCE 9229 #include 9230 9231 int sigblock(int mask); 9232 9233 Description 9234 9235 The sigblock() function shall add the signals corresponding to 9236 the bits set in mask to the set of signals currently being 9237 blocked from delivery. 9238 9239 Return Value 9240 9241 The sigblock() function shall return the previous signal mask. 9242 9243 Errors 9244 9245 None. 9246 9247 Notes 9248 9249 sigblock() is made obsolete by sigprocmask(). A future version 9250 of this specification may deprecate this function. 9251 9252 siggetmask 9253 9254 Name 9255 9256 siggetmask -- manipulate the signal mask (DEPRECATED) 9257 9258 Synopsis 9259 9260 #define _BSD_SOURCE 9261 #include 9262 9263 int siggetmask(void); 9264 9265 Description 9266 9267 The siggetmask() function shall return the current set of 9268 masked signals. 9269 9270 Notes 9271 9272 siggetmask() is made obsolete by sigprocmask(). 9273 9274 sigisemptyset 9275 9276 Name 9277 9278 sigisemptyset -- check for empty signal set 9279 9280 Synopsis 9281 9282 #include 9283 9284 int sigisemptyset(const sigset_t * set); 9285 9286 Description 9287 9288 The sigisemptyset() function shall check for empty signal set 9289 referenced by set. 9290 9291 Return Value 9292 9293 The sigisemptyset() function shall return a positive non-zero 9294 value if the signal set referenced by set is empty, or zero if 9295 this set is empty. On error, sigisemptyset() shall return -1 9296 and set errno to indicate the error. 9297 9298 Errors 9299 9300 EINVAL 9301 set is a null pointer. 9302 9303 sigorset 9304 9305 Name 9306 9307 sigorset -- build a new signal set by combining the two input 9308 sets using logical OR 9309 9310 Synopsis 9311 9312 #include 9313 9314 int sigorset(sigset_t * set, const sigset_t * left, const 9315 sigset_t * right); 9316 9317 Description 9318 9319 The sigorset() shall combine the two signal sets referenced by 9320 left and right, using a logical OR operation, and shall place 9321 the result in the location referenced by set, The resulting 9322 signal set shall contain only signals that are in either the 9323 set referenced by left or the set referenced by right. 9324 9325 Return Value 9326 9327 On success, sigorset() shall return 0. Otherise, sigorset() 9328 shall return -1 and set errno to indicate the error. 9329 9330 Errors 9331 9332 EINVAL 9333 One or more of set, left, or right was a null pointer. 9334 9335 See Also 9336 9337 sigorset() 9338 9339 sigreturn 9340 9341 Name 9342 9343 sigreturn -- return from signal handler and cleanup stack 9344 frame 9345 9346 Synopsis 9347 9348 int sigreturn(struct sigcontext * scp); 9349 9350 Description 9351 9352 The sigreturn() function is used by the system to cleanup 9353 after a signal handler has returned. This function is not in 9354 the source standard; it is only in the binary standard. 9355 9356 Return Value 9357 9358 sigreturn() never returns. 9359 9360 stime 9361 9362 Name 9363 9364 stime -- set time 9365 9366 Synopsis 9367 9368 #define _SVID_SOURCE 9369 #include 9370 9371 int stime(const time_t * t); 9372 9373 Description 9374 9375 If the process has appropriate privilege, the stime() function 9376 shall set the system's idea of the time and date. Time, 9377 referenced by t, is measured in seconds from the epoch 9378 (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970). 9379 9380 Return Value 9381 9382 On success, stime() shall return 0. Otherwise, stime() shall 9383 return -1 and errno shall be set to indicate the error. 9384 9385 Errors 9386 9387 EPERM 9388 The process does not have appropriate privilege. 9389 9390 EINVAL 9391 t is a null pointer. 9392 9393 stpcpy 9394 9395 Name 9396 9397 stpcpy -- copy a string returning a pointer to its end 9398 9399 Synopsis 9400 9401 #include 9402 9403 char * stpcpy(char * restrict dest, const char * restrict 9404 src); 9405 9406 Description 9407 9408 The stpcpy() function shall copy the string pointed to by src 9409 (including the terminating '\0' character) to the array 9410 pointed to by dest. The strings may not overlap, and the 9411 destination string dest shall be large enough to receive the 9412 copy. 9413 9414 Return Value 9415 9416 stpcpy() returns a pointer to the end of the string dest (that 9417 is, the address of the terminating '\0' character) rather than 9418 the beginning. 9419 9420 Example 9421 9422 This program uses stpcpy() to concatenate foo and bar to 9423 produce foobar, which it then prints. 9424 #include 9425 9426 int 9427 main (void) 9428 { 9429 char buffer[256]; 9430 char *to = buffer; 9431 to = stpcpy (to, "foo"); 9432 to = stpcpy (to, "bar"); 9433 printf ("%s\n", buffer); 9434 } 9435 9436 stpncpy 9437 9438 Name 9439 9440 stpncpy -- copy a fixed-size string, returning a pointer to 9441 its end 9442 9443 Synopsis 9444 9445 #include 9446 9447 char * stpncpy(char * restrict dest, const char * restrict 9448 src, size_t n); 9449 9450 Description 9451 9452 The stpncpy() function shall copy at most n characters from 9453 the string pointed to by src, including the terminating \0 9454 character, to the array pointed to by dest. Exactly n 9455 characters are written at dest. If the length strlen()(src) is 9456 smaller than n, the remaining characters in dest are filled 9457 with \0 characters. If the length strlen()(src) is greater 9458 than or equal to n, dest will not be \0 terminated. 9459 9460 The strings may not overlap. 9461 9462 The programmer shall ensure that there is room for at least n 9463 characters at dest. 9464 9465 Return Value 9466 9467 The stpncpy() function shall return a pointer to the 9468 terminating NULL in dest, or, if dest is not NULL-terminated, 9469 dest + n. 9470 9471 strcasestr 9472 9473 Name 9474 9475 strcasestr -- locate a substring ignoring case 9476 9477 Synopsis 9478 9479 #include 9480 9481 char * strcasestr(const char * s1, const char * s2); 9482 9483 Description 9484 9485 The strcasestr() shall behave as strstr(), except that it 9486 shall ignore the case of both strings. The strcasestr() 9487 function shall be locale aware; that is strcasestr() shall 9488 behave as if both strings had been converted to lower case in 9489 the current locale before the comparison is performed. 9490 9491 Return Value 9492 9493 Upon successful completion, strcasestr() shall return a 9494 pointer to the located string or a null pointer if the string 9495 is not found. If s2 points to a string with zero length, the 9496 function shall return s1. 9497 9498 strerror_r 9499 9500 Name 9501 9502 strerror_r -- reentrant version of strerror 9503 9504 Synopsis 9505 9506 #include 9507 9508 char * strerror_r(int errnum, char * buf, size_t buflen); 9509 9510 Description 9511 9512 The strerror_r() shall behave as specified in ISO POSIX 9513 (2003), except as described below. 9514 9515 Returns String, not Error Value 9516 9517 The strerror_r() function shall return a pointer to the string 9518 corresponding to errno. The returned pointer may point within 9519 the buffer buf (at most buflen bytes). 9520 9521 Return Value 9522 9523 On success, strerror_r() shall return a pointer to the 9524 generated message string (determined by the setting of the 9525 LC_MESSAGES category in the current locale). Otherwise, 9526 strerror_r() shall return the string corresponding to "Unknown 9527 error". 9528 9529 strfry 9530 9531 Name 9532 9533 strfry -- randomize a string (DEPRECATED) 9534 9535 Synopsis 9536 9537 #include 9538 9539 char * strfry(char * string); 9540 9541 Description 9542 9543 The strfry() function is deprecated from the LSB and is 9544 expected to disappear from a future version of the LSB. 9545 9546 strfry() randomizes the contents of string by using rand()(3) 9547 to randomly swap characters in the string. The result is an 9548 anagram of string. 9549 9550 Return Value 9551 9552 strfry() returns a pointer to the randomized string. 9553 9554 strndup 9555 9556 Name 9557 9558 strndup -- return a malloc'd copy of at most the specified 9559 number of bytes of a string 9560 9561 Synopsis 9562 9563 #include 9564 9565 char * strndup(const char * string, size_t n); 9566 9567 Description 9568 9569 The strndup() function shall return a malloc()'d copy of at 9570 most n bytes of string. The resultant string shall be 9571 terminated even if no NULL terminator appears before string+n. 9572 9573 Return Value 9574 9575 On success, strndup() shall return a pointer to a newly 9576 allocated block of memory containing a copy of at most n bytes 9577 of string. Otherwise, strndup() shall return NULL and set 9578 errno to indicate the error. 9579 9580 Errors 9581 9582 ENOMEM 9583 Insufficient memory available. 9584 9585 strnlen 9586 9587 Name 9588 9589 strnlen -- determine the length of a fixed-size string 9590 9591 Synopsis 9592 9593 #include 9594 9595 size_t strnlen(const char * s, size_t maxlen); 9596 9597 Description 9598 9599 strnlen() returns the number of characters in the string s, 9600 not including the terminating \0 character, but at most 9601 maxlen. In doing this, strnlen() looks only at the first 9602 maxlen characters at s and never beyond s + maxlen. 9603 9604 Return Value 9605 9606 strnlen() returns strlen()(s), if that is less than maxlen, or 9607 maxlen if there is no \0 character among the first maxlen 9608 characters pointed to by s. 9609 9610 strptime 9611 9612 Name 9613 9614 strptime -- parse a time string 9615 9616 Description 9617 9618 The strptime() shall behave as specified in the ISO POSIX 9619 (2003) with differences as listed below. 9620 9621 Number of leading zeroes may be limited 9622 9623 The ISO POSIX (2003) specifies fields for which "leading zeros 9624 are permitted but not required"; however, applications shall 9625 not expect to be able to supply more leading zeroes for these 9626 fields than would be implied by the range of the field. 9627 Implementations may choose to either match an input with 9628 excess leading zeroes, or treat this as a non-matching input. 9629 For example, %j has a range of 001 to 366, so 0, 00, 000, 001, 9630 and 045 are acceptable inputs, but inputs such as 0000, 0366 9631 and the like are not. 9632 9633 Rationale 9634 9635 glibc developers consider it appropriate behavior to forbid 9636 excess leading zeroes. When trying to parse a given input 9637 against several format strings, forbidding excess leading 9638 zeroes could be helpful. For example, if one matches 9639 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it 9640 seems useful for the first match to fail, as it would be 9641 perverse to parse that date as November 12, year 26. The 9642 second pattern parses it as December 26, year 11. 9643 9644 The ISO POSIX (2003) is not explicit that an unlimited number 9645 of leading zeroes are required, although it may imply this. 9646 The LSB explicitly allows implementations to have either 9647 behavior. Future versions of this standard may require 9648 implementations to forbid excess leading zeroes. 9649 9650 An Interpretation Request is currently pending against ISO 9651 POSIX (2003) for this matter. 9652 9653 strsep 9654 9655 Name 9656 9657 strsep -- extract token from string 9658 9659 Synopsis 9660 9661 #include 9662 9663 char * strsep(char * * stringp, const char * delim); 9664 9665 Description 9666 9667 The strsep() function shall find the first token in the string 9668 referenced by the pointer stringp, using the characters in 9669 delim as delimiters. 9670 9671 If stringp is NULL, strsep() shall return NULL and do nothing 9672 else. 9673 9674 If stringp is non-NULL, strsep() shall find the first token in 9675 the string referenced by stringp, where tokens are delimited 9676 by characters in the string delim. This token shall be 9677 terminated with a \0 character by overwriting the delimiter, 9678 and stringp shall be updated to point past the token. In case 9679 no delimiter was found, the token is taken to be the entire 9680 string referenced by stringp, and the location referenced by 9681 stringp is made NULL. 9682 9683 Return Value 9684 9685 strsep() shall return a pointer to the beginning of the token. 9686 9687 Notes 9688 9689 The strsep() function was introduced as a replacement for 9690 strtok(), since the latter cannot handle empty fields. 9691 However, strtok() conforms to ISO C (1999) and to ISO POSIX 9692 (2003) and hence is more portable. 9693 9694 See Also 9695 9696 strtok(), strtok_r(). 9697 9698 strsignal 9699 9700 Name 9701 9702 strsignal -- return string describing signal 9703 9704 Synopsis 9705 9706 #define _GNU_SOURCE 9707 #include 9708 9709 char * strsignal(int sig); 9710 9711 extern const char * const sys_siglist[]; 9712 9713 Description 9714 9715 The strsignal() function shall return a pointer to a string 9716 describing the signal number sig. The string can only be used 9717 until the next call to strsignal(). 9718 9719 The array sys_siglist holds the signal description strings 9720 indexed by signal number. This array should not be accessed 9721 directly by applications. 9722 9723 Return Value 9724 9725 If sig is a valid signal number, strsignal() shall return a 9726 pointer to the appropriate description string. Otherwise, 9727 strsignal() shall return either a pointer to the string 9728 "unknown signal", or a null pointer. 9729 9730 Although the function is not declared as returning a pointer 9731 to a constant character string, applications shall not modify 9732 the returned string. 9733 9734 strtoq 9735 9736 Name 9737 9738 strtoq -- convert string value to a long or quad_t integer 9739 9740 Synopsis 9741 9742 #include 9743 #include 9744 #include 9745 9746 long long strtoq(const char * nptr, char * * endptr, int 9747 base); 9748 9749 Description 9750 9751 strtoq() converts the string nptr to a quadt value. The 9752 conversion is done according to the given base, which shall be 9753 between 2 and 36 inclusive, or be the special value 0. 9754 9755 nptr may begin with an arbitrary amount of white space (as 9756 determined by isspace()(3)), followed by a single optional + 9757 or - sign character. If base is 0 or 16, the string may then 9758 include a 0x prefix, and the number will be read in base 16; 9759 otherwise, a 0 base is taken as 10 (decimal), unless the next 9760 character is 0, in which case it is taken as 8 (octal). 9761 9762 The remainder of the string is converted to a long value in 9763 the obvious manner, stopping at the first character which is 9764 not a valid digit in the given base. (In bases above 10, the 9765 letter A in either upper or lower case represents 10, B 9766 represents 11, and so forth, with Z representing 35.) 9767 9768 Return Value 9769 9770 strtoq() returns the result of the conversion, unless the 9771 value would underflow or overflow. If an underflow occurs, 9772 strtoq() returns QUAD_MIN. If an overflow occurs, strtoq() 9773 returns QUAD_MAX. In both cases, the global variable errno is 9774 set to ERANGE. 9775 9776 Errors 9777 9778 ERANGE 9779 The given string was out of range; the value converted 9780 has been clamped. 9781 9782 strtouq 9783 9784 Name 9785 9786 strtouq -- convert a string to an unsigned long long 9787 9788 Synopsis 9789 9790 #include 9791 #include 9792 #include 9793 9794 unsigned long long strtouq(const char * nptr, char * * endptr, 9795 int base); 9796 9797 Description 9798 9799 strtouq() converts the string nptr to an unsigned long long 9800 value. The conversion is done according to the given base, 9801 which shall be between 2 and 36 inclusive, or be the special 9802 value 0. 9803 9804 nptr may begin with an arbitrary amount of white space (as 9805 determined by isspace()(3)), followed by a single optional + 9806 or - sign character. If base is 0 or 16, the string may then 9807 include a 0x prefix, and the number will be read in base 16; 9808 otherwise, a 0 base is taken as 10 (decimal), unless the next 9809 character is 0, in which case it is taken as 8 (octal). 9810 9811 The remainder of the string is converted to an unsigned long 9812 value in the obvious manner, stopping at the end of the string 9813 or at the first character that does not produce a valid digit 9814 in the given base. (In bases above 10, the letter A in either 9815 upper or lower case represents 10, B represents 11, and so 9816 forth, with Z representing 35.) 9817 9818 Return Value 9819 9820 On success, strtouq() returns either the result of the 9821 conversion or, if there was a leading minus sign, the negation 9822 of the result of the conversion, unless the original 9823 (non-negated) value would overflow. In the case of an overflow 9824 the function returns UQUAD_MAX and the global variable errno 9825 is set to ERANGE. 9826 9827 Errors 9828 9829 ERANGE 9830 The given string was out of range; the value converted 9831 has been clamped. 9832 9833 strverscmp 9834 9835 Name 9836 9837 strverscmp -- compare strings holding name and indices/version 9838 numbers (DEPRECATED) 9839 9840 Synopsis 9841 9842 #include 9843 9844 int strverscmp(const char * s1, const char * s2); 9845 9846 Description 9847 9848 The strverscmp() function is deprecated from the LSB and is 9849 expected to disappear from a future version of the LSB. 9850 9851 The strversmp() function shall compare two strings in a 9852 similar manner to strcmp(). If s1 and s2 contain no digits, 9853 strversmp() shall behave as strcmp(). 9854 9855 The strings are compared by scanning from left to right. If a 9856 digit or sequence of digits is encountered in both strings at 9857 the same position, the digit sequence is specially compared, 9858 as described below. If the digit sequences compared equal, the 9859 string comparison resumes in both s1 and s2 after the digit 9860 sequence. 9861 9862 Digit sequences are classified as either "integral" or 9863 "fractional". A fractional digit sequence begins with a '0'; 9864 otherwise the digit sequence shall be treated as an integral 9865 digit sequence. 9866 9867 If two integral digit sequences are encountered, they shall be 9868 compared as integers for equality. A fractional digit sequence 9869 shall always compare less than an integral digit sequence. If 9870 two fractional digit sequences are being compared, then if the 9871 common prefix contains only leading zeroes, the longer part 9872 shall compare less than the shorter; otherwise the comparison 9873 shall be strictly numeric. 9874 9875 Examples 9876 9877 Table 1-1. Examples 9878 Call Return Value 9879 strverscmp()( "no digit", "no digit") 0 /* same behavior as 9880 strcmp */ 9881 strverscmp()( "item#99", "item#100") < 0 /* same prefix, but 9882 99 < 100 */ 9883 strverscmp()( "alpha1", "alpha001") > 0 /* fractional part 9884 inferior to integral */ 9885 strverscmp()( "part1_f012", "part1_f01") > 0 /* two fractional 9886 parts */ 9887 strverscmp()( "foo.009", "foo.0") < 0 /* two fractional parts 9888 but with leading zeroes only */ 9889 9890 svc_register 9891 9892 Name 9893 9894 svc_register -- Register Remote Procedure Call Interface 9895 9896 Synopsis 9897 9898 #include 9899 9900 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 9901 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 9902 protocol); 9903 9904 Description 9905 9906 The svc_register() function shall associate the program 9907 identified by prognum at version versnum with the service 9908 dispatch procedure, dispatch. If protocol is zero, the service 9909 is not registered with the portmap service. If protocol is 9910 non-zero, then a mapping of the triple [prognum, versnum, 9911 protocol] to xprt->xp_port is established with the local 9912 portmap service. The procedure dispatch has the following 9913 form: 9914 9915 int dispatch(struct svc_req * request, SVCXPRT * xprt); 9916 9917 Return Value 9918 9919 svc_register() returns 1 if it succeeds, and zero otherwise. 9920 9921 svc_run 9922 9923 Name 9924 9925 svc_run -- Waits for RPC requests to arrive and calls service 9926 procedure. 9927 9928 Synopsis 9929 9930 #include 9931 9932 void svc_run(void); 9933 9934 Description 9935 9936 The svc_run() function shall wait for RPC requests to arrive, 9937 read and unpack each request, and dispatch it to the 9938 appropriate registered handler. Under normal conditions, 9939 svc_run() shall not return; it shall only return if serious 9940 errors occur that prevent further processing. 9941 9942 svc_sendreply 9943 9944 Name 9945 9946 svc_sendreply -- called by RPC service's dispatch routine 9947 9948 Synopsis 9949 9950 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 9951 out); 9952 9953 Description 9954 9955 Called by an RPC service's dispatch routine to send the 9956 results of a remote procedure call. The parameter xprt is the 9957 request's associated transport handle; outproc is the XDR 9958 routine which is used to encode the results; and out is the 9959 address of the results. This routine returns one if it 9960 succeeds, zero other-wise. 9961 9962 svctcp_create 9963 9964 Name 9965 9966 svctcp_create -- Creates a TCP/IP-based RPC service transport. 9967 9968 Synopsis 9969 9970 #include 9971 9972 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 9973 recv_buf_size); 9974 9975 Description 9976 9977 svctcp_create() cretes a TCP/IP-based RPC service transport, 9978 to which it returns a pointer. The transport is associated 9979 with the socket sock, which may be RPC_ANYSOCK, in which case 9980 a new socket is created. If the socket is not bound to a local 9981 TCP port, then this routine binds it to an arbitrary port. 9982 Upon completion, xprt->xp_sock is the transport's socket 9983 descriptor, and xprt->xp_port is the transport's port number. 9984 Since TCP-based RPC uses buffered I/O, users may specify the 9985 size of buffers; values of zero choose suitable defaults. 9986 9987 Return Value 9988 9989 svctcp_create() returns NULL if it fails, or a pointer to the 9990 RPC service transport otherwise. 9991 9992 svcudp_create 9993 9994 Name 9995 9996 svcudp_create -- Creates a UDP-based RPC service transport. 9997 9998 Synopsis 9999 10000 SVCXPRT * 10001 10002 svcudp_create(int sock); 10003 10004 Description 10005 10006 This call is equivalent to svcudp_bufcreate( sock, SZ, SZ) for 10007 some default size SZ. 10008 10009 system 10010 10011 Name 10012 10013 system -- execute a shell command 10014 10015 Synopsis 10016 10017 #include 10018 10019 int system(const char * string); 10020 10021 Description 10022 10023 The system() function shall behave as described in ISO POSIX 10024 (2003). 10025 10026 Notes 10027 10028 The fact that system() ignores interrupts is often not what a 10029 program wants. ISO POSIX (2003) describes some of the 10030 consequences; an additional consequence is that a program 10031 calling system() from a loop cannot be reliably interrupted. 10032 Many programs will want to use the exec() family of functions 10033 instead. 10034 10035 Do not use system() from a program with suid or sgid 10036 privileges, because unexpected values for some environment 10037 variables might be used to subvert system integrity. Use the 10038 exec() family of functions instead, but not execlp() or 10039 execvp(). system() will not, in fact, work properly from 10040 programs with suid or sgid privileges on systems on which 10041 /bin/sh is bash version 2, since bash 2 drops privileges on 10042 startup. (Debian uses a modified bash which does not do this 10043 when invoked as sh.) 10044 10045 The check for the availability of /bin/sh is not actually 10046 performed; it is always assumed to be available. ISO C (1999) 10047 specifies the check, but ISO POSIX (2003) specifies that the 10048 return shall always be nonzero, since a system without the 10049 shell is not conforming, and it is this that is implemented. 10050 10051 It is possible for the shell command to return 127, so that 10052 code is not a sure indication that the execve() call failed; 10053 check the global variable errno to make sure. 10054 10055 textdomain 10056 10057 Name 10058 10059 textdomain -- set the current default message domain 10060 10061 Synopsis 10062 10063 #include 10064 10065 char * textdomain(const char * domainname); 10066 10067 Description 10068 10069 The textdomain() function shall set the current default 10070 message domain to domainname. Subsequent calls to gettext() 10071 and ngettext() use the default message domain. 10072 10073 If domainname is NULL, the default message domain shall not be 10074 altered. 10075 10076 If domainname is "", textdomain() shall reset the default 10077 domain to the system default of "messages". 10078 10079 Return 10080 10081 On success, textdomain() shall return the currently selected 10082 domain. Otherwise, a null pointer shall be returned, and errno 10083 set to indicate the error. 10084 10085 Errors 10086 10087 ENOMEM 10088 Insufficent memory available. 10089 10090 unlink 10091 10092 Name 10093 10094 unlink -- remove a directory entry 10095 10096 Synopsis 10097 10098 int unlink(const char * path); 10099 10100 Description 10101 10102 unlink() is as specified in ISO POSIX (2003), but with 10103 differences as listed below. 10104 10105 See also Additional behaviors: unlink/link on directory. 10106 10107 May return EISDIR on directories 10108 10109 If path specifies a directory, the implementation may return 10110 EISDIR instead of EPERM as specified by ISO POSIX (2003). 10111 10112 Rationale: The Linux kernel has deliberately chosen EISDIR 10113 for this case and does not expect to change (Al Viro, 10114 personal communication). 10115 10116 utmpname 10117 10118 Name 10119 10120 utmpname -- set user accounting database 10121 10122 Synopsis 10123 10124 #include 10125 10126 void getutent(const char * dbname ); 10127 10128 Description 10129 10130 The setutent() function shall cause the user accounting 10131 database used by the getutent(), getutent_r(), getutxent(), 10132 getutxid(), getutxline(), and pututxline() functions to be 10133 that named by dbname, instead of the system default database. 10134 See Section 4.2 for further information. 10135 10136 Note: The LSB does not specify the format of the user 10137 accounting database, nor the names of the file or files 10138 that may contain it. The implementation may map the dbname 10139 database name on to one or more files with the given stem. 10140 10141 Return Value 10142 10143 None. 10144 10145 Errors 10146 10147 None defined. 10148 10149 vasprintf 10150 10151 Name 10152 10153 vasprintf -- write formatted output to a dynamically allocated 10154 string 10155 10156 Synopsis 10157 10158 #include 10159 #include 10160 10161 int vasprintf(char * * restrict ptr, const char * restrict 10162 format, va_list arg); 10163 10164 Description 10165 10166 The vasprintf() function shall write formatted output to a 10167 dynamically allocated string, and store the address of that 10168 string in the location referenced by ptr. It shall behave as 10169 asprintf(), except that instead of being called with a 10170 variable number of arguments, it is called with an argument 10171 list as defined by . 10172 10173 Return Value 10174 10175 Refer to fprintf(). 10176 10177 Errors 10178 10179 Refer to fprintf(). 10180 10181 vdprintf 10182 10183 Name 10184 10185 vdprintf -- write formatted output to a file descriptor 10186 10187 Synopsis 10188 10189 #include 10190 10191 int vdprintf(int fd, const char * restrict format, va_list 10192 arg); 10193 10194 Description 10195 10196 The vdprintf() shall behave as vfprintf(), except that the 10197 first argument is a file descriptor rather than a STDIO 10198 stream. 10199 10200 Return Value 10201 10202 Refer to fprintf(). 10203 10204 Errors 10205 10206 Refer to fprintf(). 10207 10208 verrx 10209 10210 Name 10211 10212 verrx -- display formatted error message and exit 10213 10214 Synopsis 10215 10216 #include 10217 #include 10218 10219 void verrx(int eval, const char * fmt, va_list args); 10220 10221 Description 10222 10223 The verrx() shall behave as errx() except that instead of 10224 being called with a variable number of arguments, it is called 10225 with an argument list as defined by . 10226 10227 verrx() does not return, but exits with the value of eval. 10228 10229 Return Value 10230 10231 None. 10232 10233 Errors 10234 10235 None. 10236 10237 vsyslog 10238 10239 Name 10240 10241 vsyslog -- log to system log 10242 10243 Synopsis 10244 10245 #include 10246 #include 10247 10248 void vsyslog(int priority, char * message, va_list arglist); 10249 10250 Description 10251 10252 The vsyslog() function is identical to syslog() as specified 10253 in ISO POSIX (2003), except that arglist (as defined by 10254 stdarg.h) replaces the variable number of arguments. 10255 10256 wait3 10257 10258 Name 10259 10260 wait3 -- wait for child process (DEPRECATED) 10261 10262 Description 10263 10264 wait3() is as specified in the SUSv2 but with differences as 10265 listed below. 10266 10267 WCONTINUED and WIFCONTINUED optional 10268 10269 Implementations need not support the functionality of 10270 WCONTINUED or WIFCONTINUED. 10271 10272 wait4 10273 10274 Name 10275 10276 wait4 -- wait for process termination, BSD style 10277 10278 Synopsis 10279 10280 #include 10281 #include 10282 #include 10283 10284 pid_t wait4(pid_t pid, int * status, int options, struct 10285 rusage * rusage); 10286 10287 Description 10288 10289 wait4() suspends execution of the current process until a 10290 child (as specified by pid) has exited, or until a signal is 10291 delivered whose action is to terminate the current process or 10292 to call a signal handling function. If a child (as requested 10293 by pid) has already exited by the time of the call (a 10294 so-called "zombie" process), the function returns immediately. 10295 Any system resources used by the child are freed. 10296 10297 The value of pid can be one of: 10298 10299 < -1 10300 wait for any child process whose process group ID is 10301 equal to the absolute value of pid. 10302 10303 -1 10304 wait for any child process; this is equivalent to 10305 calling wait3(). 10306 10307 0 10308 wait for any child process whose process group ID is 10309 equal to that of the calling process. 10310 10311 > 0 10312 wait for the child whose process ID is equal to the 10313 value of pid. 10314 10315 The value of options is a bitwise or of zero or more of the 10316 following constants: 10317 10318 WNOHANG 10319 return immediately if no child is there to be waited 10320 for. 10321 10322 WUNTRACED 10323 return for children that are stopped, and whose status 10324 has not been reported. 10325 10326 If status is not NULL, wait4() stores status information in 10327 the location status. This status can be evaluated with the 10328 following macros: 10329 10330 Note: These macros take the status value (an int) as an 10331 argument -- not a pointer to the value! 10332 10333 WIFEXITED(status) 10334 is nonzero if the child exited normally. 10335 10336 WEXITSTATUS(status) 10337 evaluates to the least significant eight bits of the 10338 return code of the child that terminated, which may 10339 have been set as the argument to a call to exit() or as 10340 the argument for a return statement in the main 10341 program. This macro can only be evaluated if 10342 WIFEXITED() returned nonzero. 10343 10344 WIFSIGNALED(status) 10345 returns true if the child process exited because of a 10346 signal that was not caught. 10347 10348 WTERMSIG(status) 10349 returns the number of the signal that caused the child 10350 process to terminate. This macro can only be evaluated 10351 if WIFSIGNALED() returned nonzero. 10352 10353 WIFSTOPPED(status) 10354 returns true if the child process that caused the 10355 return is currently stopped; this is only possible if 10356 the call was done using WUNTRACED(). 10357 10358 WSTOPSIG(status) 10359 returns the number of the signal that caused the child 10360 to stop. This macro can only be evaluated if 10361 WIFSTOPPED() returned nonzero. 10362 10363 If rusage is not NULL, the struct rusage (as defined in 10364 sys/resource.h) that it points to will be filled with 10365 accounting information. (See getrusage()(2) for details. 10366 10367 Return Value 10368 10369 On success, the process ID of the child that exited is 10370 returned. On error, -1 is returned (in particular, when no 10371 unwaited-for child processes of the specified kind exist), or 10372 0 if WNOHANG() was used and no child was available yet. In the 10373 latter two cases, the global variable errno is set 10374 appropriately. 10375 10376 Errors 10377 10378 ECHILD 10379 No unwaited-for child process as specified does exist. 10380 10381 ERESTARTSYS 10382 A WNOHANG() was not set and an unblocked signal or a 10383 SIGCHILD was caught. This error is returned by the 10384 system call. The library interface is not allowed to 10385 return ERESTARTSYS, but will return EINTR. 10386 10387 waitpid 10388 10389 Name 10390 10391 waitpid -- wait for child process 10392 10393 Description 10394 10395 waitpid() is as specified in ISO POSIX (2003), but with 10396 differences as listed below. 10397 10398 Need not support WCONTINUED or WIFCONTINUED 10399 10400 Implementations need not support the functionality of 10401 WCONTINUED() or WIFCONTINUED(). 10402 10403 warn 10404 10405 Name 10406 10407 warn -- formatted error messages 10408 10409 Synopsis 10410 10411 #include 10412 10413 void warn(const char * fmt, ...); 10414 10415 Description 10416 10417 The warn() function shall display a formatted error message on 10418 the standard error stream. The output shall consist of the 10419 last component of the program name, a colon character, and a 10420 space character. If fmt is non-NULL, it shall be used as a 10421 format string for the printf() family of functions, and the 10422 formatted message, a colon character, and a space are written 10423 to stderr. Finally, the error message string affiliated with 10424 the current value of the global variable errno shall be 10425 written to stderr, followed by a newline character. 10426 10427 Return Value 10428 10429 None. 10430 10431 Errors 10432 10433 None. 10434 10435 warnx 10436 10437 Name 10438 10439 warnx -- formatted error messages 10440 10441 Synopsis 10442 10443 #include 10444 10445 void warnx(const char * fmt, ...); 10446 10447 Description 10448 10449 The warnx() function shall display a formatted error message 10450 on the standard error stream. The last component of the 10451 program name, a colon character, and a space shall be output. 10452 If fmt is non-NULL, it shall be used as the format string for 10453 the printf() family of functions, and the formatted error 10454 message, a colon character, and a space shall be output. The 10455 output shall be followed by a newline character. 10456 10457 Return Value 10458 10459 None. 10460 10461 Errors 10462 10463 None. 10464 10465 wcpcpy 10466 10467 Name 10468 10469 wcpcpy -- copy a wide character string, returning a pointer to 10470 its end 10471 10472 Synopsis 10473 10474 #include 10475 10476 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 10477 10478 Description 10479 10480 wcpcpy() is the wide-character equivalent of stpcpy(). It 10481 copies the wide character string src, including the 10482 terminating L'\0' character, to the array dest. 10483 10484 The strings may not overlap. 10485 10486 The programmer shall ensure that there is room for at least 10487 wcslen()(src)+1 wide characters at dest. 10488 10489 Return Value 10490 10491 wcpcpy() returns a pointer to the end of the wide-character 10492 string dest, that is, a pointer to the terminating L'\0' 10493 character. 10494 10495 wcpncpy 10496 10497 Name 10498 10499 wcpncpy -- copy a fixed-size string of wide characters, 10500 returning a pointer to its end 10501 10502 Synopsis 10503 10504 #include 10505 10506 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 10507 n); 10508 10509 Description 10510 10511 wcpncpy() is the wide-character equivalent of stpncpy(). It 10512 copies at most n wide characters from the wide-character 10513 string src, including the terminating L'\0' character, to the 10514 array dest. Exactly n wide characters are written at dest. If 10515 the length wcslen()(src) is smaller than n, the remaining wide 10516 characters in the array dest are filled with L'\0' characters. 10517 If the length wcslen()(src) is greater than or equal to n, the 10518 string dest will not be L'\0' terminated. 10519 10520 The strings may not overlap. 10521 10522 The programmer shall ensure that there is room for at least n 10523 wide characters at dest. 10524 10525 Return Value 10526 10527 wcpncpy() returns a pointer to the wide character one past the 10528 last non-null wide character written. 10529 10530 wcscasecmp 10531 10532 Name 10533 10534 wcscasecmp -- compare two wide-character strings, ignoring 10535 case 10536 10537 Synopsis 10538 10539 #include 10540 10541 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 10542 10543 Description 10544 10545 wcscasecmp() is the wide-character equivalent of strcasecmp(). 10546 It compares the wide-character string s1 and the 10547 wide-character string s2, ignoring case differences (towupper, 10548 towlower). 10549 10550 Return Value 10551 10552 wcscasecmp() returns 0 if the wide-character strings s1 and s2 10553 are equal except for case distinctions. It returns a positive 10554 integer if s1 is greater than s2, ignoring case. It returns a 10555 negative integer if s1 is smaller than s2, ignoring case. 10556 10557 Notes 10558 10559 The behavior of wcscasecmp() depends upon the LC_CTYPE 10560 category of the current locale. 10561 10562 wcsdup 10563 10564 Name 10565 10566 wcsdup -- duplicate a wide-character string 10567 10568 Synopsis 10569 10570 #include 10571 10572 wchar_t * wcsdup(const wchar_t * s); 10573 10574 Description 10575 10576 wcsdup() is the wide-character equivalent of strdup(). It 10577 allocates and returns a new wide-character string whose 10578 initial contents is a duplicate of the wide-character string 10579 s. 10580 10581 Memory for the new wide-character string is obtained with 10582 malloc(), and can be freed with free(). 10583 10584 Return Value 10585 10586 wcsdup() returns a pointer to the new wide-character string, 10587 or NULL if sufficient memory was not available. 10588 10589 wcsncasecmp 10590 10591 Name 10592 10593 wcsncasecmp -- compare two fixed-size wide-character strings, 10594 ignoring case 10595 10596 Synopsis 10597 10598 #include 10599 10600 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 10601 n); 10602 10603 Description 10604 10605 wcsncasecmp() is the wide-character equivalent of 10606 strncasecmp(). It compares the wide-character string s1 and 10607 the wide-character string s2, but at most n wide characters 10608 from each string, ignoring case differences (towupper, 10609 towlower). 10610 10611 Return Value 10612 10613 wcscasecmp() returns 0 if the wide-character strings s1 and 10614 s2, truncated to at most length n, are equal except for case 10615 distinctions. It returns a positive integer if truncated s1 is 10616 greater than truncated s2, ignoring case. It returns a 10617 negative integer if truncated s1 is smaller than truncated s2, 10618 ignoring case. 10619 10620 Notes 10621 10622 The behavior of wcsncasecmp() depends upon the LC_CTYPE 10623 category of the current locale. 10624 10625 wcsnlen 10626 10627 Name 10628 10629 wcsnlen -- determine the length of a fixed-size wide-character 10630 string 10631 10632 Synopsis 10633 10634 #include 10635 10636 size_t wcsnlen(const wchar_t * s, size_t maxlen); 10637 10638 Description 10639 10640 wcsnlen() is the wide-character equivalent of strnlen(). It 10641 returns the number of wide-characters in the string s, not 10642 including the terminating L'\0' character, but at most maxlen. 10643 In doing this, wcsnlen() looks only at the first maxlen 10644 wide-characters at s and never beyond s + maxlen. 10645 10646 Return Value 10647 10648 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 10649 maxlen if there is no L'\0' character among the first maxlen 10650 wide characters pointed to by s. 10651 10652 Notes 10653 10654 The behavior of wcsncasecmp() depends on the LC_CTYPE category 10655 of the current locale. 10656 10657 wcsnrtombs 10658 10659 Name 10660 10661 wcsnrtombs -- convert a wide character string to a multi-byte 10662 string 10663 10664 Synopsis 10665 10666 #include 10667 10668 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 10669 nwc, size_t len, mbstate_t * ps); 10670 10671 Description 10672 10673 wcsnrtombs() is like wcsrtombs(), except that the number of 10674 wide characters to be converted, starting at src, is limited 10675 to nwc. 10676 10677 If dest is not a NULL pointer, wcsnrtombs() converts at most 10678 nwc wide characters from the wide-character string src to a 10679 multibyte string starting at dest. At most len bytes are 10680 written to dest. The state ps is updated. 10681 10682 The conversion is effectively performed by repeatedly calling: 10683 wcrtomb(dest, *src, ps) 10684 10685 as long as this call succeeds, and then incrementing dest by 10686 the number of bytes written and src by 1. 10687 10688 The conversion can stop for three reasons: 10689 10690 * A wide character has been encountered that cannot be 10691 represented as a multibyte sequence (according to the 10692 current locale). In this case src is left pointing to the 10693 invalid wide character, (size_t)(-1) is returned, and 10694 errno is set to EILSEQ. 10695 * nws wide characters have been converted without 10696 encountering a L'\0', or the length limit forces a stop. 10697 In this case, src is left pointing to the next wide 10698 character to be converted, and the number bytes written to 10699 dest is returned. 10700 * The wide-character string has been completely converted, 10701 including the terminating L'\0' (which has the side effect 10702 of bringing back ps to the initial state). In this case, 10703 src is set to NULL, and the number of bytes written to 10704 dest, excluding the terminating L'\0' byte, is returned. 10705 10706 If dest is NULL, len is ignored, and the conversion proceeds 10707 as above, except that the converted bytes are not written out 10708 to memory, and that no destination length limit exists. 10709 10710 In both of the above cases, if ps is a NULL pointer, a static 10711 anonymous state only known to wcsnrtombs() is used instead. 10712 10713 The programmer shall ensure that there is room for at least 10714 len bytes at dest. 10715 10716 Return Value 10717 10718 wcsnrtombs() returns the number of bytes that make up the 10719 converted part of multibyte sequence, not including the 10720 terminating L'\0' byte. If a wide character was encountered 10721 which could not be converted, (size_t)(-1) is returned, and 10722 the global variable errno set to EILSEQ. 10723 10724 Notes 10725 10726 The behavior of wcsnrtombs() depends on the LC_CTYPE category 10727 of the current locale. 10728 10729 Passing NULL as ps is not multi-thread safe. 10730 10731 wcstoq 10732 10733 Name 10734 10735 wcstoq -- convert wide string to long long int representation 10736 10737 Synopsis 10738 10739 #include 10740 10741 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 10742 restrict endptr, int base); 10743 10744 Description 10745 10746 The wcstoq() function shall convert the initial portion of the 10747 wide string nptr to long long int representation. It is 10748 identical to wcstoll(). 10749 10750 Return Value 10751 10752 Refer to wcstoll(). 10753 10754 Errors 10755 10756 Refer to wcstoll(). 10757 10758 wcstouq 10759 10760 Name 10761 10762 wcstouq -- convert wide string to unsigned long long int 10763 representation 10764 10765 Synopsis 10766 10767 #include 10768 10769 unsigned long long wcstouq(const wchar_t * restrict nptr, 10770 wchar_t ** restrict endptr, int base); 10771 10772 Description 10773 10774 The wcstouq() function shall convert the initial portion of 10775 the wide string nptr to unsigned long long int representation. 10776 It is identical to wcstoull(). 10777 10778 Return Value 10779 10780 Refer to wcstoull(). 10781 10782 Errors 10783 10784 Refer to wcstoull(). 10785 10786 xdr_u_int 10787 10788 Name 10789 10790 xdr_u_int -- library routines for external data representation 10791 10792 Synopsis 10793 10794 int xdr_u_int(XDR * xdrs, unsigned int * up); 10795 10796 Description 10797 10798 xdr_u_int() is a filter primitive that translates between C 10799 unsigned integers and their external representations. 10800 10801 Return Value 10802 10803 On success, 1 is returned. On error, 0 is returned. 10804 _________________________________________________________ 10805 10806 1.6. Interfaces for libm 10807 10808 Table 1-35 defines the library name and shared object name for 10809 the libm library 10810 10811 Table 1-35. libm Definition 10812 Library: libm 10813 SONAME: See archLSB. 10814 10815 The behavior of the interfaces in this library is specified by 10816 the following specifications: 10817 10818 ISO C (1999) 10819 this specification 10820 SUSv2 10821 ISO POSIX (2003) 10822 _________________________________________________________ 10823 10824 1.6.1. Math 10825 _________________________________________________________ 10826 10827 1.6.1.1. Interfaces for Math 10828 10829 An LSB conforming implementation shall provide the generic 10830 functions for Math specified in Table 1-36, with the full 10831 functionality as described in the referenced underlying 10832 specification. 10833 10834 Table 1-36. libm - Math Function Interfaces 10835 __finite [1] ccosl [2] exp [2] j1l [1] powf [2] 10836 __finitef [1] ceil [2] exp2 [2] jn [2] powl [2] 10837 __finitel [1] ceilf [2] exp2f [2] jnf [1] remainder [2] 10838 __fpclassify [3] ceill [2] expf [2] jnl [1] remainderf [2] 10839 __fpclassifyf [3] cexp [2] expl [2] ldexp [2] remainderl [2] 10840 __signbit [1] cexpf [2] expm1 [2] ldexpf [2] remquo [2] 10841 __signbitf [1] cexpl [2] expm1f [2] ldexpl [2] remquof [2] 10842 acos [2] cimag [2] expm1l [2] lgamma [2] remquol [2] 10843 acosf [2] cimagf [2] fabs [2] lgamma_r [1] rint [2] 10844 acosh [2] cimagl [2] fabsf [2] lgammaf [2] rintf [2] 10845 acoshf [2] clog [2] fabsl [2] lgammaf_r [1] rintl [2] 10846 acoshl [2] clog10 [1] fdim [2] lgammal [2] round [2] 10847 acosl [2] clog10f [1] fdimf [2] lgammal_r [1] roundf [2] 10848 asin [2] clog10l [1] fdiml [2] llrint [2] roundl [2] 10849 asinf [2] clogf [2] feclearexcept [2] llrintf [2] scalb [2] 10850 asinh [2] clogl [2] fegetenv [2] llrintl [2] scalbf [1] 10851 asinhf [2] conj [2] fegetexceptflag [2] llround [2] scalbl [1] 10852 asinhl [2] conjf [2] fegetround [2] llroundf [2] scalbln [2] 10853 asinl [2] conjl [2] feholdexcept [2] llroundl [2] scalblnf [2] 10854 atan [2] copysign [2] feraiseexcept [2] log [2] scalblnl [2] 10855 atan2 [2] copysignf [2] fesetenv [2] log10 [2] scalbn [2] 10856 atan2f [2] copysignl [2] fesetexceptflag [2] log10f [2] 10857 scalbnf [2] 10858 atan2l [2] cos [2] fesetround [2] log10l [2] scalbnl [2] 10859 atanf [2] cosf [2] fetestexcept [2] log1p [2] significand [1] 10860 atanh [2] cosh [2] feupdateenv [2] log1pf [2] significandf [1] 10861 atanhf [2] coshf [2] finite [4] log1pl [2] significandl [1] 10862 atanhl [2] coshl [2] finitef [1] log2 [2] sin [2] 10863 atanl [2] cosl [2] finitel [1] log2f [2] sincos [1] 10864 cabs [2] cpow [2] floor [2] log2l [2] sincosf [1] 10865 cabsf [2] cpowf [2] floorf [2] logb [2] sincosl [1] 10866 cabsl [2] cpowl [2] floorl [2] logbf [2] sinf [2] 10867 cacos [2] cproj [2] fma [2] logbl [2] sinh [2] 10868 cacosf [2] cprojf [2] fmaf [2] logf [2] sinhf [2] 10869 cacosh [2] cprojl [2] fmal [2] logl [2] sinhl [2] 10870 cacoshf [2] creal [2] fmax [2] lrint [2] sinl [2] 10871 cacoshl [2] crealf [2] fmaxf [2] lrintf [2] sqrt [2] 10872 cacosl [2] creall [2] fmaxl [2] lrintl [2] sqrtf [2] 10873 carg [2] csin [2] fmin [2] lround [2] sqrtl [2] 10874 cargf [2] csinf [2] fminf [2] lroundf [2] tan [2] 10875 cargl [2] csinh [2] fminl [2] lroundl [2] tanf [2] 10876 casin [2] csinhf [2] fmod [2] matherr [1] tanh [2] 10877 casinf [2] csinhl [2] fmodf [2] modf [2] tanhf [2] 10878 casinh [2] csinl [2] fmodl [2] modff [2] tanhl [2] 10879 casinhf [2] csqrt [2] frexp [2] modfl [2] tanl [2] 10880 casinhl [2] csqrtf [2] frexpf [2] nan [2] tgamma [2] 10881 casinl [2] csqrtl [2] frexpl [2] nanf [2] tgammaf [2] 10882 catan [2] ctan [2] gamma [4] nanl [2] tgammal [2] 10883 catanf [2] ctanf [2] gammaf [1] nearbyint [2] trunc [2] 10884 catanh [2] ctanh [2] gammal [1] nearbyintf [2] truncf [2] 10885 catanhf [2] ctanhf [2] hypot [2] nearbyintl [2] truncl [2] 10886 catanhl [2] ctanhl [2] hypotf [2] nextafter [2] y0 [2] 10887 catanl [2] ctanl [2] hypotl [2] nextafterf [2] y0f [1] 10888 cbrt [2] dremf [1] ilogb [2] nextafterl [2] y0l [1] 10889 cbrtf [2] dreml [1] ilogbf [2] nexttoward [2] y1 [2] 10890 cbrtl [2] erf [2] ilogbl [2] nexttowardf [2] y1f [1] 10891 ccos [2] erfc [2] j0 [2] nexttowardl [2] y1l [1] 10892 ccosf [2] erfcf [2] j0f [1] pow [2] yn [2] 10893 ccosh [2] erfcl [2] j0l [1] pow10 [1] ynf [1] 10894 ccoshf [2] erff [2] j1 [2] pow10f [1] ynl [1] 10895 ccoshl [2] erfl [2] j1f [1] pow10l [1] 10896 10897 Referenced Specification(s) 10898 10899 [1]. ISO C (1999) 10900 10901 [2]. ISO POSIX (2003) 10902 10903 [3]. this specification 10904 10905 [4]. SUSv2 10906 10907 An LSB conforming implementation shall provide the generic 10908 data interfaces for Math specified in Table 1-37, with the 10909 full functionality as described in the referenced underlying 10910 specification. 10911 10912 Table 1-37. libm - Math Data Interfaces 10913 signgam [1] 10914 10915 Referenced Specification(s) 10916 10917 [1]. ISO POSIX (2003) 10918 _________________________________________________________ 10919 10920 1.7. Data Definitions for libm 10921 10922 This section defines global identifiers and their values that 10923 are associated with interfaces contained in libm. These 10924 definitions are organized into groups that correspond to 10925 system headers. This convention is used as a convenience for 10926 the reader, and does not imply the existence of these headers, 10927 or their content. 10928 10929 These definitions are intended to supplement those provided in 10930 the referenced underlying specifications. 10931 10932 This specification uses ISO/IEC 9899 C Language as the 10933 reference programming language, and data definitions are 10934 specified in ISO C format. The C language is used here as a 10935 convenient notation. Using a C language description of these 10936 data objects does not preclude their use by other programming 10937 languages. 10938 _________________________________________________________ 10939 10940 1.7.1. complex.h 10941 10942 #define complex _Complex 10943 _________________________________________________________ 10944 10945 1.7.2. math.h 10946 10947 #define DOMAIN 1 10948 #define SING 2 10949 10950 struct exception 10951 { 10952 int type; 10953 char *name; 10954 double arg1; 10955 double arg2; 10956 double retval; 10957 } 10958 ; 10959 #define FP_NAN 0 10960 #define FP_INFINITE 1 10961 #define FP_ZERO 2 10962 #define FP_SUBNORMAL 3 10963 #define FP_NORMAL 4 10964 10965 #define isnormal(x) (fpclassify (x) == FP_NORMAL) 10966 #define isfinite(x) (sizeof (x) == sizeof (float) ? __finitef (x) : 10967 sizeof (x) == sizeof (double)? __finite (x) : __finitel (x)) 10968 #define isinf(x) (sizeof (x) == sizeof (float) ? __isinff (x): s 10969 izeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) 10970 #define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) : 10971 sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) 10972 10973 #define HUGE_VAL 0x1.0p2047 10974 #define HUGE_VALF 0x1.0p255f 10975 #define HUGE_VALL 0x1.0p32767L 10976 10977 #define NAN ((float)0x7fc00000UL) 10978 #define M_1_PI 0.31830988618379067154 10979 #define M_LOG10E 0.43429448190325182765 10980 #define M_2_PI 0.63661977236758134308 10981 #define M_LN2 0.69314718055994530942 10982 #define M_SQRT1_2 0.70710678118654752440 10983 #define M_PI_4 0.78539816339744830962 10984 #define M_2_SQRTPI 1.12837916709551257390 10985 #define M_SQRT2 1.41421356237309504880 10986 #define M_LOG2E 1.4426950408889634074 10987 #define M_PI_2 1.57079632679489661923 10988 #define M_LN10 2.30258509299404568402 10989 #define M_E 2.7182818284590452354 10990 #define M_PI 3.14159265358979323846 10991 #define INFINITY HUGE_VALF 10992 10993 #define MATH_ERRNO 1 10994 #define MATH_ERREXCEPT 2 10995 10996 #define isunordered(u, v) (__extension__({ __typeof__(u) __u = (u 10997 ); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__ 10998 v) == FP_NAN; })) 10999 #define islessgreater(x, y) (__extension__({ __typeof__(x) __x = (x 11000 ); __typeof__(y) __y = (y);!isunordered (__x, __y) & & (__x < __y || __ 11001 y < __x); })) 11002 #define isless(x,y) (__extension__({ __typeof__(x) __x = (x); __typ 11003 eof__(y) __y = (y);!isunordered (__x, __y) & & __x < __y; })) 11004 #define islessequal(x, y) (__extension__({ __typeof__(x) __x = (x 11005 ); __typeof__(y) __y = (y);!isunordered (__x, __y) & & __x <= __y; })) 11006 #define isgreater(x,y) (__extension__({ __typeof__(x) __x = (x); __typ 11007 eof__(y) __y = (y);!isunordered (__x, __y) & & __x > __y; })) 11008 #define isgreaterequal(x,y) (__extension__({ __typeof__(x) __x = (x 11009 ); __typeof__(y) __y = (y);!isunordered (__x, __y) & & __x >= __y; })) 11010 _________________________________________________________ 11011 11012 1.8. Interface Definitions for libm 11013 11014 Table of Contents 11015 __fpclassify -- Classify real floating type 11016 __fpclassifyf -- Classify real floating type 11017 11018 The following interfaces are included in libm and are defined 11019 by this specification. Unless otherwise noted, these 11020 interfaces shall be included in the source standard. 11021 11022 Other interfaces listed above for libm shall behave as 11023 described in the referenced base document. 11024 11025 __fpclassify 11026 11027 Name 11028 11029 __fpclassify -- Classify real floating type 11030 11031 Synopsis 11032 11033 int __fpclassify(double arg); 11034 11035 Description 11036 11037 __fpclassify() has the same specification as fpclassify() in 11038 ISO POSIX (2003), except that the argument type for 11039 __fpclassify() is known to be double. 11040 11041 __fpclassify() is not in the source standard; it is only in 11042 the binary standard. 11043 11044 __fpclassifyf 11045 11046 Name 11047 11048 __fpclassifyf -- Classify real floating type 11049 11050 Synopsis 11051 11052 int __fpclassifyf(float arg); 11053 11054 Description 11055 11056 __fpclassifyf() has the same specification as fpclassifyf() in 11057 ISO POSIX (2003), except that the argument type for 11058 __fpclassifyf() is known to be float. 11059 11060 __fpclassifyf() is not in the source standard; it is only in 11061 the binary standard. 11062 _________________________________________________________ 11063 11064 1.9. Interfaces for libpthread 11065 11066 Table 1-38 defines the library name and shared object name for 11067 the libpthread library 11068 11069 Table 1-38. libpthread Definition 11070 Library: libpthread 11071 SONAME: libpthread.so.0 11072 11073 The behavior of the interfaces in this library is specified by 11074 the following specifications: 11075 11076 Large File Support 11077 this specification 11078 ISO POSIX (2003) 11079 _________________________________________________________ 11080 11081 1.9.1. Realtime Threads 11082 _________________________________________________________ 11083 11084 1.9.1.1. Interfaces for Realtime Threads 11085 11086 No external functions are defined for libpthread - Realtime 11087 Threads 11088 _________________________________________________________ 11089 11090 1.9.2. Advanced Realtime Threads 11091 _________________________________________________________ 11092 11093 1.9.2.1. Interfaces for Advanced Realtime Threads 11094 11095 No external functions are defined for libpthread - Advanced 11096 Realtime Threads 11097 _________________________________________________________ 11098 11099 1.9.3. Posix Threads 11100 _________________________________________________________ 11101 11102 1.9.3.1. Interfaces for Posix Threads 11103 11104 An LSB conforming implementation shall provide the generic 11105 functions for Posix Threads specified in Table 1-39, with the 11106 full functionality as described in the referenced underlying 11107 specification. 11108 11109 Table 1-39. libpthread - Posix Threads Function Interfaces 11110 _pthread_cleanup_pop [1] pthread_attr_setstacksize [2] 11111 pthread_getspecific [2] pthread_rwlock_destroy [2] 11112 pthread_setspecific [2] 11113 _pthread_cleanup_push [1] pthread_cancel [2] pthread_join [2] 11114 pthread_rwlock_init [2] pthread_sigmask [2] 11115 pread [2] pthread_cond_broadcast [2] pthread_key_create [2] 11116 pthread_rwlock_rdlock [2] pthread_testcancel [2] 11117 pread64 [3] pthread_cond_destroy [2] pthread_key_delete [2] 11118 pthread_rwlock_timedrdlock [2] pwrite [2] 11119 pthread_attr_destroy [2] pthread_cond_init [2] pthread_kill 11120 [2] pthread_rwlock_timedwrlock [2] pwrite64 [3] 11121 pthread_attr_getdetachstate [2] pthread_cond_signal [2] 11122 pthread_mutex_destroy [2] pthread_rwlock_tryrdlock [2] 11123 sem_close [2] 11124 pthread_attr_getguardsize [2] pthread_cond_timedwait [2] 11125 pthread_mutex_init [2] pthread_rwlock_trywrlock [2] 11126 sem_destroy [2] 11127 pthread_attr_getschedparam [2] pthread_cond_wait [2] 11128 pthread_mutex_lock [2] pthread_rwlock_unlock [2] sem_getvalue 11129 [2] 11130 pthread_attr_getstack [2] pthread_condattr_destroy [2] 11131 pthread_mutex_trylock [2] pthread_rwlock_wrlock [2] sem_init 11132 [2] 11133 pthread_attr_getstackaddr [2] pthread_condattr_getpshared [2] 11134 pthread_mutex_unlock [2] pthread_rwlockattr_destroy [2] 11135 sem_open [2] 11136 pthread_attr_getstacksize [2] pthread_condattr_init [2] 11137 pthread_mutexattr_destroy [2] pthread_rwlockattr_getpshared 11138 [2] sem_post [2] 11139 pthread_attr_init [2] pthread_condattr_setpshared [2] 11140 pthread_mutexattr_getpshared [2] pthread_rwlockattr_init [2] 11141 sem_timedwait [2] 11142 pthread_attr_setdetachstate [2] pthread_create [2] 11143 pthread_mutexattr_gettype [2] pthread_rwlockattr_setpshared 11144 [2] sem_trywait [2] 11145 pthread_attr_setguardsize [2] pthread_detach [2] 11146 pthread_mutexattr_init [2] pthread_self [2] sem_unlink [2] 11147 pthread_attr_setschedparam [2] pthread_equal [2] 11148 pthread_mutexattr_setpshared [2] pthread_setcancelstate [2] 11149 sem_wait [2] 11150 pthread_attr_setstack [2] pthread_exit [2] 11151 pthread_mutexattr_settype [2] pthread_setcanceltype [2] 11152 pthread_attr_setstackaddr [2] pthread_getconcurrency [2] 11153 pthread_once [2] pthread_setconcurrency [2] 11154 11155 Referenced Specification(s) 11156 11157 [1]. this specification 11158 11159 [2]. ISO POSIX (2003) 11160 11161 [3]. Large File Support 11162 _________________________________________________________ 11163 11164 1.10. Data Definitions for libpthread 11165 11166 This section defines global identifiers and their values that 11167 are associated with interfaces contained in libpthread. These 11168 definitions are organized into groups that correspond to 11169 system headers. This convention is used as a convenience for 11170 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 11174 the referenced underlying specifications. 11175 11176 This specification uses ISO/IEC 9899 C Language as the 11177 reference programming language, and data definitions are 11178 specified in ISO C format. The C language is used here as a 11179 convenient notation. Using a C language description of these 11180 data objects does not preclude their use by other programming 11181 languages. 11182 _________________________________________________________ 11183 11184 1.10.1. pthread.h 11185 11186 #define PTHREAD_MUTEX_DEFAULT 1 11187 #define PTHREAD_MUTEX_NORMAL 1 11188 #define PTHREAD_MUTEX_RECURSIVE 2 11189 #define PTHREAD_RWLOCK_DEFAULT_NP 2 11190 #define PTHREAD_MUTEX_ERRORCHECK 3 11191 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(& _buffer, 11192 (execute));} 11193 #define __LOCK_INITIALIZER { 0, 0 } 11194 #define PTHREAD_RWLOCK_INITIALIZER { __LOCK_INITIALIZER, 0, NULL, 11195 NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE } 11196 #define PTHREAD_MUTEX_INITIALIZER {0,0,0,PTHREAD_MUTEX_NORMAL,__L 11197 OCK_INITIALIZER} 11198 #define pthread_cleanup_push(routine,arg) {struct _pthread_cleanu 11199 p_buffer _buffer;_pthread_cleanup_push(& _buffer,(routine),(arg)); 11200 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 11201 11202 struct _pthread_cleanup_buffer 11203 { 11204 void (*__routine) (void *); 11205 void *__arg; 11206 int __canceltype; 11207 struct _pthread_cleanup_buffer *__prev; 11208 } 11209 ; 11210 typedef unsigned int pthread_key_t; 11211 typedef int pthread_once_t; 11212 typedef long long __pthread_cond_align_t; 11213 11214 typedef unsigned long pthread_t; 11215 struct _pthread_fastlock 11216 { 11217 long __status; 11218 int __spinlock; 11219 } 11220 ; 11221 11222 typedef struct _pthread_descr_struct *_pthread_descr; 11223 11224 typedef struct 11225 { 11226 int __m_reserved; 11227 int __m_count; 11228 _pthread_descr __m_owner; 11229 int __m_kind; 11230 struct _pthread_fastlock __m_lock; 11231 } 11232 pthread_mutex_t; 11233 typedef struct 11234 { 11235 int __mutexkind; 11236 } 11237 pthread_mutexattr_t; 11238 11239 typedef struct 11240 { 11241 int __detachstate; 11242 int __schedpolicy; 11243 struct sched_param __schedparam; 11244 int __inheritsched; 11245 int __scope; 11246 size_t __guardsize; 11247 int __stackaddr_set; 11248 void *__stackaddr; 11249 unsigned long __stacksize; 11250 } 11251 pthread_attr_t; 11252 11253 typedef struct 11254 { 11255 struct _pthread_fastlock __c_lock; 11256 _pthread_descr __c_waiting; 11257 char __padding[48 - sizeof (struct _pthread_fastlock) - 11258 sizeof (_pthread_descr) - sizeof (__pthread_cond_align 11259 _t)]; 11260 __pthread_cond_align_t __align; 11261 } 11262 pthread_cond_t; 11263 typedef struct 11264 { 11265 int __dummy; 11266 } 11267 pthread_condattr_t; 11268 11269 typedef struct _pthread_rwlock_t 11270 { 11271 struct _pthread_fastlock __rw_lock; 11272 int __rw_readers; 11273 _pthread_descr __rw_writer; 11274 _pthread_descr __rw_read_waiting; 11275 _pthread_descr __rw_write_waiting; 11276 int __rw_kind; 11277 int __rw_pshared; 11278 } 11279 pthread_rwlock_t; 11280 typedef struct 11281 { 11282 int __lockkind; 11283 int __pshared; 11284 } 11285 pthread_rwlockattr_t; 11286 11287 #define PTHREAD_CREATE_JOINABLE 0 11288 #define PTHREAD_INHERIT_SCHED 0 11289 #define PTHREAD_ONCE_INIT 0 11290 #define PTHREAD_PROCESS_PRIVATE 0 11291 #define PTHREAD_CREATE_DETACHED 1 11292 #define PTHREAD_EXPLICIT_SCHED 1 11293 #define PTHREAD_PROCESS_SHARED 1 11294 11295 #define PTHREAD_CANCELED ((void*)-1) 11296 #define PTHREAD_CANCEL_DEFERRED 0 11297 #define PTHREAD_CANCEL_ENABLE 0 11298 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 11299 #define PTHREAD_CANCEL_DISABLE 1 11300 _________________________________________________________ 11301 11302 1.10.2. semaphore.h 11303 11304 typedef struct 11305 { 11306 struct _pthread_fastlock __sem_lock; 11307 int __sem_value; 11308 _pthread_descr __sem_waiting; 11309 } 11310 sem_t; 11311 #define SEM_FAILED ((sem_t*)0) 11312 11313 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 11314 _________________________________________________________ 11315 11316 1.11. Interface Definitions for libpthread 11317 11318 Table of Contents 11319 _pthread_cleanup_pop -- establish cancellation handlers 11320 _pthread_cleanup_push -- establish cancellation handlers 11321 11322 The following interfaces are included in libpthread and are 11323 defined by this specification. Unless otherwise noted, these 11324 interfaces shall be included in the source standard. 11325 11326 Other interfaces listed above for libpthread shall behave as 11327 described in the referenced base document. 11328 11329 _pthread_cleanup_pop 11330 11331 Name 11332 11333 _pthread_cleanup_pop -- establish cancellation handlers 11334 11335 Synopsis 11336 11337 #include 11338 11339 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 11340 int); 11341 11342 Description 11343 11344 The _pthread_cleanup_pop() function provides an implementation 11345 of the pthread_cleanup_pop() macro described in ISO POSIX 11346 (2003). 11347 11348 The _pthread_cleanup_pop() function is not in the source 11349 standard; it is only in the binary standard. 11350 11351 _pthread_cleanup_push 11352 11353 Name 11354 11355 _pthread_cleanup_push -- establish cancellation handlers 11356 11357 Synopsis 11358 11359 #include 11360 11361 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 11362 void (*) (void *), void *); 11363 11364 Description 11365 11366 The _pthread_cleanup_push() function provides an 11367 implementation of the pthread_cleanup_push() macro described 11368 in ISO POSIX (2003). 11369 11370 The _pthread_cleanup_push() function is not in the source 11371 standard; it is only in the binary standard. 11372 _________________________________________________________ 11373 11374 1.12. Interfaces for libgcc_s 11375 11376 Table 1-40 defines the library name and shared object name for 11377 the libgcc_s library 11378 11379 Table 1-40. libgcc_s Definition 11380 Library: libgcc_s 11381 SONAME: libgcc_s.so.1 11382 _________________________________________________________ 11383 11384 1.12.1. Unwind Library 11385 _________________________________________________________ 11386 11387 1.12.1.1. Interfaces for Unwind Library 11388 11389 No external functions are defined for libgcc_s - Unwind 11390 Library 11391 _________________________________________________________ 11392 11393 1.13. Data Definitions for libgcc_s 11394 11395 This section defines global identifiers and their values that 11396 are associated with interfaces contained in libgcc_s. These 11397 definitions are organized into groups that correspond to 11398 system headers. This convention is used as a convenience for 11399 the reader, and does not imply the existence of these headers, 11400 or their content. 11401 11402 These definitions are intended to supplement those provided in 11403 the referenced underlying specifications. 11404 11405 This specification uses ISO/IEC 9899 C Language as the 11406 reference programming language, and data definitions are 11407 specified in ISO C format. The C language is used here as a 11408 convenient notation. Using a C language description of these 11409 data objects does not preclude their use by other programming 11410 languages. 11411 _________________________________________________________ 11412 11413 1.13.1. unwind.h 11414 11415 struct dwarf_eh_base 11416 { 11417 void *tbase; 11418 void *dbase; 11419 void *func; 11420 } 11421 ; 11422 struct _Unwind_Context; 11423 11424 typedef unsigned int _Unwind_Ptr; 11425 typedef unsigned int _Unwind_Word; 11426 11427 typedef enum 11428 { 11429 _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_FATAL_PHASE2_ 11430 ERROR = 11431 2, _URC_FATAL_PHASE1_ERROR = 3, _URC_NORMAL_STOP = 4, _URC_END_OF_S 11432 TACK = 11433 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 11434 7, _URC_CONTINUE_UNWIND = 8 11435 } 11436 _Unwind_Reason_Code; 11437 11438 struct _Unwind_Exception 11439 { 11440 _Unwind_Exception_Class; 11441 _Unwind_Exception_Cleanup_Fn; 11442 _Unwind_Word; 11443 _Unwind_Word; 11444 } 11445 ; 11446 #define _UA_SEARCH_PHASE 1 11447 #define _UA_END_OF_STACK 16 11448 #define _UA_CLEANUP_PHASE 2 11449 #define _UA_HANDLER_FRAME 4 11450 #define _UA_FORCE_UNWIND 8 11451 _________________________________________________________ 11452 11453 1.14. Interfaces for libdl 11454 11455 Table 1-41 defines the library name and shared object name for 11456 the libdl library 11457 11458 Table 1-41. libdl Definition 11459 Library: libdl 11460 SONAME: libdl.so.2 11461 11462 The behavior of the interfaces in this library is specified by 11463 the following specifications: 11464 11465 this specification 11466 ISO POSIX (2003) 11467 _________________________________________________________ 11468 11469 1.14.1. Dynamic Loader 11470 _________________________________________________________ 11471 11472 1.14.1.1. Interfaces for Dynamic Loader 11473 11474 An LSB conforming implementation shall provide the generic 11475 functions for Dynamic Loader specified in Table 1-42, with the 11476 full functionality as described in the referenced underlying 11477 specification. 11478 11479 Table 1-42. libdl - Dynamic Loader Function Interfaces 11480 dladdr [1] dlclose [2] dlerror [2] dlopen [1] dlsym [1] 11481 11482 Referenced Specification(s) 11483 11484 [1]. this specification 11485 11486 [2]. ISO POSIX (2003) 11487 _________________________________________________________ 11488 11489 1.15. Data Definitions for libdl 11490 11491 This section defines global identifiers and their values that 11492 are associated with interfaces contained in libdl. These 11493 definitions are organized into groups that correspond to 11494 system headers. This convention is used as a convenience for 11495 the reader, and does not imply the existence of these headers, 11496 or their content. 11497 11498 These definitions are intended to supplement those provided in 11499 the referenced underlying specifications. 11500 11501 This specification uses ISO/IEC 9899 C Language as the 11502 reference programming language, and data definitions are 11503 specified in ISO C format. The C language is used here as a 11504 convenient notation. Using a C language description of these 11505 data objects does not preclude their use by other programming 11506 languages. 11507 _________________________________________________________ 11508 11509 1.15.1. dlfcn.h 11510 11511 #define RTLD_NEXT ((void *) -1l) 11512 #define RTLD_LOCAL 0 11513 #define RTLD_LAZY 0x00001 11514 #define RTLD_NOW 0x00002 11515 #define RTLD_GLOBAL 0x00100 11516 11517 typedef struct 11518 { 11519 char *dli_fname; 11520 void *dli_fbase; 11521 char *dli_sname; 11522 void *dli_saddr; 11523 } 11524 Dl_info; 11525 _________________________________________________________ 11526 11527 1.16. Interface Definitions for libdl 11528 11529 Table of Contents 11530 dladdr -- find the shared object containing a given address 11531 dlopen -- open dynamic object 11532 dlsym -- obtain the address of a symbol from a dlopen object 11533 11534 The following interfaces are included in libdl and are defined 11535 by this specification. Unless otherwise noted, these 11536 interfaces shall be included in the source standard. 11537 11538 Other interfaces listed above for libdl shall behave as 11539 described in the referenced base document. 11540 11541 dladdr 11542 11543 Name 11544 11545 dladdr -- find the shared object containing a given address 11546 11547 Synopsis 11548 11549 #include 11550 11551 typedef struct { 11552 const char *dli_fname; 11553 void *dli_fbase; 11554 const char *dli_sname; 11555 void *dli_saddr; 11556 } Dl_info; 11557 11558 int dladdr(const void * addr, Dl_info * dlip); 11559 11560 Description 11561 11562 The dladdr() function shall query the dynamic linker for 11563 information about the shared object containing the address 11564 addr. The information shall be returned in the user supplied 11565 data structure referenced by dlip. 11566 11567 The structure shall contain at least the following members: 11568 11569 dli_fname 11570 The pathname of the shared object containing the 11571 address 11572 11573 dli_fbase 11574 The base address at which the shared object is mapped 11575 into the address space of the calling process. 11576 11577 dli_sname 11578 The name of the nearest runtime symbol with value less 11579 than or equal to addr. Where possible, the symbol name 11580 shall be returned as it would appear in C source code. 11581 11582 If no symbol with a suitable value is found, both this 11583 field and dli_saddr shall be set to NULL. 11584 11585 dli_saddr 11586 The address of the symbol returned in dli_sname. 11587 11588 The behavior of dladdr() is only specified in dynamically 11589 linked programs. 11590 11591 Return Value 11592 11593 On success, dladdr() shall return non-zero, and the structure 11594 referenced by dlip shall be filled in as described. Otherwise, 11595 dladdr() shall return zero, and the cause of the error can be 11596 fetched with dlerr(). 11597 11598 Errors 11599 11600 See dlerr(). 11601 11602 Environment 11603 11604 LD_LIBRARY_PATH 11605 directory search-path for object files 11606 11607 dlopen 11608 11609 Name 11610 11611 dlopen -- open dynamic object 11612 11613 Synopsis 11614 11615 #include 11616 11617 void * dlopen(const char * filename, int flag); 11618 11619 Description 11620 11621 dlopen shall behave as specified in ISO POSIX (2003), but with 11622 additional behaviors listed below. 11623 11624 If the file argument does not contain a slash character, then 11625 the system shall look for a library of that name in at least 11626 the following directories, and use the first one which is 11627 found: 11628 11629 * The directories specified by the DT_RPATH dynamic entry. 11630 * The directories specified in the LD_LIBRARY_PATH 11631 environment variable (which is a colon separated list of 11632 pathnames). This step shall be skipped for setuid and 11633 setgid executables. 11634 * A set of directories sufficient to contain the libraries 11635 specified in this standard. 11636 11637 Note: Traditionally, /lib and /usr/lib. This case would 11638 also cover cases in which the system used the mechanism of 11639 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 11640 Example: An application which is not linked against libm 11641 may choose to dlopen libm. 11642 11643 dlsym 11644 11645 Name 11646 11647 dlsym -- obtain the address of a symbol from a dlopen object 11648 11649 Description 11650 11651 dlsym() is as specified in the ISO POSIX (2003), but with 11652 differences as listed below. 11653 11654 The special purpose value for handle RTLD_NEXT 11655 11656 The value RTLD_NEXT, which is reserved for future use shall be 11657 available, with the behavior as described in ISO POSIX (2003). 11658 _________________________________________________________ 11659 11660 1.17. Interfaces for libcrypt 11661 11662 Table 1-43 defines the library name and shared object name for 11663 the libcrypt library 11664 11665 Table 1-43. libcrypt Definition 11666 Library: libcrypt 11667 SONAME: libcrypt.so.1 11668 11669 The behavior of the interfaces in this library is specified by 11670 the following specifications: 11671 11672 ISO POSIX (2003) 11673 _________________________________________________________ 11674 11675 1.17.1. Encryption 11676 _________________________________________________________ 11677 11678 1.17.1.1. Interfaces for Encryption 11679 11680 An LSB conforming implementation shall provide the generic 11681 functions for Encryption specified in Table 1-44, with the 11682 full functionality as described in the referenced underlying 11683 specification. 11684 11685 Table 1-44. libcrypt - Encryption Function Interfaces 11686 crypt [1] encrypt [1] setkey [1] 11687 11688 Referenced Specification(s) 11689 11690 [1]. ISO POSIX (2003) 11691 _________________________________________________________ 11692 11693 1.18. Interfaces for libpam 11694 11695 Table 1-45 defines the library name and shared object name for 11696 the libpam library 11697 11698 Table 1-45. libpam Definition 11699 Library: libpam 11700 SONAME: libpam.so.0 11701 11702 A single service name, other, shall always be present. The 11703 behavior of this service shall be determined by the system 11704 administrator. Additional service names may also exist. [1] 11705 11706 The behavior of the interfaces in this library is specified by 11707 the following specifications: 11708 11709 this specification 11710 _________________________________________________________ 11711 11712 1.18.1. Pluggable Authentication API 11713 _________________________________________________________ 11714 11715 1.18.1.1. Interfaces for Pluggable Authentication API 11716 11717 An LSB conforming implementation shall provide the generic 11718 functions for Pluggable Authentication API specified in Table 11719 1-46, with the full functionality as described in the 11720 referenced underlying specification. 11721 11722 Table 1-46. libpam - Pluggable Authentication API Function 11723 Interfaces 11724 pam_acct_mgmt [1] pam_close_session [1] pam_get_item [1] 11725 pam_set_item [1] pam_strerror [1] 11726 pam_authenticate [1] pam_end [1] pam_getenvlist [1] 11727 pam_setcred [1] 11728 pam_chauthtok [1] pam_fail_delay [1] pam_open_session [1] 11729 pam_start [1] 11730 11731 Referenced Specification(s) 11732 11733 [1]. this specification 11734 _________________________________________________________ 11735 11736 1.19. Data Definitions for libpam 11737 11738 This section defines global identifiers and their values that 11739 are associated with interfaces contained in libpam. These 11740 definitions are organized into groups that correspond to 11741 system headers. This convention is used as a convenience for 11742 the reader, and does not imply the existence of these headers, 11743 or their content. 11744 11745 These definitions are intended to supplement those provided in 11746 the referenced underlying specifications. 11747 11748 This specification uses ISO/IEC 9899 C Language as the 11749 reference programming language, and data definitions are 11750 specified in ISO C format. The C language is used here as a 11751 convenient notation. Using a C language description of these 11752 data objects does not preclude their use by other programming 11753 languages. 11754 _________________________________________________________ 11755 11756 1.19.1. security/pam_appl.h 11757 11758 typedef struct pam_handle pam_handle_t; 11759 struct pam_message 11760 { 11761 int msg_style; 11762 const char *msg; 11763 } 11764 ; 11765 struct pam_response 11766 { 11767 char *resp; 11768 int resp_retcode; 11769 } 11770 ; 11771 11772 struct pam_conv 11773 { 11774 int (*conv) (int num_msg, const struct pam_message * *msg, 11775 struct pam_response * *resp, void *appdata_ptr); 11776 void *appdata_ptr; 11777 } 11778 ; 11779 #define PAM_PROMPT_ECHO_OFF 1 11780 #define PAM_PROMPT_ECHO_ON 2 11781 #define PAM_ERROR_MSG 3 11782 #define PAM_TEXT_INFO 4 11783 11784 #define PAM_SERVICE 1 11785 #define PAM_USER 2 11786 #define PAM_TTY 3 11787 #define PAM_RHOST 4 11788 #define PAM_CONV 5 11789 #define PAM_RUSER 8 11790 #define PAM_USER_PROMPT 9 11791 11792 #define PAM_SUCCESS 0 11793 #define PAM_OPEN_ERR 1 11794 #define PAM_USER_UNKNOWN 10 11795 #define PAM_MAXTRIES 11 11796 #define PAM_NEW_AUTHTOK_REQD 12 11797 #define PAM_ACCT_EXPIRED 13 11798 #define PAM_SESSION_ERR 14 11799 #define PAM_CRED_UNAVAIL 15 11800 #define PAM_CRED_EXPIRED 16 11801 #define PAM_CRED_ERR 17 11802 #define PAM_CONV_ERR 19 11803 #define PAM_SYMBOL_ERR 2 11804 #define PAM_AUTHTOK_ERR 20 11805 #define PAM_AUTHTOK_RECOVER_ERR 21 11806 #define PAM_AUTHTOK_LOCK_BUSY 22 11807 #define PAM_AUTHTOK_DISABLE_AGING 23 11808 #define PAM_TRY_AGAIN 24 11809 #define PAM_ABORT 26 11810 #define PAM_AUTHTOK_EXPIRED 27 11811 #define PAM_BAD_ITEM 29 11812 #define PAM_SERVICE_ERR 3 11813 #define PAM_SYSTEM_ERR 4 11814 #define PAM_BUF_ERR 5 11815 #define PAM_PERM_DENIED 6 11816 #define PAM_AUTH_ERR 7 11817 #define PAM_CRED_INSUFFICIENT 8 11818 #define PAM_AUTHINFO_UNAVAIL 9 11819 11820 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 11821 #define PAM_ESTABLISH_CRED 0x0002U 11822 #define PAM_DELETE_CRED 0x0004U 11823 #define PAM_REINITIALIZE_CRED 0x0008U 11824 #define PAM_REFRESH_CRED 0x0010U 11825 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 11826 #define PAM_SILENT 0x8000U 11827 _________________________________________________________ 11828 11829 1.20. Interface Definitions for libpam 11830 11831 Table of Contents 11832 pam_acct_mgmt -- establish the status of a user's account 11833 pam_authenticate -- authenticate the user 11834 pam_chauthtok -- change the authentication token for a given 11835 user 11836 11837 pam_close_session -- indicate that an authenticated session 11838 has ended 11839 11840 pam_end -- terminate the use of the PAM library 11841 pam_fail_delay -- specify delay time to use on authentication 11842 error 11843 11844 pam_get_item -- obtain the value of the indicated item. 11845 pam_getenvlist -- returns a pointer to the complete PAM 11846 environment. 11847 11848 pam_open_session -- used to indicate that an authenticated 11849 session has been initiated 11850 11851 pam_set_item -- (re)set the value of an item. 11852 pam_setcred -- set the module-specific credentials of the user 11853 pam_start -- initialize the PAM library 11854 pam_strerror -- returns a string describing the PAM error 11855 11856 The following interfaces are included in libpam and are 11857 defined by this specification. Unless otherwise noted, these 11858 interfaces shall be included in the source standard. 11859 11860 Other interfaces listed above for libpam shall behave as 11861 described in the referenced base document. 11862 11863 pam_acct_mgmt 11864 11865 Name 11866 11867 pam_acct_mgmt -- establish the status of a user's account 11868 11869 Synopsis 11870 11871 #include 11872 11873 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 11874 11875 Description 11876 11877 pam_acct_mgmt() establishes the account's usability and the 11878 user's accessibility to the system. It is typically called 11879 after the user has been authenticated. 11880 11881 flags may be specified as any valid flag (namely, one of those 11882 applicable to the flags argument of pam_authenticate()). 11883 Additionally, the value of flags may be logically or'd with 11884 PAM_SILENT. 11885 11886 Return Value 11887 11888 PAM_SUCCESS 11889 Success. 11890 11891 PAM_NEW_AUTHTOK_REQD 11892 User is valid, but user's authentication token has 11893 expired. The correct response to this return-value is 11894 to require that the user satisfy the pam_chauthtok() 11895 function before obtaining service. It may not be 11896 possible for an application to do this. In such a case, 11897 the user should be denied access until the account 11898 password is updated. 11899 11900 PAM_ACCT_EXPIRED 11901 User is no longer permitted access to the system. 11902 11903 PAM_AUTH_ERR 11904 Authentication error. 11905 11906 PAM_PERM_DENIED 11907 User is not permitted to gain access at this time. 11908 11909 PAM_USER_UNKNOWN 11910 User is not known to a module's account management 11911 component. 11912 11913 Errors 11914 11915 May be translated to text with pam_strerror(). 11916 11917 pam_authenticate 11918 11919 Name 11920 11921 pam_authenticate -- authenticate the user 11922 11923 Synopsis 11924 11925 #include 11926 11927 int pam_authenticate(pam_handle_t * pamh, int flags); 11928 11929 Description 11930 11931 pam_authenticate() serves as an interface to the 11932 authentication mechanisms of the loaded modules. 11933 11934 flags is an optional parameter that may be specified by the 11935 following value: 11936 11937 PAM_DISALLOW_NULL_AUTHTOK 11938 Instruct the authentication modules to return 11939 PAM_AUTH_ERR if the user does not have a registered 11940 authorization token. 11941 11942 Additionally, the value of flags may be logically or'd with 11943 PAM_SILENT. 11944 11945 The process may need to be privileged in order to successfully 11946 call this function. 11947 11948 Return Value 11949 11950 PAM_SUCCESS 11951 Success. 11952 11953 PAM_AUTH_ERR 11954 User was not authenticated or process did not have 11955 sufficient privileges to perform authentication. 11956 11957 PAM_CRED_INSUFFICIENT 11958 Application does not have sufficient credentials to 11959 authenticate the user. 11960 11961 PAM_AUTHINFO_UNAVAIL 11962 Modules were not able to access the authentication 11963 information. This might be due to a network or hardware 11964 failure, etc. 11965 11966 PAM_USER_UNKNOWN 11967 Supplied username is not known to the authentication 11968 service. 11969 11970 PAM_MAXTRIES 11971 One or more authentication modules has reached its 11972 limit of tries authenticating the user. Do not try 11973 again. 11974 11975 PAM_ABORT 11976 One or more authentication modules failed to load. 11977 11978 Errors 11979 11980 May be translated to text with pam_strerror(). 11981 11982 pam_chauthtok 11983 11984 Name 11985 11986 pam_chauthtok -- change the authentication token for a given 11987 user 11988 11989 Synopsis 11990 11991 #include 11992 11993 int pam_chauthtok(pam_handle_t * pamh, const int flags); 11994 11995 Description 11996 11997 pam_chauthtok() is used to change the authentication token for 11998 a given user as indicated by the state associated with the 11999 handle pamh. 12000 12001 flags is an optional parameter that may be specified by the 12002 following value: 12003 12004 PAM_CHANGE_EXPIRED_AUTHTOK 12005 User's authentication token should only be changed if 12006 it has expired. 12007 12008 Additionally, the value of flags may be logically or'd with 12009 PAM_SILENT. 12010 12011 RETURN VALUE 12012 12013 PAM_SUCCESS 12014 Success. 12015 12016 PAM_AUTHTOK_ERR 12017 A module was unable to obtain the new authentication 12018 token. 12019 12020 PAM_AUTHTOK_RECOVER_ERR 12021 A module was unable to obtain the old authentication 12022 token. 12023 12024 PAM_AUTHTOK_LOCK_BUSY 12025 One or more modules were unable to change the 12026 authentication token since it is currently locked. 12027 12028 PAM_AUTHTOK_DISABLE_AGING 12029 Authentication token aging has been disabled for at 12030 least one of the modules. 12031 12032 PAM_PERM_DENIED 12033 Permission denied. 12034 12035 PAM_TRY_AGAIN 12036 Not all modules were in a position to update the 12037 authentication token(s). In such a case, none of the 12038 user's authentication tokens are updated. 12039 12040 PAM_USER_UNKNOWN 12041 User is not known to the authentication token changing 12042 service. 12043 12044 ERRORS 12045 12046 May be translated to text with pam_strerror(). 12047 12048 pam_close_session 12049 12050 Name 12051 12052 pam_close_session -- indicate that an authenticated session 12053 has ended 12054 12055 Synopsis 12056 12057 #include 12058 12059 int pam_close_session(pam_handle_t * pamh, int flags); 12060 12061 Description 12062 12063 pam_close_session() is used to indicate that an authenticated 12064 session has ended. It is used to inform the module that the 12065 user is exiting a session. It should be possible for the PAM 12066 library to open a session and close the same session from 12067 different applications. 12068 12069 flags may have the value PAM_SILENT to indicate that no output 12070 should be generated as a result of this function call. 12071 12072 Return Value 12073 12074 PAM_SUCCESS 12075 Success. 12076 12077 PAM_SESSION_ERR 12078 One of the required loaded modules was unable to close 12079 a session for the user. 12080 12081 Errors 12082 12083 May be translated to text with pam_strerror(). 12084 12085 pam_end 12086 12087 Name 12088 12089 pam_end -- terminate the use of the PAM library 12090 12091 Synopsis 12092 12093 #include 12094 12095 int pam_end(pam_handle_t * pamh, int pam_status); 12096 12097 Description 12098 12099 pam_end() terminates use of the PAM library. On success, the 12100 contents of *pamh are no longer valid, and all memory 12101 associated with it is invalid. 12102 12103 Normally, pam_status is passed the value PAM_SUCCESS, but in 12104 the event of an unsuccessful service application, the 12105 appropriate PAM error return value should be used. 12106 12107 Return Value 12108 12109 PAM_SUCCESS 12110 Success. 12111 12112 Errors 12113 12114 May be translated to text with pam_strerror(). 12115 12116 pam_fail_delay 12117 12118 Name 12119 12120 pam_fail_delay -- specify delay time to use on authentication 12121 error 12122 12123 Synopsis 12124 12125 #include 12126 12127 int pam_fail_delay(pam_handle_t * pamh, unsigned int 12128 micro_sec); 12129 12130 Description 12131 12132 pam_fail_delay() specifies the minimum delay for the PAM 12133 library to use when an authentication error occurs. The actual 12134 delay can vary by as much at 25%. If this function is called 12135 multiple times, the longest time specified by any of the call 12136 will be used. 12137 12138 The delay is invoked if an authentication error occurs during 12139 the pam_authenticate() or pam_chauthtok() function calls. 12140 12141 Independent of the success of pam_authenticate() or 12142 pam_chauthtok(), the delay time is reset to its default value 12143 of 0 when the PAM library returns control to the application 12144 from these two functions. 12145 12146 Return Value 12147 12148 PAM_SUCCESS 12149 Success. 12150 12151 Errors 12152 12153 May be translated to text with pam_strerror(). 12154 12155 pam_get_item 12156 12157 Name 12158 12159 pam_get_item -- obtain the value of the indicated item. 12160 12161 Synopsis 12162 12163 #include 12164 12165 int pam_get_item(const pam_handle_t * pamh, int item_type, 12166 const void * * item); 12167 12168 Description 12169 12170 pam_get_item() obtains the value of the indicated item_type. 12171 The possible values of item_type are the same as listed for 12172 pam_set_item(). 12173 12174 On success, item contains a pointer to the value of the 12175 corresponding item. Note that this is a pointer to the actual 12176 data and should not be free()'d or over-written. 12177 12178 Return Value 12179 12180 PAM_SUCCESS 12181 Success. 12182 12183 PAM_PERM_DENIED 12184 Application passed a NULL pointer for item. 12185 12186 PAM_BAD_ITEM 12187 Application attempted to get an undefined item. 12188 12189 Errors 12190 12191 May be translated to text with pam_strerror(). 12192 12193 pam_getenvlist 12194 12195 Name 12196 12197 pam_getenvlist -- returns a pointer to the complete PAM 12198 environment. 12199 12200 Synopsis 12201 12202 #include 12203 12204 char * const * pam_getenvlist(pam_handle_t * pamh); 12205 12206 Description 12207 12208 pam_getenvlist() returns a pointer to the complete PAM 12209 environment. This pointer points to an array of pointers to 12210 NUL-terminated strings and must be terminated by a NULL 12211 pointer. Each string has the form "name=value". 12212 12213 The PAM library module allocates memory for the returned value 12214 and the associated strings. The calling application is 12215 responsible for freeing this memory. 12216 12217 Return Value 12218 12219 pam_getenvlist() returns an array of string pointers 12220 containing the PAM environment. On error, NULL is returned. 12221 12222 pam_open_session 12223 12224 Name 12225 12226 pam_open_session -- used to indicate that an authenticated 12227 session has been initiated 12228 12229 Synopsis 12230 12231 #include 12232 12233 int pam_open_session(pam_handle_t * pamh, int flags); 12234 12235 Description 12236 12237 pam_handle_t() is used to indicate that an authenticated 12238 session has begun. It is used to inform the module that the 12239 user is currently in a session. It should be possible for the 12240 PAM library to open a session and close the same session from 12241 different applications. 12242 12243 flags may have the value PAM_SILENT to indicate that no output 12244 be generated as a rsult of this function call. 12245 12246 Return Value 12247 12248 PAM_SUCCESS 12249 Success. 12250 12251 PAM_SESSION_ERR 12252 One of the loaded modules was unable to open a session 12253 for the user. 12254 12255 ERRORS 12256 12257 May be translated to text with pam_strerror(). 12258 12259 pam_set_item 12260 12261 Name 12262 12263 pam_set_item -- (re)set the value of an item. 12264 12265 Synopsis 12266 12267 #include 12268 12269 int pam_set_item(pam_handle_t * pamh, int item_type, const 12270 void * item); 12271 12272 Description 12273 12274 pam_set_item() (re)sets the value of one of the following 12275 item_types: 12276 12277 PAM_SERVICE 12278 service name 12279 12280 PAM_USER 12281 user name 12282 12283 PAM_TTY 12284 terminal name 12285 12286 The value for a device file should include the /dev/ 12287 prefix. The value for graphical, X-based, applications 12288 should be the $DISPLAY variable. 12289 12290 PAM_RHOST 12291 remote host name 12292 12293 PAM_CONV 12294 conversation structure 12295 12296 PAM_RUSER 12297 remote user name 12298 12299 PAM_USER_PROMPT 12300 string to be used when prompting for a user's name 12301 12302 The default value for this string is Please enter 12303 username: . 12304 12305 For all item_types other than PAM_CONV, item is a pointer to a 12306 NULL-terminated character string. In the case of PAM_CONV, 12307 item points to an initialized pam_conv structure. 12308 12309 Return Value 12310 12311 PAM_SUCCESS 12312 Success. 12313 12314 PAM_PERM_DENIED 12315 An attempt was made to replace the conversation 12316 structure with a NULL value. 12317 12318 PAM_BUF_ERR 12319 Function ran out of memory making a copy of the item. 12320 12321 PAM_BAD_ITEM 12322 Application attempted to set an undefined item. 12323 12324 Errors 12325 12326 May be translated to text with pam_strerror(). 12327 12328 pam_setcred 12329 12330 Name 12331 12332 pam_setcred -- set the module-specific credentials of the user 12333 12334 Synopsis 12335 12336 #include 12337 12338 extern int pam_setcred(pam_handle_t * pamh, int flags); 12339 12340 Description 12341 12342 pam_setcred() sets the module-specific credentials of the 12343 user. It is usually called after the user has been 12344 authenticated, after the account management function has been 12345 called and after a session has been opened for the user. 12346 12347 flags maybe specified from among the following values: 12348 12349 PAM_ESTABLISH_CRED 12350 set credentials for the authentication service 12351 12352 PAM_DELETE_CRED 12353 delete credentials associated with the authentication 12354 service 12355 12356 PAM_REINITIALIZE_CRED 12357 reinitialize the user credentials 12358 12359 PAM_REFRESH_CRED 12360 extend lifetime of the user credentials 12361 12362 Additionally, the value of flags may be logically or'd with 12363 PAM_SILENT. 12364 12365 Return Value 12366 12367 PAM_SUCCESS 12368 Success. 12369 12370 PAM_CRED_UNAVAIL 12371 Module cannot retrieve the user's credentials. 12372 12373 PAM_CRED_EXPIRED 12374 User's credentials have expired. 12375 12376 PAM_USER_UNKNOWN 12377 User is not known to an authentication module. 12378 12379 PAM_CRED_ERR 12380 Module was unable to set the credentials of the user. 12381 12382 Errors 12383 12384 May be translated to text with pam_strerror(). 12385 12386 pam_start 12387 12388 Name 12389 12390 pam_start -- initialize the PAM library 12391 12392 Synopsis 12393 12394 #include 12395 12396 int pam_start(const char * service_name, const char * user, 12397 const struct pam_conv * pam_conversation, pam_handle_t * * 12398 pamh); 12399 12400 Description 12401 12402 pam_start() is used to initialize the PAM library. It must be 12403 called prior to any other usage of the PAM library. On 12404 success, *pamh becomes a handle that provides continuity for 12405 successive calls to the PAM library. pam_start() expects 12406 arguments as follows: the service_name of the program, the 12407 username of the individual to be authenticated, a pointer to 12408 an application-supplied pam_conv structure, and a pointer to a 12409 pam_handle_t pointer. 12410 12411 An application must provide the conversation function used for 12412 direct communication between a loaded module and the 12413 application. The application also typically provides a means 12414 for the module to prompt the user for a password, etc. 12415 12416 The structure, pam_conv, is defined to be, 12417 struct pam_conv { 12418 int (*conv) (int num_msg, 12419 const struct pam_message * *msg, 12420 struct pam_response * *resp, 12421 void *appdata_ptr); 12422 void *appdata_ptr; 12423 }; 12424 12425 It is initialized by the application before it is passed to 12426 the library. The contents of this structure are attached to 12427 the *pamh handle. The point of this argument is to provide a 12428 mechanism for any loaded module to interact directly with the 12429 application program; this is why it is called a conversation 12430 structure. 12431 12432 When a module calls the referenced conv() function, 12433 appdata_ptr is set to the second element of this structure. 12434 12435 The other arguments of a call to conv() concern the 12436 information exchanged by module and application. num_msg holds 12437 the length of the array of pointers passed via msg. On 12438 success, the pointer resp points to an array of num_msg 12439 pam_response structures, holding the application-supplied 12440 text. Note that resp is a struct pam_response array and not an 12441 array of pointers. 12442 12443 Return Value 12444 12445 PAM_SUCCESS 12446 Success. 12447 12448 PAM_BUF_ERR 12449 Memory allocation error. 12450 12451 PAM_ABORT 12452 Internal failure. 12453 12454 ERRORS 12455 12456 May be translated to text with pam_strerror(). 12457 12458 pam_strerror 12459 12460 Name 12461 12462 pam_strerror -- returns a string describing the PAM error 12463 12464 Synopsis 12465 12466 #include 12467 12468 const char * pam_strerror(pam_handle_t * pamh, int errnum); 12469 12470 Description 12471 12472 pam_strerror() returns a string describing the PAM error 12473 associated with errnum. 12474 12475 Return Value 12476 12477 On success, this function returns a description of the 12478 indicated error. The application should not free or modify 12479 this string. Otherwise, a string indicating that the error is 12480 unknown shall be returned. It is unspecified whether or not 12481 the string returned is translated according to the setting of 12482 LC_MESSAGES. 12483 12484 II. Utility Libraries 12485 12486 Table of Contents 12487 2. Utility Libraries 12488 _________________________________________________________ 12489 12490 Chapter 2. Utility Libraries 12491 12492 An LSB-conforming implementation shall also support some 12493 utility libraries which are built on top of the interfaces 12494 provided by the base libraries. These libraries implement 12495 common functionality, and hide additional system dependent 12496 information such as file formats and device names. 12497 _________________________________________________________ 12498 12499 2.1. Interfaces for libz 12500 12501 Table 2-1 defines the library name and shared object name for 12502 the libz library 12503 12504 Table 2-1. libz Definition 12505 Library: libz 12506 SONAME: libz.so.1 12507 12508 The behavior of the interfaces in this library is specified by 12509 the following specifications: 12510 12511 this specification 12512 _________________________________________________________ 12513 12514 2.1.1. Compression Library 12515 _________________________________________________________ 12516 12517 2.1.1.1. Interfaces for Compression Library 12518 12519 An LSB conforming implementation shall provide the generic 12520 functions for Compression Library specified in Table 2-2, with 12521 the full functionality as described in the referenced 12522 underlying specification. 12523 12524 Table 2-2. libz - Compression Library Function Interfaces 12525 adler32 [1] deflateInit2_ [1] gzerror [1] gzrewind [1] 12526 inflateReset [1] 12527 compress [1] deflateInit_ [1] gzflush [1] gzseek [1] 12528 inflateSetDictionary [1] 12529 compress2 [1] deflateParams [1] gzgetc [1] gzsetparams [1] 12530 inflateSync [1] 12531 compressBound [1] deflateReset [1] gzgets [1] gztell [1] 12532 inflateSyncPoint [1] 12533 crc32 [1] deflateSetDictionary [1] gzopen [1] gzwrite [1] 12534 uncompress [1] 12535 deflate [1] get_crc_table [1] gzprintf [1] inflate [1] zError 12536 [1] 12537 deflateBound [1] gzclose [1] gzputc [1] inflateEnd [1] 12538 zlibVersion [1] 12539 deflateCopy [1] gzdopen [1] gzputs [1] inflateInit2_ [1] 12540 deflateEnd [1] gzeof [1] gzread [1] inflateInit_ [1] 12541 12542 Referenced Specification(s) 12543 12544 [1]. this specification 12545 _________________________________________________________ 12546 12547 2.2. Data Definitions for libz 12548 12549 This section defines global identifiers and their values that 12550 are associated with interfaces contained in libz. These 12551 definitions are organized into groups that correspond to 12552 system headers. This convention is used as a convenience for 12553 the reader, and does not imply the existence of these headers, 12554 or their content. 12555 12556 These definitions are intended to supplement those provided in 12557 the referenced underlying specifications. 12558 12559 This specification uses ISO/IEC 9899 C Language as the 12560 reference programming language, and data definitions are 12561 specified in ISO C format. The C language is used here as a 12562 convenient notation. Using a C language description of these 12563 data objects does not preclude their use by other programming 12564 languages. 12565 _________________________________________________________ 12566 12567 2.2.1. zlib.h 12568 12569 In addition to the values below, the zlib.h header shall 12570 define the ZLIB_VERSION macro. This macro may be used to check 12571 that the version of the library at run time matches that at 12572 compile time. 12573 12574 See also the zlibVersion() function, which returns the library 12575 version at run time. The first character of the version at 12576 compile time should always match the first character at run 12577 time. 12578 #define Z_NULL 0 12579 #define MAX_WBITS 15 12580 #define MAX_MEM_LEVEL 9 12581 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) 12582 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy 12583 ),ZLIB_VERSION,sizeof(z_stream)) 12584 #define deflateInit(strm,level) deflateInit_((strm), (level), ZLI 12585 B_VERSION, sizeof(z_stream)) 12586 #define inflateInit2(strm,windowBits) inflateInit2_((strm), (windowBi 12587 ts), ZLIB_VERSION, sizeof(z_stream)) 12588 #define inflateInit(strm) inflateInit_((strm), ZLI 12589 B_VERSION, sizeof(z_stream)) 12590 12591 typedef char charf; 12592 typedef int intf; 12593 12594 typedef void *voidpf; 12595 typedef unsigned int uInt; 12596 typedef unsigned long uLong; 12597 typedef uLong uLongf; 12598 typedef void *voidp; 12599 typedef unsigned char Byte; 12600 typedef off_t z_off_t; 12601 typedef void *const voidpc; 12602 12603 typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size); 12604 typedef void (*free_func) (voidpf opaque, voidpf address); 12605 struct internal_state 12606 { 12607 int dummy; 12608 } 12609 ; 12610 typedef Byte Bytef; 12611 typedef uInt uIntf; 12612 12613 typedef struct z_stream_s 12614 { 12615 Bytef *next_in; 12616 uInt avail_in; 12617 uLong total_in; 12618 Bytef *next_out; 12619 uInt avail_out; 12620 uLong total_out; 12621 char *msg; 12622 struct internal_state *state; 12623 alloc_func zalloc; 12624 free_func zfree; 12625 voidpf opaque; 12626 int data_type; 12627 uLong adler; 12628 uLong reserved; 12629 } 12630 z_stream; 12631 12632 typedef z_stream *z_streamp; 12633 typedef voidp gzFile; 12634 #define Z_NO_FLUSH 0 12635 #define Z_PARTIAL_FLUSH 1 12636 #define Z_SYNC_FLUSH 2 12637 #define Z_FULL_FLUSH 3 12638 #define Z_FINISH 4 12639 12640 #define Z_ERRNO (-1) 12641 #define Z_STREAM_ERROR (-2) 12642 #define Z_DATA_ERROR (-3) 12643 #define Z_MEM_ERROR (-4) 12644 #define Z_BUF_ERROR (-5) 12645 #define Z_VERSION_ERROR (-6) 12646 #define Z_OK 0 12647 #define Z_STREAM_END 1 12648 #define Z_NEED_DICT 2 12649 12650 #define Z_DEFAULT_COMPRESSION (-1) 12651 #define Z_NO_COMPRESSION 0 12652 #define Z_BEST_SPEED 1 12653 #define Z_BEST_COMPRESSION 9 12654 12655 #define Z_DEFAULT_STRATEGY 0 12656 #define Z_FILTERED 1 12657 #define Z_HUFFMAN_ONLY 2 12658 12659 #define Z_BINARY 0 12660 #define Z_ASCII 1 12661 #define Z_UNKNOWN 2 12662 12663 #define Z_DEFLATED 8 12664 _________________________________________________________ 12665 12666 2.3. Interface Definitions for libz 12667 12668 Table of Contents 12669 adler32 -- Compute Adler 32 Checksum 12670 compress -- compress data 12671 compress2 -- compress data at a specified level 12672 compressBound -- compute compressed data size 12673 crc32 -- Compute CRC-32 Checksum 12674 deflate -- compress data 12675 deflateBound -- compute compressed data size 12676 deflateCopy -- copy compression stream 12677 deflateEnd -- free compression stream state 12678 deflateInit2_ -- initialize compression system 12679 deflateInit_ -- initialize compression system 12680 deflateParams -- set compression parameters 12681 deflateReset -- reset compression stream state 12682 deflateSetDictionary -- initialize compression dictionary 12683 get_crc_table -- generate a table for crc calculations 12684 gzclose -- close a compressed file stream 12685 gzdopen -- open a compressed file 12686 gzeof -- check for end-of-file on a compressed file stream 12687 gzerror -- decode an error on a compressed file stream 12688 gzflush -- flush a compressed file stream 12689 gzgetc -- read a character from a compressed file 12690 gzgets -- read a string from a compressed file 12691 gzopen -- open a compressed file 12692 gzprintf -- format data and compress 12693 gzputc -- write character to a compressed file 12694 gzputs -- string write to a compressed file 12695 gzread -- read from a compressed file 12696 gzrewind -- reset the file-position indicator on a compressed 12697 file stream 12698 12699 gzseek -- reposition a file-position indicator in a compressed 12700 file stream 12701 12702 gzsetparams -- dynamically set compression parameters 12703 gztell -- find position on a compressed file stream 12704 gzwrite -- write to a compressed file 12705 inflate -- decompress data 12706 inflateEnd -- free decompression stream state 12707 inflateInit2_ -- initialize decompression system 12708 inflateInit_ -- initialize decompression system 12709 inflateReset -- reset decompression stream state 12710 inflateSetDictionary -- initialize decompression dictionary 12711 inflateSync -- advance compression stream to next sync point 12712 inflateSyncPoint -- test for synchronization point 12713 uncompress -- uncompress data 12714 zError -- translate error number to string 12715 zlibVersion -- discover library version at run time 12716 12717 The following interfaces are included in libz and are defined 12718 by this specification. Unless otherwise noted, these 12719 interfaces shall be included in the source standard. 12720 12721 Other interfaces listed above for libz shall behave as 12722 described in the referenced base document. 12723 12724 adler32 12725 12726 Name 12727 12728 adler32 -- Compute Adler 32 Checksum 12729 12730 Synopsis 12731 12732 #include 12733 12734 uLong adler32(uLong adler, const Bytef * buf, uInt len); 12735 12736 Description 12737 12738 The adler32() function shall compute a running Adler-32 12739 checksum (as described in RFC 1950: ZLIB Compressed Data 12740 Format Specication). On entry, adler is the previous value for 12741 the checksum, and buf shall point to an array of len bytes of 12742 data to be added to this checksum. The adler32() function 12743 shall return the new checksum. 12744 12745 If buf is NULL (or Z_NULL), adler32() shall return the initial 12746 checksum. 12747 12748 Return Value 12749 12750 The adler32() function shall return the new checksum value. 12751 12752 Errors 12753 12754 None defined. 12755 12756 Application Usage (informative) 12757 12758 The following code fragment demonstrates typical usage of the 12759 adler32() function: 12760 uLong adler = adler32(0L, Z_NULL, 0); 12761 12762 while (read_buffer(buffer, length) != EOF) { 12763 adler = adler32(adler, buffer, length); 12764 } 12765 if (adler != original_adler) error(); 12766 12767 compress 12768 12769 Name 12770 12771 compress -- compress data 12772 12773 Synopsis 12774 12775 #include 12776 12777 int compress(Bytef * dest, uLongf * destLen, const Bytef * 12778 source, uLong sourceLen); 12779 12780 Description 12781 12782 The compress() function shall attempt to compress sourceLen 12783 bytes of data in the buffer source, placing the result in the 12784 buffer dest. 12785 12786 On entry, destLen should point to a value describing the size 12787 of the dest buffer. The application should ensure that this 12788 value be at least (sourceLen × 1.001) + 12. On successful 12789 exit, the variable referenced by destLen shall be updated to 12790 hold the length of compressed data in dest. 12791 12792 The compress() function is equivalent to compress2() with a 12793 level of Z_DEFAULT_LEVEL. 12794 12795 Return Value 12796 12797 On success, compress() shall return Z_OK. Otherwise, 12798 compress() shall return a value to indicate the error. 12799 12800 Errors 12801 12802 On error, compress() shall return a value as described below: 12803 12804 Z_BUF_ERROR 12805 The buffer dest was not large enough to hold the 12806 compressed data. 12807 12808 Z_MEM_ERROR 12809 Insufficient memory. 12810 12811 compress2 12812 12813 Name 12814 12815 compress2 -- compress data at a specified level 12816 12817 Synopsis 12818 12819 #include 12820 12821 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 12822 source, uLong sourceLen, int level); 12823 12824 Description 12825 12826 The compress2() function shall attempt to compress sourceLen 12827 bytes of data in the buffer source, placing the result in the 12828 buffer dest, at the level described by level. The level 12829 supplied shall be a value between 0 and 9, or the value 12830 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 12831 speed, while a level of 9 requests the highest compression. A 12832 level of 0 indicates that no compression should be used, and 12833 the output shall be the same as the input. 12834 12835 On entry, destLen should point to a value describing the size 12836 of the dest buffer. The application should ensure that this 12837 value be at least (sourceLen × 1.001) + 12. On successful 12838 exit, the variable referenced by destLen shall be updated to 12839 hold the length of compressed data in dest. 12840 12841 The compress() function is equivalent to compress2() with a 12842 level of Z_DEFAULT_LEVEL. 12843 12844 Return Value 12845 12846 On success, compress2() shall return Z_OK. Otherwise, 12847 compress2() shall return a value to indicate the error. 12848 12849 Errors 12850 12851 On error, compress2() shall return a value as described below: 12852 12853 Z_BUF_ERROR 12854 The buffer dest was not large enough to hold the 12855 compressed data. 12856 12857 Z_MEM_ERROR 12858 Insufficient memory. 12859 12860 Z_STREAM_ERROR 12861 The level was not Z_DEFAULT_LEVEL, or was not between 0 12862 and 9. 12863 12864 compressBound 12865 12866 Name 12867 12868 compressBound -- compute compressed data size 12869 12870 Synopsis 12871 12872 #include 12873 12874 int compressBound(uLong sourceLen); 12875 12876 Description 12877 12878 The compressBound() function shall estimate the size of buffer 12879 required to compress sourceLen bytes of data using the 12880 compress() or compress2() functions. If successful, the value 12881 returned shall be an upper bound for the size of buffer 12882 required to compress sourceLen bytes of data, using the 12883 parameters stored in stream, in a single call to compress() or 12884 compress2(). 12885 12886 Return Value 12887 12888 The compressBound() shall return a value representing the 12889 upper bound of an array to allocate to hold the compressed 12890 data in a single call to compress() or compress2(). This 12891 function may return a conservative value that may be larger 12892 than sourceLen. 12893 12894 Errors 12895 12896 None defined. 12897 12898 crc32 12899 12900 Name 12901 12902 crc32 -- Compute CRC-32 Checksum 12903 12904 Synopsis 12905 12906 #include 12907 12908 uLong crc32(uLong crc, const Bytef * buf, uInt len); 12909 12910 Description 12911 12912 The crc32() function shall compute a running Cyclic Redundancy 12913 Check checksum, as defined in ITU-T V.42. On entry, crc is the 12914 previous value for the checksum, and buf shall point to an 12915 array of len bytes of data to be added to this checksum. The 12916 crc32() function shall return the new checksum. 12917 12918 If buf is NULL (or Z_NULL), crc32() shall return the initial 12919 checksum. 12920 12921 Return Value 12922 12923 The crc32() function shall return the new checksum value. 12924 12925 Errors 12926 12927 None defined. 12928 12929 Application Usage (informative) 12930 12931 The following code fragment demonstrates typical usage of the 12932 crc32() function: 12933 uLong crc = crc32(0L, Z_NULL, 0); 12934 12935 while (read_buffer(buffer, length) != EOF) { 12936 crc = crc32(crc, buffer, length); 12937 } 12938 if (crc != original_crc) error(); 12939 12940 deflate 12941 12942 Name 12943 12944 deflate -- compress data 12945 12946 Synopsis 12947 12948 #include 12949 12950 int deflate(z_streamp stream, int flush); 12951 12952 Description 12953 12954 The deflate() function shall attempt to compress data until 12955 either the input buffer is empty or the output buffer is full. 12956 The stream references a z_stream structure. Before the first 12957 call to deflate(), this structure should have been initialized 12958 by a call to deflateInit2_(). 12959 12960 Note: deflateInit2_() is only in the binary standard; 12961 source level applications should initialize stream via a 12962 call to deflateInit() or deflateInit2(). 12963 12964 In addition, the stream input and output buffers should have 12965 been initialized as follows: 12966 12967 next_in 12968 should point to the data to be compressed. 12969 12970 avail_in 12971 should contain the number of bytes of data in the 12972 buffer referenced by next_in. 12973 12974 next_out 12975 should point to a buffer where compressed data may be 12976 placed. 12977 12978 avail_out 12979 should contain the size in bytes of the buffer 12980 referenced by next_out 12981 12982 The deflate() function shall perform one or both of the 12983 following actions: 12984 12985 1. Compress input data from next_in and update next_in, 12986 avail_in and total_in to reflect the data that has been 12987 compressed. 12988 2. Fill the output buffer referenced by next_out, and update 12989 next_out, avail_out and total_out to reflect the 12990 compressed data that has been placed there. If flush is 12991 not Z_NO_FLUSH, and avail_out indicates that there is 12992 still space in output buffer, this action shall always 12993 occur (see below for further details). 12994 12995 The deflate() function shall return when either avail_in 12996 reaches zero (indicating that all the input data has been 12997 compressed), or avail_out reaches zero (indicating that the 12998 output buffer is full). 12999 13000 On success, the deflate() function shall set the adler field 13001 of the stream to the adler32() checksum of all the input data 13002 compressed so far (represented by total_in). 13003 13004 If the deflate() function shall attempt to determine the type 13005 of input data, and set field data_type in stream to Z_ASCII if 13006 the majority of the data bytes fall within the ASCII (ISO 646) 13007 printable character range. Otherwise, it shall set data_type 13008 to Z_BINARY. This data type is informational only, and does 13009 not affect the compression algorithm. 13010 13011 Note: Future versions of the LSB may remove this 13012 requirement, since it is based on an outdated character set 13013 that does not support Internationalization, and does not 13014 affect the algorithm. It is included for information only 13015 at this release. Applications should not depend on this 13016 field. 13017 13018 Flush Operation 13019 13020 The parameter flush determines when compressed bits are added 13021 to the output buffer in next_out. If flush is Z_NO_FLUSH, 13022 deflate() may return with some data pending output, and not 13023 yet added to the output buffer. 13024 13025 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 13026 output to next_out and align the output to a byte boundary. A 13027 synchronization point is generated in the output. 13028 13029 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 13030 Z_SYNC_FLUSH, and the compression state shall be reset. A 13031 synchronization point is generated in the output. 13032 13033 Rationale: Z_SYNC_FLUSH is intended to ensure that the 13034 compressed data contains all the data compressed so far, 13035 and allows a decompressor to reconstruct all of the input 13036 data. Z_FULL_FLUSH allows decompression to restart from 13037 this point if the previous compressed data has been lost or 13038 damaged. Flushing is likely to degrade the performance of 13039 the compression system, and should only be used where 13040 necessary. 13041 13042 If flush is set to Z_FINISH, all pending input shall be 13043 processed and deflate() shall return with Z_STREAM_END if 13044 there is sufficient space in the output buffer at next_out, as 13045 indicated by avail_out. If deflate() is called with flush set 13046 to Z_FINISH and there is insufficient space to store the 13047 compressed data, and no other error has occurred during 13048 compression, deflate() shall return Z_OK, and the application 13049 should call deflate() again with flush unchanged, and having 13050 updated next_out and avail_out. 13051 13052 If all the compression is to be done in a single step, 13053 deflate() may be called with flush set to Z_FINISH immediately 13054 after the stream has been initialized if avail_out is set to 13055 at least the value returned by deflateBound(). 13056 13057 Return Value 13058 13059 On success, deflate() shall return Z_OK, unless flush was set 13060 to Z_FINISH and there was sufficient space in the output 13061 buffer to compress all of the input data. In this case, 13062 deflate() shall return Z_STREAM_END. On error, deflate() shall 13063 return a value to indicate the error. 13064 13065 Note: If deflate() returns Z_OK and has set avail_out to 13066 zero, the function should be called again with the same 13067 value for flush, and with updated next_out and avail_out 13068 until deflate() returns with Z_OK (or Z_STREAM_END if flush 13069 is set to Z_FINISH) and a non-zero avail_out. 13070 13071 Errors 13072 13073 On error, deflate() shall return a value as described below, 13074 and set the msg field of stream to point to a string 13075 describing the error: 13076 13077 Z_BUF_ERROR 13078 No progress is possible; either avail_in or avail_out 13079 was zero. 13080 13081 Z_MEM_ERROR 13082 Insufficient memory. 13083 13084 Z_STREAM_ERROR 13085 The state (as represented in stream) is inconsistent, 13086 or stream was NULL. 13087 13088 deflateBound 13089 13090 Name 13091 13092 deflateBound -- compute compressed data size 13093 13094 Synopsis 13095 13096 #include 13097 13098 int deflateBound(z_streamp stream, uLong sourceLen); 13099 13100 Description 13101 13102 The deflateBound() function shall estimate the size of buffer 13103 required to compress sourceLen bytes of data. If successful, 13104 the value returned shall be an upper bound for the size of 13105 buffer required to compress sourceLen bytes of data, using the 13106 parameters stored in stream, in a single call to deflate() 13107 with flush set to Z_FINISH. 13108 13109 On entry, stream should have been initialized via a call to 13110 deflateInit_() or deflateInit2_(). 13111 13112 Return Value 13113 13114 The deflateBound() shall return a value representing the upper 13115 bound of an array to allocate to hold the compressed data in a 13116 single call to deflate(). If the stream is not correctly 13117 initialized, or is NULL, then deflateBound() may return a 13118 conservative value that may be larger than sourceLen. 13119 13120 Errors 13121 13122 None defined. 13123 13124 deflateCopy 13125 13126 Name 13127 13128 deflateCopy -- copy compression stream 13129 13130 Synopsis 13131 13132 #include 13133 13134 int deflateCopy(z_streamp dest, z_streamp source); 13135 13136 Description 13137 13138 The deflateCopy() function shall copy the compression state 13139 information in source to the uninitialized z_stream structure 13140 referenced by dest. 13141 13142 On successful return, dest will be an exact copy of the stream 13143 referenced by source. The input and output buffer pointers in 13144 next_in and next_out will reference the same data. 13145 13146 Return Value 13147 13148 On success, deflateCopy() shall return Z_OK. Otherwise it 13149 shall return a value less than zero to indicate the error. 13150 13151 Errors 13152 13153 On error, deflateCopy() shall return a value as described 13154 below: 13155 13156 Z_STREAM_ERROR 13157 The state in source is inconsistent, or either source 13158 or dest was NULL. 13159 13160 Z_MEM_ERROR 13161 Insufficient memory available. 13162 13163 Application Usage (informative) 13164 13165 This function can be useful when several compression 13166 strategies will be tried, for example when there are several 13167 ways of pre-processing the input data with a filter. The 13168 streams that will be discarded should then be freed by calling 13169 deflateEnd(). Note that deflateCopy() duplicates the internal 13170 compression state which can be quite large, so this strategy 13171 may be slow and can consume lots of memory. 13172 13173 deflateEnd 13174 13175 Name 13176 13177 deflateEnd -- free compression stream state 13178 13179 Synopsis 13180 13181 #include 13182 13183 int deflateEnd(z_streamp stream); 13184 13185 Description 13186 13187 The deflateEnd() function shall free all allocated state 13188 information referenced by stream. All pending output is 13189 discarded, and unprocessed input is ignored. 13190 13191 Return Value 13192 13193 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 13194 there was pending output discarded or input unprocessed. 13195 Otherwise it shall return Z_STREAM_ERROR to indicate the 13196 error. 13197 13198 Errors 13199 13200 On error, deflateEnd() shall return Z_STREAM_ERROR. The 13201 following conditions shall be treated as an error: 13202 13203 * The state in stream is inconsistent or inappropriate. 13204 * stream is NULL. 13205 13206 deflateInit2_ 13207 13208 Name 13209 13210 deflateInit2_ -- initialize compression system 13211 13212 Synopsis 13213 13214 #include 13215 13216 int deflateInit2_ (z_streamp strm, int level, int method, int 13217 windowBits, int memLevel, int strategy, char * version, int 13218 stream_size); 13219 13220 Description 13221 13222 The deflateInit2_() function shall initialize the compression 13223 system. On entry, strm shall refer to a user supplied z_stream 13224 object (a z_stream_s structure). The following fields shall be 13225 set on entry: 13226 13227 zalloc 13228 a pointer to an alloc_func function, used to allocate 13229 state information. If this is NULL, a default 13230 allocation function will be used. 13231 13232 zfree 13233 a pointer to a free_func function, used to free memory 13234 allocated by the zalloc function. If this is NULL a 13235 default free function will be used. 13236 13237 opaque 13238 If alloc_func is not NULL, opaque is a user supplied 13239 pointer to data that will be passed to the alloc_func 13240 and free_func functions. 13241 13242 If the version requested is not compatible with the version 13243 implemented, or if the size of the z_stream_s structure 13244 provided in stream_size does not match the size in the library 13245 implementation, deflateInit2_() shall fail, and return 13246 Z_VERSION_ERROR. 13247 13248 The level supplied shall be a value between 0 and 9, or the 13249 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 13250 speed, while a level of 9 requests the highest compression. A 13251 level of 0 indicates that no compression should be used, and 13252 the output shall be the same as the input. 13253 13254 The method selects the compression algorithm to use. LSB 13255 conforming implementation shall support the Z_DEFLATED method, 13256 and may support other implementation defined methods. 13257 13258 The windowBits parameter shall be a base 2 logarithm of the 13259 window size to use, and shall be a value between 8 and 15. A 13260 smaller value will use less memory, but will result in a 13261 poorer compression ratio, while a higher value will give 13262 better compression but utilize more memory. 13263 13264 The memLevel parameter specifies how much memory to use for 13265 the internal state. The value of memLevel shall be between 1 13266 and MAX_MEM_LEVEL. Smaller values use less memory but are 13267 slower, while higher values use more memory to gain 13268 compression speed. 13269 13270 The strategy parameter selects the compression strategy to 13271 use: 13272 13273 Z_DEFAULT_STRATEGY 13274 use the system default compression strategy. 13275 Z_DEFAULT_STRATEGY is particularly appropriate for text 13276 data. 13277 13278 Z_FILTERED 13279 use a compression strategy tuned for data consisting 13280 largely of small values with a fairly random 13281 distribution. Z_FILTERED uses more Huffman encoding and 13282 less string matching than Z_DEFAULT_STRATEGY. 13283 13284 Z_HUFFMAN_ONLY 13285 force Huffman encoding only, with no string match. 13286 13287 The deflateInit2_() function is not in the source standard; it 13288 is only in the binary standard. Source applications should use 13289 the deflateInit2() macro. 13290 13291 Return Value 13292 13293 On success, the deflateInit2_() function shall return Z_OK. 13294 Otherwise, deflateInit2_() shall return a value as described 13295 below to indicate the error. 13296 13297 Errors 13298 13299 On error, deflateInit2_() shall return one of the following 13300 error indicators: 13301 13302 Z_STREAM_ERROR 13303 Invalid parameter. 13304 13305 Z_MEM_ERROR 13306 Insufficient memory available. 13307 13308 Z_VERSION_ERROR 13309 The version requested is not compatible with the 13310 library version, or the z_stream size differs from that 13311 used by the library. 13312 13313 In addition, the msg field of the strm may be set to an error 13314 message. 13315 13316 deflateInit_ 13317 13318 Name 13319 13320 deflateInit_ -- initialize compression system 13321 13322 Synopsis 13323 13324 #include 13325 13326 int deflateInit_(z_streamp stream, int level, const char * 13327 version, int stream_size); 13328 13329 Description 13330 13331 The deflateInit_() function shall initialize the compression 13332 system. On entry, stream shall refer to a user supplied 13333 z_stream object (a z_stream_s structure). The following fields 13334 shall be set on entry: 13335 13336 zalloc 13337 a pointer to an alloc_func function, used to allocate 13338 state information. If this is NULL, a default 13339 allocation function will be used. 13340 13341 zfree 13342 a pointer to a free_func function, used to free memory 13343 allocated by the zalloc function. If this is NULL a 13344 default free function will be used. 13345 13346 opaque 13347 If alloc_func is not NULL, opaque is a user supplied 13348 pointer to data that will be passed to the alloc_func 13349 and free_func functions. 13350 13351 If the version requested is not compatible with the version 13352 implemented, or if the size of the z_stream_s structure 13353 provided in stream_size does not match the size in the library 13354 implementation, deflateInit_() shall fail, and return 13355 Z_VERSION_ERROR. 13356 13357 The level supplied shall be a value between 0 and 9, or the 13358 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 13359 speed, while a level of 9 requests the highest compression. A 13360 level of 0 indicates that no compression should be used, and 13361 the output shall be the same as the input. 13362 13363 The deflateInit_() function is not in the source standard; it 13364 is only in the binary standard. Source applications should use 13365 the deflateInit() macro. 13366 13367 The deflateInit_() function is equivalent to 13368 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, 13369 Z_DEFAULT_STRATEGY, version, stream_size); 13370 13371 Return Value 13372 13373 On success, the deflateInit_() function shall return Z_OK. 13374 Otherwise, deflateInit_() shall return a value as described 13375 below to indicate the error. 13376 13377 Errors 13378 13379 On error, deflateInit_() shall return one of the following 13380 error indicators: 13381 13382 Z_STREAM_ERROR 13383 Invalid parameter. 13384 13385 Z_MEM_ERROR 13386 Insufficient memory available. 13387 13388 Z_VERSION_ERROR 13389 The version requested is not compatible with the 13390 library version, or the z_stream size differs from that 13391 used by the library. 13392 13393 In addition, the msg field of the stream may be set to an 13394 error message. 13395 13396 deflateParams 13397 13398 Name 13399 13400 deflateParams -- set compression parameters 13401 13402 Synopsis 13403 13404 #include 13405 13406 int deflateParams(z_streamp stream, int level, int strategy); 13407 13408 Description 13409 13410 The deflateParams() function shall dynamically alter the 13411 compression parameters for the compression stream object 13412 stream. On entry, stream shall refer to a user supplied 13413 z_stream object (a z_stream_s structure), already initialized 13414 via a call to deflateInit_() or deflateInit2_(). 13415 13416 The level supplied shall be a value between 0 and 9, or the 13417 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 13418 speed, while a level of 9 requests the highest compression. A 13419 level of 0 indicates that no compression should be used, and 13420 the output shall be the same as the input. If the compression 13421 level is altered by deflateParams(), and some data has already 13422 been compressed with this stream (i.e. total_in is not zero), 13423 and the new level requires a different underlying compression 13424 method, then stream shall be flushed by a call to deflate(). 13425 13426 The strategy parameter selects the compression strategy to 13427 use: 13428 13429 Z_DEFAULT_STRATEGY 13430 use the system default compression strategy. 13431 Z_DEFAULT_STRATEGY is particularly appropriate for text 13432 data. 13433 13434 Z_FILTERED 13435 use a compression strategy tuned for data consisting 13436 largely of small values with a fairly random 13437 distribution. Z_FILTERED uses more Huffman encoding and 13438 less string matching than Z_DEFAULT_STRATEGY. 13439 13440 Z_HUFFMAN_ONLY 13441 force Huffman encoding only, with no string match. 13442 13443 Return Value 13444 13445 On success, the deflateParams() function shall return Z_OK. 13446 Otherwise, deflateParams() shall return a value as described 13447 below to indicate the error. 13448 13449 Errors 13450 13451 On error, deflateParams() shall return one of the following 13452 error indicators: 13453 13454 Z_STREAM_ERROR 13455 Invalid parameter. 13456 13457 Z_MEM_ERROR 13458 Insufficient memory available. 13459 13460 Z_BUF_ERROR 13461 Insufficient space in stream to flush the current 13462 output. 13463 13464 In addition, the msg field of the strm may be set to an error 13465 message. 13466 13467 Application Usage (Informative) 13468 13469 Applications should ensure that the stream is flushed, e.g. by 13470 a call to deflate(stream, Z_SYNC_FLUSH) before calling 13471 deflateParams(), or ensure that there is sufficient space in 13472 next_out (as identified by avail_out) to ensure that all 13473 pending output and all uncompressed input can be flushed in a 13474 single call to deflate(). 13475 13476 Rationale: Although the deflateParams() function should 13477 flush pending output and compress all pending input, the 13478 result is unspecified if there is insufficient space in the 13479 output buffer. Applications should only call 13480 deflateParams() when the stream is effectively empty 13481 (flushed). 13482 13483 The deflateParams() can be used to switch between 13484 compression and straight copy of the input data, or to 13485 switch to a different kind of input data requiring a 13486 different strategy. 13487 13488 deflateReset 13489 13490 Name 13491 13492 deflateReset -- reset compression stream state 13493 13494 Synopsis 13495 13496 #include 13497 13498 int deflateReset(z_streamp stream); 13499 13500 Description 13501 13502 The deflateReset() function shall reset all state associated 13503 with stream. All pending output shall be discarded, and the 13504 counts of processed bytes (total_in and total_out) shall be 13505 reset to zero. 13506 13507 Return Value 13508 13509 On success, deflateReset() shall return Z_OK. Otherwise it 13510 shall return Z_STREAM_ERROR to indicate the error. 13511 13512 Errors 13513 13514 On error, deflateReset() shall return Z_STREAM_ERROR. The 13515 following conditions shall be treated as an error: 13516 13517 * The state in stream is inconsistent or inappropriate. 13518 * stream is NULL. 13519 13520 deflateSetDictionary 13521 13522 Name 13523 13524 deflateSetDictionary -- initialize compression dictionary 13525 13526 Synopsis 13527 13528 #include 13529 13530 int deflateSetDictionary(z_streamp stream, const Bytef * 13531 dictionary, uInt dictlen); 13532 13533 Description 13534 13535 The deflateSetDictionary() function shall initialize the 13536 compression dictionary associated with stream using the 13537 dictlen bytes referenced by dictionary. 13538 13539 The implementation may silently use a subset of the provided 13540 dictionary if the dictionary cannot fit in the current window 13541 associated with stream (see deflateInit2_()). The application 13542 should ensure that the dictionary is sorted such that the most 13543 commonly used strings occur at the end of the dictionary. 13544 13545 If the dictionary is successfully set, the Adler32 checksum of 13546 the entire provided dictionary shall be stored in the adler 13547 member of stream. This value may be used by the decompression 13548 system to select the correct dictionary. The compression and 13549 decompression systems must use the same dictionary. 13550 13551 stream shall reference an initialized compression stream, with 13552 total_in zero (i.e. no data has been compressed since the 13553 stream was initialized). 13554 13555 Return Value 13556 13557 On success, deflateSetDictionary() shall return Z_OK. 13558 Otherwise it shall return Z_STREAM_ERROR to indicate an error. 13559 13560 Errors 13561 13562 On error, deflateSetDictionary() shall return a value as 13563 described below: 13564 13565 Z_STREAM_ERROR 13566 The state in stream is inconsistent, or stream was 13567 NULL. 13568 13569 Application Usage (informative) 13570 13571 The application should provide a dictionary consisting of 13572 strings {{{ed note: do we really mean "strings"? Null 13573 terminated?}}} that are likely to be encountered in the data 13574 to be compressed. The application should ensure that the 13575 dictionary is sorted such that the most commonly used strings 13576 occur at the end of the dictionary. 13577 13578 The use of a dictionary is optional; however if the data to be 13579 compressed is relatively short and has a predictable 13580 structure, the use of a dictionary can substantially improve 13581 the compression ratio. 13582 13583 get_crc_table 13584 13585 Name 13586 13587 get_crc_table -- generate a table for crc calculations 13588 13589 Synopsis 13590 13591 #include 13592 13593 const uLongf * get_crc_table(void); 13594 13595 Description 13596 13597 Generate tables for a byte-wise 32-bit CRC calculation based 13598 on the polynomial: 13599 x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+ 13600 1 13601 13602 In a multi-threaded application, get_crc_table() should be 13603 called by one thread to initialize the tables before any other 13604 thread calls any libz function. 13605 13606 Return Value 13607 13608 The get_crc_table() function shall return a pointer to the 13609 first of a set of tables used internally to calculate CRC-32 13610 values (see crc32()). 13611 13612 Errors 13613 13614 None defined. 13615 13616 gzclose 13617 13618 Name 13619 13620 gzclose -- close a compressed file stream 13621 13622 Synopsis 13623 13624 #include 13625 13626 int gzclose (gzFile file ); 13627 13628 Description 13629 13630 The gzclose() function shall close the compressed file stream 13631 file. If file was open for writing, gzclose() shall first 13632 flush any pending output. Any state information allocated 13633 shall be freed. 13634 13635 Return Value 13636 13637 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 13638 shall return an error value as described below. 13639 13640 Errors 13641 13642 On error, gzclose() may set the global variable errno to 13643 indicate the error. The gzclose() shall return a value other 13644 than Z_OK on error. 13645 13646 Z_STREAM_ERROR 13647 file was NULL (or Z_NULL), or did not refer to an open 13648 compressed file stream. 13649 13650 Z_ERRNO 13651 An error occurred in the underlying base libraries, and 13652 the application should check errno for further 13653 information. 13654 13655 Z_BUF_ERROR 13656 no compression progress is possible during buffer flush 13657 (see deflate()). 13658 13659 gzdopen 13660 13661 Name 13662 13663 gzdopen -- open a compressed file 13664 13665 Synopsis 13666 13667 #include 13668 13669 gzFile gzdopen ( int fd, const char *mode ); 13670 13671 Description 13672 13673 The gzdopen() function shall attempt to associate the open 13674 file referenced by fd with a gzFile object. The mode argument 13675 is based on that of fopen(), but the mode parameter may also 13676 contain the following characters: 13677 13678 digit 13679 set the compression level to digit. A low value (e.g. 13680 1) means high speed, while a high value (e.g. 9) means 13681 high compression. A compression level of 0 (zero) means 13682 no compression. See defaultInit2_() for further 13683 details. 13684 13685 [fhR] 13686 set the compression strategy to [fhR]. The letter f 13687 corresponds to filtered data, the letter h corresponds 13688 to Huffman only compression, and the letter R 13689 corresponds to Run Length Encoding. See defaultInit2_() 13690 for further details. 13691 13692 If fd refers to an uncompressed file, and mode refers to a 13693 read mode, gzdopen() shall attempt to open the file and return 13694 a gzFile object suitable for reading directly from the file 13695 without any decompression. 13696 13697 If mode is NULL, or if mode does not contain one of r, w, or 13698 a, gzdopen() shall return Z_NULL, and need not set any other 13699 error condition. 13700 13701 Example 13702 13703 gzdopen(fileno(stdin), "r"); 13704 13705 Attempt to associate the standard input with a gzFile object. 13706 13707 Return Value 13708 13709 On success, gzdopen() shall return a gzFile object. On 13710 failure, gzdopen() shall return Z_NULL and may set errno 13711 accordingly. 13712 13713 Note: At version 1.2.2, zlib does not set errno for several 13714 error conditions. Applications may not be able to determine 13715 the cause of an error. 13716 13717 Errors 13718 13719 On error, gzdopen() may set the global variable errno to 13720 indicate the error. 13721 13722 gzeof 13723 13724 Name 13725 13726 gzeof -- check for end-of-file on a compressed file stream 13727 13728 Synopsis 13729 13730 #include 13731 13732 int gzeof (gzFile file ); 13733 13734 Description 13735 13736 The gzeof() function shall test the compressed file stream 13737 file for end of file. 13738 13739 Return Value 13740 13741 If file was open for reading and end of file has been reached, 13742 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 13743 13744 Errors 13745 13746 None defined. 13747 13748 gzerror 13749 13750 Name 13751 13752 gzerror -- decode an error on a compressed file stream 13753 13754 Synopsis 13755 13756 #include 13757 13758 const char * gzerror (gzFile file, int * errnum); 13759 13760 Description 13761 13762 The gzerror() function shall return a string describing the 13763 last error to have occurred associated with the open 13764 compressed file stream referred to by file. It shall also set 13765 the location referenced by errnum to an integer value that 13766 further identifies the error. 13767 13768 Return Value 13769 13770 The gzerror() function shall return a string that describes 13771 the last error associated with the given file compressed file 13772 stream. This string shall have the format "%s: %s", with the 13773 name of the file, followed by a colon, a space, and the 13774 description of the error. If the compressed file stream was 13775 opened by a call to gzdopen(), the format of the filename is 13776 unspecified. 13777 13778 Rationale: Although in all current implementations of libz 13779 file descriptors are named "", the code suggests 13780 that this is for debugging purposes only, and may change in 13781 a future release. 13782 13783 It is unspecified if the string returned is determined by the 13784 setting of the LC_MESSAGES category in the current locale. 13785 13786 Errors 13787 13788 None defined. 13789 13790 gzflush 13791 13792 Name 13793 13794 gzflush -- flush a compressed file stream 13795 13796 Synopsis 13797 13798 #include 13799 13800 int gzflush(gzFile file, int flush); 13801 13802 Description 13803 13804 The gzflush() function shall flush pending output to the 13805 compressed file stream identified by file, which must be open 13806 for writing. 13807 13808 Flush Operation 13809 13810 The parameter flush determines which compressed bits are added 13811 to the output file. If flush is Z_NO_FLUSH, gzflush() may 13812 return with some data pending output, and not yet written to 13813 the file. 13814 13815 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 13816 output to file and align the output to a byte boundary. There 13817 may still be data pending compression that is not flushed. 13818 13819 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 13820 Z_SYNC_FLUSH, and the compression state shall be reset. There 13821 may still be data pending compression that is not flushed. 13822 13823 Rationale: Z_SYNC_FLUSH is intended to ensure that the 13824 compressed data contains all the data compressed so far, 13825 and allows a decompressor to reconstruct all of the input 13826 data. Z_FULL_FLUSH allows decompression to restart from 13827 this point if the previous compressed data has been lost or 13828 damaged. Flushing is likely to degrade the performance of 13829 the compression system, and should only be used where 13830 necessary. 13831 13832 If flush is set to Z_FINISH, all pending uncompressed data 13833 shall be compressed and all output shall be flushed. 13834 13835 Return Value 13836 13837 On success, gzflush() shall return the value Z_OK. Otherwise 13838 gzflush() shall return a value to indicate the error, and may 13839 set the error number associated with the compressed file 13840 stream file. 13841 13842 Note: If flush is set to Z_FINISH and the flush operation 13843 is successful, gzflush() will return Z_OK, but the 13844 compressed file stream error value may be set to 13845 Z_STREAM_END. 13846 13847 Errors 13848 13849 On error, gzwrite() shall return an error value, and may set 13850 the error number associated with the stream identified by file 13851 to indicate the error. Applications may use gzerror() to 13852 access this error value. 13853 13854 Z_ERRNO 13855 An underlying base library function has indicated an 13856 error. The global variable errno may be examined for 13857 further information. 13858 13859 Z_STREAM_ERROR 13860 The stream is invalid, is not open for writing, or is 13861 in an invalid state. 13862 13863 Z_BUF_ERROR 13864 no compression progress is possible (see deflate()). 13865 13866 Z_MEM_ERROR 13867 Insufficient memory available to compress. 13868 13869 gzgetc 13870 13871 Name 13872 13873 gzgetc -- read a character from a compressed file 13874 13875 Synopsis 13876 13877 #include 13878 13879 int gzgetc (gzFile file); 13880 13881 Description 13882 13883 The gzgetc() function shall read the next single character 13884 from the compressed file stream referenced by file, which 13885 shall have been opened in a read mode (see gzopen() and 13886 gzdopen()). 13887 13888 Return Value 13889 13890 On success, gzgetc() shall return the uncompressed character 13891 read, otherwise, on end of file or error, gzgetc() shall 13892 return -1. 13893 13894 Errors 13895 13896 On end of file or error, gzgetc() shall return -1. Further 13897 information can be found by calling gzerror() with a pointer 13898 to the compressed file stream. 13899 13900 gzgets 13901 13902 Name 13903 13904 gzgets -- read a string from a compressed file 13905 13906 Synopsis 13907 13908 #include 13909 13910 char * gzgets (gzFile file, char * buf, int len); 13911 13912 Description 13913 13914 The gzgets() function shall attempt to read data from the 13915 compressed file stream file, uncompressing it into buf until 13916 either len-1 bytes have been inserted into buf, or until a 13917 newline character has been uncompressed into buf. A null byte 13918 shall be appended to the uncompressed data. The file shall 13919 have been opened in for reading (see gzopen() and gzdopen()). 13920 13921 Return Value 13922 13923 On success, gzgets() shall return a pointer to buf. Otherwise, 13924 gzgets() shall return Z_NULL. Applications may examine the 13925 cause using gzerror(). 13926 13927 Errors 13928 13929 On error, gzgets() shall return Z_NULL. The following 13930 conditions shall always be treated as an error: 13931 13932 file is NULL, or does not refer to a file open for reading; 13933 buf is NULL; 13934 len is less than or equal to zero. 13935 13936 gzopen 13937 13938 Name 13939 13940 gzopen -- open a compressed file 13941 13942 Synopsis 13943 13944 #include 13945 13946 gzFile gzopen (const char *path , const char *mode ); 13947 13948 Description 13949 13950 The gzopen() function shall open the compressed file named by 13951 path. The mode argument is based on that of fopen(), but the 13952 mode parameter may also contain the following characters: 13953 13954 digit 13955 set the compression level to digit. A low value (e.g. 13956 1) means high speed, while a high value (e.g. 9) means 13957 high compression. A compression level of 0 (zero) means 13958 no compression. See defaultInit2_() for further 13959 details. 13960 13961 [fhR] 13962 set the compression strategy to [fhR]. The letter f 13963 corresponds to filtered data, the letter h corresponds 13964 to Huffman only compression, and the letter R 13965 corresponds to Run Length Encoding. See defaultInit2_() 13966 for further details. 13967 13968 If path refers to an uncompressed file, and mode refers to a 13969 read mode, gzopen() shall attempt to open the file and return 13970 a gzFile object suitable for reading directly from the file 13971 without any decompression. 13972 13973 If path or mode is NULL, or if mode does not contain one of r, 13974 w, or a, gzopen() shall return Z_NULL, and need not set any 13975 other error condition. 13976 13977 The gzFile object is also referred to as a compressed file 13978 stream. 13979 13980 Example 13981 13982 gzopen("file.gz", "w6h"); 13983 13984 Attempt to create a new compressed file, file.gz, at 13985 compression level 6 using Huffman only compression. 13986 13987 Return Value 13988 13989 On success, gzopen() shall return a gzFile object (also known 13990 as a compressed file stream). On failure, gzopen() shall 13991 return Z_NULL and may set errno accordingly. 13992 13993 Note: At version 1.2.2, zlib does not set errno for several 13994 error conditions. Applications may not be able to determine 13995 the cause of an error. 13996 13997 Errors 13998 13999 On error, gzopen() may set the global variable errno to 14000 indicate the error. 14001 14002 gzprintf 14003 14004 Name 14005 14006 gzprintf -- format data and compress 14007 14008 Synopsis 14009 14010 #include 14011 14012 int gzprintf (gzFile file, const char * fmt, ...); 14013 14014 Description 14015 14016 The gzprintf() function shall format data as for fprintf(), 14017 and write the resulting string to the compressed file stream 14018 file. 14019 14020 Return Value 14021 14022 The gzprintf() function shall return the number of 14023 uncompressed bytes actually written, or a value less than or 14024 equal to 0 in the event of an error. 14025 14026 Errors 14027 14028 If file is NULL, or refers to a compressed file stream that 14029 has not been opened for writing, gzprintf() shall return 14030 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 14031 14032 gzputc 14033 14034 Name 14035 14036 gzputc -- write character to a compressed file 14037 14038 Synopsis 14039 14040 #include 14041 14042 int gzputc (gzFile file, int c); 14043 14044 Description 14045 14046 The gzputc() function shall write the single character c, 14047 converted from integer to unsigned character, to the 14048 compressed file referenced by file, which shall have been 14049 opened in a write mode (see gzopen() and gzdopen()). 14050 14051 Return Value 14052 14053 On success, gzputc() shall return the value written, otherwise 14054 gzputc() shall return -1. 14055 14056 Errors 14057 14058 On error, gzputc() shall return -1. 14059 14060 gzputs 14061 14062 Name 14063 14064 gzputs -- string write to a compressed file 14065 14066 Synopsis 14067 14068 #include 14069 14070 int gzputs (gzFile file, const char * s); 14071 14072 Description 14073 14074 The gzputs() function shall write the null terminated string s 14075 to the compressed file referenced by file, which shall have 14076 been opened in a write mode (see gzopen() and gzdopen()). The 14077 terminating null character shall not be written. The gzputs() 14078 function shall return the number of uncompressed bytes 14079 actually written. 14080 14081 Return Value 14082 14083 On success, gzputs() shall return the number of uncompressed 14084 bytes actually written to file. On error gzputs() shall return 14085 a value less than or equal to 0. Applications may examine the 14086 cause using gzerror(). 14087 14088 Errors 14089 14090 On error, gzputs() shall set the error number associated with 14091 the stream identified by file to indicate the error. 14092 Applications should use gzerror() to access this error value. 14093 If file is NULL, gzputs() shall return Z_STREAM_ERR. 14094 14095 Z_ERRNO 14096 An underlying base library function has indicated an 14097 error. The global variable errno may be examined for 14098 further information. 14099 14100 Z_STREAM_ERROR 14101 The stream is invalid, is not open for writing, or is 14102 in an invalid state. 14103 14104 Z_BUF_ERROR 14105 no compression progress is possible (see deflate()). 14106 14107 Z_MEM_ERROR 14108 Insufficient memory available to compress. 14109 14110 gzread 14111 14112 Name 14113 14114 gzread -- read from a compressed file 14115 14116 Synopsis 14117 14118 #include 14119 14120 int gzread (gzFile file, voidp buf, unsigned int len); 14121 14122 Description 14123 14124 The gzread() function shall read data from the compressed file 14125 referenced by file, which shall have been opened in a read 14126 mode (see gzopen() and gzdopen()). The gzread() function shall 14127 read data from file, and uncompress it into buf. At most, len 14128 bytes of uncompressed data shall be copied to buf. If the file 14129 is not compressed, gzread() shall simply copy data from file 14130 to buf without alteration. 14131 14132 Return Value 14133 14134 On success, gzread() shall return the number of bytes 14135 decompressed into buf. If gzread() returns 0, either the 14136 end-of-file has been reached or an underlying read error has 14137 occurred. Applications should use gzerror() or gzeof() to 14138 determine which occurred. On other errors, gzread() shall 14139 return a value less than 0 and and applications may examine 14140 the cause using gzerror(). 14141 14142 Errors 14143 14144 On error, gzread() shall set the error number associated with 14145 the stream identified by file to indicate the error. 14146 Applications should use gzerror() to access this error value. 14147 14148 Z_ERRNO 14149 An underlying base library function has indicated an 14150 error. The global variable errno may be examined for 14151 further information. 14152 14153 Z_STREAM_END 14154 End of file has been reached on input. 14155 14156 Z_DATA_ERROR 14157 A CRC error occurred when reading data; the file is 14158 corrupt. 14159 14160 Z_STREAM_ERROR 14161 The stream is invalid, or is in an invalid state. 14162 14163 Z_NEED_DICT 14164 A dictionary is needed (see inflateSetDictionary()). 14165 14166 Z_MEM_ERROR 14167 Insufficient memory available to decompress. 14168 14169 gzrewind 14170 14171 Name 14172 14173 gzrewind -- reset the file-position indicator on a compressed 14174 file stream 14175 14176 Synopsis 14177 14178 #include 14179 14180 int gzrewind(gzFile file); 14181 14182 Description 14183 14184 The gzrewind() function shall set the starting position for 14185 the next read on compressed file stream file to the beginning 14186 of file. file must be open for reading. 14187 14188 gzrewind() is equivalent to 14189 (int)gzseek(file, 0L, SEEK_SET) 14190 14191 . 14192 14193 Return Value 14194 14195 On success, gzrewind() shall return 0. On error, gzrewind() 14196 shall return -1, and may set the error value for file 14197 accordingly. 14198 14199 Errors 14200 14201 On error, gzrewind() shall return -1, indicating that file is 14202 NULL, or does not represent an open compressed file stream, or 14203 represents a compressed file stream that is open for writing 14204 and is not currently at the beginning of file. 14205 14206 gzseek 14207 14208 Name 14209 14210 gzseek -- reposition a file-position indicator in a compressed 14211 file stream 14212 14213 Synopsis 14214 14215 #include 14216 14217 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 14218 14219 Description 14220 14221 The gzseek() function shall set the file-position indicator 14222 for the compressed file stream file. The file-position 14223 indicator controls where the next read or write operation on 14224 the compressed file stream shall take place. The offset 14225 indicates a byte offset in the uncompressed data. The whence 14226 parameter may be one of: 14227 14228 SEEK_SET 14229 the offset is relative to the start of the uncompressed 14230 data. 14231 14232 SEEK_CUR 14233 the offset is relative to the current positition in the 14234 uncompressed data. 14235 14236 Note: The value SEEK_END need not be supported. 14237 14238 If the file is open for writing, the new offset must be 14239 greater than or equal to the current offset. In this case, 14240 gzseek() shall compress a sequence of null bytes to fill the 14241 gap from the previous offset to the new offset. 14242 14243 Return Value 14244 14245 On success, gzseek() shall return the resulting offset in the 14246 file expressed as a byte position in the uncompressed data 14247 stream. On error, gzseek() shall return -1, and may set the 14248 error value for file accordingly. 14249 14250 Errors 14251 14252 On error, gzseek() shall return -1. The following conditions 14253 shall always result in an error: 14254 14255 * file is NULL 14256 * file does not represent an open compressed file stream. 14257 * file refers to a compressed file stream that is open for 14258 writing, and the newly computed offset is less than the 14259 current offset. 14260 * The newly computed offset is less than zero. 14261 * whence is not one of the supported values. 14262 14263 Application Usage (informative) 14264 14265 If file is open for reading, the implementation may still need 14266 to uncompress all of the data up to the new offset. As a 14267 result, gzseek() may be extremely slow in some circumstances. 14268 14269 gzsetparams 14270 14271 Name 14272 14273 gzsetparams -- dynamically set compression parameters 14274 14275 Synopsis 14276 14277 #include 14278 14279 int gzsetparams (gzFile file, int level, int strategy); 14280 14281 Description 14282 14283 The gzsetparams() function shall set the compression level and 14284 compression strategy on the compressed file stream referenced 14285 by file. The compressed file stream shall have been opened in 14286 a write mode. The level and strategy are as defined in 14287 deflateInit2_. If there is any data pending writing, it shall 14288 be flushed before the parameters are updated. 14289 14290 Return Value 14291 14292 On success, the gzsetparams() function shall return Z_OK. 14293 14294 Errors 14295 14296 On error, gzsetparams() shall return one of the following 14297 error indications: 14298 14299 Z_STREAM_ERROR 14300 Invalid parameter, or file not open for writing. 14301 14302 Z_BUF_ERROR 14303 An internal inconsistency was detected while flushing 14304 the previous buffer. 14305 14306 gztell 14307 14308 Name 14309 14310 gztell -- find position on a compressed file stream 14311 14312 Synopsis 14313 14314 #include 14315 14316 z_off_t gztell (gzFile file ); 14317 14318 Description 14319 14320 The gztell() function shall return the starting position for 14321 the next read or write operation on compressed file stream 14322 file. This position represents the number of bytes from the 14323 beginning of file in the uncompressed data. 14324 14325 gztell() is equivalent to 14326 gzseek(file, 0L, SEEK_SET) 14327 14328 . 14329 14330 Return Value 14331 14332 gztell() shall return the current offset in the file expressed 14333 as a byte position in the uncompressed data stream. On error, 14334 gztell() shall return -1, and may set the error value for file 14335 accordingly. 14336 14337 Errors 14338 14339 On error, gztell() shall return -1, indicating that file is 14340 NULL, or does not represent an open compressed file stream. 14341 14342 gzwrite 14343 14344 Name 14345 14346 gzwrite -- write to a compressed file 14347 14348 Synopsis 14349 14350 #include 14351 14352 int gzwrite (gzFile file, voidpc buf, unsigned int len); 14353 14354 Description 14355 14356 The gzwrite() function shall write data to the compressed file 14357 referenced by file, which shall have been opened in a write 14358 mode (see gzopen() and gzdopen()). On entry, buf shall point 14359 to a buffer containing lenbytes of uncompressed data. The 14360 gzwrite() function shall compress this data and write it to 14361 file. The gzwrite() function shall return the number of 14362 uncompressed bytes actually written. 14363 14364 Return Value 14365 14366 On success, gzwrite() shall return the number of uncompressed 14367 bytes actually written to file. On error gzwrite() shall 14368 return a value less than or equal to 0. Applications may 14369 examine the cause using gzerror(). 14370 14371 Errors 14372 14373 On error, gzwrite() shall set the error number associated with 14374 the stream identified by file to indicate the error. 14375 Applications should use gzerror() to access this error value. 14376 14377 Z_ERRNO 14378 An underlying base library function has indicated an 14379 error. The global variable errno may be examined for 14380 further information. 14381 14382 Z_STREAM_ERROR 14383 The stream is invalid, is not open for writing, or is 14384 in an invalid state. 14385 14386 Z_BUF_ERROR 14387 no compression progress is possible (see deflate()). 14388 14389 Z_MEM_ERROR 14390 Insufficient memory available to compress. 14391 14392 inflate 14393 14394 Name 14395 14396 inflate -- decompress data 14397 14398 Synopsis 14399 14400 #include 14401 14402 int inflate(z_streamp stream, int flush); 14403 14404 Description 14405 14406 The inflate() function shall attempt to decompress data until 14407 either the input buffer is empty or the output buffer is full. 14408 The stream references a z_stream structure. Before the first 14409 call to inflate(), this structure should have been initialized 14410 by a call to inflateInit2_(). 14411 14412 Note: inflateInit2_() is only in the binary standard; 14413 source level applications should initialize stream via a 14414 call to inflateInit() or inflateInit2(). 14415 14416 In addition, the stream input and output buffers should have 14417 been initialized as follows: 14418 14419 next_in 14420 should point to the data to be decompressed. 14421 14422 avail_in 14423 should contain the number of bytes of data in the 14424 buffer referenced by next_in. 14425 14426 next_out 14427 should point to a buffer where decompressed data may be 14428 placed. 14429 14430 avail_out 14431 should contain the size in bytes of the buffer 14432 referenced by next_out 14433 14434 The inflate() function shall perform one or both of the 14435 following actions: 14436 14437 1. Decompress input data from next_in and update next_in, 14438 avail_in and total_in to reflect the data that has been 14439 decompressed. 14440 2. Fill the output buffer referenced by next_out, and update 14441 next_out, avail_out, and total_out to reflect the 14442 decompressed data that has been placed there. If flush is 14443 not Z_NO_FLUSH, and avail_out indicates that there is 14444 still space in output buffer, this action shall always 14445 occur (see below for further details). 14446 14447 The inflate() function shall return when either avail_in 14448 reaches zero (indicating that all the input data has been 14449 compressed), or avail_out reaches zero (indicating that the 14450 output buffer is full). 14451 14452 On success, the inflate() function shall set the adler field 14453 of the stream to the Adler-32 checksum of all the input data 14454 compressed so far (represented by total_in). 14455 14456 Flush Operation 14457 14458 The parameter flush determines when uncompressed bytes are 14459 added to the output buffer in next_out. If flush is 14460 Z_NO_FLUSH, inflate() may return with some data pending 14461 output, and not yet added to the output buffer. 14462 14463 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 14464 output to next_out, and update next_out and avail_out 14465 accordingly. 14466 14467 If flush is set to Z_BLOCK, inflate() shall stop adding data 14468 to the output buffer if and when the next compressed block 14469 boundary is reached (see RFC 1951: DEFLATE Compressed Data 14470 Format Specification). 14471 14472 If flush is set to Z_FINISH, all of the compressed input shall 14473 be decompressed and added to the output. If there is 14474 insufficient output space (i.e. the compressed input data 14475 uncompresses to more than avail_out bytes), then inflate() 14476 shall fail and return Z_BUF_ERROR. 14477 14478 Return Value 14479 14480 On success, inflate() shall return Z_OK if decompression 14481 progress has been made, or Z_STREAM_END if all of the input 14482 data has been decompressed and there was sufficient space in 14483 the output buffer to store the uncompressed result. On error, 14484 inflate() shall return a value to indicate the error. 14485 14486 Note: If inflate() returns Z_OK and has set avail_out to 14487 zero, the function should be called again with the same 14488 value for flush, and with updated next_out and avail_out 14489 until inflate() returns with either Z_OK or Z_STREAM_END 14490 and a non-zero avail_out. 14491 14492 On success, inflate() shall set the adler to the Adler-32 14493 checksum of the output produced so far (i.e. total_out bytes). 14494 14495 Errors 14496 14497 On error, inflate() shall return a value as described below, 14498 and may set the msg field of stream to point to a string 14499 describing the error: 14500 14501 Z_BUF_ERROR 14502 No progress is possible; either avail_in or avail_out 14503 was zero. 14504 14505 Z_MEM_ERROR 14506 Insufficient memory. 14507 14508 Z_STREAM_ERROR 14509 The state (as represented in stream) is inconsistent, 14510 or stream was NULL. 14511 14512 Z_NEED_DICT 14513 A preset dictionary is required. The adler field shall 14514 be set to the Adler-32 checksum of the dictionary 14515 chosen by the compressor. 14516 14517 inflateEnd 14518 14519 Name 14520 14521 inflateEnd -- free decompression stream state 14522 14523 Synopsis 14524 14525 #include 14526 14527 int inflateEnd(z_streamp stream); 14528 14529 Description 14530 14531 The inflateEnd() function shall free all allocated state 14532 information referenced by stream. All pending output is 14533 discarded, and unprocessed input is ignored. 14534 14535 Return Value 14536 14537 On success, inflateEnd() shall return Z_OK. Otherwise it shall 14538 return Z_STREAM_ERROR to indicate the error. 14539 14540 Errors 14541 14542 On error, inflateEnd() shall return Z_STREAM_ERROR. The 14543 following conditions shall be treated as an error: 14544 14545 * The state in stream is inconsistent. 14546 * stream is NULL. 14547 * The zfree function pointer is NULL. 14548 14549 inflateInit2_ 14550 14551 Name 14552 14553 inflateInit2_ -- initialize decompression system 14554 14555 Synopsis 14556 14557 #include 14558 14559 int inflateInit2_ (z_streamp strm, int windowBits, char * 14560 version, int stream_size); 14561 14562 Description 14563 14564 The inflateInit2_() function shall initialize the 14565 decompression system. On entry, strm shall refer to a user 14566 supplied z_stream object (a z_stream_s structure). The 14567 following fields shall be set on entry: 14568 14569 zalloc 14570 a pointer to an alloc_func function, used to allocate 14571 state information. If this is NULL, a default 14572 allocation function will be used. 14573 14574 zfree 14575 a pointer to a free_func function, used to free memory 14576 allocated by the zalloc function. If this is NULL a 14577 default free function will be used. 14578 14579 opaque 14580 If alloc_func is not NULL, opaque is a user supplied 14581 pointer to data that will be passed to the alloc_func 14582 and free_func functions. 14583 14584 If the version requested is not compatible with the version 14585 implemented, or if the size of the z_stream_s structure 14586 provided in stream_size does not match the size in the library 14587 implementation, inflateInit2_() shall fail, and return 14588 Z_VERSION_ERROR. 14589 14590 The windowBits parameter shall be a base 2 logarithm of the 14591 maximum window size to use, and shall be a value between 8 and 14592 15. If the input data was compressed with a larger window 14593 size, subsequent attempts to decompress this data will fail 14594 with Z_DATA_ERROR, rather than try to allocate a larger 14595 window. 14596 14597 The inflateInit2_() function is not in the source standard; it 14598 is only in the binary standard. Source applications should use 14599 the inflateInit2() macro. 14600 14601 Return Value 14602 14603 On success, the inflateInit2_() function shall return Z_OK. 14604 Otherwise, inflateInit2_() shall return a value as described 14605 below to indicate the error. 14606 14607 Errors 14608 14609 On error, inflateInit2_() shall return one of the following 14610 error indicators: 14611 14612 Z_STREAM_ERROR 14613 Invalid parameter. 14614 14615 Z_MEM_ERROR 14616 Insufficient memory available. 14617 14618 Z_VERSION_ERROR 14619 The version requested is not compatible with the 14620 library version, or the z_stream size differs from that 14621 used by the library. 14622 14623 In addition, the msg field of the strm may be set to an error 14624 message. 14625 14626 inflateInit_ 14627 14628 Name 14629 14630 inflateInit_ -- initialize decompression system 14631 14632 Synopsis 14633 14634 #include 14635 14636 int inflateInit_(z_streamp stream, const char * version, int 14637 stream_size); 14638 14639 Description 14640 14641 The inflateInit_() function shall initialize the decompression 14642 system. On entry, stream shall refer to a user supplied 14643 z_stream object (a z_stream_s structure). The following fields 14644 shall be set on entry: 14645 14646 zalloc 14647 a pointer to an alloc_func function, used to allocate 14648 state information. If this is NULL, a default 14649 allocation function will be used. 14650 14651 zfree 14652 a pointer to a free_func function, used to free memory 14653 allocated by the zalloc function. If this is NULL a 14654 default free function will be used. 14655 14656 opaque 14657 If alloc_func is not NULL, opaque is a user supplied 14658 pointer to data that will be passed to the alloc_func 14659 and free_func functions. 14660 14661 If the version requested is not compatible with the version 14662 implemented, or if the size of the z_stream_s structure 14663 provided in stream_size does not match the size in the library 14664 implementation, inflateInit_() shall fail, and return 14665 Z_VERSION_ERROR. 14666 14667 The inflateInit_() function is not in the source standard; it 14668 is only in the binary standard. Source applications should use 14669 the inflateInit() macro. 14670 14671 The inflateInit_() shall be equivalent to 14672 inflateInit2_(strm, DEF_WBITS, version, stream_size); 14673 14674 Return Value 14675 14676 On success, the inflateInit_() function shall return Z_OK. 14677 Otherwise, inflateInit_() shall return a value as described 14678 below to indicate the error. 14679 14680 Errors 14681 14682 On error, inflateInit_() shall return one of the following 14683 error indicators: 14684 14685 Z_STREAM_ERROR 14686 Invalid parameter. 14687 14688 Z_MEM_ERROR 14689 Insufficient memory available. 14690 14691 Z_VERSION_ERROR 14692 The version requested is not compatible with the 14693 library version, or the z_stream size differs from that 14694 used by the library. 14695 14696 In addition, the msg field of the strm may be set to an error 14697 message. 14698 14699 inflateReset 14700 14701 Name 14702 14703 inflateReset -- reset decompression stream state 14704 14705 Synopsis 14706 14707 #include 14708 14709 int inflateReset(z_streamp stream); 14710 14711 Description 14712 14713 The inflateReset() function shall reset all state associated 14714 with stream. All pending output shall be discarded, and the 14715 counts of processed bytes (total_in and total_out) shall be 14716 reset to zero. 14717 14718 Return Value 14719 14720 On success, inflateReset() shall return Z_OK. Otherwise it 14721 shall return Z_STREAM_ERROR to indicate the error. 14722 14723 Errors 14724 14725 On error, inflateReset() shall return Z_STREAM_ERROR. The 14726 following conditions shall be treated as an error: 14727 14728 * The state in stream is inconsistent or inappropriate. 14729 * stream is NULL. 14730 14731 inflateSetDictionary 14732 14733 Name 14734 14735 inflateSetDictionary -- initialize decompression dictionary 14736 14737 Synopsis 14738 14739 #include 14740 14741 int inflateSetDictionary(z_streamp stream, const Bytef * 14742 dictionary, uInt dictlen); 14743 14744 Description 14745 14746 The inflateSetDictionary() function shall initialize the 14747 decompression dictionary associated with stream using the 14748 dictlen bytes referenced by dictionary. 14749 14750 The inflateSetDictionary() function should be called 14751 immediately after a call to inflate() has failed with return 14752 value Z_NEED_DICT. The dictionary must have the same Adler-32 14753 checksum as the dictionary used for the compression (see 14754 deflateSetDictionary()). 14755 14756 stream shall reference an initialized decompression stream, 14757 with total_in zero (i.e. no data has been decompressed since 14758 the stream was initialized). 14759 14760 Return Value 14761 14762 On success, inflateSetDictionary() shall return Z_OK. 14763 Otherwise it shall return a value as indicated below. 14764 14765 Errors 14766 14767 On error, inflateSetDictionary() shall return a value as 14768 described below: 14769 14770 Z_STREAM_ERROR 14771 The state in stream is inconsistent, or stream was 14772 NULL. 14773 14774 Z_DATA_ERROR 14775 The Adler-32 checksum of the supplied dictionary does 14776 not match that used for the compression. 14777 14778 Application Usage (informative) 14779 14780 The application should provide a dictionary consisting of 14781 strings {{{ed note: do we really mean "strings"? Null 14782 terminated?}}} that are likely to be encountered in the data 14783 to be compressed. The application should ensure that the 14784 dictionary is sorted such that the most commonly used strings 14785 occur at the end of the dictionary. 14786 14787 The use of a dictionary is optional; however if the data to be 14788 compressed is relatively short and has a predictable 14789 structure, the use of a dictionary can substantially improve 14790 the compression ratio. 14791 14792 inflateSync 14793 14794 Name 14795 14796 inflateSync -- advance compression stream to next sync point 14797 14798 Synopsis 14799 14800 #include 14801 14802 int inflateSync(z_streamp stream); 14803 14804 Description 14805 14806 The inflateSync() function shall advance through the 14807 compressed data in stream, skipping any invalid compressed 14808 data, until the next full flush point is reached, or all input 14809 is exhausted. See the description for deflate() with flush 14810 level Z_FULL_FLUSH. No output is placed in next_out. 14811 14812 Return Value 14813 14814 On success, inflateSync() shall return Z_OK, and update the 14815 next_in,, avail_in, and, total_in fields of stream to reflect 14816 the number of bytes of compressed data that have been skipped. 14817 Otherwise, inflateSync() shall return a value as described 14818 below to indicate the error. 14819 14820 Errors 14821 14822 On error, inflateSync() shall return a value as described 14823 below: 14824 14825 Z_STREAM_ERROR 14826 The state (as represented in stream) is inconsistent, 14827 or stream was NULL. 14828 14829 Z_BUF_ERROR 14830 There is no data available to skip over. 14831 14832 Z_DATA_ERROR 14833 No sync point was found. 14834 14835 inflateSyncPoint 14836 14837 Name 14838 14839 inflateSyncPoint -- test for synchronization point 14840 14841 Synopsis 14842 14843 #include 14844 14845 int inflateSyncPoint(z_streamp stream); 14846 14847 Description 14848 14849 The inflateSyncPoint() function shall return a non-zero calue 14850 if the compressed data stream referenced by stream is at a 14851 synchronization point. 14852 14853 Return Value 14854 14855 If the compressed data in stream is at a synchronization point 14856 (see deflate() with a flush level of Z_SYNC_FLUSH or 14857 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 14858 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 14859 valid, inflateSyncPoint() shall return 0. If stream is 14860 invalid, or in an invalid state, inflateSyncPoint() shall 14861 return Z_STREAM_ERROR to indicate the error. 14862 14863 Errors 14864 14865 On error, inflateSyncPoint() shall return a value as described 14866 below: 14867 14868 Z_STREAM_ERROR 14869 The state (as represented in stream) is inconsistent, 14870 or stream was NULL. 14871 14872 uncompress 14873 14874 Name 14875 14876 uncompress -- uncompress data 14877 14878 Synopsis 14879 14880 #include 14881 14882 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 14883 source, uLong sourceLen); 14884 14885 Description 14886 14887 The uncompress() function shall attempt to uncompress 14888 sourceLen bytes of data in the buffer source, placing the 14889 result in the buffer dest. 14890 14891 On entry, destLen should point to a value describing the size 14892 of the dest buffer. The application should ensure that this 14893 value is large enough to hold the entire uncompressed data. 14894 14895 Note: The LSB does not describe any mechanism by which a 14896 compressor can communicate the size required to the 14897 uncompressor. 14898 14899 On successful exit, the variable referenced by destLen shall 14900 be updated to hold the length of uncompressed data in dest. 14901 14902 Return Value 14903 14904 On success, uncompress() shall return Z_OK. Otherwise, 14905 uncompress() shall return a value to indicate the error. 14906 14907 Errors 14908 14909 On error, uncompress() shall return a value as described 14910 below: 14911 14912 Z_BUF_ERROR 14913 The buffer dest was not large enough to hold the 14914 uncompressed data. 14915 14916 Z_MEM_ERROR 14917 Insufficient memory. 14918 14919 Z_DATA_ERROR 14920 The compressed data (referenced by source) was 14921 corrupted. 14922 14923 zError 14924 14925 Name 14926 14927 zError -- translate error number to string 14928 14929 Synopsis 14930 14931 #include 14932 14933 const char * zError(int err); 14934 14935 Description 14936 14937 The zError() function shall return the string identifying the 14938 error associated with err. This allows for conversion from 14939 error code to string for functions such as compress() and 14940 uncompress(), that do not always set the string version of an 14941 error. 14942 14943 Return Value 14944 14945 The zError() function shall return a the string identifying 14946 the error associated with err, or NULL if err is not a valid 14947 error code. 14948 14949 It is unspecified if the string returned is determined by the 14950 setting of the LC_MESSAGES category in the current locale. 14951 14952 Errors 14953 14954 None defined. 14955 14956 zlibVersion 14957 14958 Name 14959 14960 zlibVersion -- discover library version at run time 14961 14962 Synopsis 14963 14964 #include 14965 14966 const char * zlibVersion (void); 14967 14968 Description 14969 14970 The zlibVersion() function shall return the string identifying 14971 the interface version at the time the library was built. 14972 14973 Applications should compare the value returned from 14974 zlibVersion() with the macro constant ZLIB_VERSION for 14975 compatibility. 14976 14977 Return Value 14978 14979 The zlibVersion() function shall return a the string 14980 identifying the version of the library currently implemented. 14981 14982 Errors 14983 14984 None defined. 14985 _________________________________________________________ 14986 14987 2.4. Interfaces for libncurses 14988 14989 Table 2-3 defines the library name and shared object name for 14990 the libncurses library 14991 14992 Table 2-3. libncurses Definition 14993 Library: libncurses 14994 SONAME: libncurses.so.5 14995 14996 The behavior of the interfaces in this library is specified by 14997 the following specifications: 14998 14999 X/Open Curses 15000 _________________________________________________________ 15001 15002 2.4.1. Curses 15003 _________________________________________________________ 15004 15005 2.4.1.1. Interfaces for Curses 15006 15007 An LSB conforming implementation shall provide the generic 15008 functions for Curses specified in Table 2-4, with the full 15009 functionality as described in the referenced underlying 15010 specification. 15011 15012 Table 2-4. libncurses - Curses Function Interfaces 15013 addch [1] has_ic [1] mvwaddchnstr [1] scr_init [1] vwscanw [1] 15014 addchnstr [1] has_il [1] mvwaddchstr [1] scr_restore [1] 15015 waddch [1] 15016 addchstr [1] hline [1] mvwaddnstr [1] scr_set [1] waddchnstr 15017 [1] 15018 addnstr [1] idcok [1] mvwaddstr [1] scrl [1] waddchstr [1] 15019 addstr [1] idlok [1] mvwchgat [1] scroll [1] waddnstr [1] 15020 attr_get [1] immedok [1] mvwdelch [1] scrollok [1] waddstr [1] 15021 attr_off [1] inch [1] mvwgetch [1] set_curterm [1] wattr_get 15022 [1] 15023 attr_on [1] inchnstr [1] mvwgetnstr [1] set_term [1] wattr_off 15024 [1] 15025 attr_set [1] inchstr [1] mvwgetstr [1] setscrreg [1] wattr_on 15026 [1] 15027 attroff [1] init_color [1] mvwhline [1] setupterm [1] 15028 wattr_set [1] 15029 attron [1] init_pair [1] mvwin [1] slk_attr_set [1] wattroff 15030 [1] 15031 attrset [1] initscr [1] mvwinch [1] slk_attroff [1] wattron 15032 [1] 15033 baudrate [1] innstr [1] mvwinchnstr [1] slk_attron [1] 15034 wattrset [1] 15035 beep [1] insch [1] mvwinchstr [1] slk_attrset [1] wbkgd [1] 15036 bkgd [1] insdelln [1] mvwinnstr [1] slk_clear [1] wbkgdset [1] 15037 bkgdset [1] insertln [1] mvwinsch [1] slk_color [1] wborder 15038 [1] 15039 border [1] insnstr [1] mvwinsnstr [1] slk_init [1] wchgat [1] 15040 box [1] insstr [1] mvwinsstr [1] slk_label [1] wclear [1] 15041 can_change_color [1] instr [1] mvwinstr [1] slk_noutrefresh 15042 [1] wclrtobot [1] 15043 cbreak [1] intrflush [1] mvwprintw [1] slk_refresh [1] 15044 wclrtoeol [1] 15045 chgat [1] is_linetouched [1] mvwscanw [1] slk_restore [1] 15046 wcolor_set [1] 15047 clear [1] is_wintouched [1] mvwvline [1] slk_set [1] 15048 wcursyncup [1] 15049 clearok [1] isendwin [1] napms [1] slk_touch [1] wdelch [1] 15050 clrtobot [1] keyname [1] newpad [1] standend [1] wdeleteln [1] 15051 clrtoeol [1] keypad [1] newterm [1] standout [1] wechochar [1] 15052 color_content [1] killchar [1] newwin [1] start_color [1] 15053 werase [1] 15054 color_set [1] leaveok [1] nl [1] subpad [1] wgetch [1] 15055 copywin [1] longname [1] nocbreak [1] subwin [1] wgetnstr [1] 15056 curs_set [1] meta [1] nodelay [1] syncok [1] wgetstr [1] 15057 def_prog_mode [1] move [1] noecho [1] termattrs [1] whline [1] 15058 def_shell_mode [1] mvaddch [1] nonl [1] termname [1] winch [1] 15059 del_curterm [1] mvaddchnstr [1] noqiflush [1] tgetent [1] 15060 winchnstr [1] 15061 delay_output [1] mvaddchstr [1] noraw [1] tgetflag [1] 15062 winchstr [1] 15063 delch [1] mvaddnstr [1] notimeout [1] tgetnum [1] winnstr [1] 15064 deleteln [1] mvaddstr [1] overlay [1] tgetstr [1] winsch [1] 15065 delscreen [1] mvchgat [1] overwrite [1] tgoto [1] winsdelln 15066 [1] 15067 delwin [1] mvcur [1] pair_content [1] tigetflag [1] winsertln 15068 [1] 15069 derwin [1] mvdelch [1] pechochar [1] tigetnum [1] winsnstr [1] 15070 doupdate [1] mvderwin [1] pnoutrefresh [1] tigetstr [1] 15071 winsstr [1] 15072 dupwin [1] mvgetch [1] prefresh [1] timeout [1] winstr [1] 15073 echo [1] mvgetnstr [1] printw [1] touchline [1] wmove [1] 15074 echochar [1] mvgetstr [1] putp [1] touchwin [1] wnoutrefresh 15075 [1] 15076 endwin [1] mvhline [1] putwin [1] tparm [1] wprintw [1] 15077 erase [1] mvinch [1] qiflush [1] tputs [1] wredrawln [1] 15078 erasechar [1] mvinchnstr [1] raw [1] typeahead [1] wrefresh 15079 [1] 15080 filter [1] mvinchstr [1] redrawwin [1] unctrl [1] wscanw [1] 15081 flash [1] mvinnstr [1] refresh [1] ungetch [1] wscrl [1] 15082 flushinp [1] mvinsch [1] reset_prog_mode [1] untouchwin [1] 15083 wsetscrreg [1] 15084 getbkgd [1] mvinsnstr [1] reset_shell_mode [1] use_env [1] 15085 wstandend [1] 15086 getch [1] mvinsstr [1] resetty [1] vidattr [1] wstandout [1] 15087 getnstr [1] mvinstr [1] restartterm [1] vidputs [1] wsyncdown 15088 [1] 15089 getstr [1] mvprintw [1] ripoffline [1] vline [1] wsyncup [1] 15090 getwin [1] mvscanw [1] savetty [1] vw_printw [1] wtimeout [1] 15091 halfdelay [1] mvvline [1] scanw [1] vw_scanw [1] wtouchln [1] 15092 has_colors [1] mvwaddch [1] scr_dump [1] vwprintw [1] wvline 15093 [1] 15094 15095 Referenced Specification(s) 15096 15097 [1]. X/Open Curses 15098 15099 An LSB conforming implementation shall provide the generic 15100 data interfaces for Curses specified in Table 2-5, with the 15101 full functionality as described in the referenced underlying 15102 specification. 15103 15104 Table 2-5. libncurses - Curses Data Interfaces 15105 COLORS [1] COLS [1] acs_map [1] curscr [1] 15106 COLOR_PAIRS [1] LINES [1] cur_term [1] stdscr [1] 15107 15108 Referenced Specification(s) 15109 15110 [1]. X/Open Curses 15111 _________________________________________________________ 15112 15113 2.5. Data Definitions for libncurses 15114 15115 This section defines global identifiers and their values that 15116 are associated with interfaces contained in libncurses. These 15117 definitions are organized into groups that correspond to 15118 system headers. This convention is used as a convenience for 15119 the reader, and does not imply the existence of these headers, 15120 or their content. 15121 15122 These definitions are intended to supplement those provided in 15123 the referenced underlying specifications. 15124 15125 This specification uses ISO/IEC 9899 C Language as the 15126 reference programming language, and data definitions are 15127 specified in ISO C format. The C language is used here as a 15128 convenient notation. Using a C language description of these 15129 data objects does not preclude their use by other programming 15130 languages. 15131 _________________________________________________________ 15132 15133 2.5.1. curses.h 15134 15135 #define ERR (-1) 15136 #define OK (0) 15137 #define ACS_RARROW (acs_map['+']) 15138 #define ACS_LARROW (acs_map[',']) 15139 #define ACS_UARROW (acs_map['-']) 15140 #define ACS_DARROW (acs_map['.']) 15141 #define ACS_BLOCK (acs_map['0']) 15142 #define ACS_CKBOARD (acs_map['a']) 15143 #define ACS_DEGREE (acs_map['f']) 15144 #define ACS_PLMINUS (acs_map['g']) 15145 #define ACS_BOARD (acs_map['h']) 15146 #define ACS_LANTERN (acs_map['i']) 15147 #define ACS_LRCORNER (acs_map['j']) 15148 #define ACS_URCORNER (acs_map['k']) 15149 #define ACS_ULCORNER (acs_map['l']) 15150 #define ACS_LLCORNER (acs_map['m']) 15151 #define ACS_PLUS (acs_map['n']) 15152 #define ACS_S1 (acs_map['o']) 15153 #define ACS_HLINE (acs_map['q']) 15154 #define ACS_S9 (acs_map['s']) 15155 #define ACS_LTEE (acs_map['t']) 15156 #define ACS_RTEE (acs_map['u']) 15157 #define ACS_BTEE (acs_map['v']) 15158 #define ACS_TTEE (acs_map['w']) 15159 #define ACS_VLINE (acs_map['x']) 15160 #define ACS_DIAMOND (acs_map['`']) 15161 #define ACS_BULLET (acs_map['~']) 15162 #define getmaxyx(win,y,x) (y=(win)?((win)->_maxy+1):ERR,x=(win)?( 15163 (win)->_maxx+1):ERR) 15164 #define getbegyx(win,y,x) (y=(win)?(win)->_begy:ERR,x=(win)?(win) 15165 ->_begx:ERR) 15166 #define getyx(win,y,x) (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx: 15167 ERR) 15168 #define getparyx(win,y,x) (y=(win)?(win)->_pary:ERR,x=(win)?(win) 15169 ->_parx:ERR) 15170 15171 #define WA_ALTCHARSET A_ALTCHARSET 15172 #define WA_ATTRIBUTES A_ATTRIBUTES 15173 #define WA_BLINK A_BLINK 15174 #define WA_BOLD A_BOLD 15175 #define WA_DIM A_DIM 15176 #define WA_HORIZONTAL A_HORIZONTAL 15177 #define WA_INVIS A_INVIS 15178 #define WA_LEFT A_LEFT 15179 #define WA_LOW A_LOW 15180 #define WA_NORMAL A_NORMAL 15181 #define WA_PROTECT A_PROTECT 15182 #define WA_REVERSE A_REVERSE 15183 #define WA_RIGHT A_RIGHT 15184 #define WA_STANDOUT A_STANDOUT 15185 #define WA_TOP A_TOP 15186 #define WA_UNDERLINE A_UNDERLINE 15187 #define WA_VERTICAL A_VERTICAL 15188 #define A_REVERSE NCURSES_BITS(1UL,10) 15189 15190 #define COLOR_BLACK 0 15191 #define COLOR_RED 1 15192 #define COLOR_GREEN 2 15193 #define COLOR_YELLOW 3 15194 #define COLOR_BLUE 4 15195 #define COLOR_MAGENTA 5 15196 #define COLOR_CYAN 6 15197 #define COLOR_WHITE 7 15198 15199 #define _SUBWIN 0x01 15200 #define _ENDLINE 0x02 15201 #define _FULLWIN 0x04 15202 #define _ISPAD 0x10 15203 #define _HASMOVED 0x20 15204 15205 typedef unsigned char bool; 15206 15207 typedef unsigned long chtype; 15208 typedef struct screen SCREEN; 15209 typedef struct _win_st WINDOW; 15210 typedef chtype attr_t; 15211 typedef struct 15212 { 15213 attr_t attr; 15214 wchar_t chars[5]; 15215 } 15216 cchar_t; 15217 struct pdat 15218 { 15219 short _pad_y; 15220 short _pad_x; 15221 short _pad_top; 15222 short _pad_left; 15223 short _pad_bottom; 15224 short _pad_right; 15225 } 15226 ; 15227 15228 struct _win_st 15229 { 15230 short _cury; 15231 short _curx; 15232 short _maxy; 15233 short _maxx; 15234 short _begy; 15235 short _begx; 15236 short _flags; 15237 attr_t _attrs; 15238 chtype _bkgd; 15239 bool _notimeout; 15240 bool _clear; 15241 bool _leaveok; 15242 bool _scroll; 15243 bool _idlok; 15244 bool _idcok; 15245 bool _immed; 15246 bool _sync; 15247 bool _use_keypad; 15248 int _delay; 15249 struct ldat *_line; 15250 short _regtop; 15251 short _regbottom; 15252 int _parx; 15253 int _pary; 15254 WINDOW *_parent; 15255 struct pdat _pad; 15256 short _yoffset; 15257 cchar_t _bkgrnd; 15258 } 15259 ; 15260 #define KEY_CODE_YES 0400 15261 #define KEY_BREAK 0401 15262 #define KEY_MIN 0401 15263 #define KEY_DOWN 0402 15264 #define KEY_UP 0403 15265 #define KEY_LEFT 0404 15266 #define KEY_RIGHT 0405 15267 #define KEY_HOME 0406 15268 #define KEY_BACKSPACE 0407 15269 #define KEY_F0 0410 15270 #define KEY_DL 0510 15271 #define KEY_IL 0511 15272 #define KEY_DC 0512 15273 #define KEY_IC 0513 15274 #define KEY_EIC 0514 15275 #define KEY_CLEAR 0515 15276 #define KEY_EOS 0516 15277 #define KEY_EOL 0517 15278 #define KEY_SF 0520 15279 #define KEY_SR 0521 15280 #define KEY_NPAGE 0522 15281 #define KEY_PPAGE 0523 15282 #define KEY_STAB 0524 15283 #define KEY_CTAB 0525 15284 #define KEY_CATAB 0526 15285 #define KEY_ENTER 0527 15286 #define KEY_SRESET 0530 15287 #define KEY_RESET 0531 15288 #define KEY_PRINT 0532 15289 #define KEY_LL 0533 15290 #define KEY_A1 0534 15291 #define KEY_A3 0535 15292 #define KEY_B2 0536 15293 #define KEY_C1 0537 15294 #define KEY_C3 0540 15295 #define KEY_BTAB 0541 15296 #define KEY_BEG 0542 15297 #define KEY_CANCEL 0543 15298 #define KEY_CLOSE 0544 15299 #define KEY_COMMAND 0545 15300 #define KEY_COPY 0546 15301 #define KEY_CREATE 0547 15302 #define KEY_END 0550 15303 #define KEY_EXIT 0551 15304 #define KEY_FIND 0552 15305 #define KEY_HELP 0553 15306 #define KEY_MARK 0554 15307 #define KEY_MESSAGE 0555 15308 #define KEY_MOVE 0556 15309 #define KEY_NEXT 0557 15310 #define KEY_OPEN 0560 15311 #define KEY_OPTIONS 0561 15312 #define KEY_PREVIOUS 0562 15313 #define KEY_REDO 0563 15314 #define KEY_REFERENCE 0564 15315 #define KEY_REFRESH 0565 15316 #define KEY_REPLACE 0566 15317 #define KEY_RESTART 0567 15318 #define KEY_RESUME 0570 15319 #define KEY_SAVE 0571 15320 #define KEY_SBEG 0572 15321 #define KEY_SCANCEL 0573 15322 #define KEY_SCOMMAND 0574 15323 #define KEY_SCOPY 0575 15324 #define KEY_SCREATE 0576 15325 #define KEY_SDC 0577 15326 #define KEY_SDL 0600 15327 #define KEY_SELECT 0601 15328 #define KEY_SEND 0602 15329 #define KEY_SEOL 0603 15330 #define KEY_SEXIT 0604 15331 #define KEY_SFIND 0605 15332 #define KEY_SHELP 0606 15333 #define KEY_SHOME 0607 15334 #define KEY_SIC 0610 15335 #define KEY_SLEFT 0611 15336 #define KEY_SMESSAGE 0612 15337 #define KEY_SMOVE 0613 15338 #define KEY_SNEXT 0614 15339 #define KEY_SOPTIONS 0615 15340 #define KEY_SPREVIOUS 0616 15341 #define KEY_SPRINT 0617 15342 #define KEY_SREDO 0620 15343 #define KEY_SREPLACE 0621 15344 #define KEY_SRIGHT 0622 15345 #define KEY_SRSUME 0623 15346 #define KEY_SSAVE 0624 15347 #define KEY_SSUSPEND 0625 15348 #define KEY_SUNDO 0626 15349 #define KEY_SUSPEND 0627 15350 #define KEY_UNDO 0630 15351 #define KEY_MOUSE 0631 15352 #define KEY_RESIZE 0632 15353 #define KEY_MAX 0777 15354 15355 #define PAIR_NUMBER(a) (((a)& A_COLOR)>>8) 15356 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 15357 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 15358 #define A_NORMAL 0L 15359 #define NCURSES_ATTR_SHIFT 8 15360 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 15361 #define A_BLINK NCURSES_BITS(1UL,11) 15362 #define A_DIM NCURSES_BITS(1UL,12) 15363 #define A_BOLD NCURSES_BITS(1UL,13) 15364 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 15365 #define A_INVIS NCURSES_BITS(1UL,15) 15366 #define A_PROTECT NCURSES_BITS(1UL,16) 15367 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 15368 #define A_LEFT NCURSES_BITS(1UL,18) 15369 #define A_LOW NCURSES_BITS(1UL,19) 15370 #define A_RIGHT NCURSES_BITS(1UL,20) 15371 #define A_TOP NCURSES_BITS(1UL,21) 15372 #define A_VERTICAL NCURSES_BITS(1UL,22) 15373 #define A_STANDOUT NCURSES_BITS(1UL,8) 15374 #define A_UNDERLINE NCURSES_BITS(1UL,9) 15375 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 15376 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 15377 _________________________________________________________ 15378 15379 2.6. Interfaces for libutil 15380 15381 Table 2-6 defines the library name and shared object name for 15382 the libutil library 15383 15384 Table 2-6. libutil Definition 15385 Library: libutil 15386 SONAME: libutil.so.1 15387 15388 The behavior of the interfaces in this library is specified by 15389 the following specifications: 15390 15391 this specification 15392 _________________________________________________________ 15393 15394 2.6.1. Utility Functions 15395 _________________________________________________________ 15396 15397 2.6.1.1. Interfaces for Utility Functions 15398 15399 An LSB conforming implementation shall provide the generic 15400 functions for Utility Functions specified in Table 2-7, with 15401 the full functionality as described in the referenced 15402 underlying specification. 15403 15404 Table 2-7. libutil - Utility Functions Function Interfaces 15405 forkpty [1] login_tty [1] logwtmp [1] 15406 login [1] logout [1] openpty [1] 15407 15408 Referenced Specification(s) 15409 15410 [1]. this specification 15411 _________________________________________________________ 15412 15413 2.7. Interface Definitions for libutil 15414 15415 Table of Contents 15416 forkpty -- Create a new process attached to an available 15417 pseudo-terminal 15418 15419 login -- login utility function 15420 login_tty -- Prepare a terminal for login 15421 logout -- logout utility function 15422 logwtmp -- append an entry to the wtmp file 15423 openpty -- find and open an available pseudo-terminal 15424 15425 The following interfaces are included in libutil and are 15426 defined by this specification. Unless otherwise noted, these 15427 interfaces shall be included in the source standard. 15428 15429 Other interfaces listed above for libutil shall behave as 15430 described in the referenced base document. 15431 15432 forkpty 15433 15434 Name 15435 15436 forkpty -- Create a new process attached to an available 15437 pseudo-terminal 15438 15439 Synopsis 15440 15441 #include 15442 15443 int forkpty(int * amaster, char * name, struct termios * 15444 termp, struct winsize * winp); 15445 15446 Description 15447 15448 The forkpty() function shall find and open a pseudo-terminal 15449 device pair in the same manner as the openpty() function. If a 15450 pseudo-terminal is available, forkpty() shall create a new 15451 process in the same manner as the fork() function, and 15452 prepares the new process for login in the same manner as 15453 login_tty(). 15454 15455 If termp is not null, it shall refer to a termios structure 15456 that shall be used to initialize the characteristics of the 15457 slave device. If winp is not null, it shall refer to a winsize 15458 structure used to initialize the window size of the slave 15459 device. 15460 15461 Return Value 15462 15463 On success, the parent process shall return the process id of 15464 the child, and the child shall return 0. On error, no new 15465 process shall be created, -1 shall be returned, and errno 15466 shall be set appropriately. On success, the parent process 15467 shall receive the file descriptor of the master side of the 15468 pseudo-terminal in the location referenced by amaster, and, if 15469 name is not NULL, the filename of the slave device in name. 15470 15471 Errors 15472 15473 EAGAIN 15474 Unable to create a new process. 15475 15476 ENOENT 15477 There are no available pseudo-terminals. 15478 15479 ENOMEM 15480 Insufficient memory was available. 15481 15482 login 15483 15484 Name 15485 15486 login -- login utility function 15487 15488 Synopsis 15489 15490 #include 15491 15492 void login (struct utmp * ut ); 15493 15494 Description 15495 15496 The login() function shall update the user accounting 15497 databases. The ut parameter shall reference a utmp structure 15498 for all fields except the following: 15499 15500 1. The ut_type field shall be set to USER_PROCESS. 15501 2. The ut_pid field shall be set to the process identifier 15502 for the current process. 15503 3. The ut_line field shall be set to the name of the 15504 controlling terminal device. The name shall be found by 15505 examining the device associated with the standard input, 15506 output and error streams in sequence, until one associated 15507 with a terminal device is found. If none of these streams 15508 refers to a terminal device, the ut_line field shall be 15509 set to "???". If the terminal device is in the /dev 15510 directory hierarchy, the ut_line field shall not contain 15511 the leading "/dev/", otherwise it shall be set to the 15512 final component of the pathname of the device. If the user 15513 accounting database imposes a limit on the size of the 15514 ut_line field, it shall truncate the name, but any such 15515 limit shall not be smaller than UT_LINESIZE (including a 15516 terminating null character). 15517 15518 Return Value 15519 15520 None 15521 15522 Errors 15523 15524 None 15525 15526 login_tty 15527 15528 Name 15529 15530 login_tty -- Prepare a terminal for login 15531 15532 Synopsis 15533 15534 #include 15535 15536 int login_tty (int fdr); 15537 15538 Description 15539 15540 The login_tty() function shall prepare the terminal device 15541 referenced by the file descriptor fdr. This function shall 15542 create a new session, make the terminal the controlling 15543 terminal for the current process, and set the standard input, 15544 output, and error streams of the current process to the 15545 terminal. If fdr is not the standard input, output or error 15546 stream, then login_tty() shall close fdr. 15547 15548 Return Value 15549 15550 On success, login_tty() shall return zero; otherwise -1 is 15551 returned, and errno shall be set appropriately. 15552 15553 Errors 15554 15555 ENOTTY 15556 fdr does not refer to a terminal device. 15557 15558 logout 15559 15560 Name 15561 15562 logout -- logout utility function 15563 15564 Synopsis 15565 15566 #include 15567 15568 int logout (const char * line ); 15569 15570 Description 15571 15572 Given the device line, the logout() function shall search the 15573 user accounting database which is read by getutent() for an 15574 entry with the corresponding line, and with the type of 15575 USER_PROCESS. If a corresponding entry is located, it shall be 15576 updated as follows: 15577 15578 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 15579 bytes). 15580 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 15581 bytes). 15582 3. The ut_tv shall be set to the current time of day. 15583 4. The ut_type field shall be set to DEAD_PROCESS. 15584 15585 Return Value 15586 15587 On success, the logout() function shall return non-zero. Zero 15588 is returned if there was no entry to remove, or if the utmp 15589 file could not be opened or updated. 15590 15591 logwtmp 15592 15593 Name 15594 15595 logwtmp -- append an entry to the wtmp file 15596 15597 Synopsis 15598 15599 #include 15600 15601 void logwtmp (const char * line , const char * name , const 15602 char * host ); 15603 15604 Description 15605 15606 If the process has permission to update the user accounting 15607 databases, the logwtmp() function shall append a record to the 15608 user accounting database that records all logins and logouts. 15609 The record to be appended shall be constructed as follows: 15610 15611 1. The ut_line field shall be initialized from line. If the 15612 user accounting database imposes a limit on the size of 15613 the ut_line field, it shall truncate the value, but any 15614 such limit shall not be smaller than UT_LINESIZE 15615 (including a terminating null character). 15616 2. The ut_name field shall be initialized from name. If the 15617 user accounting database imposes a limit on the size of 15618 the ut_name field, it shall truncate the value, but any 15619 such limit shall not be smaller than UT_NAMESIZE 15620 (including a terminating null character). 15621 3. The ut_host field shall be initialized from host. If the 15622 user accounting database imposes a limit on the size of 15623 the ut_host field, it shall truncate the value, but any 15624 such limit shall not be smaller than UT_HOSTSIZE 15625 (including a terminating null character). 15626 4. If the name parameter does not refer to an empty string 15627 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 15628 otherwise the ut_type field shall be set to DEAD_PROCESS. 15629 5. The ut_id field shall be set to the process identifier for 15630 the current process. 15631 6. The ut_tv field shall be set to the current time of day. 15632 15633 Note: If a process does not have write access to the the 15634 user accounting database, the logwtmp() function will not 15635 update it. Since the function does not return any value, an 15636 application has no way of knowing whether it succeeded or 15637 failed. 15638 15639 Return Value 15640 15641 None. 15642 15643 openpty 15644 15645 Name 15646 15647 openpty -- find and open an available pseudo-terminal 15648 15649 Synopsis 15650 15651 #include 15652 15653 int openpty(int *amaster, int *aslave, char *name, struct 15654 termios *termp, struct winsize *winp); 15655 15656 Description 15657 15658 The openpty() function shall find an available pseudo-terminal 15659 and return file descriptors for the master and slave devices 15660 in the locations referenced by amaster and aslave 15661 respectively. If name is not NULL, the filename of the slave 15662 shall be placed in the user supplied buffer referenced by 15663 name. If termp is not NULL, it shall point to a termios 15664 structure used to initialize the terminal parameters of the 15665 slave pseudo-terminal device. If winp is not NULL, it shall 15666 point to a winsize structure used to initialize the window 15667 size parameters of the slave pseudo-terminal device. 15668 15669 Return Value 15670 15671 On success, zero is returned. On error, -1 is returned, and 15672 errno is set appropriately. 15673 15674 Errors 15675 15676 ENOENT 15677 There are no available pseudo-terminals. 15678 15679 III. Commands and Utilities 15680 15681 Table of Contents 15682 3. Commands and Utilities 15683 _________________________________________________________ 15684 15685 Chapter 3. Commands and Utilities 15686 15687 3.1. Commands and Utilities 15688 15689 Table 3-1 lists the Commands and Utilities required to be 15690 present on a conforming system. These commands and utilities 15691 shall behave as described in the relevant underlying 15692 specification, with the following exceptions: 15693 15694 1. If any operand (except one which follows --) starts with a 15695 hyphen, the behavior is unspecified. 15696 15697 Rationale (Informative): Applications should place options 15698 before operands, or use --, as needed. This text is needed 15699 because GNU option parsing differs from POSIX. For example, 15700 ls . -a in GNU ls means to list the current directory, 15701 showing all files (that is, "." is an operand and -a is an 15702 option). In POSIX, "." and -a are both operands, and the 15703 command means to list the current directory, and also the 15704 file named -a. Suggesting that applications rely on the 15705 setting of the POSIXLY_CORRECT environment variable, or try 15706 to set it, seems worse than just asking the applictions to 15707 invoke commands in ways which work with either the POSIX or 15708 GNU behaviors. 15709 15710 The behavior of the interfaces described in this section is 15711 specified by the following standards. 15712 15713 this specification 15714 ISO POSIX (2003) 15715 15716 Table 3-1. Commands and Utilities 15717 [ [1] ar [2] at [2] awk [2] basename [1] 15718 batch [2] bc [2] cat [1] chfn [2] chgrp [2] 15719 chmod [1] chown [2] chsh [2] cksum [1] cmp [1] 15720 col [2] comm [1] cp [1] cpio [2] crontab [2] 15721 csplit [1] cut [2] date [1] dd [1] df [2] 15722 diff [1] dirname [1] dmesg [2] du [2] echo [2] 15723 egrep [2] env [1] expand [1] expr [1] false [1] 15724 fgrep [2] file [2] find [2] fold [1] fuser [2] 15725 gencat [1] getconf [1] gettext [2] grep [2] groupadd [2] 15726 groupdel [2] groupmod [2] groups [2] gunzip [2] gzip [2] 15727 head [1] hostname [2] iconv [1] id [1] install [2] 15728 install_initd [2] ipcrm [2] ipcs [2] join [1] kill [1] 15729 killall [2] ln [1] locale [1] localedef [1] logname [1] 15730 lpr [2] ls [2] lsb_release [2] m4 [2] make [1] 15731 man [1] md5sum [2] mkdir [1] mkfifo [1] mknod [2] 15732 mktemp [2] more [2] mount [2] msgfmt [2] mv [1] 15733 newgrp [2] nice [1] nl [1] nohup [1] od [2] 15734 passwd [2] paste [1] patch [2] pathchk [1] pidof [2] 15735 pr [1] printf [1] ps [1] pwd [1] remove_initd [2] 15736 renice [2] rm [1] rmdir [1] sed [2] sendmail [2] 15737 sh [1] shutdown [2] sleep [1] sort [1] split [1] 15738 strip [1] stty [1] su [2] sync [2] tail [1] 15739 tar [2] tee [1] test [1] time [1] touch [1] 15740 tr [1] true [1] tsort [1] tty [1] umount [2] 15741 uname [1] unexpand [1] uniq [1] useradd [2] userdel [2] 15742 usermod [2] wc [1] xargs [2] 15743 15744 Referenced Specification(s) 15745 15746 [1]. ISO POSIX (2003) 15747 15748 [2]. this specification 15749 _________________________________________________________ 15750 15751 3.2. Command Behavior 15752 15753 Table of Contents 15754 ar -- create and maintain library archives (DEPRECATED) 15755 at -- examine or delete jobs for later execution 15756 awk -- pattern scanning and processing language 15757 batch -- schedule commands to be executed in a batch queue 15758 bc -- An arbitrary precision calculator language 15759 chfn -- change user name and information 15760 chgrp -- change file group 15761 chown -- change file owner and group 15762 chsh -- change login shell 15763 col -- filter reverse line feeds from input 15764 cpio -- copy file archives in and out 15765 crontab -- maintain crontab files for individual users 15766 cut -- split a file into sections determined by context lines 15767 df -- report filesystem disk space usage 15768 dmesg -- print or control the system message buffer 15769 du -- estimate file space usage 15770 echo -- display a line of text 15771 egrep -- search a file with an ERE pattern 15772 fgrep -- search a file with a fixed pattern 15773 file -- determine file type 15774 find -- search for files in a directory hierarchy 15775 fuser -- identify processes using files or sockets 15776 gettext -- retrieve text string from message catalog 15777 grep -- print lines matching a pattern 15778 groupadd -- create a new group 15779 groupdel -- delete a group 15780 groupmod -- modify a group 15781 groups -- display a group 15782 gunzip -- uncompress files 15783 gzip -- compress or expand files 15784 hostname -- show or set the system's host name 15785 install -- copy files and set attributes 15786 install_initd -- install an init.d file 15787 ipcrm -- Remove IPC Resources 15788 ipcs -- provide information on ipc facilities 15789 killall -- kill processes by name 15790 lpr -- off line print 15791 ls -- list directory contents 15792 lsb_release -- print distribution specific information 15793 m4 -- macro processor 15794 md5sum -- generate or check MD5 message digests 15795 mknod -- make special files 15796 mktemp -- make temporary file name (unique) 15797 more -- display files on a page-by-page basis 15798 mount -- mount a file system 15799 msgfmt -- create a message object from a message file 15800 newgrp -- change group ID 15801 od -- dump files in octal and other formats 15802 passwd -- change user password 15803 patch -- apply a diff file to an original 15804 pidof -- find the process ID of a running program 15805 remove_initd -- clean up boot script system modifications 15806 introduced by install_initd 15807 15808 renice -- alter priority of running processes 15809 sed -- stream editor 15810 sendmail -- an electronic mail transport agent 15811 shutdown -- bring the system down 15812 su -- change user ID or become super-user 15813 sync -- flush filesystem buffers 15814 tar -- file archiver 15815 umount -- unmount file systems 15816 useradd -- create a new user or update default new user 15817 information 15818 15819 userdel -- delete a user account and related files 15820 usermod -- modify a user account 15821 xargs -- build and execute command lines from standard input 15822 15823 This section contains descriptions for commands and utilities 15824 whose specified behavior in the LSB contradicts or extends the 15825 standards referenced. It also contains commands and utilities 15826 only required by the LSB and not specified by other standards. 15827 15828 ar 15829 15830 Name 15831 15832 ar -- create and maintain library archives (DEPRECATED) 15833 15834 Description 15835 15836 ar is deprecated from the LSB and is expected to disappear 15837 from a future version of the LSB. 15838 15839 Rationale: The LSB generally does not include software 15840 development utilities nor does it specify .o and .a file 15841 formats. 15842 15843 ar is as specified in ISO POSIX (2003) but with differences as 15844 listed below. 15845 15846 Differences 15847 15848 -T, -C 15849 need not be accepted. 15850 15851 -l 15852 has unspecified behavior. 15853 15854 -q 15855 has unspecified behavior; using -r is suggested. 15856 15857 at 15858 15859 Name 15860 15861 at -- examine or delete jobs for later execution 15862 15863 Description 15864 15865 at is as specified in ISO POSIX (2003) but with differences as 15866 listed below. 15867 15868 Differences 15869 15870 -d 15871 is functionally equivalent to the -r option specified 15872 in ISO POSIX (2003). 15873 15874 -r 15875 need not be supported, but the '-d' option is 15876 equivalent. 15877 15878 -t time 15879 need not be supported. 15880 15881 Files 15882 15883 The files at.allow and at.deny reside in /etc rather than 15884 /usr/lib/cron. 15885 15886 awk 15887 15888 Name 15889 15890 awk -- pattern scanning and processing language 15891 15892 Description 15893 15894 awk is as specified in ISO POSIX (2003) but with differences 15895 as listed below. 15896 15897 Differences 15898 15899 Certain aspects of internationalized regular expressions are 15900 optional; see Internationalization and Regular Expressions. 15901 15902 batch 15903 15904 Name 15905 15906 batch -- schedule commands to be executed in a batch queue 15907 15908 Description 15909 15910 The specification for batch is as specified in ISO POSIX 15911 (2003), but with the following differences as listed below. 15912 15913 Files 15914 15915 The files at.allow and at.deny reside in /etc rather than 15916 /usr/lib/cron. 15917 15918 bc 15919 15920 Name 15921 15922 bc -- An arbitrary precision calculator language 15923 15924 Description 15925 15926 bc is as specified in ISO POSIX (2003) but with differences as 15927 listed below. 15928 15929 Differences 15930 15931 The bc language may be extended in an implementation defined 15932 manner. If an implementation supports extensions, it shall 15933 also support the additional options: 15934 15935 -s|--standard 15936 processes exactly the POSIX bc language. 15937 15938 -w|--warn 15939 gives warnings for extensions to POSIX bc. 15940 15941 chfn 15942 15943 Name 15944 15945 chfn -- change user name and information 15946 15947 Synopsis 15948 15949 chfn [-f full_name] [-h home_phone] [user] 15950 15951 Description 15952 15953 chfn shall update the user database. An unprivileged user may 15954 only change the fields for their own account, a user with 15955 appropriate privileges may change the fields for any account. 15956 15957 The fields full_name and home_phone may contain any character 15958 except: 15959 15960 any control character 15961 comma 15962 colon 15963 equal sign 15964 15965 If none of the options are selected, chfn operates in an 15966 interactive fashion. The prompts and expected input in 15967 interactive mode are unspecified and should not be relied 15968 upon. 15969 15970 As it is possible for the system to be configured to restrict 15971 which fields a non-privileged user is permitted to change, 15972 applications should be written to gracefully handle these 15973 situations. 15974 15975 Standard Options 15976 15977 -f full_name 15978 sets the user's full name. 15979 15980 -h home_phone 15981 sets the user's home phone number. 15982 15983 Future Directions 15984 15985 The following two options are expected to be added in a future 15986 version of the LSB: 15987 15988 -o office 15989 sets the user's office room number. 15990 15991 -p office_phone 15992 sets the user's office phone number. 15993 15994 Note that some implementations contain a "-o other" option 15995 which specifies an additional field called "other". 15996 Traditionally, this field is not subject to the constraints 15997 about legitimate characters in fields. Also, one traditionally 15998 shall have appropriate privileges to change the other field. 15999 At this point there is no consensus about whether it is 16000 desirable to specify the other field; applications may wish to 16001 avoid using it. 16002 16003 The "-w work_phone" field found in some implementations should 16004 be replaced by the "-p office_phone" field. The "-r 16005 room_number" field found in some implementations is the 16006 equivalent of the "-o office" option mentioned above; which 16007 one of these two options to specify will depend on 16008 implementation experience and the decision regarding the other 16009 field. 16010 16011 chgrp 16012 16013 Name 16014 16015 chgrp -- change file group 16016 16017 Description 16018 16019 chgrp is as specified in ISO POSIX (2003) but with differences 16020 as listed below. 16021 16022 Differences 16023 16024 The -L, -H, and -P options need not be supported. 16025 16026 chown 16027 16028 Name 16029 16030 chown -- change file owner and group 16031 16032 Description 16033 16034 chown is as specified in ISO POSIX (2003) but with differences 16035 as listed below. 16036 16037 Differences 16038 16039 The -L, -H, and -P options need not be supported. 16040 16041 chsh 16042 16043 Name 16044 16045 chsh -- change login shell 16046 16047 Synopsis 16048 16049 chsh [-s login_shell] [user] 16050 16051 Description 16052 16053 chsh changes the user login shell. This determines the name of 16054 the user's initial login command. An unprivileged user may 16055 only change the login shell for their own account, a user with 16056 appropriate privilege may change the login shell for any 16057 account specified by user. 16058 16059 Unless the user has appropriate privilege, the initial login 16060 command name shall be one of those listed in /etc/shells. The 16061 login_shell shall be the absolute path (i.e. it must start 16062 with '/') to an executable file. Accounts which are restricted 16063 (in an implementation-defined manner) may not change their 16064 login shell. 16065 16066 If the -s option is not selected, chsh operates in an 16067 interactive mode. The prompts and expected input in this mode 16068 are unspecified. 16069 16070 Standard Options 16071 16072 -s login_shell 16073 sets the login shell. 16074 16075 col 16076 16077 Name 16078 16079 col -- filter reverse line feeds from input 16080 16081 Description 16082 16083 col is as specified in the SUSv2 with the difference that the 16084 -p option has unspecified behavior. 16085 16086 Although col is shown as legacy in SUSv2, Version 2, it is not 16087 (yet) deprecated in the LSB. 16088 16089 cpio 16090 16091 Name 16092 16093 cpio -- copy file archives in and out 16094 16095 Description 16096 16097 cpio is as specified in ISO POSIX (2003), but with differences 16098 as listed below. 16099 16100 Differences 16101 16102 Some elements of the Pattern Matching Notation are optional; 16103 see Internationalization and Pattern Matching Notation. 16104 16105 crontab 16106 16107 Name 16108 16109 crontab -- maintain crontab files for individual users 16110 16111 Synopsis 16112 16113 crontab [-u user] file 16114 crontab [-u user] {-l | -r | -e} 16115 16116 Description 16117 16118 crontab is as specified in ISO POSIX (2003), but with 16119 differences as listed below. 16120 16121 Files 16122 16123 The files cron.allow and cron.deny reside in /etc rather than 16124 /usr/lib/cron. 16125 16126 cut 16127 16128 Name 16129 16130 cut -- split a file into sections determined by context lines 16131 16132 Description 16133 16134 cut is as specified in ISO POSIX (2003), but with differences 16135 as listed below. 16136 16137 Differences 16138 16139 -n 16140 has unspecified behavior. 16141 16142 df 16143 16144 Name 16145 16146 df -- report filesystem disk space usage 16147 16148 Description 16149 16150 df is as specified in ISO POSIX (2003), but with the following 16151 differences. 16152 16153 If the -k option is not specified, disk space is shown in 16154 unspecified units. Applications should specify -k. 16155 16156 If an argument is the absolute file name of a disk device node 16157 containing a mounted filesystem, df shows the space available 16158 on that filesystem rather than on the filesystem containing 16159 the device node (which is always the root filesystem). 16160 16161 dmesg 16162 16163 Name 16164 16165 dmesg -- print or control the system message buffer 16166 16167 Synopsis 16168 16169 dmesg [-c | -n level | -s bufsize] 16170 16171 Description 16172 16173 dmesg examines or controls the system message buffer. Only a 16174 user with appropriate privileges may modify the system message 16175 buffer parameters or contents. 16176 16177 Standard Options 16178 16179 -c 16180 If the user has appropriate privilege, clears the 16181 system message buffer contents after printing. 16182 16183 -n level 16184 If the user has appropriate privilege, sets the level 16185 at which logging of messages is done to the console. 16186 16187 -s bufsize 16188 uses a buffer of bufsize to query the system message 16189 buffer. This is 16392 by default (this matches the 16190 default kernel syslog buffer size since 2.1.113). If 16191 you have set the kernel buffer to larger than the 16192 default then this option can be used to view the entire 16193 buffer. 16194 16195 du 16196 16197 Name 16198 16199 du -- estimate file space usage 16200 16201 Description 16202 16203 du is as specified in ISO POSIX (2003), but with differences 16204 as listed below. 16205 16206 Differences 16207 16208 If the -k option is not specified, disk space is shown in 16209 unspecified units. Applications should specify -k. 16210 16211 echo 16212 16213 Name 16214 16215 echo -- display a line of text 16216 16217 Synopsis 16218 16219 echo [STRING...] 16220 16221 Description 16222 16223 The echo command is as specified in ISO POSIX (2003), but with 16224 the following differences. 16225 16226 Unlike the behavior specified in ISO POSIX (2003), whether 16227 echo supports options is implementation defined. The behavior 16228 of echo if any arguments contain backslashes is also 16229 implementation defined. Conforming applications shall not run 16230 echo with a first argument starting with a hyphen, or with any 16231 arguments containing backslashes; they shall use printf in 16232 those cases. 16233 16234 Note: The behavior specified here is similar to that 16235 specified by ISO POSIX (2003) without the XSI option. 16236 However, the LSB forbids all options and the latter forbids 16237 only -n. 16238 16239 egrep 16240 16241 Name 16242 16243 egrep -- search a file with an ERE pattern 16244 16245 Description 16246 16247 egrep is equivalent to grep -E. For further details, see the 16248 specification for grep. 16249 16250 fgrep 16251 16252 Name 16253 16254 fgrep -- search a file with a fixed pattern 16255 16256 Description 16257 16258 fgrep is equivalent to grep -F. For further details, see the 16259 specification for grep. 16260 16261 file 16262 16263 Name 16264 16265 file -- determine file type 16266 16267 Description 16268 16269 file is as specified in ISO POSIX (2003), but with differences 16270 as listed below. 16271 16272 Differences 16273 16274 The -M, -h, -d, and -i options need not be supported. 16275 16276 find 16277 16278 Name 16279 16280 find -- search for files in a directory hierarchy 16281 16282 Description 16283 16284 find is as specified in ISO POSIX (2003), but with additional 16285 options as specified below. 16286 16287 Differences 16288 16289 Some elements of the Pattern Matching Notation are optional; 16290 see Internationalization and Pattern Matching Notation. 16291 16292 fuser 16293 16294 Name 16295 16296 fuser -- identify processes using files or sockets 16297 16298 Description 16299 16300 fuser is as specified in ISO POSIX (2003), but with 16301 differences as listed below. 16302 16303 Differences 16304 16305 -c 16306 has unspecified behavior. 16307 16308 -f 16309 has unspecified behavior. 16310 16311 gettext 16312 16313 Name 16314 16315 gettext -- retrieve text string from message catalog 16316 16317 Synopsis 16318 16319 gettext [options] [textdomain] msgid 16320 gettext -s [options] msgid... 16321 16322 Description 16323 16324 The gettext utility retrieves a translated text string 16325 corresponding to string msgid from a message object generated 16326 with msgfmt utility. 16327 16328 The message object name is derived from the optional argument 16329 textdomain if present, otherwise from the TEXTDOMAIN 16330 environment variable. If no domain is specified, or if a 16331 corresponding string cannot be found, gettext prints msgid. 16332 16333 Ordinarily gettext looks for its message object in 16334 dirname/lang/LC_MESSAGES where dirname is the 16335 implementation-defined default directory and lang is the 16336 locale name. If present, the TEXTDOMAINDIR environment 16337 variable replaces the dirname. 16338 16339 This utility interprets C escape sequences such as \t for tab. 16340 Use \\ to print a backslash. To produce a message on a line of 16341 its own, either put a \n at the end of msgid, or use this 16342 command in conjunction with the printf utility. 16343 16344 When used with the -s option the gettext utility behaves like 16345 the echo utility, except that the message corresponding to 16346 msgid in the selected catalog provides the arguments. 16347 16348 Options 16349 16350 -d domainname, --domain=domainname 16351 PARAMETER translated messages from domainname. 16352 16353 -e 16354 Enable expansion of some escape sequences. 16355 16356 -n 16357 Suppress trailing newline. 16358 16359 Operands 16360 16361 The following operands are supported: 16362 16363 textdomain 16364 A domain name used to retrieve the messages. 16365 16366 msgid 16367 A key to retrieve the localized message. 16368 16369 Environment Variables 16370 16371 LANGUAGE 16372 Specifies one or more locale names. 16373 16374 LANG 16375 Specifies locale name. 16376 16377 LC_MESSAGES 16378 Specifies messaging locale, and if present overrides 16379 LANG for messages. 16380 16381 TEXTDOMAIN 16382 Specifies the text domain name, which is identical to 16383 the message object filename without .mo suffix. 16384 16385 TEXTDOMAINDIR 16386 Specifies the pathname to the message catalog, and if 16387 present replaces the implementation-defined default 16388 directory. 16389 16390 Exit Status 16391 16392 The following exit values are returned: 16393 16394 0 16395 Successful completion. 16396 16397 >0 16398 An error occurred. 16399 16400 grep 16401 16402 Name 16403 16404 grep -- print lines matching a pattern 16405 16406 Description 16407 16408 grep is as specified in ISO POSIX (2003), but with differences 16409 as listed below. 16410 16411 LSB Differences 16412 16413 Some elements of the Pattern Matching Notation are optional; 16414 see Internationalization and Pattern Matching Notation. 16415 16416 groupadd 16417 16418 Name 16419 16420 groupadd -- create a new group 16421 16422 Synopsis 16423 16424 groupadd [-g gid [-o]] group 16425 16426 Description 16427 16428 If the caller has appropriate privilege, the groupadd command 16429 shall create a new group named group. The group name shall be 16430 unique in the group database. If no gid is specified, groupadd 16431 shall create the new group with a unique group ID. 16432 16433 Options 16434 16435 -g gid [-o] 16436 The new group shall have group ID gid. If the -o option 16437 is not used, no other group shall have this group ID. 16438 The value of gidshall be non-negative. 16439 16440 groupdel 16441 16442 Name 16443 16444 groupdel -- delete a group 16445 16446 Synopsis 16447 16448 groupdel group 16449 16450 Description 16451 16452 If the caller has sufficient privilege, the groupdel command 16453 shall modify the system group database, deleting the group 16454 named group. If the group named group does not exist, groupdel 16455 shall issue a diagnostic message and exit with a non-zero exit 16456 status. 16457 16458 groupmod 16459 16460 Name 16461 16462 groupmod -- modify a group 16463 16464 Synopsis 16465 16466 groupmod [-g gid [-o]] [-n group_name] group 16467 16468 Description 16469 16470 If the caller has appropriate privilege, the groupmod command 16471 shall modify the entry in the system group database 16472 corresponding to a group named group. 16473 16474 Options 16475 16476 -g gid [-o] 16477 Modify the group's group ID, setting it to gid. If the 16478 -o option is not used, no other group shall have this 16479 group ID. The value of gidshall be non-negative. 16480 16481 Note: Only the group ID in the database is altered; any 16482 files with group ownership set to the original group ID are 16483 unchanged by this modification. 16484 16485 -n group_name 16486 changes the name of the group from group to group_name. 16487 16488 groups 16489 16490 Name 16491 16492 groups -- display a group 16493 16494 Synopsis 16495 16496 groups [user] 16497 16498 Description 16499 16500 The groups command shall behave as id -Gn [user], as specified 16501 in ISO POSIX (2003). The optional user parameter will display 16502 the groups for the named user. 16503 16504 gunzip 16505 16506 Name 16507 16508 gunzip -- uncompress files 16509 16510 Description 16511 16512 gunzip is equivalent to gzip -d. See the specification for 16513 gzip for further details. 16514 16515 gzip 16516 16517 Name 16518 16519 gzip -- compress or expand files 16520 16521 Synopsis 16522 16523 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 16524 16525 Description 16526 16527 The gzip command shall attempt to reduce the size of the named 16528 files. Whenever possible, each file is replaced by one with 16529 the extension .gz, while keeping the same ownership modes, 16530 access and modification times. If no files are specified, or 16531 if a file name is -, the standard input is compressed to the 16532 standard output. gzip shall only attempt to compress regular 16533 files. In particular, it will ignore symbolic links. 16534 16535 When compressing, gzip uses the deflate algorithm specified in 16536 RFC 1951: DEFLATE Compressed Data Format Specification and 16537 stores the result in a file using the gzip file format 16538 specified in RFC 1952: GZIP File Format Specification. 16539 16540 Options 16541 16542 -c, --stdout, --to-stdout 16543 writes output on standard output, leaving the original 16544 files unchanged. If there are several input files, the 16545 output consists of a sequence of independently 16546 compressed members. To obtain better compression, 16547 concatenate all input files before compressing them. 16548 16549 -d, --decompress, --uncompress 16550 the name operands are compressed files, and gzip shall 16551 decompress them. 16552 16553 -f, --force 16554 forces compression or decompression even if the file 16555 has multiple links or the corresponding file already 16556 exists, or if the compressed data is read from or 16557 written to a terminal. If the input data is not in a 16558 format recognized by gzip, and if the option --stdout 16559 is also given, copy the input data without change to 16560 the standard ouput: let gzip behave as cat. If -f is 16561 not given, and when not running in the background, gzip 16562 prompts to verify whether an existing file should be 16563 overwritten. 16564 16565 -l, --list 16566 lists the compressed size, uncompressed size, ration 16567 and uncompressed name for each compressed file. Gives 16568 the uncompressed size as -1 for files not in gzip 16569 format. Additionally displays method, crc and timestamp 16570 for the uncompress file when used in combination with 16571 --verbose. 16572 16573 For decompression, gzip shall support at least the 16574 following compression methods: 16575 16576 + deflate (RFC 1951: DEFLATE Compressed Data Format 16577 Specification) 16578 + compress (ISO POSIX (2003)) 16579 16580 The crc shall be given as ffffffff for a file not in 16581 gzip format. 16582 16583 With --name, the uncompressed name, date and time are 16584 those stored within the compress file, if present. 16585 16586 With --verbose, the size totals and compression ratio 16587 for all files is also displayed, unless some sizes are 16588 unknown. With --quiet, the title and totals lines are 16589 not displayed. 16590 16591 -L, --license 16592 displays the gzip license and quit. 16593 16594 -n, --no-name 16595 does not save the original file name and time stamp by 16596 default when compressing. (The original name is always 16597 saved if the name had to be truncated.) When 16598 decompressing, do not restore the original file name if 16599 present (remove only the gzip suffix from the 16600 compressed file name) and do not restore the original 16601 time stamp if present (copy it from the compressed 16602 file). This option is the default when decompressing. 16603 16604 -N, --name 16605 always saves the original file name and time stamp when 16606 compressing; this is the default. When decompressing, 16607 restore the original file name and time stamp if 16608 present. This option is useful on systems which have a 16609 limit on file name length or when the time stamp has 16610 been lost after a file transfer. 16611 16612 -q, --quiet 16613 suppresses all warnings. 16614 16615 -r, --recursive 16616 travels the directory structure recursively. If any of 16617 the file names specified on the command line are 16618 directories, gzip will descend into the directory and 16619 compress all the files it finds there (or decompress 16620 them in the case of gunzip). 16621 16622 -S .suf, --sufix .suf 16623 uses suffix .suf instead of .gz. 16624 16625 -t, --test 16626 checks the compressed file integrity. 16627 16628 -v, --verbose 16629 displays the name and percentage reduction for each 16630 file compressed or decompressed. 16631 16632 -#, --fast, --best 16633 regulates the speed of compression using the specified 16634 digit #, where -1 or --fast indicates the fastest 16635 compression method (less compression) and -9 or --best 16636 indicates the slowest compression method (best 16637 compression). The default compression level is -6 (that 16638 is, biased towards high compression at expense of 16639 speed). 16640 16641 LSB Deprecated Options 16642 16643 The behaviors specified in this section are expected to 16644 disappear from a future version of the LSB; applications 16645 should only use the non-LSB-deprecated behaviors. 16646 16647 -V, --version 16648 displays the version number and compilation options, 16649 then quits. 16650 16651 hostname 16652 16653 Name 16654 16655 hostname -- show or set the system's host name 16656 16657 Synopsis 16658 16659 hostname [name] 16660 16661 Description 16662 16663 hostname is used to either display or, with appropriate 16664 privileges, set the current host name of the system. The host 16665 name is used by many applications to identify the machine. 16666 16667 When called without any arguments, the program displays the 16668 name of the system as returned by the gethostname() function. 16669 16670 When called with a name argument, and the user has appropriate 16671 privilege, the command sets the host name. 16672 16673 Note: It is not specified if the hostname displayed will be 16674 a fully qualified domain name. Applications requiring a 16675 particular format of hostname should check the output and 16676 take appropriate action. 16677 16678 install 16679 16680 Name 16681 16682 install -- copy files and set attributes 16683 16684 Synopsis 16685 16686 install [option...] SOURCE DEST 16687 install [option...] SOURCE... DEST 16688 install [-d | --directory] [option...] DIRECTORY... 16689 16690 Description 16691 16692 In the first two formats, copy SOURCE to DEST or multiple 16693 SOURCE(s) to the existing DIRECTORY, optionally setting 16694 permission modes and file ownership. In the third format, each 16695 DIRECTORY and any missing parent directories shall be created. 16696 16697 Standard Options 16698 16699 --backup[=METHOD] 16700 makes a backup of each existing destination file. 16701 METHOD may be one of the following: 16702 16703 + none or off never make backups. 16704 + numbered or t make numbered backups. A numbered 16705 backup has the form "%s.~%d~", target_name, 16706 version_number. Each backup shall increment the 16707 version number by 1. 16708 + existing or nil numbered if numbered backups exist, 16709 or simple otherwise. 16710 + simple or never append a suffix to the name. The 16711 default suffix is '~', but can be overriden by 16712 setting SIMPLE_BACKUP_SUFFIX in the environment, or 16713 via the -S or --suffix option. 16714 16715 If no METHOD is specified, the environment variable 16716 VERSION_CONTROL shall be examined for one of the above. 16717 Unambiguous abbreviations of METHOD shall be accepted. 16718 If no METHOD is specified, or if METHOD is empty, the 16719 backup method shall default to existing. 16720 16721 If METHOD is invalid or ambiguous, install shall fail 16722 and issue a diagnostic message. 16723 16724 -b 16725 is equivalent to --backup=existing. 16726 16727 -d, --directory 16728 treats all arguments as directory names; creates all 16729 components of the specified directories. 16730 16731 -D 16732 creates all leading components of DEST except the last, 16733 then copies SOURCE to DEST; useful in the 1st format. 16734 16735 -g GROUP, --group=GROUP 16736 if the user has appropriate privilege, sets group 16737 ownership, instead of process' current group. GROUP is 16738 either a name in the user group database, or a positive 16739 integer, which shall be used as a group-id. 16740 16741 -m MODE, --mode=MODE 16742 sets permission mode (specified as in chmod), instead 16743 of the default rwxr-xr-x. 16744 16745 -o OWNER, --owner=OWNER 16746 if the user has appropriate privilege, sets ownership. 16747 OWNER is either a name in the user login database, or a 16748 positive integer, which shall be used as a user-id. 16749 16750 -p, --preserve-timestamps 16751 copies the access and modification times of SOURCE 16752 files to corresponding destination files. 16753 16754 -s, --strip 16755 strips symbol tables, only for 1st and 2nd formats. 16756 16757 -S SUFFIX, --suffix=SUFFIX 16758 equivalent to --backup=existing, except if a simple 16759 suffix is required, use SUFFIX. 16760 16761 --verbose 16762 prints the name of each directory as it is created. 16763 16764 -v, --verbose 16765 print the name of each file before copying it to 16766 stdout. 16767 16768 install_initd 16769 16770 Name 16771 16772 install_initd -- install an init.d file 16773 16774 Synopsis 16775 16776 /usr/lib/lsb/install_initd initd_file 16777 16778 Description 16779 16780 install_initd shall install a system initialization file that 16781 has been copied to the /etc/init.d location such that this 16782 file shall be run at the appropriate point during system 16783 initialization. The install_initrd command is typically called 16784 in the postinstall script of a package. See also Section 8.4. 16785 16786 ipcrm 16787 16788 Name 16789 16790 ipcrm -- Remove IPC Resources 16791 16792 Synopsis 16793 16794 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid 16795 | -M shmkey]... 16796 ipcrm [shm | msg | msg] id... 16797 16798 Description 16799 16800 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 16801 the ipcrm shall behave as described in ISO POSIX (2003). 16802 16803 Otherwise, ipcrm shall remove the resource of the specified 16804 type identified by id. 16805 16806 Future Directions 16807 16808 A future revision of this specification may deprecate the 16809 second synopsis form. 16810 16811 Rationale: In its first Linux implementation, ipcrm used 16812 the second syntax shown in the SYNOPSIS. Functionality 16813 present in other implementations of ipcrm has since been 16814 added, namely the ability to delete resources by key (not 16815 just identifier), and to respect the same command line 16816 syntax. The previous syntax is still supported for 16817 backwards compatibility only. 16818 16819 ipcs 16820 16821 Name 16822 16823 ipcs -- provide information on ipc facilities 16824 16825 Synopsis 16826 16827 ipcs [-smq] [-tcp] 16828 16829 Description 16830 16831 ipcs provides information on the ipc facilities for which the 16832 calling process has read access. 16833 16834 Resource display options 16835 16836 -m 16837 shared memory segments. 16838 16839 -q 16840 message queues. 16841 16842 -s 16843 semaphore arrays. 16844 16845 Output format options 16846 16847 -t 16848 time. 16849 16850 -p 16851 pid. 16852 16853 -c 16854 creator. 16855 16856 Application Usage 16857 16858 In some implementations of ipcs the -a option will print all 16859 information available. In other implementations the -a option 16860 will print all resource types. Therefore, applications shall 16861 not use the -a option. 16862 16863 Some implements of ipcs implement more output formats than are 16864 specified here. These options are not consistent between 16865 differing implementations of ipcs. Therefore, only the -t -c 16866 and -p option flags may be used. At least one of the -t -c and 16867 -p options shall be specified. 16868 16869 killall 16870 16871 Name 16872 16873 killall -- kill processes by name 16874 16875 Synopsis 16876 16877 killall [-egiqvw] [-signal] name... 16878 killall -l 16879 killall -V 16880 16881 Description 16882 16883 killall sends a signal to all processes running any of the 16884 specified commands. If no signal name is specified, SIGTERM is 16885 sent. 16886 16887 Signals can be specified either by name (e.g. -HUP) or by 16888 number (e.g. -1). Signal 0 (check if a process exists) can 16889 only be specified by number. 16890 16891 If the command name contains a slash (/), processes executing 16892 that particular file will be selected for killing, independent 16893 of their name. 16894 16895 killall returns a non-zero return code if no process has been 16896 killed for any of the listed commands. If at least one process 16897 has been killed for each command, killall returns zero. 16898 16899 A killall process never kills itself (but may kill other 16900 killall processes). 16901 16902 Standard Options 16903 16904 -e 16905 requires an exact match for very long names. If a 16906 command name is longer than 15 characters, the full 16907 name may be unavailable (i.e. it is swapped out). In 16908 this case, killall will kill everything that matches 16909 within the first 15 characters. With -e, such entries 16910 are skipped. killall prints a message for each skipped 16911 entry if -v is specified in addition to -e. 16912 16913 -g 16914 kills the process group to which the process belongs. 16915 The kill signal is only sent once per group, even if 16916 multiple processes belonging to the same process group 16917 were found. 16918 16919 -i 16920 asks interactively for confirmation before killing. 16921 16922 -l 16923 lists all known signal names. 16924 16925 -q 16926 does not complain if no processes were killed. 16927 16928 -v 16929 reports if the signal was successfully sent. 16930 16931 LSB Deprecated Options 16932 16933 The behaviors specified in this section are expected to 16934 disappear from a future version of the LSB; applications 16935 should only use the non-LSB-deprecated behaviors. 16936 16937 -V 16938 displays version information. 16939 16940 lpr 16941 16942 Name 16943 16944 lpr -- off line print 16945 16946 Synopsis 16947 16948 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 16949 title] [name ......] 16950 16951 Description 16952 16953 lpr uses a spooling daemon to print the named files when 16954 facilities become available. If no names appear, the standard 16955 input is assumed. 16956 16957 Standard Options 16958 16959 -l 16960 identifies binary data that is not to be filtered but 16961 sent as raw input to printer. 16962 16963 -p 16964 formats with "pr" before sending to printer. 16965 16966 -Pprinter 16967 sends output to the printer named printer instead of 16968 the default printer. 16969 16970 -h 16971 suppresses header page. 16972 16973 -s 16974 uses symbolic links. 16975 16976 -#copies 16977 specifies copies as the number of copies to print. 16978 16979 -J name 16980 specifies name as the job name for the header page. 16981 16982 -T title 16983 specifies title as the title used for "pr". 16984 16985 ls 16986 16987 Name 16988 16989 ls -- list directory contents 16990 16991 Description 16992 16993 ls is as specified in ISO POSIX (2003), but with differences 16994 listed below. 16995 16996 Differences 16997 16998 -l 16999 If the file is a character special or block special 17000 file, the size of the file shall be replaced with two 17001 unsigned numbers in the format "%u, %u", representing 17002 the major and minor device numbers associated with the 17003 special file. 17004 17005 Note: The LSB does not specify the meaning of the major and 17006 minor devices numbers. 17007 17008 -p 17009 in addition to ISO POSIX (2003) behavior of printing a 17010 slash for a directory, ls -p may display other 17011 characters for other file types. 17012 17013 Certain aspects of the pattern matching notation are optional; 17014 see Internationalization and Pattern Matching Notation. 17015 17016 lsb_release 17017 17018 Name 17019 17020 lsb_release -- print distribution specific information 17021 17022 Synopsis 17023 17024 lsb_release [OPTION...] 17025 17026 Description 17027 17028 The lsb_release command prints certain LSB (Linux Standard 17029 Base) and Distribution information. 17030 17031 If no options are given, the -v option is assumed. 17032 17033 Options 17034 17035 -v, --version 17036 displays version of LSB against which distribution is 17037 compliant. The version is expressed as a colon 17038 seperated list of LSB module descriptions. LSB module 17039 descriptions are dash seperated tuples containing the 17040 module name, version, and architecture name. The output 17041 is a single line of text of the following format: 17042 17043 LSB Version:\t 17044 17045 -i, --id 17046 displays string id of distributor. The output is a 17047 single line of text of the following format: 17048 17049 Distributor ID:\t 17050 17051 -d, --description 17052 displays single line text description of distribution. 17053 The output is of the following format: 17054 17055 Description:\t 17056 17057 -r, --release 17058 displays release number of distribution. The output is 17059 a single line of text of the following format: 17060 17061 Release:\t 17062 17063 -c, --codename 17064 displays codename according to distribution release. 17065 The output is a single line of text of the following 17066 format. 17067 17068 Codename:\t 17069 17070 -a, --all 17071 displays all of the above information. 17072 17073 -s, --short 17074 displays all of the above information in short output 17075 format. 17076 17077 -h, --help 17078 displays a human-readable help message. 17079 17080 Examples 17081 17082 The following command will list the LSB Profiles which are 17083 currently supported on this platform. 17084 example% lsb_release -v 17085 LSB Version: core-2.0-ia32:core-2.0-noarch:graphics-2.0-ia32:graphics-2 17086 .0-noarch 17087 17088 m4 17089 17090 Name 17091 17092 m4 -- macro processor 17093 17094 Description 17095 17096 m4 is as specified in ISO POSIX (2003), but with extensions as 17097 listed below. 17098 17099 Extensions 17100 17101 -P 17102 forces all builtins to be prefixed with m4_. For 17103 example, define becomes m4_define. 17104 17105 -I directory 17106 Add directory to the end of the search path for 17107 includes. 17108 17109 md5sum 17110 17111 Name 17112 17113 md5sum -- generate or check MD5 message digests 17114 17115 Synopsis 17116 17117 md5sum [-c [file] | file...] 17118 17119 Description 17120 17121 For each file, write to standard output a line containing the 17122 MD5 message digest of that file, followed by one or more blank 17123 characters, followed by the name of the file. The MD5 message 17124 digest shall be calculated according to RFC 1321: The MD5 17125 Message-Digest Algorithm and output as 32 hexadecimal digits. 17126 17127 If no file names are specified as operands, read from standard 17128 input and use "-" as the file name in the output. 17129 17130 Options 17131 17132 -c [file] 17133 checks the MD5 message digest of all files named in 17134 file against the message digest listed in the same 17135 file. The actual format of file is the same as the 17136 output of md5sum. That is, each line in the file 17137 describes a file. If file is not specified, read 17138 message digests from stdin. 17139 17140 Exit Status 17141 17142 md5sum shall exit with status 0 if the sum was generated 17143 successfully, or, in check mode, if the check matched. 17144 Otherwise, md5sum shall exit with a non-zero status. 17145 17146 mknod 17147 17148 Name 17149 17150 mknod -- make special files 17151 17152 Synopsis 17153 17154 mknod [-m mode | --mode=mode] name type [major minor] 17155 mknod [--version] 17156 17157 Description 17158 17159 The mknod command shall create a special file named name of 17160 the given type. 17161 17162 The type shall be one of the following: 17163 17164 b 17165 creates a block (buffered) special file with the 17166 specified major and minor device numbers. 17167 17168 c, u 17169 creates a character (unbuffered) special file with the 17170 specified major and minor device numbers. 17171 17172 p 17173 creates a FIFO. 17174 17175 Options 17176 17177 -m mode, --mode=mode 17178 create the special file with file access permissions 17179 set as described in mode. The permissions may be any 17180 absolute value (i.e. one not containing '+' or '-') 17181 acceptable to the chmod command. 17182 17183 --version 17184 output version information and exit. 17185 17186 Note: This option may be deprecated in a future release of 17187 this specification. 17188 17189 If type is pparameter, major and minor shall not be specified. 17190 Otherwise, these parameters are mandatory. 17191 17192 Future Directions 17193 17194 This command may be deprecated in a future version of this 17195 specification. The major and minor operands are insufficently 17196 portable to be specified usefully here. Only a FIFO can be 17197 portably created by this command, and the mkfifo command is a 17198 simpler interface for that purpose. 17199 17200 mktemp 17201 17202 Name 17203 17204 mktemp -- make temporary file name (unique) 17205 17206 Synopsis 17207 17208 mktemp [-q] [-u] template 17209 17210 Description 17211 17212 The mktemp command takes the given file name template and 17213 overwrites a portion of it to create a file name. This file 17214 name shall be unique and suitable for use by the application. 17215 17216 The template should have at least six trailing 'X' characters. 17217 These characters are replaced with characters from the 17218 portable filename character set in order to generate a unique 17219 name. 17220 17221 If mktemp can successfully generate a unique file name, and 17222 the -u option is not present, the file shall be created with 17223 read and write permission only for the current user. The 17224 mktemp command shall write the filename generated to the 17225 standard output. 17226 17227 Options 17228 17229 -q 17230 fail silently if an error occurs. Diagnostic messages 17231 to stderr are suppressed, but the command shall still 17232 exit with a non-zero exit status if an error occurs. 17233 17234 -u 17235 operates in `unsafe' mode. A unique name is generated, 17236 but the temporary file shall be unlinked before mktemp 17237 exits. Use of this option is not encouraged. 17238 17239 more 17240 17241 Name 17242 17243 more -- display files on a page-by-page basis 17244 17245 Description 17246 17247 more is as specified in ISO POSIX (2003), but with differences 17248 as listed below. 17249 17250 Differences 17251 17252 The more command need not respect the LINES and COLUMNS 17253 environment variables. 17254 17255 The following additional options may be supported: 17256 17257 -num 17258 specifies an integer which is the screen size (in 17259 lines). 17260 17261 +num 17262 starts at line number num. 17263 17264 +/pattern 17265 Start at the first line matching the pattern, 17266 equivalent to executing the search forward (/) command 17267 with the given pattern immediately after opening each 17268 file. 17269 17270 The following options from ISO POSIX (2003) may behave 17271 differently: 17272 17273 -e 17274 has unspecified behavior. 17275 17276 -i 17277 has unspecified behavior. 17278 17279 -n 17280 has unspecified behavior. 17281 17282 -p 17283 Either clear the whole screen before displaying any 17284 text (instead of the usual scrolling behavior), or 17285 provide the behavior specified by ISO POSIX (2003). In 17286 the latter case, the syntax is "-p command". 17287 17288 -t 17289 has unspecified behavior. 17290 17291 The more command need not support the following interactive 17292 commands: 17293 17294 g 17295 G 17296 u 17297 control u 17298 control f 17299 newline 17300 j 17301 k 17302 r 17303 R 17304 m 17305 ' (return to mark) 17306 /! 17307 ? 17308 N 17309 :e 17310 :t 17311 control g 17312 ZZ 17313 17314 Rationale 17315 17316 The +num and +/string options are deprecated in SUSv2, and 17317 have been removed in ISO POSIX (2003); however this 17318 specification continues to specify them because the publicly 17319 available util-linux package does not support the replacement 17320 (-p command). The +command option as found in SUSv2 is more 17321 general than is specified here, but the util-linux package 17322 appears to only support the more specific +num and +/string 17323 forms. 17324 17325 mount 17326 17327 Name 17328 17329 mount -- mount a file system 17330 17331 Synopsis 17332 17333 mount [-hV] 17334 mount [-a] [-fFnrsvw] [-t vfstype] 17335 mount [-fnrsvw] [-o options [,...]] [device | dir] 17336 mount [-fnrsvw] [-t vfstype] [-o options] device dir 17337 17338 Description 17339 17340 As described in ISO POSIX (2003), all files in the system are 17341 organized in a directed graph, known as the file hierarchy, 17342 rooted at /. These files can be spread out over several 17343 underlying devices. The mount command shall attach the file 17344 system found on some underlying device to the file hierarchy. 17345 17346 Options 17347 17348 -v 17349 invoke verbose mode. The mount command shall provide 17350 diagnostic messages on stdout. 17351 17352 -a 17353 mount all filesystems (of the given types) mentioned in 17354 /etc/fstab. 17355 17356 -F 17357 If the -a option is also present, fork a new 17358 incarnation of mount for each device to be mounted. 17359 This will do the mounts on different devices or 17360 different NFS servers in parallel. 17361 17362 -f 17363 cause everything to be done except for the actual 17364 system call; if it's not obvious, this `fakes' mounting 17365 the file system. 17366 17367 -n 17368 mount without writing in /etc/mtab. This is necessary 17369 for example when /etc is on a read-only file system. 17370 17371 -s 17372 ignore mount options not supported by a filesystem 17373 type. Not all filesystems support this option. 17374 17375 -r 17376 mount the file system read-only. A synonym is -o ro. 17377 17378 -w 17379 mount the file system read/write. (default) A synonym 17380 is -o rw. 17381 17382 -L label 17383 If the file /proc/partitions is supported, mount the 17384 partition that has the specified label. 17385 17386 -U uuid 17387 If the file /proc/partitions is supported, mount the 17388 partition that has the specified uuid. 17389 17390 -t vfstype 17391 indicate a file system type of vfstype. 17392 17393 More than one type may be specified in a comma 17394 separated list. The list of file system types can be 17395 prefixed with no to specify the file system types on 17396 which no action should be taken. 17397 17398 -o 17399 options are specified with a -o flag followed by a 17400 comma-separated string of options. Some of these 17401 options are only useful when they appear in the 17402 /etc/fstab file. The following options apply to any 17403 file system that is being mounted: 17404 17405 async 17406 perform all I/O to the file system 17407 asynchronously. 17408 17409 atime 17410 update inode access time for each access. 17411 (default) 17412 17413 auto 17414 in /etc/fstab, indicate the device is mountable 17415 with -a. 17416 17417 defaults 17418 use default options: rw, suid, dev, exec, auto, 17419 nouser, async. 17420 17421 dev 17422 interpret character or block special devices on 17423 the file system. 17424 17425 exec 17426 permit execution of binaries. 17427 17428 noatime 17429 do not update file access times on this file 17430 system. 17431 17432 noauto 17433 in /etc/fstab, indicates the device is only 17434 explicitly mountable. 17435 17436 nodev 17437 do not interpret character or block special 17438 devices on the file system. 17439 17440 noexec 17441 do not allow execution of any binaries on the 17442 mounted file system. 17443 17444 nosuid 17445 do not allow set-user-identifier or 17446 set-group-identifier bits to take effect. 17447 17448 nouser 17449 forbid an unprivileged user to mount the file 17450 system. (default) 17451 17452 remount 17453 remount an already-mounted file system. This is 17454 commonly used to change the mount options for a 17455 file system, especially to make a read-only file 17456 system writable. 17457 17458 ro 17459 mount the file system read-only. 17460 17461 rw 17462 mount the file system read-write. 17463 17464 suid 17465 allow set-user-identifier or set-group-identifier 17466 bits to take effect. 17467 17468 sync 17469 do all I/O to the file system synchronously. 17470 17471 user 17472 allow an unprivilieged user to mount the file 17473 system. This option implies the options noexec, 17474 nosuid, nodev unless overridden by subsequent 17475 options. 17476 17477 LSB Deprecated Options 17478 17479 The behaviors specified in this section are expected to 17480 disappear from a future version of the LSB; applications 17481 should only use the non-LSB-deprecated behaviors. 17482 17483 -V 17484 output version and exit. 17485 17486 msgfmt 17487 17488 Name 17489 17490 msgfmt -- create a message object from a message file 17491 17492 Synopsis 17493 17494 msgfmt [options...] filename... 17495 17496 Description 17497 17498 The msgfmt command generates a binary message catalog from a 17499 textual translation description. Message catalogs, or message 17500 object files, are stored in files with a .mo extension. 17501 17502 Note: The format of message object files is not guaranteed 17503 to be portable. Message catalogs should always be generated 17504 on the target architecture using the msgfmt command. 17505 17506 The source message files, otherwise known as portable object 17507 files, have a .po extension. 17508 17509 The filename operands shall be portable object files. The .po 17510 file contains messages to be displayed to users by system 17511 utilities or by application programs. The portable object 17512 files are text files, and the messages in them can be 17513 rewritten in any language supported by the system. 17514 17515 If any filename is -, a portable object file shall be read 17516 from the standard input. 17517 17518 The msgfmt command interprets data as characters according to 17519 the current setting of the LC_CTYPE locale category. 17520 17521 Options 17522 17523 -c, --check 17524 Detect and diagnose input file anomalies which might 17525 represent translation errors. The msgid and msgstr 17526 strings are studied and compared. It is considered 17527 abnormal that one string starts or ends with a newline 17528 while the other does not. 17529 17530 If the message is flagged as c-format (see Comment 17531 Handling), check that the msgid string and the msgstr 17532 translation have the same number of % format 17533 specifiers, with matching types. 17534 17535 -D directory, --directory=directory 17536 Add directory to list for input files search. If 17537 filename is not an absolute pathname and filename 17538 cannot be opened, search for it in directory. This 17539 option may be repeated. Directories shall be searched 17540 in order, with the leftmost directory searched first. 17541 17542 -f, --use-fuzzy 17543 Use entries marked as fuzzy in output. If this option 17544 is not specified, such entries are not included into 17545 the output. See Comment Handling below. 17546 17547 -o output-file, --output-file=output-file 17548 Specify the output file name as output-file. If 17549 multiple domains or duplicate msgids in the .po file 17550 are present, the behavior is unspecified. If 17551 output-file is -, output is written to standard output. 17552 17553 --strict 17554 Ensure that all output files have a .mo extension. 17555 Output files are named either by the -o (or 17556 --output-file) option, or by domains found in the input 17557 files. 17558 17559 -v, --verbose 17560 Print additional information to the standard error, 17561 including the number of translated strings processed. 17562 17563 Operands 17564 17565 The filename operands are treated as portable object files. 17566 The format of portable object files is defined in EXTENDED 17567 DESCRIPTION. 17568 17569 Standard Input 17570 17571 The standard input is not used unless a filename operand is 17572 specified as "-". 17573 17574 Environment Variables 17575 17576 LANGUAGE 17577 Specifies one or more locale names. 17578 17579 LANG 17580 Specifies locale name. 17581 17582 LC_ALL 17583 Specifies locale name for all categories. If defined, 17584 overrides LANG, LC_CTYPE and LC_MESSAGES. 17585 17586 LC_CTYPE 17587 Determine the locale for the interpretation of 17588 sequences of bytes of text data as characters (for 17589 example, single-byte as opposed to multi-byte 17590 characters in arguments and input files). 17591 17592 LC_MESSAGES 17593 Specifies messaging locale, and if present overrides 17594 LANG for messages. 17595 17596 Standard Output 17597 17598 The standard output is not used unless the option-argument of 17599 the -o option is specified as -. 17600 17601 Extended Description 17602 17603 The format of portable object files (.po files) is defined as 17604 follows. Each .po file contains one or more lines, with each 17605 line containing either a comment or a statement. Comments 17606 start the line with a hash mark (#) and end with the newline 17607 character. Empty lines, or lines containing only white-space, 17608 shall be ignored. Comments can in certain circumstances alter 17609 the behavior of msgfmt. See Comment Handling below for details 17610 on comment processing. The format of a statement is: 17611 17612 directive value 17613 17614 Each directive starts at the beginning of the line and is 17615 separated from value by white space (such as one or more space 17616 or tab characters). The value consists of one or more quoted 17617 strings separated by white space. If two or more strings are 17618 specified as value, they are normalized into single string 17619 using the string normalization syntax specified in ISO C 17620 (1999). The following directives are supported: 17621 17622 domain domainname 17623 17624 msgid message_identifier 17625 17626 msgid_plural untranslated_string_plural 17627 17628 msgstr message_string 17629 17630 msgstr[n] message_string 17631 17632 The behavior of the domain directive is affected by the 17633 options used. See OPTIONS for the behavior when the -o option 17634 is specified. If the -o option is not specified, the behavior 17635 of the domain directive is as follows: 17636 17637 1. All msgids from the beginning of each .po file to the 17638 first domain directive are put into a default message 17639 object file, messages (or messages.mo if the --strict 17640 option is specified). 17641 2. When msgfmt encounters a domain domainname directive in 17642 the .po file, all following msgids until the next domain 17643 directive are put into the message object file domainname 17644 (or domainname.mo if --strict option is specified). 17645 3. Duplicate msgids are defined in the scope of each domain. 17646 That is, a msgid is considered a duplicate only if the 17647 identical msgid exists in the same domain. 17648 4. All duplicate msgids are ignored. 17649 17650 The msgid directive specifies the value of a message 17651 identifier associated with the directive that follows it. The 17652 msgid_plural directive specifies the plural form message 17653 specified to the plural message handling functions ngettext(), 17654 dngettext() or dcngettext(). The message_identifier string 17655 identifies a target string to be used at retrieval time. Each 17656 statement containing a msgid directive shall be followed by a 17657 statement containing a msgstr directive or msgstr[n] 17658 directives. 17659 17660 The msgstr directive specifies the target string associated 17661 with the message_identifier string declared in the immediately 17662 preceding msgid directive. 17663 17664 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 17665 target string to be used with plural form handling functions 17666 ngettext(), dngettext() and dcngettext(). 17667 17668 Message strings can contain the following escape sequences: 17669 17670 Table 3-1. Escape Sequences 17671 \n newline 17672 \t tab 17673 \v vertical tab 17674 \b backspace 17675 \r carriage return 17676 \f formfeed 17677 \\ backslash 17678 \" double quote 17679 \ddd octal bit pattern 17680 \xHH hexadecimal bit pattern 17681 17682 Comment Handling 17683 17684 Comments are introduced by a #, and continue to the end of the 17685 line. The second character (i.e. the character following the 17686 #) has special meaning. Regular comments should follow a space 17687 character. Other comment types include: 17688 17689 # normal-comments 17690 17691 #. automatic-comments 17692 17693 #: reference... 17694 17695 #, flag 17696 17697 Automatic and reference comments are typically generated by 17698 external utilities, and are not specified by the LSB. The 17699 msgfmt command shall ignore such comments. 17700 17701 Note: Portable object files may be produced by unspecified 17702 tools. Some of the comment types described here may arise 17703 from the use of such tools. It is beyond the scope of this 17704 specification to describe these tools. 17705 17706 The #, comments require one or more flags separated by the 17707 comma (,) character. The following flags can be specified: 17708 17709 fuzzy 17710 This flag shows that the following msgstr string might 17711 not be a correct translation. Only the translator (i.e. 17712 the individual undertaking the translation) can judge 17713 if the translation requires further modification, or is 17714 acceptable as is. Once satisfied with the translation, 17715 the translator then removes this fuzzy flag. 17716 17717 If this flag is specified, the msgfmt utility will not 17718 generate the entry for the immediately following msgid 17719 in the output message catalog, unless the --use-fuzzy 17720 is specified. 17721 17722 c-format, no-c-format 17723 The c-format flag indicates that the msgid string is 17724 used as format string by printf()-like functions. If 17725 the c-format flag is given for a string the msgfmt 17726 utility may perform additional tests to check to 17727 validity of the translation. 17728 17729 Plurals 17730 17731 The msgid entry with empty string ("") is called the header 17732 entry and is treated specially. If the message string for the 17733 header entry contains nplurals=value, the value indicates the 17734 number of plural forms. For example, if nplurals=4, there are 17735 4 plural forms. If nplurals is defined, there should be a 17736 plural=expression on the same line, separated by a semicolon 17737 (;) character. The expression is a C language expression to 17738 determine which version of msgstr[n] to be used based on the 17739 value of n, the last argument of ngettext(), dngettext() or 17740 dcngettext(). For example: 17741 nplurals=2; plural=n == 1 ? 0 : 1 17742 17743 indicates that there are 2 plural forms in the language; 17744 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 17745 Another example: 17746 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 17747 17748 indicates that there are 3 plural forms in the language; 17749 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 17750 otherwise msgstr[2] is used. 17751 17752 If the header entry contains charset=codeset string, the 17753 codeset is used to indicate the codeset to be used to encode 17754 the message strings. If the output string's codeset is 17755 different from the message string's codeset, codeset 17756 conversion from the message strings's codeset to the output 17757 string's codeset will be performed upon the call of gettext(), 17758 dgettext(), dcgettext(), ngettext(), dngettext(), and 17759 dcngettext(). The output string's codeset is determined by the 17760 current locale's codeset (the return value of 17761 nl_langinfo(CODESET)) by default, and can be changed by the 17762 call of bind_textdomain_codeset(). 17763 17764 Exit Status 17765 17766 The following exit values are returned: 17767 17768 0 17769 Successful completion. 17770 17771 >0 17772 An error occurred. 17773 17774 Application Usage 17775 17776 Neither msgfmt nor any gettext() function imposes a limit on 17777 the total length of a message. Installing message catalogs 17778 under the C locale is pointless, since they are ignored for 17779 the sake of efficiency. 17780 17781 Examples 17782 17783 Example 1: Examples of creating message objects from message 17784 files. 17785 17786 In this example module1.po, module2.po and module3.po are 17787 portable message object files. 17788 example% cat module1.po 17789 17790 # default domain "messages" 17791 17792 msgid "message one" 17793 17794 msgstr "mensaje nśmero uno" 17795 17796 # 17797 17798 domain "help_domain" 17799 17800 msgid "help two" 17801 17802 msgstr "ayuda nśmero dos" 17803 17804 # 17805 17806 domain "error_domain" 17807 17808 msgid "error three" 17809 17810 msgstr "error nśmero tres" 17811 17812 example% cat module2.po 17813 17814 # default domain "messages" 17815 17816 msgid "message four" 17817 17818 msgstr "mensaje nśmero cuatro" 17819 17820 # 17821 17822 domain "error_domain" 17823 17824 msgid "error five" 17825 17826 msgstr "error nśmero cinco" 17827 17828 # 17829 17830 domain "window_domain" 17831 17832 msgid "window six" 17833 17834 msgstr "ventana nśmero seises" 17835 17836 example% cat module3.po 17837 17838 # default domain "messages" 17839 17840 msgid "message seven" 17841 17842 msgstr "mensaje nśmero siete" 17843 17844 The following command will produce the output files messages, 17845 help_domain, and error_domain. 17846 example% msgfmt module1.po 17847 17848 The following command will produce the output files 17849 messages.mo, help_domain.mo, error_domain.mo, and 17850 window_domain.mo. 17851 example% msgfmt module1.po module2.po 17852 17853 The following example will produce the output file hello.mo. 17854 example% msgfmt -o hello.mo module3.po 17855 17856 newgrp 17857 17858 Name 17859 17860 newgrp -- change group ID 17861 17862 Synopsis 17863 17864 newgrp [group] 17865 17866 Description 17867 17868 The newgrp command is as specified in ISO POSIX (2003), but 17869 with differences as listed below. 17870 17871 Differences 17872 17873 The -l option specified in ISO POSIX (2003) need not be 17874 supported. 17875 17876 od 17877 17878 Name 17879 17880 od -- dump files in octal and other formats 17881 17882 Synopsis 17883 17884 od [-abcdfilox] [-w width | --width-width] [-v] [-A 17885 address_base] [-j skip] [-n count] [-t type_string] [file...] 17886 od --traditional [options] [file] [[+]offset [.] [b]] 17887 [[+]label [.] [b]] 17888 17889 Description 17890 17891 od is as specified in ISO POSIX (2003), but with differences 17892 as listed below. 17893 17894 Differences 17895 17896 -wwidth, --width[=width] 17897 each output line is limited to width bytes from the 17898 input. 17899 17900 --traditional 17901 accepts arguments in traditional form. 17902 17903 Note: The XSI optional behavior described in ISO POSIX 17904 (2003) is not supported unless the --traditional option is 17905 also specified. 17906 17907 Pre-POSIX and XSI Specifications 17908 17909 The LSB supports option intermixtures with the following 17910 pre-POSIX and XSI options: 17911 17912 -a 17913 is equivalent to -t a, selects named characters. 17914 17915 -b 17916 is equivalent to -t o1, selects octal bytes. 17917 17918 -c 17919 is equivalent to -t c, selects characters. 17920 17921 -d 17922 is equivalent to -t u2, selects unsigned decimal two 17923 byte units. 17924 17925 -f 17926 is equivalent to -t fF, selects floats. 17927 17928 -i 17929 is equivalent to -t d2, selects decimal two byte units. 17930 17931 Note: This usage may change in future releases; portable 17932 applications should use -t d2. 17933 17934 -l 17935 is equivalent to -t d4, selects decimal longs. 17936 17937 -o 17938 is equivalent to -t o2, selects octal two byte units. 17939 17940 -x 17941 is equivalent to -t x2, selects hexadecimal two byte 17942 units. 17943 17944 Note that the XSI option -s need not be supported. 17945 17946 Traditional Usage 17947 17948 If the --traditional is specified, there may be between zero 17949 and three operands specified. 17950 17951 If no operands are specified, then od shall read the standard 17952 input. 17953 17954 If there is exactly one operand, and it is an offset of the 17955 form [+]offset[.][b], then it shall be interpreted as 17956 specified in ISO POSIX (2003). The file to be dumped shall be 17957 the standard input. 17958 17959 If there are exactly two operands, and they are both of the 17960 form [+]offset[.][b], then the first shall be an treated as an 17961 offset (as above), and the second shall be a label, in the 17962 same format as the offset. If a label is specified, then the 17963 first output line produced for each input block shall be 17964 preceded by the input offset, cumulative across input files, 17965 of the next byte to be written, followed by the label, in 17966 parentheses. The label shall increment in the same manner as 17967 the offset. 17968 17969 If there are three operands, then the first shall be the file 17970 to dump, the second the offset, and the third the label. 17971 17972 passwd 17973 17974 Name 17975 17976 passwd -- change user password 17977 17978 Synopsis 17979 17980 passwd [-x max] [-n min] [-w warn] [-i inact] name 17981 passwd {-l | -u} name 17982 17983 Description 17984 17985 passwd changes passwords for user and group accounts. A normal 17986 user may only change the password for their own account, the 17987 super user may change the password for any account. passwd 17988 also changes password expiry dates and intervals. Applications 17989 may not assume the format of prompts and anticipated input for 17990 user interaction, because they are unspecified. 17991 17992 Options 17993 17994 -x max 17995 sets the maximum number of days a password remains 17996 valid. 17997 17998 -n min 17999 sets the minimum number of days before a password may 18000 be changed. 18001 18002 -w warn 18003 sets the number of days warning the user will receive 18004 before their password will expire. 18005 18006 -i inactive 18007 disables an account after the password has been expired 18008 for the given number of days. 18009 18010 -l 18011 disables an account by changing the password to a value 18012 which matches no possible encrypted value. 18013 18014 -u 18015 re-enables an account by changing the password back to 18016 its previous value. 18017 18018 patch 18019 18020 Name 18021 18022 patch -- apply a diff file to an original 18023 18024 Description 18025 18026 patch is as specified in ISO POSIX (2003), but with extensions 18027 as listed below. 18028 18029 Extensions 18030 18031 --binary 18032 reads and write all files in binary mode, except for 18033 standard output and /dev/tty. This option has no effect 18034 on POSIX-compliant systems. 18035 18036 -u, --unified 18037 interprets the patch file as a unified context diff. 18038 18039 pidof 18040 18041 Name 18042 18043 pidof -- find the process ID of a running program 18044 18045 Synopsis 18046 18047 pidof [-s] [-x] [-o omitpid...] program... 18048 18049 Description 18050 18051 Return the process ID of a process which is running the 18052 program named on the command line. 18053 18054 Options 18055 18056 -s 18057 instructs the program to only return one pid. 18058 18059 -x 18060 causes the program to also return process id's of 18061 shells running the named scripts. 18062 18063 -o 18064 omits processes with specified process id. 18065 18066 remove_initd 18067 18068 Name 18069 18070 remove_initd -- clean up boot script system modifications 18071 introduced by install_initd 18072 18073 Synopsis 18074 18075 /usr/lib/lsb/remove_initd initd_file 18076 18077 Description 18078 18079 remove_initd processes the removal of the modifications made 18080 to a distribution's boot script system by the install_initd 18081 program. This cleanup is performed in the preuninstall script 18082 of a package; however, the package manager is still 18083 responsible for removing the /etc/init.d file. See also 18084 Section 8.4. 18085 18086 renice 18087 18088 Name 18089 18090 renice -- alter priority of running processes 18091 18092 Description 18093 18094 renice is as specified in ISO POSIX (2003), but with 18095 differences as listed below. 18096 18097 Differences 18098 18099 -n increment 18100 has unspecified behavior. 18101 18102 sed 18103 18104 Name 18105 18106 sed -- stream editor 18107 18108 Description 18109 18110 sed is as specified in ISO POSIX (2003), but with differences 18111 as listed below. 18112 18113 LSB Differences 18114 18115 Certain aspects of internationalized regular expressions are 18116 optional; see Internationalization and Regular Expressions. 18117 18118 sendmail 18119 18120 Name 18121 18122 sendmail -- an electronic mail transport agent 18123 18124 Synopsis 18125 18126 sendmail [options] [address...] 18127 18128 Description 18129 18130 To deliver electronic mail (email), applications shall support 18131 the interface provided by /usr/sbin/sendmail (described here). 18132 This interface shall be the default delivery method for 18133 applications. 18134 18135 This program sends an email message to one or more recipients, 18136 routing the message as necessary. This program is not intended 18137 as a user interface routine. 18138 18139 With no options, sendmail reads its standard input up to an 18140 end-of-file or a line consisting only of a single dot and 18141 sends a copy of the message found there to all of the 18142 addresses listed. It determines the network(s) to use based on 18143 the syntax and contents of the addresses. 18144 18145 It is recommended that applications use as few options as 18146 necessary, none if possible. 18147 18148 Some agents allow aliasing on the local system to be prevented 18149 by preceding the address with a backslash. 18150 18151 The format of messages shall be as defined in RFC 2822. 18152 18153 Options 18154 18155 -bm 18156 reads mail from standard input and delivers to the 18157 recipient addresses. This is the default mode of 18158 operation. 18159 18160 -bp 18161 lists information about messages currently in the input 18162 mail queue. 18163 18164 -bs 18165 uses the SMTP protocol as described in RFC 2821; reads 18166 SMTP commands on standard input and writes SMTP 18167 responses on standard output. 18168 18169 Note that RFC 2821 specifies \r\n (CR-LF) be used at 18170 the end of each line, but pipes almost always use \n 18171 (LF) instead. To deal with this, agents will accept 18172 both \r\n and \n at the end of each line. When 18173 accepting \r\n, the \r before the \n is silently 18174 discarded. 18175 18176 -F fullname 18177 explicitly sets the full name of the sender for 18178 incoming mail unless the message already contains a 18179 From: message header. 18180 18181 If the user running sendmail is not sufficiently 18182 trusted, then the actual sender may be indicated in the 18183 message, depending on the behavior of the agent. 18184 18185 -f name 18186 explicitly sets the envelope sender address for 18187 incoming mail. If there is no From: header, the address 18188 specified in the From: header will also be set. 18189 18190 If the user running sendmail is not sufficiently 18191 trusted, then the actual sender will be indicated in 18192 the message. 18193 18194 -i 18195 ignores dots alone on lines by themselves in incoming 18196 messages. If -bs is also used, the behavior is 18197 unspecified. 18198 18199 -odb 18200 delivers any mail in background, if supported; 18201 otherwise ignored. 18202 18203 -odf 18204 delivers any mail in foreground, if supported; 18205 otherwise ignored. 18206 18207 -oem or -em 18208 mails errors back to the sender. (default) 18209 18210 -oep or -ep 18211 writes errors to the standard error output. 18212 18213 -oeq or -eq 18214 does not send notification of errors to the sender. 18215 This only works for mail delivered locally. 18216 18217 -oi 18218 is equivalent to -i. 18219 18220 -om 18221 indicates that the sender of a message should receive a 18222 copy of the message if the sender appears in an alias 18223 expansion. Ignored if aliases are not supported. 18224 18225 -t 18226 reads the message to obtain recipients from the To:, 18227 Cc:, and Bcc: headers in the message instead of from 18228 the command arguments. If a Bcc: header is present, it 18229 is removed from the message unless there is no To: or 18230 Cc: header, in which case a Bcc: header with no data is 18231 created, in accordance with RFC 2822. 18232 18233 If there are any arguments, they specify addresses to 18234 which the message is not to be delivered. That is, the 18235 argument addresses are removed from the recipients list 18236 obtained from the headers. Note: some agents implement 18237 this behavior in reverse, adding addresses instead of 18238 removing them. Others may disallow addresses in 18239 argument list. Therefore, applications should not put 18240 addresses in the argument list if -t is used. 18241 18242 This option is sometimes ignored when not in -bm mode 18243 (the default). 18244 18245 Exit status 18246 18247 0 18248 successful completion on all addresses. This does not 18249 indicate successful delivery. 18250 18251 >0 18252 there was an error. 18253 18254 Notes/Rationale 18255 18256 This page is believed to reflect functionality provided by 18257 smail, exim and other implementations, not just the sendmail 18258 implementation. 18259 18260 shutdown 18261 18262 Name 18263 18264 shutdown -- bring the system down 18265 18266 Synopsis 18267 18268 /sbin/shutdown [-t sec] [-arkhcfF] time [warning-message] 18269 18270 Description 18271 18272 shutdown brings the system down in a secure way. All logged-in 18273 users are notified that the system is going down, and login(1) 18274 is blocked. It is possible to shut the system down immediately 18275 or after a specified delay. All processes are first notified 18276 that the system is going down by the signal SIGTERM. If 18277 neither the -h or the -r argument is used, then the default 18278 behavior is to take the system to runlevel one where 18279 administrative tasks can be run. 18280 18281 Standard Options 18282 18283 -a 18284 uses /etc/shutdown.allow. 18285 18286 -t sec 18287 tells init(8) to wait sec seconds between sending 18288 processes the warning and the kill signal, before 18289 changing to another runlevel. 18290 18291 -k 18292 doesn't really shutdown; only sends the warning 18293 messages to everybody. 18294 18295 -r 18296 reboots after shutdown. 18297 18298 -h 18299 halts after shutdown. Powering off after halting is 18300 unspecified. 18301 18302 -f 18303 skips fsck on reboot. 18304 18305 -F 18306 forces fsck on reboot. 18307 18308 -c 18309 cancels an already running shutdown. With this option, 18310 it is of course not possible to give the time argument, 18311 but you can enter a explanatory message on the command 18312 line that will be sent to all users. 18313 18314 time 18315 specifies when to shut down. 18316 18317 The time argument can have different formats. First, it 18318 can be an absolute time in the format hh:mm, in which 18319 hh is the hour (1 or 2 digits) and mm is the minute of 18320 the hour (in two digits). Second, it can be in the 18321 format +m, in which m is the number of minutes to wait. 18322 The word now is an alias for +0. 18323 18324 If shutdown is called with a delay, it creates the 18325 advisory file /etc/nologin which causes programs such 18326 as login(1) to not allow new user logins. shutdown only 18327 removes this file if it is stopped before it can signal 18328 init (i.e. it is cancelled or something goes wrong). 18329 Otherwise it is the responsibility of the system 18330 shutdown or startup scripts to remove this file so that 18331 users can login. 18332 18333 warning-message 18334 specifies message to send all users. 18335 18336 su 18337 18338 Name 18339 18340 su -- change user ID or become super-user 18341 18342 Synopsis 18343 18344 su [options] [-] [username [ARGS]] 18345 18346 Description 18347 18348 su is used to become another user during a login session. 18349 Invoked without a username, su defaults to becoming the super 18350 user. The optional argument - may be used to provide an 18351 environment similar to what the user would expect had the user 18352 logged in directly. 18353 18354 The user will be prompted for a password, if appropriate. 18355 Invalid passwords will produce an error message. All attempts, 18356 both valid and invalid, are logged to detect abuses of the 18357 system. Applications may not assume the format of prompts and 18358 anticipated input for user interaction, because they are 18359 unspecified. 18360 18361 An optional command can be executed. This is done by the shell 18362 specified in /etc/passwd for the target user unless the -s or 18363 -m options are used. Any arguments supplied after the username 18364 will be passed to the invoked shell (shell shall support the 18365 -c command line option in order for a command to be passed to 18366 it). 18367 18368 The current environment is passed to the new shell. The value 18369 of $PATH is reset to /bin:/usr/bin for normal users, or 18370 /sbin:/bin:/usr/sbin:/usr/bin for the super user. This may be 18371 changed with the ENV_PATH and ENV_SUPATH definitions in 18372 /etc/login.defs. When using the -m or -p options, the user's 18373 environment is not changed. 18374 18375 A subsystem login is indicated by the presense of a "*" as the 18376 first character of the login shell. The given home directory 18377 will be used as the root of a new filesystem which the user is 18378 actually logged into. 18379 18380 Standard Options 18381 18382 - 18383 makes this a login shell. 18384 18385 -c, --comand=command 18386 passes command to the invoked shell. It is passed 18387 directly to the invoked shell (using the shell's -c 18388 option), so its syntax is whatever that shell can 18389 accept. 18390 18391 -m, -p, --preserve-environment 18392 does not reset environment variables, and keeps the 18393 same shell if it is present in /etc/shells. 18394 18395 -s, --shell=shell 18396 uses shell instead of the default in /etc/passwd. The 18397 shell specified shall be present in /etc/shells. 18398 18399 sync 18400 18401 Name 18402 18403 sync -- flush filesystem buffers 18404 18405 Synopsis 18406 18407 sync 18408 18409 Description 18410 18411 Force changed blocks to disk, update the super block. 18412 18413 tar 18414 18415 Name 18416 18417 tar -- file archiver 18418 18419 Description 18420 18421 tar is as specified in SUSv2, but with differences as listed 18422 below. 18423 18424 Differences 18425 18426 Certain aspects of internationalized filename globbing are 18427 optional; see Internationalization and Pattern Matching 18428 Notation. 18429 18430 -h 18431 doesn't dump symlinks; dumps the files they point to. 18432 18433 -z 18434 filters the archive through gzip. 18435 18436 umount 18437 18438 Name 18439 18440 umount -- unmount file systems 18441 18442 Synopsis 18443 18444 umount [-hV] 18445 umount -a [-nrv] [-t vfstype] 18446 umount [-nrv] device | dir... 18447 18448 Description 18449 18450 umount detaches the file system(s) mentioned from the file 18451 hierarchy. A file system is specified by giving the directory 18452 where it has been mounted. 18453 18454 Standard Options 18455 18456 -v 18457 invokes verbose mode. 18458 18459 -n 18460 unmounts without writing in /etc/mtab. 18461 18462 -r 18463 tries to remount read-only if unmounting fails. 18464 18465 -a 18466 unmounts all of the file systems described in /etc/mtab 18467 except for the proc filesystem. 18468 18469 -t vfstype 18470 indicates that the actions should only be taken on file 18471 systems of the specified type. More than one type may 18472 be specified in a comma separated list. The list of 18473 file system types can be prefixed with no to specify 18474 the file system types on which no action should be 18475 taken. 18476 18477 -f 18478 forces unmount (in case of an unreachable NFS system). 18479 18480 LSB Deprecated Options 18481 18482 The behaviors specified in this section are expected to 18483 disappear from a future version of the LSB; applications 18484 should only use the non-LSB-deprecated behaviors. 18485 18486 -V 18487 print version and exits. 18488 18489 useradd 18490 18491 Name 18492 18493 useradd -- create a new user or update default new user 18494 information 18495 18496 Synopsis 18497 18498 useradd [-c comment] [-d home_dir] 18499 [-g initial_group] [-G group[,...]] 18500 [-m [-k skeleton_dir]] [-p passwd] [-r] 18501 [-s shell] [-u uid [ -o]] login 18502 18503 useradd -D [-g default_group] [-b default_home] 18504 [-s default_shell] 18505 18506 Description 18507 18508 When invoked without the -D option, useradd creates a new user 18509 account using the values specified on the command line and the 18510 default values from the system. The new user account will be 18511 entered into the system files as needed, the home directory 18512 will be created, and initial files copied, depending on the 18513 command line options. 18514 18515 When invoked with the -D option, useradd will either display 18516 the current default values, or update the default values from 18517 the command line. If no options are specified, useradd 18518 displays the current default values. 18519 18520 Standard Options 18521 18522 -c comment 18523 specifies the new user's password file comment field 18524 value. 18525 18526 -d home_dir 18527 creates the new user using home_dir as the value for 18528 the user's login directory. The default is to append 18529 the login name to default_home and use that as the 18530 login directory name. 18531 18532 -g initial_group 18533 specifies the group name or number of the user's 18534 initial login group. The group name shall exist. A 18535 group number shall refer to an already existing group. 18536 If -g is not specified, the implementation will follow 18537 the normal user default for that system. This may 18538 create a new group or choose a default group that 18539 normal users are placed in. Applications which require 18540 control of the groups into which a user is placed 18541 should specify -g. 18542 18543 -G group,[...] 18544 specifies a list of supplementary groups which the user 18545 is also a member of. Each group is separated from the 18546 next by a comma, with no intervening whitespace. The 18547 groups are subject to the same restrictions as the 18548 group given with the -g option. The default is for the 18549 user to belong only to the initial group. 18550 18551 -m [-k skeleton_dir] 18552 specifies the user's home directory will be created if 18553 it does not exist. The files contained in skeleton_dir 18554 will be copied to the home directory if the -k option 18555 is used, otherwise the files contained in /etc/skel 18556 will be used instead. Any directories contained in 18557 skeleton_dir or /etc/skel will be created in the user's 18558 home directory as well. The -k option is only valid in 18559 conjunction with the -m option. The default is to not 18560 create the directory and to not copy any files. 18561 18562 -p passwd 18563 is the encrypted password, as returned by crypt(3). The 18564 default is to disable the account. 18565 18566 -r 18567 creates a system account, that is, a user with a UID in 18568 the range reserved for system account users. If there 18569 is not a UID free in the reserved range the command 18570 will fail. 18571 18572 -s shell 18573 specifies the name of the user's login shell. The 18574 default is to leave this field blank, which causes the 18575 system to select the default login shell. 18576 18577 -u uid [-o] 18578 specifies the numerical value of the user's ID. This 18579 value shall be unique, unless the -o option is used. 18580 The value shall be non-negative. The default is the 18581 smallest ID value greater than 499 which is not yet 18582 used. 18583 18584 Change Default Options 18585 18586 -b default_home 18587 specifies the initial path prefix for a new user's home 18588 directory. The user's name will be affixed to the end 18589 of default_home to create the new directory name if the 18590 -d option is not used when creating a new account. 18591 18592 -g default_group 18593 specifies the group name or ID for a new user's initial 18594 group. The named group shall exist, and a numerical 18595 group ID shall have an existing entry. 18596 18597 -s default_shell 18598 specifies the name of the new user's login shell. The 18599 named program will be used for all future new user 18600 accounts. 18601 18602 -c comment 18603 specifies the new user's password file comment field 18604 value. 18605 18606 Application Usage 18607 18608 The -D option will typically be used by system administration 18609 packages. Most applications should not change defaults which 18610 will affect other applications and users. 18611 18612 userdel 18613 18614 Name 18615 18616 userdel -- delete a user account and related files 18617 18618 Synopsis 18619 18620 userdel [-r] login 18621 18622 Description 18623 18624 Delete the user account named login. If there is also a group 18625 named login, this command may delete the group as well, or may 18626 leave it alone. 18627 18628 Options 18629 18630 -r 18631 removes files in the user's home directory along with 18632 the home directory itself. Files located in other file 18633 system will have to be searched for and deleted 18634 manually. 18635 18636 usermod 18637 18638 Name 18639 18640 usermod -- modify a user account 18641 18642 Synopsis 18643 18644 usermod [-c comment] [-d home_dir [ -m]] 18645 [-g initial_group] [-G group[,...]] 18646 [-l login_name] [-p passwd] 18647 [-s shell] [-u uid [ -o]] login 18648 18649 Options 18650 18651 -c comment 18652 specifies the new value of the user's password file 18653 comment field. 18654 18655 -d home_dir 18656 specifies the user's new login directory. If the -m 18657 option is given the contents of the current home 18658 directory will be moved to the new home directory, 18659 which is created if it does not already exist. 18660 18661 -g initial_group 18662 specifies the group name or number of the user's new 18663 initial login group. The group name shall exist. A 18664 group number shall refer to an already existing group. 18665 18666 -G group,[...] 18667 specifies a list of supplementary groups which the user 18668 is also a member of. Each group is separated from the 18669 next by a comma, with no intervening whitespace. The 18670 groups are subject to the same restrictions as the 18671 group given with the -g option. If the user is 18672 currently a member of a group which is not listed, the 18673 user will be removed from the group. 18674 18675 -l login_name 18676 changes the name of the user from login to login_name. 18677 Nothing else is changed. In particular, the user's home 18678 directory name should probably be changed to reflect 18679 the new login name. 18680 18681 -p passwd 18682 is the encrypted password, as returned by crypt(3). 18683 18684 -s shell 18685 specifies the name of the user's new login shell. 18686 Setting this field to blank causes the system to select 18687 the default login shell. 18688 18689 -u uid [-o] 18690 specifies the numerical value of the user's ID. This 18691 value shall be unique, unless the -o option is used. 18692 The value shall be non-negative. Any files which the 18693 user owns and which are located in the directory tree 18694 rooted at the user's home directory will have the file 18695 user ID changed automatically. Files outside of the 18696 user's home directory shall be altered manually. 18697 18698 xargs 18699 18700 Name 18701 18702 xargs -- build and execute command lines from standard input 18703 18704 Description 18705 18706 xargs is as specified in ISO POSIX (2003), but with 18707 differences as listed below. 18708 18709 Differences 18710 18711 -E 18712 has unspecified behavior. 18713 18714 -I 18715 has unspecified behavior. 18716 18717 -L 18718 has unspecified behavior. 18719 18720 IV. Execution Environment 18721 18722 Table of Contents 18723 4. File System Hierarchy 18724 5. Additional Recommendations 18725 6. Additional Behaviors 18726 7. Localization 18727 _________________________________________________________ 18728 18729 Chapter 4. File System Hierarchy 18730 18731 An LSB conforming implementation shall provide the mandatory 18732 portions of the filesystem hierarchy specified in the 18733 Filesystem Hierarchy Standard (FHS), together with any 18734 additional requirements made in this specification. 18735 18736 An LSB conforming application shall conform to the Filesystem 18737 Hierarchy Standard. 18738 18739 The FHS allows many components or subsystems to be optional. 18740 An application shall check for the existence of an optional 18741 component before using it, and should behave in a reasonable 18742 manner if the optional component is not present. 18743 18744 The FHS requirement to locate the operating system kernel in 18745 either / or /boot does not apply if the operating system 18746 kernel does not exist as a file in the filesystem. 18747 18748 The FHS specifies certain behaviors for a variety of commands 18749 if they are present (for example, ping or python). However, 18750 LSB applications shall not rely on any commands beyond those 18751 specified by the LSB. The mere existence of a command may not 18752 be used as an indication that the command behaves in any 18753 particular way. 18754 18755 The following directories or links need not be present: 18756 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 18757 _________________________________________________________ 18758 18759 4.1. /dev 18760 18761 The following shall exist under /dev. Other devices may also 18762 exist in /dev. Device names may exist as symbolic links to 18763 other device nodes located in /dev or subdirectories of /dev. 18764 There is no requirement concerning major/minor number values. 18765 18766 /dev/null 18767 An infinite data source and data sink. Data written to 18768 this device shall be discarded. Reads from this device 18769 shall always return end-of-file (EOF). 18770 18771 /dev/zero 18772 This device is a source of zeroed out data. All data 18773 written to this device shall be discarded. A read from 18774 this device shall always return the requested number of 18775 bytes, each initialized to the value '\0'. 18776 18777 /dev/tty 18778 In each process, a synonym for the controlling terminal 18779 associated with the process group of that process, if 18780 any. All reads and writes to this device shall behave 18781 as if the actual controlling terminal device had been 18782 opened. 18783 _________________________________________________________ 18784 18785 4.2. User Accounting Databases 18786 18787 The Filesystem Hierarchy Standard specifies two optional 18788 locations for user accounting databases used by the 18789 getutent(), getutent_r(), getutxent(), getutxid(), 18790 getutxline(), and pututxline() functions. These are 18791 /var/run/utmp and /var/run/wtmp. 18792 18793 The LSB does not specify the format or structure of these 18794 files, or even if they are files at all. If the implementation 18795 uses the file system to store these databases, the filenames 18796 /var/run/utmp and /var/log/wtmp may refer to one or more files 18797 with that stem. 18798 _________________________________________________________ 18799 18800 Chapter 5. Additional Recommendations 18801 18802 5.1. Minimal granted Directory and File permissions 18803 18804 In this Chapter "System" means an "LSB conforming 18805 implementation" and "application" means an "LSB conforming 18806 (third party vendor) application". 18807 18808 The system shall grant to the application read and execute 18809 permissions on files needed to use all system interfaces 18810 (ABIs) required by the LSB specification. 18811 _________________________________________________________ 18812 18813 5.2. Recommendations for applications on ownership and permissions 18814 18815 5.2.1. Directory Write Permissions 18816 18817 The application should not depend on having directory write 18818 permission outside /tmp, /var/tmp, invoking user's home 18819 directory and /var/opt/package, (where package is the name of 18820 the application package). 18821 18822 The application should not depend on owning these directories. 18823 18824 For these directories the application should be able to work 18825 with directory write permissions restricted by the S_ISVTXT 18826 bit (otherwise known as the "sticky bit"). 18827 _________________________________________________________ 18828 18829 5.2.2. File Write Permissions 18830 18831 The application should not depend on file write permission on 18832 files not owned by the user it runs under with the exception 18833 of its personal inbox /var/mail/username. 18834 _________________________________________________________ 18835 18836 5.2.3. File Read and execute Permissions 18837 18838 The application should not depend on having read permission to 18839 every file and directory. 18840 _________________________________________________________ 18841 18842 5.2.4. Suid and Sgid Permissions 18843 18844 The application should not depend on the set user ID or set 18845 group ID (the S_ISUID or S_ISGID permissions of a file not 18846 packaged with the application. Instead, the distribution is 18847 responsible for assuming that all system commands have the 18848 required permissions and work correctly. 18849 18850 Rationale: In order to implement common security policies 18851 it is strongly advisable for applications to use the 18852 minimum set of security attributes necessary for correct 18853 operation. Applications that require substantial 18854 appropriate privilege are likely to cause problems with 18855 such security policies. 18856 _________________________________________________________ 18857 18858 5.2.5. Privileged users 18859 18860 In general, applications should not depend on running as a 18861 privileged user. This specification uses the term "appropriate 18862 privilege" throughout to identify operations that cannot be 18863 achieved without some special granting of additional 18864 privilege. 18865 18866 Applications that have a reason to run with appropriate 18867 privilege should outline this reason clearly in their 18868 documentation. Users of the application should be informed, 18869 that "this application demands security privileges, which 18870 could interfere with system security". 18871 18872 The application should not contain binary-only software that 18873 requires being run with appropriate privilege, as this makes 18874 security auditing harder or even impossible. 18875 _________________________________________________________ 18876 18877 5.2.6. Changing permissions 18878 18879 The application shall not change permissions of files and 18880 directories that do not belong to its own package. Should an 18881 application require that certain files and directories not 18882 directly belonging to the package have a particular ownership, 18883 the application shall document this requirement, and may fail 18884 during installation if the permissions on these files is 18885 inappropriate. 18886 _________________________________________________________ 18887 18888 5.2.7. Removable Media (Cdrom, Floppy, etc.) 18889 18890 Applications that expect to be runnable from removable media 18891 should not depend on logging in as a privileged user, and 18892 should be prepared to deal with a restrictive environment. 18893 Examples of such restrictions could be default mount options 18894 that disable set-user/group-ID attributes, disabling block or 18895 character-special files on the medium, or remapping the user 18896 and group IDs of files away from any privileged value. 18897 18898 Rationale: System vendors and local system administrators 18899 want to run applications from removable media, but want the 18900 possibility to control what the application can do. 18901 _________________________________________________________ 18902 18903 5.2.8. Installable applications 18904 18905 Where the installation of an application needs additional 18906 privileges, it must clearly document all files and system 18907 databases that are modified outside of those in /opt/pkg-name 18908 and /var/opt/pkg-name, other than those that may be updated by 18909 system logging or auditing activities. 18910 18911 Without this, the local system administrator would have to 18912 blindly trust a piece of software, particularly with respect 18913 to its security. 18914 _________________________________________________________ 18915 18916 Chapter 6. Additional Behaviors 18917 18918 6.1. Mandatory Optional Behaviors 18919 18920 This section specifies behaviors in which there is optional 18921 behavior in one of the standards on which the LSB relies, and 18922 where the LSB requires a specific behavior. 18923 18924 Note: The LSB does not require the kernel to be Linux; the 18925 set of mandated options reflects current existing practice, 18926 but may be modified in future releases. 18927 18928 LSB conforming implementations shall support the following 18929 options defined within the ISO POSIX (2003): 18930 18931 _POSIX_FSYNC 18932 _POSIX_MAPPED_FILES 18933 _POSIX_MEMLOCK 18934 _POSIX_MEMLOCK_RANGE 18935 _POSIX_MEMORY_PROTECTION 18936 _POSIX_PRIORITY_SCHEDULING 18937 _POSIX_REALTIME_SIGNALS 18938 _POSIX_THREAD_ATTR_STACKADDR 18939 _POSIX_THREAD_ATTR_STACKSIZE 18940 _POSIX_THREAD_PROCESS_SHARED 18941 _POSIX_THREAD_SAFE_FUNCTIONS 18942 _POSIX_THREADS 18943 _XOPEN_UNIX 18944 18945 The opendir() function shall consume a file descriptor in the 18946 same fashion as open(), and therefore may fail with EMFILE or 18947 ENFILE. 18948 18949 The START and STOP termios characters shall be changeable, as 18950 described as optional behavior in the "General Terminal 18951 Interface" section of the ISO POSIX (2003). 18952 18953 The access() function function shall fail with errno set to 18954 EINVAL if the amode argument contains bits other than those 18955 set by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 18956 18957 The link() function shall require access to the existing file 18958 in order to succeed, as described as optional behavior in the 18959 ISO POSIX (2003). 18960 18961 Calling unlink() on a directory shall fail. Calling link() 18962 specifying a directory as the first argument shall fail. See 18963 also unlink. 18964 18965 Note: Linux allows rename() on a directory without having 18966 write access, but the LSB does not require this. 18967 _________________________________________________________ 18968 18969 6.1.1. Special Requirements 18970 18971 LSB conforming systems shall enforce certain special 18972 additional restrictions above and beyond those required by ISO 18973 POSIX (2003). 18974 18975 Note: These additional restrictions are required in order 18976 to support the testing and certification programs 18977 associated with the LSB. In each case, these are values 18978 that defined macros must not have; conforming applications 18979 that use these values shall trigger a failure in the 18980 interface that is otherwise described as a "may fail". 18981 18982 The fcntl() function shall treat the "cmd" value -1 as 18983 invalid. 18984 18985 The whence value -1 shall be an invalid value for the lseek(), 18986 fseek() and fcntl() functions. 18987 18988 The value -5 shall be an invalid signal number. 18989 18990 If the sigaddset() or sigdelset() functions are passed an 18991 invalid signal number, they shall return with EINVAL. 18992 Implementations are only required to enforce this requirement 18993 for signal numbers which are specified to be invalid by this 18994 specification (such as the -5 mentioned above). 18995 18996 The mode value -1 to the access() function shall be treated as 18997 invalid. 18998 18999 A value of -1 shall be an invalid "_PC_..." value for 19000 pathconf(). 19001 19002 A value of -1 shall be an invalid "_SC..." value for 19003 sysconf(). 19004 19005 The nl_item value -1 shall be invalid for nl_langinfo(). 19006 19007 The value -1 shall be an invalid "_CS_..." value for 19008 confstr(). 19009 19010 The value "a" shall be an invalid mode argument to popen(). 19011 _________________________________________________________ 19012 19013 Chapter 7. Localization 19014 19015 In order to install a message catalog, the installation 19016 procedure shall supply the message catalog in a format 19017 readable by the msgfmt utility, which shall be invoked to 19018 compile the message catalog into an appropriate binary format 19019 on the target system. 19020 19021 Rationale: The original intent was to allow an application 19022 to contain the binary GNU MO format files. However, the 19023 format of these files is not officially stable, hence it is 19024 necessary to compile these catalogs on the target system. 19025 These binary catalogs may differ from architecture to 19026 architecture as well. 19027 19028 The resulting binary message catalog shall be located in the 19029 package's private area under /opt, and the application may use 19030 bindtextdomain() to specify this location. 19031 19032 Implementations shall support the POSIX and C locales as 19033 specified in the ISO POSIX (2003). 19034 _________________________________________________________ 19035 19036 7.1. Regular Expressions 19037 19038 Utilities that process regular expressions shall support Basic 19039 Regular Expressions and Extended Regular Expressions as 19040 specified in ISO POSIX (2003), with the following exceptions: 19041 19042 Range expression (such as [a-z]) can be based on code point 19043 order instead of collating element order. 19044 19045 Equivalence class expression (such as [=a=]) and 19046 multi-character collating element expression (such as [.ch.]) 19047 are optional. 19048 19049 Handling of a multi-character collating element is optional. 19050 19051 This affects at least the following utilities: grep (grep) 19052 (including egrep), sed (sed), and awk (awk). 19053 _________________________________________________________ 19054 19055 7.2. Pattern Matching Notation 19056 19057 Utilities that perform filename pattern matching (also known 19058 as Filename Globbing) shall do it as specified in ISO POSIX 19059 (2003), Pattern Matching Notation, with the following 19060 exceptions: 19061 19062 Pattern bracket expressions (such as [a-z]) can be based on 19063 code point order instead of collating element order. 19064 19065 Equivalence class expression (such as [=a=]) and 19066 multi-character collating element expression (such as [.ch.]) 19067 are optional. 19068 19069 Handling of a multi-character collating element is optional. 19070 19071 This affects at least the following utilities: cpio (cpio), 19072 find (find), ls (ls) and tar (tar). 19073 19074 V. System Initialization 19075 19076 Table of Contents 19077 8. System Initialization 19078 _________________________________________________________ 19079 19080 Chapter 8. System Initialization 19081 19082 8.1. Cron Jobs 19083 19084 In addition to the individual user crontab files specified by 19085 ISO POSIX (2003) stored under /var/spool/cron, the process 19086 that executes scheduled commands shall also process the 19087 following additional crontab files: /etc/crontab, 19088 /etc/cron.d/* The installation of a package shall not modify 19089 the configuration file /etc/crontab. 19090 19091 If a package wishes to install a job that has to be executed 19092 periodically, it shall place a file in one of the following 19093 directories: 19094 19095 /etc/cron.daily 19096 /etc/cron.weekly 19097 /etc/cron.monthly 19098 19099 As these directory names suggest, the files within them are 19100 executed on a daily, weekly, or monthly basis, respectively, 19101 under the control of an entry in one of the system crontab 19102 files. See below for the rules concerning the names of files 19103 in these directories. 19104 19105 It is recommended that files installed in any of these 19106 directories be scripts (e.g. shell scripts, Perl scripts, 19107 etc.) so that they may be modified by the local system 19108 administrator. 19109 19110 The scripts in these directories should check if all necessary 19111 programs are installed before they try to execute them. 19112 Otherwise, problems will arise if a package is removed (but 19113 not purged), since the configuration files are kept on the 19114 system in this situation. 19115 19116 If a certain job has to be executed at a different frequency 19117 (e.g. more frequently than daily), the package shall install a 19118 file /etc/cron.d/cron-name tagged as a configuration file. 19119 This file uses the same syntax as /etc/crontab and is 19120 processed by the system automatically. 19121 19122 To avoid namespace conflicts in the /etc/cron.* directories, 19123 the filenames used by LSB-compliant packages in 19124 /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly, or 19125 /etc/cron.d shall come from a managed namespace. These 19126 filenames may be assigned using one of the following methods: 19127 19128 * Assigned namespace. This namespace consists of names which 19129 only use the character set [a-z0-9]. In order to avoid 19130 conflicts these cron script names shall be reserved 19131 through the Linux Assigned Names and Numbers Authority 19132 (LANANA). Information about the LANANA may be found at 19133 www.lanana.org. 19134 Commonly used names shall be reserved in advance; 19135 developers for projects should be encouraged reserve names 19136 from LANANA, so that each distribution can use the same 19137 name, and to avoid conflicts with other projects. 19138 * Hierarchical namespace. This namespace consists of script 19139 names of the form: [hier1]-[hier2]-...-[name], where name 19140 is again taken from the character set [a-z0-9], and where 19141 there may be one or more [hier-n] components. [hier1] may 19142 either be an LSB provider name assigned by the LANANA, or 19143 it may be owners' DNS name in lower case, with at least 19144 one '.'. e.g. "debian.org", "staroffice.sun.com", etc. The 19145 LSB provider name assigned by LANANA shall only consist of 19146 the ASCII characters [a-z0-9]. 19147 * Reserved namespace. This namespace consists of script 19148 names which begin with the character '_', and is reserved 19149 for distribution use only. This namespace should be used 19150 for core packages only. 19151 _________________________________________________________ 19152 19153 8.2. Init Script Actions 19154 19155 Init files provided by LSB applications shall accept one 19156 argument, saying what to do: 19157 19158 start start the service 19159 stop stop the service 19160 restart stop and restart the service if the service is already 19161 running, otherwise start the service 19162 try-restart restart the service if the service is already 19163 running 19164 reload cause the configuration of the service to be reloaded 19165 without actually stopping and restarting the service 19166 force-reload cause the configuration to be reloaded if the 19167 service supports this, otherwise restart the service if it is 19168 running 19169 status print the current status of the service 19170 19171 The start, stop, restart, force-reload, and status commands 19172 shall be supported by all init files; the reload and the 19173 try-restart options are optional. Other init script actions 19174 may be defined by the init script. 19175 19176 Init files shall ensure that they will behave sensibly if 19177 invoked with start when the service is already running, or 19178 with stop when it isn't, and that they don't kill 19179 unfortunately-named user processes. The best way to achieve 19180 this is to use the init-script functions provided by 19181 /lib/lsb/init-functions. 19182 19183 If a service reloads its configuration automatically (as in 19184 the case of cron, for example), the reload option of the init 19185 file shall behave as if the configuration has been reloaded 19186 successfully. The restart, try-restart, reload and 19187 force-reload action may be atomic; i.e. if a service is known 19188 not be operational after a restart or reload, the script may 19189 return an error without any further action. 19190 19191 These executable files shall not fail obscurely when the 19192 configuration files remain but the package has been removed, 19193 as the default in [the packaging system] is to leave 19194 configuration files on the system after the package has been 19195 removed. Only when it is executed with the [purge] option will 19196 [the packaging system] remove configuration files. Therefore, 19197 you should include a test statement at the top of the file, 19198 like this: 19199 test -f program-executed-later-in-file || exit 5 19200 19201 or take the equivalent action if the init file is not a shell 19202 script. 19203 19204 If the status command is given, the init script will return 19205 the following exit status codes. 19206 19207 0 program is running or service is OK 19208 1 program is dead and /var/run pid file exists 19209 2 program is dead and /var/lock lock file exists 19210 3 program is not running 19211 4 program or service status is unknown 19212 5-99 reserved for future LSB use 19213 100-149 reserved for distribution use 19214 150-199 reserved for application use 19215 200-254 reserved 19216 19217 In the case of init script commands other than "status" (i.e., 19218 "start", "stop", "restart", "try-restart", "reload", and 19219 "force-reload"), the init script shall return an exit status 19220 of zero if the action described by the argument has been 19221 successful. Otherwise, the exit status shall be non-zero, as 19222 defined below. In addition to straightforward success, the 19223 following situations are also to be considered successful: 19224 19225 * restarting a service (instead of reloading it) with the 19226 "force-reload" argument 19227 * running "start" on a service already running 19228 * running "stop" on a service already stopped or not running 19229 * running "restart" on a service already stopped or not 19230 running 19231 * running "try-restart" on a service already stopped or not 19232 running 19233 19234 In case of an error, while processing any init script action 19235 except for "status", the init script shall print an error 19236 message and return one of the following non-zero exit status 19237 codes. 19238 19239 1 generic or unspecified error (current practice) 19240 2 invalid or excess argument(s) 19241 3 unimplemented feature (for example, "reload") 19242 4 user had insufficient privilege 19243 5 program is not installed 19244 6 program is not configured 19245 7 program is not running 19246 8-99 reserved for future LSB use 19247 100-149 reserved for distribution use 19248 150-199 reserved for application use 19249 200-254 reserved 19250 19251 Error and status messages should be printed with the logging 19252 functions such as log_failure_msg and so on. Scripts may write 19253 to standard error or standard output, but implementations need 19254 not present text written to standard error/output to the user 19255 or do anything else with it. 19256 19257 Since init files may be run manually by a system administrator 19258 with non-standard environment variable values for PATH, USER, 19259 LOGNAME, etc. init files shall not depend on the values of 19260 these environment variables. They should set them to some 19261 known/default values if they are needed. 19262 _________________________________________________________ 19263 19264 8.3. Comment Conventions for Init Scripts 19265 19266 LSB applications which need to execute script(s) at bootup 19267 and/or shutdown may provide one or more init.d files. These 19268 files are installed by the install_initd program described 19269 below, which copies it into a standard directory and makes 19270 whatever other adjustments (creation of symlinks, creation of 19271 entries in a database, etc.) are necessary so that the script 19272 can be run at boot-time. 19273 19274 Note: This specification does not require, but is designed 19275 to allow, the development of a system which runs boot 19276 scripts in parallel. Hence, enforced-serialization of 19277 scripts is avoided unless it is explicitly necessary. 19278 19279 In the init.d file, information about the shell script shall 19280 be delimited by the lines "### BEGIN INIT INFO" and "### END 19281 INIT INFO". These delimiter lines may containg trailing 19282 whitespace, which shall be ignored. Inside this block there 19283 shall be lines of the form "# {keyword}: [arg1] [arg2] ...". 19284 (All lines inside this block start with a hash ('#') character 19285 in the first column, so that shell treats them as comments.) 19286 There shall be exactly one space character between "#" and the 19287 keyword. 19288 19289 Note: More than one space, or a tab character, indicates 19290 the continuation line. 19291 19292 The following keywords, with their arguments are defined in 19293 this specification: 19294 # Provides: boot_facility_1 [ boot_facility_2 ...] 19295 # Required-Start: boot_facility_1 [ boot_facility_2 ...] 19296 # Required-Stop: boot_facility_1 [ boot_facility_2 ...] 19297 # Should-Start: boot_facility_1 [ boot_facility_2 ...] 19298 # Should-Stop: boot_facility_1 [ boot_facility_2 ...] 19299 # Default-Start: run_level_1 [ run_level_2 ...] 19300 # Default-Stop: run_level_1 [ run_level_2 ...] 19301 # Short-Description: short_description 19302 # Description: multiline_description 19303 19304 Additional keywords may be defined in future LSB 19305 specifications. Distributions may define local extensions by 19306 using the prefix "X-[distribution name]" --- for example, 19307 "X-RedHat-foobardecl", or "X-Debian-xyzzydecl". 19308 19309 An init.d shell script may declare using the "Required-Start: 19310 " header that it shall not be run until certain boot 19311 facilities are provided. This information is used by the 19312 installation tool or the boot-time boot-script execution 19313 facility to assure that init scripts are run in the correct 19314 order. When an init script is run with a "start" argument, the 19315 boot facility or facilities specified in the "Provides" header 19316 shall be considered present, and hence init scripts which 19317 require those boot facilities would then be eligble to be run. 19318 When an init script is run with a "stop" argument, the boot 19319 facilities specified in the "Provides" header are considered 19320 no longer present. There are naming conventions for boot 19321 facilities and system facilities, as described in a following 19322 section. 19323 19324 Similarly, the "Required-Stop:" header defines which 19325 facilities shall still be available during the shutdown of 19326 that service. Hence, the init script system should avoid 19327 stopping shell scripts which provide those facilities until 19328 this shell script is stopped. 19329 19330 The "Should-Start:" header defines which facilities if present 19331 should be started before this service. This allows for weak 19332 dependencies which do not cause the service to fail if a 19333 facility is not available. But may cause reduced functionality 19334 of the service. Compliant applications should not rely on the 19335 existence of this feature. 19336 19337 The "Should-Stop:" header defines which facilities should be 19338 still available during the shutdown of that service. 19339 19340 The "Default-Start" and "Default-Stop" headers define which 19341 run levels should by default run the script with a start or 19342 stop argument, respectively, to start or stop the services 19343 controlled by the init script. 19344 19345 Note: For example, if you want a service to run in 19346 runlevels 3, 4, and 5 (only), specify "Default-Start: 3 4 19347 5" and "Default-Stop: 0 1 2 6". 19348 19349 The "Short-Description" and "Description" header fields are 19350 used to provide text which describes the actions of the init 19351 script. The "short_description" shall be a relatively short, 19352 pithy description of the init script, where as the 19353 "multiline_description" can be a much longer piece of text 19354 that may span mulitple lines. In a multiline description, each 19355 continuation line shall begin with a '#' followed by tab 19356 character or a '#' followed by at least two space characters. 19357 The multiline description is terminated by the first line that 19358 does not match this criteria. 19359 19360 The comment conventions described in this session are only 19361 required for use by LSB-compliant applications; system init 19362 scripts as provided by LSB-compliant run-time environments are 19363 not required to use the scheme outlined here. 19364 _________________________________________________________ 19365 19366 8.4. Installation and Removal of init.d Files 19367 19368 An init.d file is installed in /etc/init.d (which may be a 19369 symlink to another location). This can be done by the package 19370 installer. See Script Names>. During the package's postinstall 19371 script, the program "/usr/lib/lsb/install_initd" configures 19372 the distribution's boot script system to call the package's 19373 init.d file at the appropriate time. 19374 19375 Note: For example, install_initd might create symbolic 19376 links in /etc/rc2.d and other such directories which point 19377 to the files in /etc/init.d (or it might update a database, 19378 or some other mechanism). The init.d files themselves 19379 should already be in /etc/init.d before running 19380 install_initd. 19381 19382 The install_initd program takes a single argument, the 19383 pathname to the /etc/init.d file. For example: 19384 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 19385 19386 The install_initd program shall return an exit status of zero 19387 if the init.d file has been successfully installed or if the 19388 the init.d file was already installed. If the required boot 19389 facilities cannot be fulfilled an exit status of one shall be 19390 returned and the init.d file shall not be installed. 19391 19392 When a software package is removed, the package's preuninstall 19393 script shall call /usr/lib/lsb/remove_initd and pass the 19394 pathname to the /etc/init.d file. The package manager is still 19395 responsible for removing the /etc/init.d file; the 19396 remove_initd program is provided in case the distribution 19397 needs to clean up any other modifications in the 19398 distribution's boot script system that might have been made by 19399 the install_initd program. For example: 19400 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 19401 19402 The remove_initd program shall return an exit status of zero 19403 if the init.d file has been successfully removed or if the the 19404 init.d file is not installed. If another init.d file which 19405 depends on a boot facility provided by this init.d file is 19406 installed, an exit status of one shall be returned and the 19407 init.d file shall remained installed. 19408 19409 There should be a tool available to the user (e.g., RedHat's 19410 chkconfig) which can be used by the system administrator to 19411 easily manipulate at which init levels a particular init.d 19412 script is started or stopped. This specification currently 19413 does not specify such an interface, however. 19414 _________________________________________________________ 19415 19416 8.5. Run Levels 19417 19418 The following run levels are specified for use by the 19419 "Default-Start:" and "Default-Stop:" specifiers as defined by 19420 the section Comment Conventions for Init Scripts>. Many LSB 19421 run-time environments commonly use these run level 19422 definitions, and in the absence of other considerations, 19423 providers of run-time environments are strongly encouraged to 19424 follow this convention to provide consistency for system 19425 administrators who need to work with multiple distributions. 19426 However, it is not required that LSB-compliant run-time 19427 environments use these run levels; the distribution-provided 19428 install_initd script may map the run levels specified below to 19429 whatever distribution-specified run levels are most 19430 appropriate. 19431 19432 0 halt 19433 1 single user mode 19434 2 multiuser with no network services exported 19435 3 normal/full multiuser 19436 4 reserved for local use, default is normal/full multiuser 19437 5 multiuser with xdm or equivalent 19438 6 reboot 19439 _________________________________________________________ 19440 19441 8.6. Facility Names 19442 19443 Boot facilities are used to indicate dependencies in init 19444 scripts, as defined in a previous section. Facility names that 19445 begin with a dollar sign ('$') are system facility names, 19446 defined by the LSB, and SHALL be provided by distributions. 19447 19448 Note: The dollar sign does not indicate variable expansion 19449 as in many Linux utilities. Starting a facility name with a 19450 dollar sign is merely a way of dividing the namespace 19451 between the system and applications. 19452 19453 LSB applications shall not provide facilities that begin with 19454 a dollar sign. This document defines the following facility 19455 names: 19456 19457 $local_fs all local filesystems are mounted 19458 $network low level networking (ethernet card; may imply PCMCIA 19459 running) 19460 $named daemons which may provide hostname resolution (if 19461 present) are running. For example, daemons to query DNS, NIS+, 19462 or LDAP. 19463 $portmap daemons providing SunRPC/ONCRPC portmapping service 19464 as defined in RFC 1833 (if present) are running 19465 $remote_fs all remote filesystems are mounted. In some LSB 19466 run-time environments, filesystems such as /usr may be remote. 19467 Many applications that require $local_fs will probably require 19468 also require $remote_fs. 19469 $syslog system logger is operational 19470 $time the system time has been set, for example by using a 19471 network-based time program such as ntp or rdate, or via the 19472 hardware Real Time Clock. 19473 19474 Other (non-system) facilities may be defined by other LSB 19475 applications. These facilities shall be named using the same 19476 conventions defined for naming init.d script names. Commonly, 19477 the facility provided by an LSB application init.d script will 19478 have the same name as the name assigned to the init.d script. 19479 _________________________________________________________ 19480 19481 8.7. Script Names 19482 19483 Since the init.d scripts shall live in a single directory, 19484 they shall come from a single namespace. Three means of 19485 assigning names from this namespace are available: 19486 19487 * Assigned namespace. This namespace consists of names which 19488 only use the character set [a-z0-9]. This space is 19489 desirable for scripts which system administrators may 19490 often wish to run manually: e.g., "/etc/init.d/named 19491 restart" In order to avoid conflicts these init.d names 19492 shall be reserved through the Linux Assigned Names and 19493 Numbers Authority (LANANA). Information about the LANANA 19494 may be found at www.lanana.org. 19495 Commonly used names shall be reserved in advance; 19496 developers for projects should be encouraged to reserve 19497 names from LANANA, so that each distribution can use the 19498 same name, and to avoid conflicts with other projects. 19499 * Hierarchical namespace. This namespace consists of scripts 19500 names which look like this: [hier1]-[hier2]-...-[name], 19501 where name is again taken the character set [a-z0-9], and 19502 where there may be one or more [hier-n] components. 19503 [hier1] may either be an LSB provider name assigned by the 19504 LANANA, or it may be owners' DNS name in lower case, with 19505 at least one '.' (e.g., "debian.org", 19506 "staroffice.sun.com"). The LSB provider name assigned by 19507 LANANA shall only consist of the ASCII characters 19508 [a-z0-9]. 19509 * Reserved namespace. This namespace consists of script 19510 names which begin with the character '_', and is reserved 19511 for distribution use only. This namespace should be used 19512 for core packages only, and in general use of this 19513 namespace is highly discouraged. 19514 19515 In general, if a package or some system function is likely to 19516 be used on multiple systems, the package developers or the 19517 distribution SHOULD get a registered name through LANANA, and 19518 distributions should strive to use the same name whenever 19519 possible. For applications which may not be "core" or may not 19520 be commonly installed, the hierarchical namespace may be more 19521 appropriate. An advantage to the hierarchical namespace is 19522 that there is no need to consult with the LANANA before 19523 obtaining an assigned name. 19524 19525 Short names are highly desirable, since many system 19526 administrators like to use them to manually start and stop 19527 services. Given this, they should be standardized on a 19528 per-package basis. This is the rationale behind having a 19529 LANANA organization to assign these names. The LANANA may be 19530 called upon to handle other namespace issues, such as 19531 package/prerequisites naming (which is essential to making 19532 prerequisites to work correctly). 19533 _________________________________________________________ 19534 19535 8.8. Init Script Functions 19536 19537 Each LSB-compliant init.d script shall source the file 19538 /lib/lsb/init-functions. This file shall cause the following 19539 shell script commands to be defined. This can be done either 19540 by adding a directory to the PATH variable which defines these 19541 commands, or by defining sh aliases. While the 19542 distribution-provided aliases may choose to use shell 19543 extensions (at the distribution's option), the LSB init.d 19544 files themselves should only depend in shell features as 19545 defined by the LSB. 19546 19547 The start_daemon, killproc and pidofproc functions shall use 19548 this algorithm for determining the status and the pid(s) of 19549 the specified program. They shall read the pidfile specified 19550 or otherwise /var/run/basename.pid and use the pid(s) herein 19551 when determining whether a program is running. The method used 19552 to determine the status is implementation defined, but should 19553 allow for non-binary programs. 19554 19555 Note: Commonly used methods check either for the existence 19556 of the /proc/pid directory or use /proc/pid/exe and 19557 /proc/pid/cmdline. Relying only on /proc/pid/exe is 19558 discouraged since this results in a not-running status for 19559 daemons that are written in a script language. 19560 19561 Compliant implementations may use other mechanisms besides 19562 those based on pidfiles, unless the -p pidfile option has been 19563 used. Compliant applications should not rely on such 19564 mechanisms and should always use a pidfile. When a program is 19565 stopped, it should delete its pidfile. Multiple pid(s) shall 19566 be separated by a single space in the pidfile and in the 19567 output of pidofproc. 19568 19569 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args] 19570 This runs the specified program as a daemon. start_daemon 19571 shall check if the program is already running using the 19572 algorithm given above. If so, it shall not start another copy 19573 of the daemon unless the -f option is given. The -n option 19574 specifies a nice level. See nice(1). start_daemon should 19575 return the LSB defined exit status codes. It shall return 0 if 19576 the program has been successfully started or is running and 19577 not 0 otherwise. 19578 killproc [-p pidfile] pathname [signal] This stops the 19579 specified program. The program is found using the algorithm 19580 given above. If a signal is specified, using the -signal_name 19581 or -signal_number syntaxes as specified by the kill command, 19582 the program is sent that signal. Otherwise, a SIGTERM followed 19583 by a SIGKILL after some number of seconds shall be sent. If a 19584 program has been terminated, the pidfile should be removed if 19585 the terminated process has not already done so. Compliant 19586 applications may use the basename instead of the pathname. 19587 killproc should return the LSB defined exit status codes. If 19588 called without a signal, it shall return 0 if the program has 19589 been stopped or is not running and not 0 otherwise. If a 19590 signal is given, it shall return 0 only if the program is 19591 running. 19592 pidofproc [-p pidfile] pathname This function returns one or 19593 more pid(s) for a particular daemon using the algorithm given 19594 above. Only pids of running processes should be returned. 19595 Compliant applications may use the basename instead of the 19596 pathname. pidofproc should return the LSB defined exit status 19597 codes for "status". It shall return 0 if the program is 19598 running and not 0 otherwise. 19599 log_success_msg "message" This requests the distribution to 19600 print a success message. The message should be relatively 19601 short; no more than 60 characters is highly desirable. 19602 log_failure_msg "message" This requests the distribution to 19603 print a failure message. The message should be relatively 19604 short; no more than 60 characters is highly desirable. 19605 log_warning_msg "message" This requests the distribution to 19606 print a warning message. The message should be relatively 19607 short; no more than 60 characters is highly desirable. 19608 19609 VI. Users & Groups 19610 19611 Table of Contents 19612 9. Users & Groups 19613 _________________________________________________________ 19614 19615 Chapter 9. Users & Groups 19616 19617 9.1. User and Group Database 19618 19619 The format of the User and Group databases is not specified. 19620 Programs may only read these databases using the provided API. 19621 Changes to these databases should be made using the provided 19622 commands. 19623 _________________________________________________________ 19624 19625 9.2. User & Group Names 19626 19627 Below is a table of required mnemonic user and group names. 19628 This specification makes no attempt to numerically assign uid 19629 or gid numbers. The exception is the uid and gid for "root" 19630 which are equal to 0. 19631 19632 Table 9-1. Required User & Group Names 19633 User Group Comments 19634 root root Administrative user with all appropriate privileges 19635 bin bin Legacy UID/GID[a] 19636 daemon daemon Legacy UID/GID[b] 19637 Notes: 19638 a. The 'bin' UID/GID is included for compatibility with legacy 19639 applications. New applications should no longer use the 'bin' 19640 UID/GID. 19641 b. The 'daemon' UID/GID was used as an unprivileged UID/GID 19642 for daemons to execute under in order to limit their access to 19643 the system. Generally daemons should now run under individual 19644 UID/GIDs in order to further partition daemons from one 19645 another. 19646 19647 Below is a table of optional mnemonic user and group names. 19648 This specification makes no attempt to numerically assign uid 19649 or gid numbers. If the username exists on a system, then they 19650 should be in the suggested corresponding group. These user and 19651 group names are for use by distributions, not by applications. 19652 19653 Table 9-2. Optional User & Group Names 19654 User Group Comments 19655 adm adm Administrative special privileges 19656 lp lp Printer special privileges 19657 sync sync Login to sync the system 19658 shutdown shutdown Login to shutdown the system 19659 halt halt Login to halt the system 19660 mail mail Mail special privileges 19661 news news News special privileges 19662 uucp uucp UUCP special privileges 19663 operator root Operator special privileges 19664 man man Man special privileges 19665 nobody nobody Used by NFS 19666 19667 The differences in numeric values of the uids and gids between 19668 systems on a network can be reconciled via NIS, rdist(1), 19669 rsync(1), or ugidd(8). Only a minimum working set of "user 19670 names" and their corresponding "user groups" are required. 19671 Applications cannot assume non system user or group names will 19672 be defined. 19673 19674 Applications cannot assume any policy for the default umask or 19675 the default directory permissions a user may have. 19676 Applications should enforce user only file permissions on 19677 private files such as mailboxes. The location of the users 19678 home directory is also not defined by policy other than the 19679 recommendations of the FHS and shall be obtained by the 19680 *pwnam(3) calls. 19681 _________________________________________________________ 19682 19683 9.3. UID Ranges 19684 19685 The system UIDs from 0 to 99 should be statically allocated by 19686 the system, and shall not be created by applications. 19687 19688 The system UIDs from 100 to 499 should be reserved for dynamic 19689 allocation by system administrators and post install scripts 19690 using useradd(1). 19691 _________________________________________________________ 19692 19693 9.4. Rationale 19694 19695 The purpose of specifying optional users and groups is to 19696 reduce the potential for name conflicts between applications 19697 and distributions. 19698 _________________________________________________________ 19699 19700 Appendix A. Alphabetical Listing of Interfaces 19701 _________________________________________________________ 19702 19703 A.1. libc 19704 19705 The behaviour of the interfaces in this library is specified 19706 by the following Standards. 19707 19708 Large File Support 19709 this specification 19710 SUSv2 19711 ISO POSIX (2003) 19712 SVID Issue 3 19713 SVID Issue 4 19714 19715 Table A-1. libc Function Interfaces 19716 _Exit(GLIBC_2.1.1)[1] getrlimit64(GLIBC_2.1.1)[1] 19717 sigaddset(GLIBC_2.1.1)[1] 19718 _IO_feof(GLIBC_2.0)[1] getrusage(GLIBC_2.0)[1] 19719 sigaltstack(GLIBC_2.0)[1] 19720 _IO_getc(GLIBC_2.0)[1] getservbyname(GLIBC_2.0)[1] 19721 sigandset(GLIBC_2.0)[1] 19722 _IO_putc(GLIBC_2.0)[1] getservbyport(GLIBC_2.0)[1] 19723 sigdelset(GLIBC_2.0)[1] 19724 _IO_puts(GLIBC_2.0)[1] getservent(GLIBC_2.0)[1] 19725 sigemptyset(GLIBC_2.0)[1] 19726 __assert_fail(GLIBC_2.0)[1] getsid(GLIBC_2.0)[1] 19727 sigfillset(GLIBC_2.0)[1] 19728 __ctype_b_loc[1] getsockname()[1] sighold()[1] 19729 __ctype_get_mb_cur_max(GLIBC_2.0)[1] getsockopt(GLIBC_2.0)[1] 19730 sigignore(GLIBC_2.0)[1] 19731 __ctype_tolower_loc[1] getsubopt()[1] siginterrupt()[1] 19732 __ctype_toupper_loc[1] gettext()[1] sigisemptyset()[1] 19733 __cxa_atexit(GLIBC_2.1.3)[1] gettimeofday(GLIBC_2.1.3)[1] 19734 sigismember(GLIBC_2.1.3)[1] 19735 __errno_location(GLIBC_2.0)[1] getuid(GLIBC_2.0)[1] 19736 siglongjmp(GLIBC_2.0)[1] 19737 __fpending(GLIBC_2.2)[1] getutent(GLIBC_2.2)[1] 19738 signal(GLIBC_2.2)[1] 19739 __fxstat(GLIBC_2.0)[1] getutent_r(GLIBC_2.0)[1] 19740 sigorset(GLIBC_2.0)[1] 19741 __fxstat64(GLIBC_2.2)[1] getutxent(GLIBC_2.2)[1] 19742 sigpause(GLIBC_2.2)[1] 19743 __getpagesize(GLIBC_2.0)[1] getutxid(GLIBC_2.0)[1] 19744 sigpending(GLIBC_2.0)[1] 19745 __getpgid(GLIBC_2.0)[1] getutxline(GLIBC_2.0)[1] 19746 sigprocmask(GLIBC_2.0)[1] 19747 __h_errno_location[1] getw()[1] sigqueue()[1] 19748 __isinf[1] getwc()[1] sigrelse()[1] 19749 __isinff[1] getwchar()[1] sigreturn()[1] 19750 __isinfl[1] getwd()[1] sigset()[1] 19751 __isnan[1] glob()[1] sigsuspend()[1] 19752 __isnanf[1] glob64()[1] sigtimedwait()[1] 19753 __isnanl[1] globfree()[1] sigwait()[1] 19754 __libc_current_sigrtmax(GLIBC_2.1)[1] globfree64(GLIBC_2.1)[1] 19755 sigwaitinfo(GLIBC_2.1)[1] 19756 __libc_current_sigrtmin(GLIBC_2.1)[1] gmtime(GLIBC_2.1)[1] 19757 sleep(GLIBC_2.1)[1] 19758 __libc_start_main(GLIBC_2.0)[1] gmtime_r(GLIBC_2.0)[1] 19759 snprintf(GLIBC_2.0)[1] 19760 __lxstat(GLIBC_2.0)[1] grantpt(GLIBC_2.0)[1] sockatmark[1] 19761 __lxstat64(GLIBC_2.2)[1] hcreate(GLIBC_2.2)[1] 19762 socket(GLIBC_2.2)[1] 19763 __mempcpy(GLIBC_2.0)[1] hdestroy(GLIBC_2.0)[1] 19764 socketpair(GLIBC_2.0)[1] 19765 __rawmemchr(GLIBC_2.1)[1] hsearch(GLIBC_2.1)[1] 19766 sprintf(GLIBC_2.1)[1] 19767 __register_atfork[1] htonl()[1] srand()[1] 19768 __sigsetjmp(GLIBC_2.0)[1] htons(GLIBC_2.0)[1] 19769 srand48(GLIBC_2.0)[1] 19770 __stpcpy(GLIBC_2.0)[1] iconv(GLIBC_2.0)[1] 19771 srandom(GLIBC_2.0)[1] 19772 __strdup(GLIBC_2.0)[1] iconv_close(GLIBC_2.0)[1] 19773 sscanf(GLIBC_2.0)[1] 19774 __strtod_internal(GLIBC_2.0)[1] iconv_open(GLIBC_2.0)[1] 19775 statvfs(GLIBC_2.0)[1] 19776 __strtof_internal(GLIBC_2.0)[1] if_freenameindex[1] 19777 statvfs64[1] 19778 __strtok_r(GLIBC_2.0)[1] if_indextoname[1] stime(GLIBC_2.0)[1] 19779 __strtol_internal(GLIBC_2.0)[1] if_nameindex[1] 19780 stpcpy(GLIBC_2.0)[1] 19781 __strtold_internal(GLIBC_2.0)[1] if_nametoindex[1] 19782 stpncpy(GLIBC_2.0)[1] 19783 __strtoll_internal(GLIBC_2.0)[1] imaxabs(GLIBC_2.0)[1] 19784 strcasecmp(GLIBC_2.0)[1] 19785 __strtoul_internal(GLIBC_2.0)[1] imaxdiv(GLIBC_2.0)[1] 19786 strcasestr(GLIBC_2.0)[1] 19787 __strtoull_internal(GLIBC_2.0)[1] index(GLIBC_2.0)[1] 19788 strcat(GLIBC_2.0)[1] 19789 __sysconf(GLIBC_2.2)[1] inet_addr(GLIBC_2.2)[1] 19790 strchr(GLIBC_2.2)[1] 19791 __sysv_signal(GLIBC_2.0)[1] inet_ntoa(GLIBC_2.0)[1] 19792 strcmp(GLIBC_2.0)[1] 19793 __wcstod_internal(GLIBC_2.0)[1] inet_ntop[1] 19794 strcoll(GLIBC_2.0)[1] 19795 __wcstof_internal(GLIBC_2.0)[1] inet_pton[1] 19796 strcpy(GLIBC_2.0)[1] 19797 __wcstol_internal(GLIBC_2.0)[1] initgroups(GLIBC_2.0)[1] 19798 strcspn(GLIBC_2.0)[1] 19799 __wcstold_internal(GLIBC_2.0)[1] initstate(GLIBC_2.0)[1] 19800 strdup(GLIBC_2.0)[1] 19801 __wcstoul_internal(GLIBC_2.0)[1] insque(GLIBC_2.0)[1] 19802 strerror(GLIBC_2.0)[1] 19803 __xmknod(GLIBC_2.0)[1] ioctl(GLIBC_2.0)[1] 19804 strerror_r(GLIBC_2.0)[1] 19805 __xstat(GLIBC_2.0)[1] isalnum(GLIBC_2.0)[1] 19806 strfmon(GLIBC_2.0)[1] 19807 __xstat64(GLIBC_2.2)[1] isalpha(GLIBC_2.2)[1] 19808 strftime(GLIBC_2.2)[1] 19809 _exit(GLIBC_2.0)[1] isascii(GLIBC_2.0)[1] strlen(GLIBC_2.0)[1] 19810 _longjmp(GLIBC_2.0)[1] isatty(GLIBC_2.0)[1] 19811 strncasecmp(GLIBC_2.0)[1] 19812 _setjmp(GLIBC_2.0)[1] isblank(GLIBC_2.0)[1] 19813 strncat(GLIBC_2.0)[1] 19814 _tolower(GLIBC_2.0)[1] iscntrl(GLIBC_2.0)[1] 19815 strncmp(GLIBC_2.0)[1] 19816 _toupper(GLIBC_2.0)[1] isdigit(GLIBC_2.0)[1] 19817 strncpy(GLIBC_2.0)[1] 19818 a64l(GLIBC_2.0)[1] isgraph(GLIBC_2.0)[1] strndup(GLIBC_2.0)[1] 19819 abort(GLIBC_2.0)[1] islower(GLIBC_2.0)[1] 19820 strnlen(GLIBC_2.0)[1] 19821 abs(GLIBC_2.0)[1] isprint(GLIBC_2.0)[1] strpbrk(GLIBC_2.0)[1] 19822 accept(GLIBC_2.0)[1] ispunct(GLIBC_2.0)[1] 19823 strptime(GLIBC_2.0)[1] 19824 access(GLIBC_2.0)[1] isspace(GLIBC_2.0)[1] 19825 strrchr(GLIBC_2.0)[1] 19826 acct(GLIBC_2.0)[1] isupper(GLIBC_2.0)[1] strsep(GLIBC_2.0)[1] 19827 adjtime(GLIBC_2.0)[1] iswalnum(GLIBC_2.0)[1] 19828 strsignal(GLIBC_2.0)[1] 19829 alarm(GLIBC_2.0)[1] iswalpha(GLIBC_2.0)[1] 19830 strspn(GLIBC_2.0)[1] 19831 asctime(GLIBC_2.0)[1] iswblank(GLIBC_2.0)[1] 19832 strstr(GLIBC_2.0)[1] 19833 asctime_r(GLIBC_2.0)[1] iswcntrl(GLIBC_2.0)[1] 19834 strtod(GLIBC_2.0)[1] 19835 asprintf(GLIBC_2.0)[1] iswctype(GLIBC_2.0)[1] 19836 strtof(GLIBC_2.0)[1] 19837 atof(GLIBC_2.0)[1] iswdigit(GLIBC_2.0)[1] 19838 strtoimax(GLIBC_2.0)[1] 19839 atoi(GLIBC_2.0)[1] iswgraph(GLIBC_2.0)[1] strtok(GLIBC_2.0)[1] 19840 atol(GLIBC_2.0)[1] iswlower(GLIBC_2.0)[1] 19841 strtok_r(GLIBC_2.0)[1] 19842 atoll[1] iswprint()[1] strtol()[1] 19843 authnone_create(GLIBC_2.0)[1] iswpunct(GLIBC_2.0)[1] 19844 strtold(GLIBC_2.0)[1] 19845 basename(GLIBC_2.0)[1] iswspace(GLIBC_2.0)[1] 19846 strtoll(GLIBC_2.0)[1] 19847 bcmp(GLIBC_2.0)[1] iswupper(GLIBC_2.0)[1] strtoq(GLIBC_2.0)[1] 19848 bcopy(GLIBC_2.0)[1] iswxdigit(GLIBC_2.0)[1] 19849 strtoul(GLIBC_2.0)[1] 19850 bind(GLIBC_2.0)[1] isxdigit(GLIBC_2.0)[1] 19851 strtoull(GLIBC_2.0)[1] 19852 bind_textdomain_codeset[1] jrand48()[1] strtoumax()[1] 19853 bindresvport(GLIBC_2.0)[1] key_decryptsession(GLIBC_2.0)[1] 19854 strtouq(GLIBC_2.0)[1] 19855 bindtextdomain(GLIBC_2.0)[1] kill(GLIBC_2.0)[1] 19856 strxfrm(GLIBC_2.0)[1] 19857 brk(GLIBC_2.0)[1] killpg(GLIBC_2.0)[1] 19858 svc_getreqset(GLIBC_2.0)[1] 19859 bsd_signal(GLIBC_2.0)[1] l64a(GLIBC_2.0)[1] 19860 svc_register(GLIBC_2.0)[1] 19861 bsearch(GLIBC_2.0)[1] labs(GLIBC_2.0)[1] svc_run(GLIBC_2.0)[1] 19862 btowc(GLIBC_2.0)[1] lchown(GLIBC_2.0)[1] 19863 svc_sendreply(GLIBC_2.0)[1] 19864 bzero(GLIBC_2.0)[1] lcong48(GLIBC_2.0)[1] 19865 svcerr_auth(GLIBC_2.0)[1] 19866 calloc(GLIBC_2.0)[1] ldiv(GLIBC_2.0)[1] 19867 svcerr_decode(GLIBC_2.0)[1] 19868 catclose(GLIBC_2.0)[1] lfind(GLIBC_2.0)[1] 19869 svcerr_noproc(GLIBC_2.0)[1] 19870 catgets(GLIBC_2.0)[1] link(GLIBC_2.0)[1] 19871 svcerr_noprog(GLIBC_2.0)[1] 19872 catopen(GLIBC_2.0)[1] listen(GLIBC_2.0)[1] 19873 svcerr_progvers(GLIBC_2.0)[1] 19874 cfgetispeed(GLIBC_2.0)[1] llabs(GLIBC_2.0)[1] 19875 svcerr_systemerr(GLIBC_2.0)[1] 19876 cfgetospeed(GLIBC_2.0)[1] lldiv(GLIBC_2.0)[1] 19877 svcerr_weakauth(GLIBC_2.0)[1] 19878 cfmakeraw(GLIBC_2.0)[1] localeconv(GLIBC_2.0)[1] 19879 svctcp_create(GLIBC_2.0)[1] 19880 cfsetispeed(GLIBC_2.0)[1] localtime(GLIBC_2.0)[1] 19881 svcudp_create(GLIBC_2.0)[1] 19882 cfsetospeed(GLIBC_2.0)[1] localtime_r(GLIBC_2.0)[1] 19883 swab(GLIBC_2.0)[1] 19884 cfsetspeed(GLIBC_2.0)[1] lockf(GLIBC_2.0)[1] 19885 swapcontext(GLIBC_2.0)[1] 19886 chdir(GLIBC_2.0)[1] lockf64(GLIBC_2.0)[1] 19887 swprintf(GLIBC_2.0)[1] 19888 chmod(GLIBC_2.0)[1] longjmp(GLIBC_2.0)[1] 19889 swscanf(GLIBC_2.0)[1] 19890 chown(GLIBC_2.1)[1] lrand48(GLIBC_2.1)[1] 19891 symlink(GLIBC_2.1)[1] 19892 chroot(GLIBC_2.0)[1] lsearch(GLIBC_2.0)[1] sync(GLIBC_2.0)[1] 19893 clearerr(GLIBC_2.0)[1] lseek(GLIBC_2.0)[1] 19894 sysconf(GLIBC_2.0)[1] 19895 clnt_create(GLIBC_2.0)[1] lseek64(GLIBC_2.0)[1] 19896 syslog(GLIBC_2.0)[1] 19897 clnt_pcreateerror(GLIBC_2.0)[1] makecontext(GLIBC_2.0)[1] 19898 system(GLIBC_2.0)[1] 19899 clnt_perrno(GLIBC_2.0)[1] malloc(GLIBC_2.0)[1] 19900 tcdrain(GLIBC_2.0)[1] 19901 clnt_perror(GLIBC_2.0)[1] mblen(GLIBC_2.0)[1] 19902 tcflow(GLIBC_2.0)[1] 19903 clnt_spcreateerror(GLIBC_2.0)[1] mbrlen(GLIBC_2.0)[1] 19904 tcflush(GLIBC_2.0)[1] 19905 clnt_sperrno(GLIBC_2.0)[1] mbrtowc(GLIBC_2.0)[1] 19906 tcgetattr(GLIBC_2.0)[1] 19907 clnt_sperror(GLIBC_2.0)[1] mbsinit(GLIBC_2.0)[1] 19908 tcgetpgrp(GLIBC_2.0)[1] 19909 clock(GLIBC_2.0)[1] mbsnrtowcs(GLIBC_2.0)[1] 19910 tcgetsid(GLIBC_2.0)[1] 19911 close(GLIBC_2.0)[1] mbsrtowcs(GLIBC_2.0)[1] 19912 tcsendbreak(GLIBC_2.0)[1] 19913 closedir(GLIBC_2.0)[1] mbstowcs(GLIBC_2.0)[1] 19914 tcsetattr(GLIBC_2.0)[1] 19915 closelog(GLIBC_2.0)[1] mbtowc(GLIBC_2.0)[1] 19916 tcsetpgrp(GLIBC_2.0)[1] 19917 confstr(GLIBC_2.0)[1] memccpy(GLIBC_2.0)[1] tdelete[1] 19918 connect(GLIBC_2.0)[1] memchr(GLIBC_2.0)[1] 19919 telldir(GLIBC_2.0)[1] 19920 creat(GLIBC_2.0)[1] memcmp(GLIBC_2.0)[1] tempnam(GLIBC_2.0)[1] 19921 creat64(GLIBC_2.1)[1] memcpy(GLIBC_2.1)[1] 19922 textdomain(GLIBC_2.1)[1] 19923 ctermid(GLIBC_2.0)[1] memmem(GLIBC_2.0)[1] tfind(GLIBC_2.0)[1] 19924 ctime(GLIBC_2.0)[1] memmove(GLIBC_2.0)[1] time(GLIBC_2.0)[1] 19925 ctime_r(GLIBC_2.0)[1] memrchr(GLIBC_2.0)[1] 19926 times(GLIBC_2.0)[1] 19927 cuserid(GLIBC_2.0)[1] memset(GLIBC_2.0)[1] 19928 tmpfile(GLIBC_2.0)[1] 19929 daemon(GLIBC_2.0)[1] mkdir(GLIBC_2.0)[1] 19930 tmpfile64(GLIBC_2.0)[1] 19931 dcgettext(GLIBC_2.0)[1] mkfifo(GLIBC_2.0)[1] 19932 tmpnam(GLIBC_2.0)[1] 19933 dcngettext[1] mkstemp()[1] toascii()[1] 19934 dgettext[1] mkstemp64()[1] tolower()[1] 19935 difftime(GLIBC_2.0)[1] mktemp(GLIBC_2.0)[1] 19936 toupper(GLIBC_2.0)[1] 19937 dirname(GLIBC_2.0)[1] mktime(GLIBC_2.0)[1] 19938 towctrans(GLIBC_2.0)[1] 19939 div(GLIBC_2.0)[1] mlock(GLIBC_2.0)[1] towlower(GLIBC_2.0)[1] 19940 dngettext[1] mlockall()[1] towupper()[1] 19941 drand48(GLIBC_2.0)[1] mmap(GLIBC_2.0)[1] 19942 truncate(GLIBC_2.0)[1] 19943 dup(GLIBC_2.0)[1] mmap64(GLIBC_2.0)[1] 19944 truncate64(GLIBC_2.0)[1] 19945 dup2(GLIBC_2.0)[1] mprotect(GLIBC_2.0)[1] 19946 tsearch(GLIBC_2.0)[1] 19947 ecvt(GLIBC_2.0)[1] mrand48(GLIBC_2.0)[1] ttyname(GLIBC_2.0)[1] 19948 endgrent(GLIBC_2.0)[1] msgctl(GLIBC_2.0)[1] 19949 ttyname_r(GLIBC_2.0)[1] 19950 endprotoent(GLIBC_2.0)[1] msgget(GLIBC_2.0)[1] 19951 twalk(GLIBC_2.0)[1] 19952 endpwent(GLIBC_2.0)[1] msgrcv(GLIBC_2.0)[1] 19953 tzset(GLIBC_2.0)[1] 19954 endservent(GLIBC_2.0)[1] msgsnd(GLIBC_2.0)[1] 19955 ualarm(GLIBC_2.0)[1] 19956 endutent(GLIBC_2.0)[1] msync(GLIBC_2.0)[1] 19957 ulimit(GLIBC_2.0)[1] 19958 endutxent(GLIBC_2.1)[1] munlock(GLIBC_2.1)[1] 19959 umask(GLIBC_2.1)[1] 19960 erand48(GLIBC_2.0)[1] munlockall(GLIBC_2.0)[1] 19961 uname(GLIBC_2.0)[1] 19962 err(GLIBC_2.0)[1] munmap(GLIBC_2.0)[1] ungetc(GLIBC_2.0)[1] 19963 error(GLIBC_2.0)[1] nanosleep(GLIBC_2.0)[1] 19964 ungetwc(GLIBC_2.0)[1] 19965 errx(GLIBC_2.0)[1] nftw(GLIBC_2.0)[1] unlink(GLIBC_2.0)[1] 19966 execl(GLIBC_2.0)[1] nftw64(GLIBC_2.0)[1] 19967 unlockpt(GLIBC_2.0)[1] 19968 execle(GLIBC_2.0)[1] ngettext[1] unsetenv[1] 19969 execlp(GLIBC_2.0)[1] nice(GLIBC_2.0)[1] usleep(GLIBC_2.0)[1] 19970 execv(GLIBC_2.0)[1] nl_langinfo(GLIBC_2.0)[1] 19971 utime(GLIBC_2.0)[1] 19972 execve(GLIBC_2.0)[1] nrand48(GLIBC_2.0)[1] 19973 utimes(GLIBC_2.0)[1] 19974 execvp(GLIBC_2.0)[1] ntohl(GLIBC_2.0)[1] utmpname[1] 19975 exit(GLIBC_2.0)[1] ntohs(GLIBC_2.0)[1] vasprintf(GLIBC_2.0)[1] 19976 fchdir(GLIBC_2.0)[1] open(GLIBC_2.0)[1] vdprintf(GLIBC_2.0)[1] 19977 fchmod(GLIBC_2.0)[1] open64(GLIBC_2.0)[1] verrx(GLIBC_2.0)[1] 19978 fchown(GLIBC_2.0)[1] opendir(GLIBC_2.0)[1] vfork(GLIBC_2.0)[1] 19979 fclose(GLIBC_2.1)[1] openlog(GLIBC_2.1)[1] 19980 vfprintf(GLIBC_2.1)[1] 19981 fcntl(GLIBC_2.0)[1] pathconf(GLIBC_2.0)[1] vfscanf[1] 19982 fcvt(GLIBC_2.0)[1] pause(GLIBC_2.0)[1] vfwprintf(GLIBC_2.0)[1] 19983 fdatasync(GLIBC_2.0)[1] pclose(GLIBC_2.0)[1] 19984 vfwscanf(GLIBC_2.0)[1] 19985 fdopen(GLIBC_2.1)[1] perror(GLIBC_2.1)[1] 19986 vprintf(GLIBC_2.1)[1] 19987 feof(GLIBC_2.0)[1] pipe(GLIBC_2.0)[1] vscanf[1] 19988 ferror(GLIBC_2.0)[1] pmap_getport(GLIBC_2.0)[1] 19989 vsnprintf(GLIBC_2.0)[1] 19990 fflush(GLIBC_2.0)[1] pmap_set(GLIBC_2.0)[1] 19991 vsprintf(GLIBC_2.0)[1] 19992 fflush_unlocked(GLIBC_2.0)[1] pmap_unset(GLIBC_2.0)[1] 19993 vsscanf[1] 19994 ffs(GLIBC_2.0)[1] poll(GLIBC_2.0)[1] vswprintf(GLIBC_2.0)[1] 19995 fgetc(GLIBC_2.0)[1] popen(GLIBC_2.0)[1] vswscanf(GLIBC_2.0)[1] 19996 fgetpos(GLIBC_2.0)[1] posix_memalign(GLIBC_2.0)[1] vsyslog[1] 19997 fgetpos64(GLIBC_2.1)[1] printf(GLIBC_2.1)[1] 19998 vwprintf(GLIBC_2.1)[1] 19999 fgets(GLIBC_2.0)[1] psignal(GLIBC_2.0)[1] 20000 vwscanf(GLIBC_2.0)[1] 20001 fgetwc(GLIBC_2.2)[1] ptsname(GLIBC_2.2)[1] wait(GLIBC_2.2)[1] 20002 fgetwc_unlocked(GLIBC_2.2)[1] putc(GLIBC_2.2)[1] 20003 wait4(GLIBC_2.2)[1] 20004 fgetws(GLIBC_2.2)[1] putc_unlocked(GLIBC_2.2)[1] 20005 waitpid(GLIBC_2.2)[1] 20006 fileno(GLIBC_2.0)[1] putchar(GLIBC_2.0)[1] warn(GLIBC_2.0)[1] 20007 flock(GLIBC_2.0)[1] putchar_unlocked(GLIBC_2.0)[1] 20008 warnx(GLIBC_2.0)[1] 20009 flockfile(GLIBC_2.0)[1] putenv(GLIBC_2.0)[1] 20010 wcpcpy(GLIBC_2.0)[1] 20011 fmtmsg(GLIBC_2.1)[1] puts(GLIBC_2.1)[1] wcpncpy(GLIBC_2.1)[1] 20012 fnmatch(GLIBC_2.2.3)[1] pututxline(GLIBC_2.2.3)[1] 20013 wcrtomb(GLIBC_2.2.3)[1] 20014 fopen(GLIBC_2.1)[1] putw(GLIBC_2.1)[1] 20015 wcscasecmp(GLIBC_2.1)[1] 20016 fopen64(GLIBC_2.1)[1] putwc(GLIBC_2.1)[1] wcscat(GLIBC_2.1)[1] 20017 fork(GLIBC_2.0)[1] putwchar(GLIBC_2.0)[1] wcschr(GLIBC_2.0)[1] 20018 fpathconf(GLIBC_2.0)[1] qsort(GLIBC_2.0)[1] 20019 wcscmp(GLIBC_2.0)[1] 20020 fprintf(GLIBC_2.0)[1] raise(GLIBC_2.0)[1] 20021 wcscoll(GLIBC_2.0)[1] 20022 fputc(GLIBC_2.0)[1] rand(GLIBC_2.0)[1] wcscpy(GLIBC_2.0)[1] 20023 fputs(GLIBC_2.0)[1] rand_r(GLIBC_2.0)[1] wcscspn(GLIBC_2.0)[1] 20024 fputwc(GLIBC_2.2)[1] random(GLIBC_2.2)[1] wcsdup(GLIBC_2.2)[1] 20025 fputws(GLIBC_2.2)[1] read(GLIBC_2.2)[1] wcsftime(GLIBC_2.2)[1] 20026 fread(GLIBC_2.0)[1] readdir(GLIBC_2.0)[1] wcslen(GLIBC_2.0)[1] 20027 free(GLIBC_2.0)[1] readdir64(GLIBC_2.0)[1] 20028 wcsncasecmp(GLIBC_2.0)[1] 20029 freeaddrinfo[1] readdir_r[1] wcsncat()[1] 20030 freopen(GLIBC_2.0)[1] readlink(GLIBC_2.0)[1] 20031 wcsncmp(GLIBC_2.0)[1] 20032 freopen64(GLIBC_2.1)[1] readv(GLIBC_2.1)[1] 20033 wcsncpy(GLIBC_2.1)[1] 20034 fscanf(GLIBC_2.0)[1] realloc(GLIBC_2.0)[1] 20035 wcsnlen(GLIBC_2.0)[1] 20036 fseek(GLIBC_2.0)[1] realpath(GLIBC_2.0)[1] 20037 wcsnrtombs(GLIBC_2.0)[1] 20038 fseeko(GLIBC_2.1)[1] recv(GLIBC_2.1)[1] wcspbrk(GLIBC_2.1)[1] 20039 fseeko64(GLIBC_2.1)[1] recvfrom(GLIBC_2.1)[1] 20040 wcsrchr(GLIBC_2.1)[1] 20041 fsetpos(GLIBC_2.0)[1] recvmsg(GLIBC_2.0)[1] 20042 wcsrtombs(GLIBC_2.0)[1] 20043 fsetpos64(GLIBC_2.1)[1] regcomp(GLIBC_2.1)[1] 20044 wcsspn(GLIBC_2.1)[1] 20045 fstatvfs(GLIBC_2.1)[1] regerror(GLIBC_2.1)[1] 20046 wcsstr(GLIBC_2.1)[1] 20047 fstatvfs64(GLIBC_2.1)[1] regexec(GLIBC_2.1)[1] 20048 wcstod(GLIBC_2.1)[1] 20049 fsync(GLIBC_2.0)[1] regfree(GLIBC_2.0)[1] wcstof(GLIBC_2.0)[1] 20050 ftell(GLIBC_2.0)[1] remove(GLIBC_2.0)[1] 20051 wcstoimax(GLIBC_2.0)[1] 20052 ftello(GLIBC_2.1)[1] remque(GLIBC_2.1)[1] wcstok(GLIBC_2.1)[1] 20053 ftello64(GLIBC_2.1)[1] rename(GLIBC_2.1)[1] 20054 wcstol(GLIBC_2.1)[1] 20055 ftime(GLIBC_2.0)[1] rewind(GLIBC_2.0)[1] wcstold(GLIBC_2.0)[1] 20056 ftok(GLIBC_2.0)[1] rewinddir(GLIBC_2.0)[1] 20057 wcstoll(GLIBC_2.0)[1] 20058 ftruncate(GLIBC_2.0)[1] rindex(GLIBC_2.0)[1] 20059 wcstombs(GLIBC_2.0)[1] 20060 ftruncate64(GLIBC_2.1)[1] rmdir(GLIBC_2.1)[1] 20061 wcstoq(GLIBC_2.1)[1] 20062 ftrylockfile(GLIBC_2.0)[1] sbrk(GLIBC_2.0)[1] 20063 wcstoul(GLIBC_2.0)[1] 20064 ftw(GLIBC_2.0)[1] scanf(GLIBC_2.0)[1] wcstoull(GLIBC_2.0)[1] 20065 ftw64(GLIBC_2.1)[1] sched_get_priority_max(GLIBC_2.1)[1] 20066 wcstoumax(GLIBC_2.1)[1] 20067 funlockfile(GLIBC_2.0)[1] sched_get_priority_min(GLIBC_2.0)[1] 20068 wcstouq(GLIBC_2.0)[1] 20069 fwide(GLIBC_2.2)[1] sched_getparam(GLIBC_2.2)[1] 20070 wcswcs(GLIBC_2.2)[1] 20071 fwprintf(GLIBC_2.2)[1] sched_getscheduler(GLIBC_2.2)[1] 20072 wcswidth(GLIBC_2.2)[1] 20073 fwrite(GLIBC_2.0)[1] sched_rr_get_interval(GLIBC_2.0)[1] 20074 wcsxfrm(GLIBC_2.0)[1] 20075 fwscanf(GLIBC_2.2)[1] sched_setparam(GLIBC_2.2)[1] 20076 wctob(GLIBC_2.2)[1] 20077 gai_strerror[1] sched_setscheduler()[1] wctomb()[1] 20078 gcvt(GLIBC_2.0)[1] sched_yield(GLIBC_2.0)[1] 20079 wctrans(GLIBC_2.0)[1] 20080 getaddrinfo[1] seed48()[1] wctype()[1] 20081 getc(GLIBC_2.0)[1] seekdir(GLIBC_2.0)[1] wcwidth(GLIBC_2.0)[1] 20082 getc_unlocked(GLIBC_2.0)[1] select(GLIBC_2.0)[1] 20083 wmemchr(GLIBC_2.0)[1] 20084 getchar(GLIBC_2.0)[1] semctl(GLIBC_2.0)[1] 20085 wmemcmp(GLIBC_2.0)[1] 20086 getchar_unlocked(GLIBC_2.0)[1] semget(GLIBC_2.0)[1] 20087 wmemcpy(GLIBC_2.0)[1] 20088 getcontext(GLIBC_2.1)[1] semop(GLIBC_2.1)[1] 20089 wmemmove(GLIBC_2.1)[1] 20090 getcwd(GLIBC_2.0)[1] send(GLIBC_2.0)[1] wmemset(GLIBC_2.0)[1] 20091 getdate(GLIBC_2.1)[1] sendmsg(GLIBC_2.1)[1] 20092 wordexp(GLIBC_2.1)[1] 20093 getegid(GLIBC_2.0)[1] sendto(GLIBC_2.0)[1] 20094 wordfree(GLIBC_2.0)[1] 20095 getenv(GLIBC_2.0)[1] setbuf(GLIBC_2.0)[1] 20096 wprintf(GLIBC_2.0)[1] 20097 geteuid(GLIBC_2.0)[1] setbuffer(GLIBC_2.0)[1] 20098 write(GLIBC_2.0)[1] 20099 getgid(GLIBC_2.0)[1] setcontext(GLIBC_2.0)[1] 20100 writev(GLIBC_2.0)[1] 20101 getgrent(GLIBC_2.0)[1] setegid(GLIBC_2.0)[1] 20102 wscanf(GLIBC_2.0)[1] 20103 getgrgid(GLIBC_2.0)[1] setenv[1] 20104 xdr_accepted_reply(GLIBC_2.0)[1] 20105 getgrgid_r(GLIBC_2.0)[1] seteuid(GLIBC_2.0)[1] 20106 xdr_array(GLIBC_2.0)[1] 20107 getgrnam(GLIBC_2.0)[1] setgid(GLIBC_2.0)[1] 20108 xdr_bool(GLIBC_2.0)[1] 20109 getgrnam_r(GLIBC_2.0)[1] setgrent(GLIBC_2.0)[1] 20110 xdr_bytes(GLIBC_2.0)[1] 20111 getgroups(GLIBC_2.0)[1] setgroups(GLIBC_2.0)[1] 20112 xdr_callhdr(GLIBC_2.0)[1] 20113 gethostbyaddr(GLIBC_2.0)[1] sethostname(GLIBC_2.0)[1] 20114 xdr_callmsg(GLIBC_2.0)[1] 20115 gethostbyname(GLIBC_2.0)[1] setitimer(GLIBC_2.0)[1] 20116 xdr_char(GLIBC_2.0)[1] 20117 gethostid(GLIBC_2.0)[1] setlocale(GLIBC_2.0)[1] 20118 xdr_double(GLIBC_2.0)[1] 20119 gethostname(GLIBC_2.0)[1] setlogmask(GLIBC_2.0)[1] 20120 xdr_enum(GLIBC_2.0)[1] 20121 getitimer(GLIBC_2.0)[1] setpgid(GLIBC_2.0)[1] 20122 xdr_float(GLIBC_2.0)[1] 20123 getloadavg(GLIBC_2.2)[1] setpgrp(GLIBC_2.2)[1] 20124 xdr_free(GLIBC_2.2)[1] 20125 getlogin(GLIBC_2.0)[1] setpriority(GLIBC_2.0)[1] 20126 xdr_int(GLIBC_2.0)[1] 20127 getnameinfo[1] setprotoent()[1] xdr_long()[1] 20128 getopt(GLIBC_2.0)[1] setpwent(GLIBC_2.0)[1] 20129 xdr_opaque(GLIBC_2.0)[1] 20130 getopt_long(GLIBC_2.0)[1] setregid(GLIBC_2.0)[1] 20131 xdr_opaque_auth(GLIBC_2.0)[1] 20132 getopt_long_only(GLIBC_2.0)[1] setreuid(GLIBC_2.0)[1] 20133 xdr_pointer(GLIBC_2.0)[1] 20134 getpagesize(GLIBC_2.0)[1] setrlimit(GLIBC_2.0)[1] 20135 xdr_reference(GLIBC_2.0)[1] 20136 getpeername(GLIBC_2.0)[1] setrlimit64[1] 20137 xdr_rejected_reply(GLIBC_2.0)[1] 20138 getpgid(GLIBC_2.0)[1] setservent(GLIBC_2.0)[1] 20139 xdr_replymsg(GLIBC_2.0)[1] 20140 getpgrp(GLIBC_2.0)[1] setsid(GLIBC_2.0)[1] 20141 xdr_short(GLIBC_2.0)[1] 20142 getpid(GLIBC_2.0)[1] setsockopt(GLIBC_2.0)[1] 20143 xdr_string(GLIBC_2.0)[1] 20144 getppid(GLIBC_2.0)[1] setstate(GLIBC_2.0)[1] 20145 xdr_u_char(GLIBC_2.0)[1] 20146 getpriority(GLIBC_2.0)[1] setuid(GLIBC_2.0)[1] 20147 xdr_u_int(GLIBC_2.0)[1] 20148 getprotobyname(GLIBC_2.0)[1] setutent(GLIBC_2.0)[1] 20149 xdr_u_long(GLIBC_2.0)[1] 20150 getprotobynumber(GLIBC_2.0)[1] setutxent(GLIBC_2.0)[1] 20151 xdr_u_short(GLIBC_2.0)[1] 20152 getprotoent(GLIBC_2.0)[1] setvbuf(GLIBC_2.0)[1] 20153 xdr_union(GLIBC_2.0)[1] 20154 getpwent(GLIBC_2.0)[1] shmat(GLIBC_2.0)[1] 20155 xdr_vector(GLIBC_2.0)[1] 20156 getpwnam(GLIBC_2.0)[1] shmctl(GLIBC_2.0)[1] 20157 xdr_void(GLIBC_2.0)[1] 20158 getpwnam_r(GLIBC_2.0)[1] shmdt(GLIBC_2.0)[1] 20159 xdr_wrapstring(GLIBC_2.0)[1] 20160 getpwuid(GLIBC_2.0)[1] shmget(GLIBC_2.0)[1] 20161 xdrmem_create(GLIBC_2.0)[1] 20162 getpwuid_r(GLIBC_2.0)[1] shutdown(GLIBC_2.0)[1] 20163 xdrrec_create(GLIBC_2.0)[1] 20164 getrlimit(GLIBC_2.2)[1] sigaction(GLIBC_2.2)[1] 20165 xdrrec_eof(GLIBC_2.2)[1] 20166 20167 Table A-2. libc Data Interfaces 20168 __daylight __timezone _sys_errlist 20169 __environ __tzname 20170 _________________________________________________________ 20171 20172 A.2. libcrypt 20173 20174 The behaviour of the interfaces in this library is specified 20175 by the following Standards. 20176 20177 ISO POSIX (2003) 20178 20179 Table A-3. libcrypt Function Interfaces 20180 crypt(GLIBC_2.0)[1] encrypt(GLIBC_2.0)[1] setkey(GLIBC_2.0)[1] 20181 _________________________________________________________ 20182 20183 A.3. libdl 20184 20185 The behaviour of the interfaces in this library is specified 20186 by the following Standards. 20187 20188 this specification 20189 ISO POSIX (2003) 20190 20191 Table A-4. libdl Function Interfaces 20192 dladdr(GLIBC_2.0)[1] dlerror(GLIBC_2.0)[1] dlsym(GLIBC_2.0)[1] 20193 dlclose(GLIBC_2.0)[1] dlopen(GLIBC_2.0)[1] 20194 _________________________________________________________ 20195 20196 A.4. libm 20197 20198 The behaviour of the interfaces in this library is specified 20199 by the following Standards. 20200 20201 ISO C (1999) 20202 this specification 20203 SUSv2 20204 ISO POSIX (2003) 20205 20206 Table A-5. libm Function Interfaces 20207 __finite[1] csinhf()[1] log10()[1] 20208 __finitef[1] csinhl()[1] log10f[1] 20209 __finitel[1] csinl()[1] log10l[1] 20210 __fpclassify[1] csqrt()[1] log1p()[1] 20211 __fpclassifyf[1] csqrtf()[1] log1pf[1] 20212 __signbit[1] csqrtl()[1] log1pl[1] 20213 __signbitf[1] ctan()[1] log2[1] 20214 acos(GLIBC_2.0)[1] ctanf(GLIBC_2.0)[1] log2f[1] 20215 acosf(GLIBC_2.0)[1] ctanh(GLIBC_2.0)[1] log2l[1] 20216 acosh(GLIBC_2.0)[1] ctanhf(GLIBC_2.0)[1] logb(GLIBC_2.0)[1] 20217 acoshf(GLIBC_2.0)[1] ctanhl(GLIBC_2.0)[1] logbf[1] 20218 acoshl(GLIBC_2.0)[1] ctanl(GLIBC_2.0)[1] logbl[1] 20219 acosl(GLIBC_2.0)[1] dremf(GLIBC_2.0)[1] logf[1] 20220 asin(GLIBC_2.0)[1] dreml(GLIBC_2.0)[1] logl[1] 20221 asinf(GLIBC_2.0)[1] erf(GLIBC_2.0)[1] lrint(GLIBC_2.0)[1] 20222 asinh(GLIBC_2.0)[1] erfc(GLIBC_2.0)[1] lrintf(GLIBC_2.0)[1] 20223 asinhf(GLIBC_2.0)[1] erfcf(GLIBC_2.0)[1] lrintl(GLIBC_2.0)[1] 20224 asinhl(GLIBC_2.0)[1] erfcl(GLIBC_2.0)[1] lround(GLIBC_2.0)[1] 20225 asinl(GLIBC_2.0)[1] erff(GLIBC_2.0)[1] lroundf(GLIBC_2.0)[1] 20226 atan(GLIBC_2.0)[1] erfl(GLIBC_2.0)[1] lroundl(GLIBC_2.0)[1] 20227 atan2(GLIBC_2.0)[1] exp(GLIBC_2.0)[1] matherr(GLIBC_2.0)[1] 20228 atan2f(GLIBC_2.0)[1] exp2[1] modf(GLIBC_2.0)[1] 20229 atan2l(GLIBC_2.0)[1] exp2f[1] modff(GLIBC_2.0)[1] 20230 atanf(GLIBC_2.0)[1] expf[1] modfl(GLIBC_2.0)[1] 20231 atanh(GLIBC_2.0)[1] expl[1] nan(GLIBC_2.0)[1] 20232 atanhf(GLIBC_2.0)[1] expm1(GLIBC_2.0)[1] nanf(GLIBC_2.0)[1] 20233 atanhl(GLIBC_2.0)[1] expm1f[1] nanl(GLIBC_2.0)[1] 20234 atanl(GLIBC_2.0)[1] expm1l[1] nearbyint(GLIBC_2.0)[1] 20235 cabs(GLIBC_2.1)[1] fabs(GLIBC_2.1)[1] nearbyintf(GLIBC_2.1)[1] 20236 cabsf(GLIBC_2.1)[1] fabsf(GLIBC_2.1)[1] 20237 nearbyintl(GLIBC_2.1)[1] 20238 cabsl(GLIBC_2.1)[1] fabsl(GLIBC_2.1)[1] 20239 nextafter(GLIBC_2.1)[1] 20240 cacos(GLIBC_2.1)[1] fdim(GLIBC_2.1)[1] 20241 nextafterf(GLIBC_2.1)[1] 20242 cacosf(GLIBC_2.1)[1] fdimf(GLIBC_2.1)[1] 20243 nextafterl(GLIBC_2.1)[1] 20244 cacosh(GLIBC_2.1)[1] fdiml(GLIBC_2.1)[1] 20245 nexttoward(GLIBC_2.1)[1] 20246 cacoshf(GLIBC_2.1)[1] feclearexcept(GLIBC_2.1)[1] 20247 nexttowardf(GLIBC_2.1)[1] 20248 cacoshl(GLIBC_2.1)[1] fegetenv(GLIBC_2.1)[1] 20249 nexttowardl(GLIBC_2.1)[1] 20250 cacosl(GLIBC_2.1)[1] fegetexceptflag(GLIBC_2.1)[1] 20251 pow(GLIBC_2.1)[1] 20252 carg(GLIBC_2.1)[1] fegetround(GLIBC_2.1)[1] 20253 pow10(GLIBC_2.1)[1] 20254 cargf(GLIBC_2.1)[1] feholdexcept(GLIBC_2.1)[1] 20255 pow10f(GLIBC_2.1)[1] 20256 cargl(GLIBC_2.1)[1] feraiseexcept(GLIBC_2.1)[1] 20257 pow10l(GLIBC_2.1)[1] 20258 casin(GLIBC_2.1)[1] fesetenv(GLIBC_2.1)[1] powf(GLIBC_2.1)[1] 20259 casinf(GLIBC_2.1)[1] fesetexceptflag(GLIBC_2.1)[1] 20260 powl(GLIBC_2.1)[1] 20261 casinh(GLIBC_2.1)[1] fesetround(GLIBC_2.1)[1] 20262 remainder(GLIBC_2.1)[1] 20263 casinhf(GLIBC_2.1)[1] fetestexcept(GLIBC_2.1)[1] 20264 remainderf(GLIBC_2.1)[1] 20265 casinhl(GLIBC_2.1)[1] feupdateenv(GLIBC_2.1)[1] 20266 remainderl(GLIBC_2.1)[1] 20267 casinl(GLIBC_2.1)[1] finite(GLIBC_2.1)[1] remquo(GLIBC_2.1)[1] 20268 catan(GLIBC_2.1)[1] finitef(GLIBC_2.1)[1] 20269 remquof(GLIBC_2.1)[1] 20270 catanf(GLIBC_2.1)[1] finitel(GLIBC_2.1)[1] 20271 remquol(GLIBC_2.1)[1] 20272 catanh(GLIBC_2.1)[1] floor(GLIBC_2.1)[1] rint(GLIBC_2.1)[1] 20273 catanhf(GLIBC_2.1)[1] floorf(GLIBC_2.1)[1] rintf(GLIBC_2.1)[1] 20274 catanhl(GLIBC_2.1)[1] floorl(GLIBC_2.1)[1] rintl(GLIBC_2.1)[1] 20275 catanl(GLIBC_2.1)[1] fma(GLIBC_2.1)[1] round(GLIBC_2.1)[1] 20276 cbrt(GLIBC_2.0)[1] fmaf(GLIBC_2.0)[1] roundf(GLIBC_2.0)[1] 20277 cbrtf(GLIBC_2.0)[1] fmal(GLIBC_2.0)[1] roundl(GLIBC_2.0)[1] 20278 cbrtl(GLIBC_2.0)[1] fmax(GLIBC_2.0)[1] scalb(GLIBC_2.0)[1] 20279 ccos(GLIBC_2.1)[1] fmaxf(GLIBC_2.1)[1] scalbf(GLIBC_2.1)[1] 20280 ccosf(GLIBC_2.1)[1] fmaxl(GLIBC_2.1)[1] scalbl(GLIBC_2.1)[1] 20281 ccosh(GLIBC_2.1)[1] fmin(GLIBC_2.1)[1] scalbln(GLIBC_2.1)[1] 20282 ccoshf(GLIBC_2.1)[1] fminf(GLIBC_2.1)[1] 20283 scalblnf(GLIBC_2.1)[1] 20284 ccoshl(GLIBC_2.1)[1] fminl(GLIBC_2.1)[1] 20285 scalblnl(GLIBC_2.1)[1] 20286 ccosl(GLIBC_2.1)[1] fmod(GLIBC_2.1)[1] scalbn(GLIBC_2.1)[1] 20287 ceil(GLIBC_2.0)[1] fmodf(GLIBC_2.0)[1] scalbnf(GLIBC_2.0)[1] 20288 ceilf(GLIBC_2.0)[1] fmodl(GLIBC_2.0)[1] scalbnl(GLIBC_2.0)[1] 20289 ceill(GLIBC_2.0)[1] frexp(GLIBC_2.0)[1] 20290 significand(GLIBC_2.0)[1] 20291 cexp(GLIBC_2.1)[1] frexpf(GLIBC_2.1)[1] 20292 significandf(GLIBC_2.1)[1] 20293 cexpf(GLIBC_2.1)[1] frexpl(GLIBC_2.1)[1] 20294 significandl(GLIBC_2.1)[1] 20295 cexpl(GLIBC_2.1)[1] gamma(GLIBC_2.1)[1] sin(GLIBC_2.1)[1] 20296 cimag(GLIBC_2.1)[1] gammaf(GLIBC_2.1)[1] sincos(GLIBC_2.1)[1] 20297 cimagf(GLIBC_2.1)[1] gammal(GLIBC_2.1)[1] 20298 sincosf(GLIBC_2.1)[1] 20299 cimagl(GLIBC_2.1)[1] hypot(GLIBC_2.1)[1] sincosl(GLIBC_2.1)[1] 20300 clog(GLIBC_2.1)[1] hypotf(GLIBC_2.1)[1] sinf(GLIBC_2.1)[1] 20301 clog10(GLIBC_2.1)[1] hypotl(GLIBC_2.1)[1] sinh(GLIBC_2.1)[1] 20302 clog10f(GLIBC_2.1)[1] ilogb(GLIBC_2.1)[1] sinhf(GLIBC_2.1)[1] 20303 clog10l(GLIBC_2.1)[1] ilogbf(GLIBC_2.1)[1] sinhl(GLIBC_2.1)[1] 20304 clogf(GLIBC_2.1)[1] ilogbl(GLIBC_2.1)[1] sinl(GLIBC_2.1)[1] 20305 clogl(GLIBC_2.1)[1] j0(GLIBC_2.1)[1] sqrt(GLIBC_2.1)[1] 20306 conj(GLIBC_2.1)[1] j0f(GLIBC_2.1)[1] sqrtf(GLIBC_2.1)[1] 20307 conjf(GLIBC_2.1)[1] j0l(GLIBC_2.1)[1] sqrtl(GLIBC_2.1)[1] 20308 conjl(GLIBC_2.1)[1] j1(GLIBC_2.1)[1] tan(GLIBC_2.1)[1] 20309 copysign(GLIBC_2.0)[1] j1f(GLIBC_2.0)[1] tanf(GLIBC_2.0)[1] 20310 copysignf(GLIBC_2.0)[1] j1l(GLIBC_2.0)[1] tanh(GLIBC_2.0)[1] 20311 copysignl(GLIBC_2.0)[1] jn(GLIBC_2.0)[1] tanhf(GLIBC_2.0)[1] 20312 cos(GLIBC_2.0)[1] jnf(GLIBC_2.0)[1] tanhl(GLIBC_2.0)[1] 20313 cosf(GLIBC_2.0)[1] jnl(GLIBC_2.0)[1] tanl(GLIBC_2.0)[1] 20314 cosh(GLIBC_2.0)[1] ldexp(GLIBC_2.0)[1] tgamma(GLIBC_2.0)[1] 20315 coshf(GLIBC_2.0)[1] ldexpf(GLIBC_2.0)[1] tgammaf(GLIBC_2.0)[1] 20316 coshl(GLIBC_2.0)[1] ldexpl(GLIBC_2.0)[1] tgammal(GLIBC_2.0)[1] 20317 cosl(GLIBC_2.0)[1] lgamma(GLIBC_2.0)[1] trunc(GLIBC_2.0)[1] 20318 cpow(GLIBC_2.1)[1] lgamma_r(GLIBC_2.1)[1] truncf(GLIBC_2.1)[1] 20319 cpowf(GLIBC_2.1)[1] lgammaf(GLIBC_2.1)[1] truncl(GLIBC_2.1)[1] 20320 cpowl(GLIBC_2.1)[1] lgammaf_r(GLIBC_2.1)[1] y0(GLIBC_2.1)[1] 20321 cproj(GLIBC_2.1)[1] lgammal(GLIBC_2.1)[1] y0f(GLIBC_2.1)[1] 20322 cprojf(GLIBC_2.1)[1] lgammal_r(GLIBC_2.1)[1] y0l(GLIBC_2.1)[1] 20323 cprojl(GLIBC_2.1)[1] llrint(GLIBC_2.1)[1] y1(GLIBC_2.1)[1] 20324 creal(GLIBC_2.1)[1] llrintf(GLIBC_2.1)[1] y1f(GLIBC_2.1)[1] 20325 crealf(GLIBC_2.1)[1] llrintl(GLIBC_2.1)[1] y1l(GLIBC_2.1)[1] 20326 creall(GLIBC_2.1)[1] llround(GLIBC_2.1)[1] yn(GLIBC_2.1)[1] 20327 csin(GLIBC_2.1)[1] llroundf(GLIBC_2.1)[1] ynf(GLIBC_2.1)[1] 20328 csinf(GLIBC_2.1)[1] llroundl(GLIBC_2.1)[1] ynl(GLIBC_2.1)[1] 20329 csinh(GLIBC_2.1)[1] log(GLIBC_2.1)[1] 20330 20331 Table A-6. libm Data Interfaces 20332 signgam 20333 _________________________________________________________ 20334 20335 A.5. libncurses 20336 20337 The behaviour of the interfaces in this library is specified 20338 by the following Standards. 20339 20340 X/Open Curses 20341 20342 Table A-7. libncurses Function Interfaces 20343 addch[1] mvdelch[1] slk_refresh[1] 20344 addchnstr[1] mvderwin[1] slk_restore[1] 20345 addchstr[1] mvgetch[1] slk_set[1] 20346 addnstr[1] mvgetnstr[1] slk_touch[1] 20347 addstr[1] mvgetstr[1] standend[1] 20348 attr_get[1] mvhline[1] standout[1] 20349 attr_off[1] mvinch[1] start_color[1] 20350 attr_on[1] mvinchnstr[1] subpad[1] 20351 attr_set[1] mvinchstr[1] subwin[1] 20352 attroff[1] mvinnstr[1] syncok[1] 20353 attron[1] mvinsch[1] termattrs[1] 20354 attrset[1] mvinsnstr[1] termname[1] 20355 baudrate[1] mvinsstr[1] tgetent[1] 20356 beep[1] mvinstr[1] tgetflag[1] 20357 bkgd[1] mvprintw[1] tgetnum[1] 20358 bkgdset[1] mvscanw[1] tgetstr[1] 20359 border[1] mvvline[1] tgoto[1] 20360 box[1] mvwaddch[1] tigetflag[1] 20361 can_change_color[1] mvwaddchnstr[1] tigetnum[1] 20362 cbreak[1] mvwaddchstr[1] tigetstr[1] 20363 chgat[1] mvwaddnstr[1] timeout[1] 20364 clear[1] mvwaddstr[1] touchline[1] 20365 clearok[1] mvwchgat[1] touchwin[1] 20366 clrtobot[1] mvwdelch[1] tparm[1] 20367 clrtoeol[1] mvwgetch[1] tputs[1] 20368 color_content[1] mvwgetnstr[1] typeahead[1] 20369 color_set[1] mvwgetstr[1] unctrl[1] 20370 copywin[1] mvwhline[1] ungetch[1] 20371 curs_set[1] mvwin[1] untouchwin[1] 20372 def_prog_mode[1] mvwinch[1] use_env[1] 20373 def_shell_mode[1] mvwinchnstr[1] vidattr[1] 20374 del_curterm[1] mvwinchstr[1] vidputs[1] 20375 delay_output[1] mvwinnstr[1] vline[1] 20376 delch[1] mvwinsch[1] vw_printw[1] 20377 deleteln[1] mvwinsnstr[1] vw_scanw[1] 20378 delscreen[1] mvwinsstr[1] vwprintw[1] 20379 delwin[1] mvwinstr[1] vwscanw[1] 20380 derwin[1] mvwprintw[1] waddch[1] 20381 doupdate[1] mvwscanw[1] waddchnstr[1] 20382 dupwin[1] mvwvline[1] waddchstr[1] 20383 echo[1] napms[1] waddnstr[1] 20384 echochar[1] newpad[1] waddstr[1] 20385 endwin[1] newterm[1] wattr_get[1] 20386 erase[1] newwin[1] wattr_off[1] 20387 erasechar[1] nl[1] wattr_on[1] 20388 filter[1] nocbreak[1] wattr_set[1] 20389 flash[1] nodelay[1] wattroff[1] 20390 flushinp[1] noecho[1] wattron[1] 20391 getbkgd[1] nonl[1] wattrset[1] 20392 getch[1] noqiflush[1] wbkgd[1] 20393 getnstr[1] noraw[1] wbkgdset[1] 20394 getstr[1] notimeout[1] wborder[1] 20395 getwin[1] overlay[1] wchgat[1] 20396 halfdelay[1] overwrite[1] wclear[1] 20397 has_colors[1] pair_content[1] wclrtobot[1] 20398 has_ic[1] pechochar[1] wclrtoeol[1] 20399 has_il[1] pnoutrefresh[1] wcolor_set[1] 20400 hline[1] prefresh[1] wcursyncup[1] 20401 idcok[1] printw[1] wdelch[1] 20402 idlok[1] putp[1] wdeleteln[1] 20403 immedok[1] putwin[1] wechochar[1] 20404 inch[1] qiflush[1] werase[1] 20405 inchnstr[1] raw[1] wgetch[1] 20406 inchstr[1] redrawwin[1] wgetnstr[1] 20407 init_color[1] refresh[1] wgetstr[1] 20408 init_pair[1] reset_prog_mode[1] whline[1] 20409 initscr[1] reset_shell_mode[1] winch[1] 20410 innstr[1] resetty[1] winchnstr[1] 20411 insch[1] restartterm[1] winchstr[1] 20412 insdelln[1] ripoffline[1] winnstr[1] 20413 insertln[1] savetty[1] winsch[1] 20414 insnstr[1] scanw[1] winsdelln[1] 20415 insstr[1] scr_dump[1] winsertln[1] 20416 instr[1] scr_init[1] winsnstr[1] 20417 intrflush[1] scr_restore[1] winsstr[1] 20418 is_linetouched[1] scr_set[1] winstr[1] 20419 is_wintouched[1] scrl[1] wmove[1] 20420 isendwin[1] scroll[1] wnoutrefresh[1] 20421 keyname[1] scrollok[1] wprintw[1] 20422 keypad[1] set_curterm[1] wredrawln[1] 20423 killchar[1] set_term[1] wrefresh[1] 20424 leaveok[1] setscrreg[1] wscanw[1] 20425 longname[1] setupterm[1] wscrl[1] 20426 meta[1] slk_attr_set[1] wsetscrreg[1] 20427 move[1] slk_attroff[1] wstandend[1] 20428 mvaddch[1] slk_attron[1] wstandout[1] 20429 mvaddchnstr[1] slk_attrset[1] wsyncdown[1] 20430 mvaddchstr[1] slk_clear[1] wsyncup[1] 20431 mvaddnstr[1] slk_color[1] wtimeout[1] 20432 mvaddstr[1] slk_init[1] wtouchln[1] 20433 mvchgat[1] slk_label[1] wvline[1] 20434 mvcur[1] slk_noutrefresh[1] 20435 20436 Table A-8. libncurses Data Interfaces 20437 COLORS LINES curscr 20438 COLOR_PAIRS acs_map stdscr 20439 COLS cur_term 20440 _________________________________________________________ 20441 20442 A.6. libpam 20443 20444 The behaviour of the interfaces in this library is specified 20445 by the following Standards. 20446 20447 this specification 20448 20449 Table A-9. libpam Function Interfaces 20450 pam_acct_mgmt[1] pam_fail_delay[1] pam_setcred[1] 20451 pam_authenticate[1] pam_get_item[1] pam_start[1] 20452 pam_chauthtok[1] pam_getenvlist[1] pam_strerror[1] 20453 pam_close_session[1] pam_open_session[1] 20454 pam_end[1] pam_set_item[1] 20455 _________________________________________________________ 20456 20457 A.7. libpthread 20458 20459 The behaviour of the interfaces in this library is specified 20460 by the following Standards. 20461 20462 Large File Support 20463 this specification 20464 ISO POSIX (2003) 20465 20466 Table A-10. libpthread Function Interfaces 20467 _pthread_cleanup_pop[1] pthread_condattr_setpshared[1] 20468 pthread_rwlock_tryrdlock()[1] 20469 _pthread_cleanup_push[1] pthread_create()[1] 20470 pthread_rwlock_trywrlock()[1] 20471 pread(GLIBC_2.1)[1] pthread_detach(GLIBC_2.1)[1] 20472 pthread_rwlock_unlock(GLIBC_2.1)[1] 20473 pread64(GLIBC_2.1)[1] pthread_equal(GLIBC_2.1)[1] 20474 pthread_rwlock_wrlock(GLIBC_2.1)[1] 20475 pthread_attr_destroy(GLIBC_2.0)[1] pthread_exit(GLIBC_2.0)[1] 20476 pthread_rwlockattr_destroy(GLIBC_2.0)[1] 20477 pthread_attr_getdetachstate(GLIBC_2.0)[1] 20478 pthread_getconcurrency[1] 20479 pthread_rwlockattr_getpshared(GLIBC_2.0)[1] 20480 pthread_attr_getguardsize(GLIBC_2.1)[1] 20481 pthread_getspecific(GLIBC_2.1)[1] 20482 pthread_rwlockattr_init(GLIBC_2.1)[1] 20483 pthread_attr_getschedparam(GLIBC_2.0)[1] 20484 pthread_join(GLIBC_2.0)[1] 20485 pthread_rwlockattr_setpshared(GLIBC_2.0)[1] 20486 pthread_attr_getstack[1] pthread_key_create()[1] 20487 pthread_self()[1] 20488 pthread_attr_getstackaddr(GLIBC_2.1)[1] 20489 pthread_key_delete(GLIBC_2.1)[1] 20490 pthread_setcancelstate(GLIBC_2.1)[1] 20491 pthread_attr_getstacksize(GLIBC_2.1)[1] 20492 pthread_kill(GLIBC_2.1)[1] pthread_setcanceltype(GLIBC_2.1)[1] 20493 pthread_attr_init(GLIBC_2.1)[1] 20494 pthread_mutex_destroy(GLIBC_2.1)[1] pthread_setconcurrency[1] 20495 pthread_attr_setdetachstate(GLIBC_2.0)[1] 20496 pthread_mutex_init(GLIBC_2.0)[1] 20497 pthread_setspecific(GLIBC_2.0)[1] 20498 pthread_attr_setguardsize(GLIBC_2.1)[1] 20499 pthread_mutex_lock(GLIBC_2.1)[1] pthread_sigmask(GLIBC_2.1)[1] 20500 pthread_attr_setschedparam(GLIBC_2.0)[1] 20501 pthread_mutex_trylock(GLIBC_2.0)[1] 20502 pthread_testcancel(GLIBC_2.0)[1] 20503 pthread_attr_setstack[1] pthread_mutex_unlock()[1] pwrite()[1] 20504 pthread_attr_setstackaddr(GLIBC_2.1)[1] 20505 pthread_mutexattr_destroy(GLIBC_2.1)[1] pwrite64(GLIBC_2.1)[1] 20506 pthread_attr_setstacksize(GLIBC_2.1)[1] 20507 pthread_mutexattr_getpshared(GLIBC_2.1)[1] 20508 sem_close(GLIBC_2.1)[1] 20509 pthread_cancel(GLIBC_2.0)[1] 20510 pthread_mutexattr_gettype(GLIBC_2.0)[1] 20511 sem_destroy(GLIBC_2.0)[1] 20512 pthread_cond_broadcast(GLIBC_2.0)[1] 20513 pthread_mutexattr_init(GLIBC_2.0)[1] 20514 sem_getvalue(GLIBC_2.0)[1] 20515 pthread_cond_destroy(GLIBC_2.0)[1] 20516 pthread_mutexattr_setpshared(GLIBC_2.0)[1] 20517 sem_init(GLIBC_2.0)[1] 20518 pthread_cond_init(GLIBC_2.0)[1] 20519 pthread_mutexattr_settype(GLIBC_2.0)[1] sem_open(GLIBC_2.0)[1] 20520 pthread_cond_signal(GLIBC_2.0)[1] pthread_once(GLIBC_2.0)[1] 20521 sem_post(GLIBC_2.0)[1] 20522 pthread_cond_timedwait(GLIBC_2.0)[1] 20523 pthread_rwlock_destroy(GLIBC_2.0)[1] 20524 sem_timedwait(GLIBC_2.0)[1] 20525 pthread_cond_wait(GLIBC_2.0)[1] 20526 pthread_rwlock_init(GLIBC_2.0)[1] sem_trywait(GLIBC_2.0)[1] 20527 pthread_condattr_destroy(GLIBC_2.0)[1] 20528 pthread_rwlock_rdlock(GLIBC_2.0)[1] sem_unlink(GLIBC_2.0)[1] 20529 pthread_condattr_getpshared[1] pthread_rwlock_timedrdlock[1] 20530 sem_wait()[1] 20531 pthread_condattr_init(GLIBC_2.0)[1] 20532 pthread_rwlock_timedwrlock[1] 20533 _________________________________________________________ 20534 20535 A.8. libutil 20536 20537 The behaviour of the interfaces in this library is specified 20538 by the following Standards. 20539 20540 this specification 20541 20542 Table A-11. libutil Function Interfaces 20543 forkpty(GLIBC_2.0)[1] login_tty(GLIBC_2.0)[1] 20544 logwtmp(GLIBC_2.0)[1] 20545 login(GLIBC_2.0)[1] logout(GLIBC_2.0)[1] openpty(GLIBC_2.0)[1] 20546 _________________________________________________________ 20547 20548 A.9. libz 20549 20550 The behaviour of the interfaces in this library is specified 20551 by the following Standards. 20552 20553 this specification 20554 20555 Table A-12. libz Function Interfaces 20556 adler32[1] gzclose[1] gztell[1] 20557 compress[1] gzdopen[1] gzwrite[1] 20558 compress2[1] gzeof[1] inflate[1] 20559 compressBound[1] gzerror[1] inflateEnd[1] 20560 crc32[1] gzflush[1] inflateInit2_[1] 20561 deflate[1] gzgetc[1] inflateInit_[1] 20562 deflateBound[1] gzgets[1] inflateReset[1] 20563 deflateCopy[1] gzopen[1] inflateSetDictionary[1] 20564 deflateEnd[1] gzprintf[1] inflateSync[1] 20565 deflateInit2_[1] gzputc[1] inflateSyncPoint[1] 20566 deflateInit_[1] gzputs[1] uncompress[1] 20567 deflateParams[1] gzread[1] zError[1] 20568 deflateReset[1] gzrewind[1] zlibVersion[1] 20569 deflateSetDictionary[1] gzseek[1] 20570 get_crc_table[1] gzsetparams[1] 20571 20572 Linux Packaging Specification 20573 _________________________________________________________ 20574 20575 Table of Contents 20576 I. Package Format and Installation 20577 20578 1. Software Installation 20579 20580 1.1. Package File Format 20581 1.2. Package Script Restrictions 20582 1.3. Package Tools 20583 1.4. Package Naming 20584 1.5. Package Dependencies 20585 1.6. Package Architecture Considerations 20586 20587 List of Tables 20588 1-1. RPM File Format 20589 1-2. Signature Format 20590 1-3. Index Type values 20591 1-4. Header Private Tag Values 20592 1-5. Signature Tag Values 20593 1-6. Signature Digest Tag Values 20594 1-7. Signature Signing Tag Values 20595 1-8. Package Info Tag Values 20596 1-9. Installation Tag Values 20597 1-10. File Info Tag Values 20598 1-11. Package Dependency Tag Values 20599 1-12. Index Type values 20600 1-13. Package Dependency Attributes 20601 1-14. Other Tag Values 20602 1-15. CPIO File Format 20603 20604 I. Package Format and Installation 20605 20606 Table of Contents 20607 1. Software Installation 20608 _________________________________________________________ 20609 20610 Chapter 1. Software Installation 20611 20612 Applications shall either be packaged in the RPM packaging 20613 format as defined in this specification, or supply an 20614 installer which is LSB conforming (for example, calls LSB 20615 commands and utilities). [2] 20616 20617 Distributions shall provide a mechanism for installing 20618 applications in this packaging format with some restrictions 20619 listed below. [3] 20620 _________________________________________________________ 20621 20622 1.1. Package File Format 20623 20624 An RPM format file consists of 4 sections, the Lead, 20625 Signature, Header, and the Payload. All values are stored in 20626 network byte order. 20627 20628 Table 1-1. RPM File Format 20629 Lead 20630 Signature 20631 Header 20632 Payload 20633 20634 These 4 sections shall exist in the order specified. 20635 20636 The lead section is used to identify the package file. 20637 20638 The signature section is used to verify the integrity, and 20639 optionally, the authenticity of the majority of the package 20640 file. 20641 20642 The header section contains all available information about 20643 the package. Entries such as the package's name, version, and 20644 file list, are contained in the header. 20645 20646 The payload section holds the files to be install. 20647 _________________________________________________________ 20648 20649 1.1.1. Lead Section 20650 20651 struct rpmlead { 20652 unsigned char magic[4]; 20653 unsigned char major, minor; 20654 short type; 20655 short archnum; 20656 char name[66]; 20657 short osnum; 20658 short signature_type; 20659 char reserved[16]; 20660 } ; 20661 20662 magic 20663 Value identifying this file as an RPM format file. This 20664 value shall be "\355\253\356\333". 20665 20666 major 20667 Value indicating the major version number of the file 20668 format version. This value shall be 3. 20669 20670 minor 20671 Value indicating the minor revision number of file 20672 format version. This value shall be 0. 20673 20674 type 20675 Value indicating whether this is a source or binary 20676 package. This value shall be 0 to indicate a binary 20677 package. 20678 20679 archnum 20680 Value indicating the architecture for which this 20681 package is valid. This value is specified in the 20682 architecture-specific LSB specification. 20683 20684 name 20685 A NUL terminated string that provides the package name. 20686 This name shall conform with the Package Naming section 20687 of this specification. 20688 20689 osnum 20690 Value indicating the Operating System for which this 20691 package is valid. This value shall be 1. 20692 20693 signature_type 20694 Value indicating the type of the signature used in the 20695 Signature part of the file. This value shall be 5. 20696 20697 reserved 20698 Reserved space. The value is undefined. 20699 _________________________________________________________ 20700 20701 1.1.2. Header Structure 20702 20703 The Header structure is used for both the Signature and Header 20704 Sections. A Header Structure consists of 3 parts, a Header 20705 record, followed by 1 or more Index records, followed by 0 or 20706 more bytes of data associated with the Index records. A Header 20707 structure shall be aligned to an 8 byte boundary. 20708 20709 Table 1-2. Signature Format 20710 Header Record 20711 Array of Index Records 20712 Store of Index Values 20713 _________________________________________________________ 20714 20715 1.1.2.1. Header Record 20716 20717 struct rpmheader { 20718 unsigned char magic[4]; 20719 unsigned char reserved[4]; 20720 int nindex; 20721 int hsize; 20722 } ; 20723 20724 magic 20725 Value identifying this record as an RPM header record. 20726 This value shall be "\216\255\350\001". 20727 20728 reserved 20729 Reserved space. This value shall be "\000\000\000\000". 20730 20731 nindex 20732 The number of Index Records that follow this Header 20733 Record. There should be at least 1 Index Record. 20734 20735 hsize 20736 The size in bytes of the storage area for the data 20737 pointed to by the Index Records. 20738 _________________________________________________________ 20739 20740 1.1.2.2. Index Record 20741 20742 struct rpmhdrindex { 20743 int tag; 20744 int type; 20745 int offset; 20746 int count; 20747 } ; 20748 20749 tag 20750 Value identifying the purpose of the data associated 20751 with this Index Record. This value of this field is 20752 dependent on the context in which the Index Record is 20753 used, and is defined below and in later sections. 20754 20755 type 20756 Value identifying the type of the data associated with 20757 this Index Record. The possible type values are defined 20758 below. 20759 20760 offset 20761 Location in the Store of the data associated with this 20762 Index Record. This value should between 0 and the value 20763 contained in the hsize of the Header Structure. 20764 20765 count 20766 Size of the data associated with this Index Record. The 20767 count is the number of elements whose size is defined 20768 by the type of this Record. 20769 _________________________________________________________ 20770 20771 1.1.2.2.1. Index Type Values 20772 20773 The possible values for the type field are defined in this 20774 table. 20775 20776 Table 1-3. Index Type values 20777 Type Value Size (in bytes) Alignment 20778 RPM_NULL_TYPE 0 Not Implemented. 20779 RPM_CHAR_TYPE 1 1 1 20780 RPM_INT8_TYPE 2 1 1 20781 RPM_INT16_TYPE 3 2 2 20782 RPM_INT32_TYPE 4 4 4 20783 RPM_INT64_TYPE 5 Reserved. 20784 RPM_STRING_TYPE 6 variable, NUL terminated 1 20785 RPM_BIN_TYPE 7 1 1 20786 RPM_STRING_ARRAY_TYPE 8 Variable, sequence of NUL terminated 20787 strings 1 20788 RPM_I18NSTRING_TYPE 9 variable, sequence of NUL terminated 20789 strings 1 20790 20791 The string arrays specified for enties of type 20792 RPM_STRING_ARRAY_TYPE and RPM_I18NSTRING_TYPE are vectors of 20793 strings in a contiguous block of memory, each element 20794 separated from its neighbors by a NUL character. 20795 20796 Index records with type RPM_I18NSTRING_TYPE shall always have 20797 a count of 1. The array entries in an index of type 20798 RPM_I18NSTRING_TYPE correspond to the locale names contained 20799 in the RPMTAG_HDRI18NTABLE index. 20800 _________________________________________________________ 20801 20802 1.1.2.2.2. Index Tag Values 20803 20804 Some values are designated as header private, and may appear 20805 in any header structure. These are defined here. Additional 20806 values are defined in later sections. 20807 20808 Table 1-4. Header Private Tag Values 20809 Name Tag Value Type Count Status 20810 RPMTAG_HEADERSIGNATURES 62 BIN 16 Optional 20811 RPMTAG_HEADERIMMUTABLE 63 BIN 16 Optional 20812 RPMTAG_HEADERI18NTABLE 100 STRING_ARRAY Required 20813 20814 RPMTAG_HEADERSIGNATURES 20815 The signature tag differentiates a signature header 20816 from a metadata header, and identifies the original 20817 contents of the signature header. 20818 20819 RPMTAG_HEADERIMMUTABLE 20820 This tag contains an index record which specifies the 20821 portion of the Header Record which was used for the 20822 calculation of a signature. This data shall be 20823 preserved or any header-only signature will be 20824 invalidated. 20825 20826 RPMTAG_HEADERI18NTABLE 20827 Contains a list of locales for which strings are 20828 provided in other parts of the package. 20829 20830 Not all Index records defined here will be present in all 20831 packages. Each tag value has a status which is defined here. 20832 20833 Required 20834 This Index Record shall be present. 20835 20836 Optional 20837 This Index Record may be present. 20838 20839 Deprecated 20840 This Index Record should not be present. 20841 20842 Obsolete 20843 This Index Record shall not be present. 20844 20845 Reserved 20846 This Index Record shall not be present. 20847 _________________________________________________________ 20848 20849 1.1.2.3. Header Store 20850 20851 The header store contains the values specified by the Index 20852 structures. These values are aligned according to their type 20853 and padding is used if needed. The store is located 20854 immediately following the Index structures. 20855 _________________________________________________________ 20856 20857 1.1.3. Signature Section 20858 20859 The Signature section is implemented using the Header 20860 structure. The signature section defines the following 20861 additional tag values which may be used in the Index 20862 structures. 20863 20864 These values exist to provide additional information about the 20865 rest of the package. 20866 20867 Table 1-5. Signature Tag Values 20868 Name Tag Value Type Count Status 20869 SIGTAG_SIGSIZE 1000 INT32 1 Required 20870 SIGTAG_PAYLOADSIZE 1007 INT32 1 Optional 20871 20872 SIGTAG_SIGSIZE 20873 This tag specifies the combined size of the Header and 20874 Payload sections. 20875 20876 SIGTAG_PAYLOADSIZE 20877 This tag specifies the uncompressed size of the Payload 20878 archive, including the cpio headers. 20879 20880 These values exist to ensure the integrity of the rest of the 20881 package. 20882 20883 Table 1-6. Signature Digest Tag Values 20884 Name Tag Value Type Count Status 20885 SIGTAG_MD5 1004 BIN 16 Required 20886 SIGTAG_SHA1HEADER 1010 STRING 1 Optional 20887 20888 SIGTAG_MD5 20889 This tag specifies the 128-bit MD5 checksum of the 20890 combined Header and Archive sections. 20891 20892 SIGTAG_SHA1HEADER 20893 This index contains the SHA1 checksum of the entire 20894 Header Section, including the Header Record, Index 20895 Records and Header store. 20896 20897 These values exist to provide authentication of the package. 20898 20899 Table 1-7. Signature Signing Tag Values 20900 Name Tag Value Type Count Status 20901 SIGTAG_PGP 1002 BIN 1 Optional 20902 SIGTAG_GPG 1005 BIN 65 Optional 20903 SIGTAG_DSAHEADER 1011 BIN 1 Optional 20904 SIGTAG_RSAHEADER 1012 BIN 1 Optional 20905 20906 SIGTAG_PGP 20907 This tag specifies the RSA signature of the combined 20908 Header and Payload sections. The data is formatted as a 20909 Version 3 Signature Packet as specified in RFC 2440: 20910 OpenPGP Message Format. 20911 20912 SIGTAG_GPG 20913 The tag contains the DSA signature of the combined 20914 Header and Payload sections. The data is formatted as a 20915 Version 3 Signature Packet as specified in RFC 2440: 20916 OpenPGP Message Format. 20917 20918 SIGTAG_DSAHEADER 20919 The tag contains the DSA signature of the Header 20920 section. The data is formatted as a Version 3 Signature 20921 Packet as specified in RFC 2440: OpenPGP Message 20922 Format. If this tag is present,then the SIGTAG_GPG tag 20923 shall also be present. 20924 20925 SIGTAG_RSAHEADER 20926 The tag contains the RSA signature of the Header 20927 section.The data is formatted as a Version 3 Signature 20928 Packet as specified in RFC 2440: OpenPGP Message 20929 Format. If this tag is present, then the SIGTAG_PGP 20930 shall also be present. 20931 _________________________________________________________ 20932 20933 1.1.4. Header Section 20934 20935 The Header section is implemented using the Header structure. 20936 The Header section defines the following additional tag values 20937 which may be used in the Index structures. 20938 _________________________________________________________ 20939 20940 1.1.4.1. Package Information 20941 20942 The following tag values are used to indicate information that 20943 describes the package as a whole. 20944 20945 Table 1-8. Package Info Tag Values 20946 Name Tag Value Type Count Status 20947 RPMTAG_NAME 1000 STRING 1 Required 20948 RPMTAG_VERSION 1001 STRING 1 Required 20949 RPMTAG_RELEASE 1002 STRING 1 Required 20950 RPMTAG_SUMMARY 1004 I18NSTRING 1 Required 20951 RPMTAG_DESCRIPTION 1005 I18NSTRING 1 Required 20952 RPMTAG_SIZE 1009 INT32 1 Required 20953 RPMTAG_LICENSE 1014 STRING 1 Required 20954 RPMTAG_GROUP 1016 I18NSTRING 1 Required 20955 RPMTAG_OS 1021 STRING 1 Required 20956 RPMTAG_ARCH 1022 STRING 1 Required 20957 RPMTAG_SOURCERPM 1044 STRING 1 Optional 20958 RPMTAG_ARCHIVESIZE 1046 INT32 1 Optional 20959 RPMTAG_RPMVERSION 1064 STRING 1 Optional 20960 RPMTAG_COOKIE 1094 STRING 1 Optional 20961 RPMTAG_PAYLOADFORMAT 1124 STRING 1 Required 20962 RPMTAG_PAYLOADCOMPRESSOR 1125 STRING 1 Required 20963 RPMTAG_PAYLOADFLAGS 1126 STRING 1 Required 20964 20965 RPMTAG_NAME 20966 This tag specifies the name of the package. 20967 20968 RPMTAG_VERSION 20969 This tag specifies the version of the package. 20970 20971 RPMTAG_RELEASE 20972 This tag specifies the release of the package. 20973 20974 RPMTAG_SUMMARY 20975 This tag specifies the summary description of the 20976 package. The summary value pointed to by this index 20977 record contains a one line description of the package. 20978 20979 RPMTAG_DESCRIPTION 20980 This tag specifies the description of the package. The 20981 description value pointed to by this index record 20982 contains a full desription of the package. 20983 20984 RPMTAG_SIZE 20985 This tag specifies the sum of the sizes of the regular 20986 files in the archive. 20987 20988 RPMTAG_LICENSE 20989 This tag specifies the license which applies to this 20990 package. 20991 20992 RPMTAG_GROUP 20993 This tag specifies the administrative group to which 20994 this package belongs. 20995 20996 RPMTAG_OS 20997 This tag specifies the OS of the package. The OS value 20998 pointed to by this index record shall be "linux". 20999 21000 RPMTAG_ARCH 21001 This tag specifies the architecture of the package. The 21002 architecture value pointed to by this index record is 21003 defined in architecture specific LSB specification. 21004 21005 RPMTAG_SOURCERPM 21006 This tag specifies the name of the source RPM 21007 21008 RPMTAG_ARCHIVESIZE 21009 This tag specifies the uncompressed size of the Payload 21010 archive, including the cpio headers. 21011 21012 RPMTAG_RPMVERSION 21013 This tag indicates the version of RPM tool used to 21014 build this package. The value is unused. 21015 21016 RPMTAG_COOKIE 21017 This tag contains an opaque string whose contents are 21018 undefined. 21019 21020 RPMTAG_PAYLOADFORMAT 21021 This tag specifies the format of the Archive section. 21022 The format value pointed to by this index record shall 21023 be 'cpio'. 21024 21025 RPMTAG_PAYLOADCOMPRESSOR 21026 This tag specifies the compression used on the Archive 21027 section. The compression value pointed to by this index 21028 record shall be 'gzip' 21029 21030 RPMTAG_PAYLOADFLAGS 21031 This tag indicates the compression level used for the 21032 Payload. This value shall always be '9'. 21033 _________________________________________________________ 21034 21035 1.1.4.2. Installation Information 21036 21037 The following tag values are used to provide information 21038 needed during the installation of the package. 21039 21040 Table 1-9. Installation Tag Values 21041 Name Tag Value Type Count Status 21042 RPMTAG_PREIN 1023 STRING 1 Optional 21043 RPMTAG_POSTIN 1024 STRING 1 Optional 21044 RPMTAG_PREUN 1025 STRING 1 Optional 21045 RPMTAG_POSTUN 1026 STRING 1 Optional 21046 RPMTAG_PREINPROG 1085 STRING 1 Optional 21047 RPMTAG_POSTINPROG 1086 STRING 1 Optional 21048 RPMTAG_PREUNPROG 1087 STRING 1 Optional 21049 RPMTAG_POSTUNPROG 1088 STRING 1 Optional 21050 21051 RPMTAG_PREIN 21052 This tag specifies the preinstall scriptlet. 21053 21054 RPMTAG_POSTIN 21055 This tag specifies the postinstall scriptlet. 21056 21057 RPMTAG_PREUN 21058 his tag specifies the preuninstall scriptlet. 21059 21060 RPMTAG_POSTUN 21061 This tag specified the postuninstall scriptlet. 21062 21063 RPMTAG_PREINPROG 21064 This tag specifies the name of the intepreter to which 21065 the preinstall scriptlet will be passed. The intepreter 21066 pointed to by this index record shall be '/bin/sh'. 21067 21068 RPMTAG_POSTINPROG 21069 This tag specifies the name of the intepreter to which 21070 the postinstall scriptlet will be passed. The 21071 intepreter pointed to by this index record shall be 21072 '/bin/sh'. 21073 21074 RPMTAG_PREUNPROG 21075 This tag specifies the name of the intepreter to which 21076 the preuninstall scriptlet will be passed. The 21077 intepreter pointed to by this index record shall be 21078 '/bin/sh'. 21079 21080 RPMTAG_POSTUNPROG 21081 This program specifies the name of the intepreter to 21082 which the postuninstall scriptlet will be passed. The 21083 intepreter pointed to by this index record shall be 21084 '/bin/sh'. 21085 _________________________________________________________ 21086 21087 1.1.4.3. File Information 21088 21089 The following tag values are used to provide information about 21090 the files in the payload. This information is provided in the 21091 header to allow more efficient access of the information. 21092 21093 Table 1-10. File Info Tag Values 21094 Name Tag Value Type Count Status 21095 RPMTAG_OLDFILENAMES 1027 STRING_ARRAY Optional 21096 RPMTAG_FILESIZES 1028 INT32 Required 21097 RPMTAG_FILEMODES 1030 INT16 Required 21098 RPMTAG_FILERDEVS 1033 INT16 Required 21099 RPMTAG_FILEMTIMES 1034 INT32 Required 21100 RPMTAG_FILEMD5S 1035 STRING_ARRAY Required 21101 RPMTAG_FILELINKTOS 1036 STRING_ARRAY Required 21102 RPMTAG_FILEFLAGS 1037 INT32 Required 21103 RPMTAG_FILEUSERNAME 1039 STRING_ARRAY Required 21104 RPMTAG_FILEGROUPNAME 1040 STRING_ARRAY Required 21105 RPMTAG_FILEDEVICES 1095 INT32 Required 21106 RPMTAG_FILEINODES 1096 INT32 Required 21107 RPMTAG_FILELANGS 1097 STRING_ARRAY Required 21108 RPMTAG_DIRINDEXES 1116 INT32 Optional 21109 RPMTAG_BASENAMES 1117 STRING_ARRAY Optional 21110 RPMTAG_DIRNAMES 1118 STRING_ARRAY Optional 21111 21112 RPMTAG_OLDFILENAMES 21113 This tag specifies the filenames when not in a 21114 compressed format as determined by the absense of 21115 rpmlib(CompressedFileNames) in the RPMTAG_REQUIRENAME 21116 index. 21117 21118 RPMTAG_FILESIZES 21119 This tag specifies the size of each file in the 21120 archive. 21121 21122 RPMTAG_FILEMODES 21123 This tag specifies the mode of each file in the 21124 archive. 21125 21126 RPMTAG_FILERDEVS 21127 This tag specifies the device number from which the 21128 file was copied. 21129 21130 RPMTAG_FILEMTIMES 21131 This tag specifies the modification time in seconds 21132 since the epoch of each file in the archive. 21133 21134 RPMTAG_FILEMD5S 21135 This tag specifies the ASCII representation of the MD5 21136 sum of the corresponding file contents. This value is 21137 empty if the corresponding archive entry is not a 21138 regular file. 21139 21140 RPMTAG_FILELINKTOS 21141 The target for a symlink, otherwise NULL. 21142 21143 RPMTAG_FILEFLAGS 21144 This tag specifies the bit(s) to classify and control 21145 how files are to be installed. 21146 21147 RPMTAG_FILEUSERNAME 21148 This tag specifies the owner of the corresponding file. 21149 21150 RPMTAG_FILEGROUPNAME 21151 This tag specifies the of the corresponding file. 21152 21153 RPMTAG_FILEDEVICES 21154 This tag specifies the 16 bit device number from which 21155 the file was copied. 21156 21157 RPMTAG_FILEINODES 21158 This tag specifies the inode value from the original 21159 file on the build host. 21160 21161 RPMTAG_FILELANGS 21162 This tag specifies a per-file locale marker used to 21163 install only locale specific subsets of files when the 21164 package is installed. 21165 21166 RPMTAG_DIRINDEXES 21167 This tag specifies the index into the array provided by 21168 the RPMTAG_DIRNAMES Index which contains the directory 21169 name for the corresponding filename. 21170 21171 RPMTAG_BASENAMES 21172 This tag specifies the base portion of the 21173 corresponding filename. 21174 21175 RPMTAG_DIRNAMES 21176 This tag specifies the directory portion of the 21177 corresponding filename. Each directory name shall 21178 contain a trailing '/'. 21179 21180 One of RPMTAG_OLDFILENAMES or the tuple 21181 RPMTAG_DIRINDEXES,RPMTAG_BASENAMES,RPMTAG_DIRNAMES shall be 21182 present, but not both. 21183 _________________________________________________________ 21184 21185 1.1.4.4. Dependency Information 21186 21187 The following tag values are used to provide information about 21188 interdependencies between packages. 21189 21190 Table 1-11. Package Dependency Tag Values 21191 Name Tag Value Type Count Status 21192 RPMTAG_PROVIDENAME 1047 STRING_ARRAY 1 Required 21193 RPMTAG_REQUIREFLAGS 1048 INT32 Required 21194 RPMTAG_REQUIRENAME 1049 STRING_ARRAY Required 21195 RPMTAG_REQUIREVERSION 1050 STRING_ARRAY Required 21196 RPMTAG_CONFLICTFLAGS 1053 INT32 Optional 21197 RPMTAG_CONFLICTNAME 1054 STRING_ARRAY Optional 21198 RPMTAG_CONFLICTVERSION 1055 STRING_ARRAY Optional 21199 RPMTAG_OBSOLETENAME 1090 STRING_ARRAY Optional 21200 RPMTAG_PROVIDEFLAGS 1112 INT32 Required 21201 RPMTAG_PROVIDEVERSION 1113 STRING_ARRAY Required 21202 RPMTAG_OBSOLETEFLAGS 1114 INT32 1 Optional 21203 RPMTAG_OBSOLETEVERSION 1115 STRING_ARRAY Optional 21204 21205 RPMTAG_PROVIDENAME 21206 This tag indicates the name of the dependency provided 21207 by this package. 21208 21209 RPMTAG_REQUIREFLAGS 21210 Bits(s) to specify the dependency range and context. 21211 21212 RPMTAG_REQUIRENAME 21213 This tag indicates the dependencies for this package. 21214 21215 RPMTAG_REQUIREVERSION 21216 This tag indicates the versions associated with the 21217 values found in the RPMTAG_REQUIRENAME Index. 21218 21219 RPMTAG_CONFLICTFLAGS 21220 Bits(s) to specify the conflict range and context. 21221 21222 RPMTAG_CONFLICTNAME 21223 This tag indicates the conflictind dependencies for 21224 this package. 21225 21226 RPMTAG_CONFLICTVERSION 21227 This tag indicates the versions associated with the 21228 values found in the RPMTAG_CONFLICTNAME Index. 21229 21230 RPMTAG_OBSOLETENAME 21231 This tag indicates the obsoleted dependencies for this 21232 package. 21233 21234 RPMTAG_PROVIDEFLAGS 21235 Bits(s) to specify the conflict range and context. 21236 21237 RPMTAG_PROVIDEVERSION 21238 This tag indicates the versions associated with the 21239 values found in the RPMTAG_PROVIDENAME Index. 21240 21241 RPMTAG_OBSOLETEFLAGS 21242 Bits(s) to specify the conflict range and context. 21243 21244 RPMTAG_OBSOLETEVERSION 21245 This tag indicates the versions associated with the 21246 values found in the RPMTAG_OBSOLETENAME Index. 21247 _________________________________________________________ 21248 21249 1.1.4.4.1. Package Dependency Values 21250 21251 The package dependencies are stored in the RPMTAG_REQUIRENAME 21252 and RPMTAG_REQUIREVERSION index records. The following values 21253 may be used. 21254 21255 Table 1-12. Index Type values 21256 Name Version Meaning Status 21257 lsb 2.0 Indicates this is an LSB conforming package. Required 21258 rpmlib(VersionedDependencies) 3.0.3-1 Indicates That the 21259 package contains PMTAG_PROVIDENAME, RPMTAG_OBSOLETENAME or 21260 RPMTAG_PREREQ records that have a version associated with 21261 them. Optional 21262 rpmlib(PayloadFilesHavePrefix) 4.0-1 Indicates the filenames 21263 in the Archive have had "." prepended to them. Optional 21264 rpmlib(CompressedFileNames) 3.0.4-1 Indicates that the 21265 filenames in the Payload are represented in the 21266 RPMTAG_DIRINDEXES, RPMTAG_DIRNAME and RPMTAG_BASENAMES 21267 indexes. Optional 21268 /bin/sh Interpreter usually required for installation 21269 scripts. Optional 21270 _________________________________________________________ 21271 21272 1.1.4.4.2. Package Dependencies Attributes 21273 21274 The package dependency attributes are stored in the 21275 RPMTAG_REQUIREFLAGS, RPMTAG_PROVIDEFLAGS and 21276 RPMTAG_OBSOLETEFLAGS index records. The following values may 21277 be used. 21278 21279 Table 1-13. Package Dependency Attributes 21280 Name Value Meaning 21281 RPMSENSE_LESS 0x02 21282 RPMSENSE_GREATER 0x04 21283 RPMSENSE_EQUAL 0x08 21284 RPMSENSE_PREREQ 0x40 21285 RPMSENSE_INTERP 0x100 21286 RPMSENSE_SCRIPT_PRE 0x200 21287 RPMSENSE_SCRIPT_POST 0x400 21288 RPMSENSE_SCRIPT_PREUN 0x800 21289 RPMSENSE_SCRIPT_POSTUN 0x1000 21290 RPMSENSE_RPMLIB 0x1000000 21291 _________________________________________________________ 21292 21293 1.1.4.5. Other Information 21294 21295 The following tag values are also found in the Header section. 21296 21297 Table 1-14. Other Tag Values 21298 Name Tag Value Type Count Status 21299 RPMTAG_BUILDTIME 1006 INT32 1 Optional 21300 RPMTAG_BUILDHOST 1007 STRING 1 Optional 21301 RPMTAG_FILEVERIFYFLAGS 1045 INT32 Optional 21302 RPMTAG_CHANGELOGTIME 1080 INT32 Optional 21303 RPMTAG_CHANGELOGNAME 1081 STRING_ARRAY Optional 21304 RPMTAG_CHANGELOGTEXT 1082 STRING_ARRAY Optional 21305 RPMTAG_OPTFLAGS 1122 STRING 1 Optional 21306 RPMTAG_RHNPLATFORM 1131 STRING 1 Deprecated 21307 RPMTAG_PLATFORM 1132 STRING 1 Optional 21308 21309 RPMTAG_BUILDTIME 21310 This tag specifies the time as seconds since the epoch 21311 at which the package was built. 21312 21313 RPMTAG_BUILDHOST 21314 This tag specifies the on which which the package was 21315 built. 21316 21317 RPMTAG_FILEVERIFYFLAGS 21318 This tag specifies the bit(s) to control how files are 21319 to be verified after install, specifying which checks 21320 should be performed. 21321 21322 RPMTAG_CHANGELOGTIME 21323 This tag specifies the Unix time in seconds since the 21324 epoch associated with each entry in the Changelog file. 21325 21326 RPMTAG_CHANGELOGNAME 21327 This tag specifies the name of who made a change to 21328 this package 21329 21330 RPMTAG_CHANGELOGTEXT 21331 This tag specifies the changes asssociated with a 21332 changelog entry. 21333 21334 RPMTAG_OPTFLAGS 21335 This tag indicates additional flags which may have been 21336 passed to the compiler when building this package. 21337 21338 RPMTAG_RHNPLATFORM 21339 This tag contains an opaque string whose contents are 21340 undefined. 21341 21342 RPMTAG_PLATFORM 21343 This tag contains an opaque string whose contents are 21344 undefined. 21345 _________________________________________________________ 21346 21347 1.1.5. Payload Section 21348 21349 The Payload section contains a compressed cpio archive. The 21350 format of this section is defined by RFC 1952: GZIP File 21351 Format Specification. 21352 21353 When uncompressed, the cpio archive contains a sequence of 21354 records for each file. Each record contains a CPIO Header, 21355 Filename, Padding, and File Data. 21356 21357 Table 1-15. CPIO File Format 21358 CPIO Header Header structure as defined below. 21359 Filename NUL terminated ASCII string containing the name of 21360 the file. 21361 Padding 0-3 bytes as needed to align the file stream to a 4 21362 byte boundary. 21363 File data The contents of the file. 21364 Padding 0-3 bytes as needed to align the file stream to a 4 21365 byte boundary. 21366 21367 The CPIO Header uses the following header structure (sometimes 21368 referred to as "new ASCII" or "SVR4 cpio"). All numbers are 21369 stored as ASCII representations of their hexadecimal value 21370 with leading zeros as needed to fill the field. With the 21371 exception of c_namesize and the corresponding name string, and 21372 c_checksum, all information contained in the CPIO Header is 21373 also represented in the Header Section. The values in in the 21374 CPIO Header shall match the values contained in the Header 21375 Section. 21376 struct { 21377 char c_magic[6]; 21378 char c_ino[8]; 21379 char c_mode[8]; 21380 char c_uid[8]; 21381 char c_gid[8]; 21382 char c_nlink[8]; 21383 char c_mtime[8]; 21384 char c_filesize[8]; 21385 char c_devmajor[8]; 21386 char c_devminor[8]; 21387 char c_rdevmajor[8]; 21388 char c_rdevminor[8]; 21389 char c_namesize[8]; 21390 char c_checksum[8]; 21391 }; 21392 21393 c_magic 21394 Value identifying this cpio format. This value shall be 21395 "070701". 21396 21397 c_ino 21398 This field contains the inode number from the 21399 filesystem from which the file was read. This field is 21400 ignored when installing a package. This field shall 21401 match the corresponding value in the RPMTAG_FILEINODES 21402 index in the Header section. 21403 21404 c_mode 21405 Permission bits of the file. This is an ascii 21406 representation of the hexadecimal number representing 21407 the bit as defined for the st_mode field of the stat 21408 structure defined for the stat function. This field 21409 shall match the corresponding value in the 21410 RPMTAG_FILEMODES index in the Header section. 21411 21412 c_uid 21413 Value identifying this owner of this file. This value 21414 matches the uid value of the corresponding user in the 21415 RPMTAG_FILEUSERNAME as found on the system where this 21416 package was built. The username specified in 21417 RPMTAG_FILEUSERNAME should take precedence when 21418 installing the package. 21419 21420 c_gid 21421 Value identifying this group of this file. This value 21422 matches the gid value of the corresponding user in the 21423 RPMTAG_FILEGROUPNAME as found on the system where this 21424 package was built. The groupname specified in 21425 RPMTAG_FILEGROUPNAME should take precedence when 21426 installing the package. 21427 21428 c_nlink 21429 Value identifying the number of links associated with 21430 this file. If the value is greater than 1, then this 21431 filename will be linked to 1 or more files in this 21432 archive that has a matching value for the c_ino, 21433 c_devmajor and c_devminor fields. 21434 21435 c_mtime 21436 Value identifying the modification time of the file 21437 when it was read. This field shall match the 21438 corresponding value in the RPMTAG_FILEMTIMES index in 21439 the Header section. 21440 21441 c_filesize 21442 Value identifying the size of the file. This field 21443 shall match the corresponding value in the 21444 RPMTAG_FILESIZES index in the Header section. 21445 21446 c_devmajor 21447 The major number of the device containing the file 21448 system from which the file was read. With the exception 21449 of processing files with c_nlink >1, this field is 21450 ignored when installing a package. This field shall 21451 match the corresponding value in the RPMTAG_FILEDEVICES 21452 index in the Header section. 21453 21454 c_devminor 21455 The minor number of the device containing the file 21456 system from which the file was read. With the exception 21457 of processing files with c_nlink >1, this field is 21458 ignored when installing a package. This field shall 21459 match the corresponding value in the RPMTAG_FILEDEVICES 21460 index in the Header section. 21461 21462 c_rdevmajor 21463 The major number of the raw device containing the file 21464 system from which the file was read. This field is 21465 ignored when installing a package. This field shall 21466 match the corresponding value in the RPMTAG_RDEVS index 21467 in the Header section. 21468 21469 c_rdevminor 21470 The minor number of the raw device containing the file 21471 system from which the file was read. This field is 21472 ignored when installing a package. This field shall 21473 match the corresponding value in the RPMTAG_RDEVS index 21474 in the Header section. 21475 21476 c_namesize 21477 Value identifying the length of the filename, which is 21478 located immediately following the CPIO Header 21479 structure. 21480 21481 c_checksum 21482 Value containing the CRC checksum of the file data. 21483 This field is not used, and shall contain the value 21484 "00000000". This field is ignored when installing a 21485 package. 21486 21487 A record with the filename "TRAILER!!!" indicates the last 21488 record in the archive. 21489 _________________________________________________________ 21490 21491 1.2. Package Script Restrictions 21492 21493 Scripts used as part of the package install and uninstall 21494 shall only use commands and interfaces that are specified by 21495 the LSB. All other commands are not guaranteed to be present, 21496 or to behave in expected ways. 21497 21498 Packages shall not use RPM triggers. 21499 21500 Packages shall not depend on the order in which scripts are 21501 executed (pre-install, pre-uninstall, &c), when doing an 21502 upgrade. 21503 _________________________________________________________ 21504 21505 1.3. Package Tools 21506 21507 The LSB does not specify the interface to the tools used to 21508 manipulate LSB-conformant packages. Each conforming 21509 distribution shall provide documentation for installing LSB 21510 packages. 21511 _________________________________________________________ 21512 21513 1.4. Package Naming 21514 21515 Packages supplied by distributions and applications must 21516 follow the following rules for the name field within the 21517 package. These rules are not required for the filename of the 21518 package file itself.[4] 21519 21520 The following rules apply to the name field alone, not 21521 including any release or version.[5] 21522 21523 * If the name begins with "lsb-" and contains no other 21524 hyphens, the name shall be assigned by the Linux Assigned 21525 Names and Numbers Authority (LANANA), which shall maintain 21526 a registry of LSB names. The name may be registered by 21527 either a distribution or an application. 21528 * If the package name begins with "lsb-" and contains more 21529 than one hyphen (for example 21530 "lsb-distro.example.com-database" or 21531 "lsb-gnome-gnumeric"), then the portion of the package 21532 name between first and second hyphens shall either be an 21533 LSB provider name assigned by the LANANA, or it may be one 21534 of the owners' fully-qualified domain names in lower case 21535 (e.g., "debian.org", "staroffice.sun.com"). The LSB 21536 provider name assigned by LANANA shall only consist of the 21537 ASCII characters [a-z0-9]. The provider name or domain 21538 name may be either that of a distribution or an 21539 application. 21540 * Package names containing no hyphens are reserved for use 21541 by distributions. Applications must not use such names.[6] 21542 * Package names which do not start with "lsb-" and which 21543 contain a hyphen are open to both distributions and 21544 applications. Distributions may name packages in any part 21545 of this namespace. They are encouraged to use names from 21546 one of the other namespaces available to them, but this is 21547 not required due to the large amount of current practice 21548 to the contrary.[7] Applications may name their packages 21549 this way, but only if the portion of the name before the 21550 first hyphen is a provider name or registered domain name 21551 as described above.[8]Note that package names in this 21552 namespace are available to both the distribution and an 21553 application. Distributions and applications will need to 21554 consider this potential for conflicts when deciding to use 21555 these names rather than the alternatives (such as names 21556 starting with "lsb-"). 21557 _________________________________________________________ 21558 21559 1.5. Package Dependencies 21560 21561 Packages shall have a dependency that indicates which LSB 21562 modules are required. LSB module descriptions are dash 21563 seperated tuples containing the name 'lsb', the module name, 21564 and the architecture name. The following dependencies may be 21565 used. 21566 21567 lsb-core-arch 21568 This dependency is used to indicate that the 21569 application is dependent on features contained in the 21570 LSB-Core specification. 21571 21572 lsb-core-noarch 21573 This dependency is used to indicate that the 21574 application is dependent on features contained in the 21575 LSB-Core specification and that the package does not 21576 contain any architecture specific files. 21577 21578 Packages shall not depend on other system-provided 21579 dependencies. They shall not depend on non-system-provided 21580 dependencies unless those dependencies are fulfilled by 21581 packages which are part of the same application. A package may 21582 only provide a virtual package name which is registered to 21583 that application. 21584 21585 Other modules in the LSB may supplement this list. The 21586 architecture specific dependencies are described in the 21587 relevant architecture specific LSB. 21588 _________________________________________________________ 21589 21590 1.6. Package Architecture Considerations 21591 21592 Packages which do not contain any architecture specific files 21593 must specify an architecture of noarch. A LSB runtime 21594 environment must accept values noarch, or the value specified 21595 in the architecture specific supplement. 21596 21597 Additional specifications or restrictions may be found in the 21598 architecture specific LSB specification. 21599 21600 Free Documentation License 21601 _________________________________________________________ 21602 21603 Table of Contents 21604 A. GNU Free Documentation License 21605 21606 A.1. PREAMBLE 21607 A.2. APPLICABILITY AND DEFINITIONS 21608 A.3. VERBATIM COPYING 21609 A.4. COPYING IN QUANTITY 21610 A.5. MODIFICATIONS 21611 A.6. COMBINING DOCUMENTS 21612 A.7. COLLECTIONS OF DOCUMENTS 21613 A.8. AGGREGATION WITH INDEPENDENT WORKS 21614 A.9. TRANSLATION 21615 A.10. TERMINATION 21616 A.11. FUTURE REVISIONS OF THIS LICENSE 21617 A.12. How to use this License for your documents 21618 _________________________________________________________ 21619 21620 Appendix A. GNU Free Documentation License 21621 21622 Version 1.1, March 2000 21623 21624 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 21625 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 21626 permitted to copy and distribute verbatim copies of this 21627 license document, but changing it is not allowed. 21628 _________________________________________________________ 21629 21630 A.1. PREAMBLE 21631 21632 The purpose of this License is to make a manual, textbook, or 21633 other written document "free" in the sense of freedom: to 21634 assure everyone the effective freedom to copy and redistribute 21635 it, with or without modifying it, either commercially or 21636 noncommercially. Secondarily, this License preserves for the 21637 author and publisher a way to get credit for their work, while 21638 not being considered responsible for modifications made by 21639 others. 21640 21641 This License is a kind of "copyleft", which means that 21642 derivative works of the document must themselves be free in 21643 the same sense. It complements the GNU General Public License, 21644 which is a copyleft license designed for free software. 21645 21646 We have designed this License in order to use it for manuals 21647 for free software, because free software needs free 21648 documentation: a free program should come with manuals 21649 providing the same freedoms that the software does. But this 21650 License is not limited to software manuals; it can be used for 21651 any textual work, regardless of subject matter or whether it 21652 is published as a printed book. We recommend this License 21653 principally for works whose purpose is instruction or 21654 reference. 21655 _________________________________________________________ 21656 21657 A.2. APPLICABILITY AND DEFINITIONS 21658 21659 This License applies to any manual or other work that contains 21660 a notice placed by the copyright holder saying it can be 21661 distributed under the terms of this License. The "Document", 21662 below, refers to any such manual or work. Any member of the 21663 public is a licensee, and is addressed as "you". 21664 21665 A "Modified Version" of the Document means any work containing 21666 the Document or a portion of it, either copied verbatim, or 21667 with modifications and/or translated into another language. 21668 21669 A "Secondary Section" is a named appendix or a front-matter 21670 section of the Document that deals exclusively with the 21671 relationship of the publishers or authors of the Document to 21672 the Document's overall subject (or to related matters) and 21673 contains nothing that could fall directly within that overall 21674 subject. (For example, if the Document is in part a textbook 21675 of mathematics, a Secondary Section may not explain any 21676 mathematics.) The relationship could be a matter of historical 21677 connection with the subject or with related matters, or of 21678 legal, commercial, philosophical, ethical or political 21679 position regarding them. 21680 21681 The "Invariant Sections" are certain Secondary Sections whose 21682 titles are designated, as being those of Invariant Sections, 21683 in the notice that says that the Document is released under 21684 this License. 21685 21686 The "Cover Texts" are certain short passages of text that are 21687 listed, as Front-Cover Texts or Back-Cover Texts, in the 21688 notice that says that the Document is released under this 21689 License. 21690 21691 A "Transparent" copy of the Document means a machine-readable 21692 copy, represented in a format whose specification is available 21693 to the general public, whose contents can be viewed and edited 21694 directly and straightforwardly with generic text editors or 21695 (for images composed of pixels) generic paint programs or (for 21696 drawings) some widely available drawing editor, and that is 21697 suitable for input to text formatters or for automatic 21698 translation to a variety of formats suitable for input to text 21699 formatters. A copy made in an otherwise Transparent file 21700 format whose markup has been designed to thwart or discourage 21701 subsequent modification by readers is not Transparent. A copy 21702 that is not "Transparent" is called "Opaque". 21703 21704 Examples of suitable formats for Transparent copies include 21705 plain ASCII without markup, Texinfo input format, LaTeX input 21706 format, SGML or XML using a publicly available DTD, and 21707 standard-conforming simple HTML designed for human 21708 modification. Opaque formats include PostScript, PDF, 21709 proprietary formats that can be read and edited only by 21710 proprietary word processors, SGML or XML for which the DTD 21711 and/or processing tools are not generally available, and the 21712 machine-generated HTML produced by some word processors for 21713 output purposes only. 21714 21715 The "Title Page" means, for a printed book, the title page 21716 itself, plus such following pages as are needed to hold, 21717 legibly, the material this License requires to appear in the 21718 title page. For works in formats which do not have any title 21719 page as such, "Title Page" means the text near the most 21720 prominent appearance of the work's title, preceding the 21721 beginning of the body of the text. 21722 _________________________________________________________ 21723 21724 A.3. VERBATIM COPYING 21725 21726 You may copy and distribute the Document in any medium, either 21727 commercially or noncommercially, provided that this License, 21728 the copyright notices, and the license notice saying this 21729 License applies to the Document are reproduced in all copies, 21730 and that you add no other conditions whatsoever to those of 21731 this License. You may not use technical measures to obstruct 21732 or control the reading or further copying of the copies you 21733 make or distribute. However, you may accept compensation in 21734 exchange for copies. If you distribute a large enough number 21735 of copies you must also follow the conditions in section 3. 21736 21737 You may also lend copies, under the same conditions stated 21738 above, and you may publicly display copies. 21739 _________________________________________________________ 21740 21741 A.4. COPYING IN QUANTITY 21742 21743 If you publish printed copies of the Document numbering more 21744 than 100, and the Document's license notice requires Cover 21745 Texts, you must enclose the copies in covers that carry, 21746 clearly and legibly, all these Cover Texts: Front-Cover Texts 21747 on the front cover, and Back-Cover Texts on the back cover. 21748 Both covers must also clearly and legibly identify you as the 21749 publisher of these copies. The front cover must present the 21750 full title with all words of the title equally prominent and 21751 visible. You may add other material on the covers in addition. 21752 Copying with changes limited to the covers, as long as they 21753 preserve the title of the Document and satisfy these 21754 conditions, can be treated as verbatim copying in other 21755 respects. 21756 21757 If the required texts for either cover are too voluminous to 21758 fit legibly, you should put the first ones listed (as many as 21759 fit reasonably) on the actual cover, and continue the rest 21760 onto adjacent pages. 21761 21762 If you publish or distribute Opaque copies of the Document 21763 numbering more than 100, you must either include a 21764 machine-readable Transparent copy along with each Opaque copy, 21765 or state in or with each Opaque copy a publicly-accessible 21766 computer-network location containing a complete Transparent 21767 copy of the Document, free of added material, which the 21768 general network-using public has access to download 21769 anonymously at no charge using public-standard network 21770 protocols. If you use the latter option, you must take 21771 reasonably prudent steps, when you begin distribution of 21772 Opaque copies in quantity, to ensure that this Transparent 21773 copy will remain thus accessible at the stated location until 21774 at least one year after the last time you distribute an Opaque 21775 copy (directly or through your agents or retailers) of that 21776 edition to the public. 21777 21778 It is requested, but not required, that you contact the 21779 authors of the Document well before redistributing any large 21780 number of copies, to give them a chance to provide you with an 21781 updated version of the Document. 21782 _________________________________________________________ 21783 21784 A.5. MODIFICATIONS 21785 21786 You may copy and distribute a Modified Version of the Document 21787 under the conditions of sections 2 and 3 above, provided that 21788 you release the Modified Version under precisely this License, 21789 with the Modified Version filling the role of the Document, 21790 thus licensing distribution and modification of the Modified 21791 Version to whoever possesses a copy of it. In addition, you 21792 must do these things in the Modified Version: 21793 21794 A. Use in the Title Page (and on the covers, if any) a title 21795 distinct from that of the Document, and from those of 21796 previous versions (which should, if there were any, be 21797 listed in the History section of the Document). You may 21798 use the same title as a previous version if the original 21799 publisher of that version gives permission. 21800 B. List on the Title Page, as authors, one or more persons or 21801 entities responsible for authorship of the modifications 21802 in the Modified Version, together with at least five of 21803 the principal authors of the Document (all of its 21804 principal authors, if it has less than five). 21805 C. State on the Title page the name of the publisher of the 21806 Modified Version, as the publisher. 21807 D. Preserve all the copyright notices of the Document. 21808 E. Add an appropriate copyright notice for your modifications 21809 adjacent to the other copyright notices. 21810 F. Include, immediately after the copyright notices, a 21811 license notice giving the public permission to use the 21812 Modified Version under the terms of this License, in the 21813 form shown in the Addendum below. 21814 G. Preserve in that license notice the full lists of 21815 Invariant Sections and required Cover Texts given in the 21816 Document's license notice. 21817 H. Include an unaltered copy of this License. 21818 I. Preserve the section entitled "History", and its title, 21819 and add to it an item stating at least the title, year, 21820 new authors, and publisher of the Modified Version as 21821 given on the Title Page. If there is no section entitled 21822 "History" in the Document, create one stating the title, 21823 year, authors, and publisher of the Document as given on 21824 its Title Page, then add an item describing the Modified 21825 Version as stated in the previous sentence. 21826 J. Preserve the network location, if any, given in the 21827 Document for public access to a Transparent copy of the 21828 Document, and likewise the network locations given in the 21829 Document for previous versions it was based on. These may 21830 be placed in the "History" section. You may omit a network 21831 location for a work that was published at least four years 21832 before the Document itself, or if the original publisher 21833 of the version it refers to gives permission. 21834 K. In any section entitled "Acknowledgements" or 21835 "Dedications", preserve the section's title, and preserve 21836 in the section all the substance and tone of each of the 21837 contributor acknowledgements and/or dedications given 21838 therein. 21839 L. Preserve all the Invariant Sections of the Document, 21840 unaltered in their text and in their titles. Section 21841 numbers or the equivalent are not considered part of the 21842 section titles. 21843 M. Delete any section entitled "Endorsements". Such a section 21844 may not be included in the Modified Version. 21845 N. Do not retitle any existing section as "Endorsements" or 21846 to conflict in title with any Invariant Section. 21847 21848 If the Modified Version includes new front-matter sections or 21849 appendices that qualify as Secondary Sections and contain no 21850 material copied from the Document, you may at your option 21851 designate some or all of these sections as invariant. To do 21852 this, add their titles to the list of Invariant Sections in 21853 the Modified Version's license notice. These titles must be 21854 distinct from any other section titles. 21855 21856 You may add a section entitled "Endorsements", provided it 21857 contains nothing but endorsements of your Modified Version by 21858 various parties--for example, statements of peer review or 21859 that the text has been approved by an organization as the 21860 authoritative definition of a standard. 21861 21862 You may add a passage of up to five words as a Front-Cover 21863 Text, and a passage of up to 25 words as a Back-Cover Text, to 21864 the end of the list of Cover Texts in the Modified Version. 21865 Only one passage of Front-Cover Text and one of Back-Cover 21866 Text may be added by (or through arrangements made by) any one 21867 entity. If the Document already includes a cover text for the 21868 same cover, previously added by you or by arrangement made by 21869 the same entity you are acting on behalf of, you may not add 21870 another; but you may replace the old one, on explicit 21871 permission from the previous publisher that added the old one. 21872 21873 The author(s) and publisher(s) of the Document do not by this 21874 License give permission to use their names for publicity for 21875 or to assert or imply endorsement of any Modified Version. 21876 _________________________________________________________ 21877 21878 A.6. COMBINING DOCUMENTS 21879 21880 You may combine the Document with other documents released 21881 under this License, under the terms defined in section 4 above 21882 for modified versions, provided that you include in the 21883 combination all of the Invariant Sections of all of the 21884 original documents, unmodified, and list them all as Invariant 21885 Sections of your combined work in its license notice. 21886 21887 The combined work need only contain one copy of this License, 21888 and multiple identical Invariant Sections may be replaced with 21889 a single copy. If there are multiple Invariant Sections with 21890 the same name but different contents, make the title of each 21891 such section unique by adding at the end of it, in 21892 parentheses, the name of the original author or publisher of 21893 that section if known, or else a unique number. Make the same 21894 adjustment to the section titles in the list of Invariant 21895 Sections in the license notice of the combined work. 21896 21897 In the combination, you must combine any sections entitled 21898 "History" in the various original documents, forming one 21899 section entitled "History"; likewise combine any sections 21900 entitled "Acknowledgements", and any sections entitled 21901 "Dedications". You must delete all sections entitled 21902 "Endorsements." 21903 _________________________________________________________ 21904 21905 A.7. COLLECTIONS OF DOCUMENTS 21906 21907 You may make a collection consisting of the Document and other 21908 documents released under this License, and replace the 21909 individual copies of this License in the various documents 21910 with a single copy that is included in the collection, 21911 provided that you follow the rules of this License for 21912 verbatim copying of each of the documents in all other 21913 respects. 21914 21915 You may extract a single document from such a collection, and 21916 distribute it individually under this License, provided you 21917 insert a copy of this License into the extracted document, and 21918 follow this License in all other respects regarding verbatim 21919 copying of that document. 21920 _________________________________________________________ 21921 21922 A.8. AGGREGATION WITH INDEPENDENT WORKS 21923 21924 A compilation of the Document or its derivatives with other 21925 separate and independent documents or works, in or on a volume 21926 of a storage or distribution medium, does not as a whole count 21927 as a Modified Version of the Document, provided no compilation 21928 copyright is claimed for the compilation. Such a compilation 21929 is called an "aggregate", and this License does not apply to 21930 the other self-contained works thus compiled with the 21931 Document, on account of their being thus compiled, if they are 21932 not themselves derivative works of the Document. 21933 21934 If the Cover Text requirement of section 3 is applicable to 21935 these copies of the Document, then if the Document is less 21936 than one quarter of the entire aggregate, the Document's Cover 21937 Texts may be placed on covers that surround only the Document 21938 within the aggregate. Otherwise they must appear on covers 21939 around the whole aggregate. 21940 _________________________________________________________ 21941 21942 A.9. TRANSLATION 21943 21944 Translation is considered a kind of modification, so you may 21945 distribute translations of the Document under the terms of 21946 section 4. Replacing Invariant Sections with translations 21947 requires special permission from their copyright holders, but 21948 you may include translations of some or all Invariant Sections 21949 in addition to the original versions of these Invariant 21950 Sections. You may include a translation of this License 21951 provided that you also include the original English version of 21952 this License. In case of a disagreement between the 21953 translation and the original English version of this License, 21954 the original English version will prevail. 21955 _________________________________________________________ 21956 21957 A.10. TERMINATION 21958 21959 You may not copy, modify, sublicense, or distribute the 21960 Document except as expressly provided for under this License. 21961 Any other attempt to copy, modify, sublicense or distribute 21962 the Document is void, and will automatically terminate your 21963 rights under this License. However, parties who have received 21964 copies, or rights, from you under this License will not have 21965 their licenses terminated so long as such parties remain in 21966 full compliance. 21967 _________________________________________________________ 21968 21969 A.11. FUTURE REVISIONS OF THIS LICENSE 21970 21971 The Free Software Foundation may publish new, revised versions 21972 of the GNU Free Documentation License from time to time. Such 21973 new versions will be similar in spirit to the present version, 21974 but may differ in detail to address new problems or concerns. 21975 See http://www.gnu.org/copyleft/. 21976 21977 Each version of the License is given a distinguishing version 21978 number. If the Document specifies that a particular numbered 21979 version of this License "or any later version" applies to it, 21980 you have the option of following the terms and conditions 21981 either of that specified version or of any later version that 21982 has been published (not as a draft) by the Free Software 21983 Foundation. If the Document does not specify a version number 21984 of this License, you may choose any version ever published 21985 (not as a draft) by the Free Software Foundation. 21986 _________________________________________________________ 21987 21988 A.12. How to use this License for your documents 21989 21990 To use this License in a document you have written, include a 21991 copy of the License in the document and put the following 21992 copyright and license notices just after the title page: 21993 21994 Copyright (c) YEAR YOUR NAME. Permission is granted to 21995 copy, distribute and/or modify this document under the 21996 terms of the GNU Free Documentation License, Version 1.1 or 21997 any later version published by the Free Software 21998 Foundation; with the Invariant Sections being LIST THEIR 21999 TITLES, with the Front-Cover Texts being LIST, and with the 22000 Back-Cover Texts being LIST. A copy of the license is 22001 included in the section entitled "GNU Free Documentation 22002 License". 22003 22004 If you have no Invariant Sections, write "with no Invariant 22005 Sections" instead of saying which ones are invariant. If you 22006 have no Front-Cover Texts, write "no Front-Cover Texts" 22007 instead of "Front-Cover Texts being LIST"; likewise for 22008 Back-Cover Texts. 22009 22010 If your document contains nontrivial examples of program code, 22011 we recommend releasing these examples in parallel under your 22012 choice of free software license, such as the GNU General 22013 Public License, to permit their use in free software. 22014 22015 Notes 22016 22017 [1] 22018 22019 Future versions of this specification might define additional 22020 service names. 22021 [2] 22022 22023 Supplying an RPM format package is encouraged because it makes 22024 systems easier to manage. A future version of the LSB may 22025 require RPM, or specify a way for an installer to update a 22026 package database. 22027 22028 Applications are also encouraged to uninstall cleanly. 22029 [3] 22030 22031 The distribution itself may use a different packaging format 22032 for its own packages, and of course it may use any available 22033 mechanism for installing the LSB-conformant packages. 22034 [4] 22035 22036 For example, there are discrepancies among distributions 22037 concerning whether the name might be 22038 frobnicator-1.7-21-ppc32.rpm or 22039 frobnicator-1.7-21-powerpc32.rpm. The architecture aside, 22040 recommended practice is for the filename of the package file 22041 to match the name within the package. 22042 [5] 22043 22044 For example, if the name with the release and version is 22045 frobnicator-1.7-21, the name part is frobnicator and falls 22046 under the rules for a name with no hyphens. 22047 [6] 22048 22049 For example, "frobnicator". 22050 [7] 22051 22052 For example, ssh-common, ssh-client, kernel-pcmcia, and the 22053 like. Possible alternative names include sshcommon, 22054 foolinux-ssh-common (where foolinux is registered to the 22055 distribution), or lsb-foolinux-ssh-common. 22056 [8] 22057 22058 For example, if an application vendor has domain name 22059 visicalc.example.com and has registered visicalc as a provider 22060 name, they might name packages visicalc-base, 22061 visicalc.example.com-charting, and the like.