1 2 Linux Standard Base Core Specification 3.0Preview1 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 7. Relationship To ISO/IEC 9945 POSIX 73 74 List of Tables 75 2-1. Normative References 76 3-1. Standard Library Names 77 3-2. Standard Library Names defined in the Architecture 78 Specific Supplement 79 _________________________________________________________ 80 81 Foreword 82 83 This is version 3.0Preview1 of the Linux Standard Base Core 84 Specification. An implementation of this version of the 85 specification may not claim to be an implementation of the 86 Linux Standard Base unless it has successfully completed the 87 compliance process as defined by the Free Standards Group. 88 _________________________________________________________ 89 90 Introduction 91 92 The LSB defines a binary interface for application programs 93 that are compiled and packaged for LSB-conforming 94 implementations on many different hardware architectures. 95 Since a binary specification shall include information 96 specific to the computer processor architecture for which it 97 is intended, it is not possible for a single document to 98 specify the interface for all possible LSB-conforming 99 implementations. Therefore, the LSB is a family of 100 specifications, rather than a single one. 101 102 This document should be used in conjunction with the documents 103 it references. This document enumerates the system components 104 it includes, but descriptions of those components may be 105 included entirely or partly in this document, partly in other 106 documents, or entirely in other reference documents. For 107 example, the section that describes system service routines 108 includes a list of the system routines supported in this 109 interface, formal declarations of the data structures they use 110 that are visible to applications, and a pointer to the 111 underlying referenced specification for information about the 112 syntax and semantics of each call. Only those routines not 113 described in standards referenced by this document, or 114 extensions to those standards, are described in the detail. 115 Information referenced in this way is as much a part of this 116 document as is the information explicitly included here. 117 118 The specification carries a version number of either the form 119 x.y or x.y.z. This version number carries the following 120 meaning: 121 122 * The first number (x) is the major version number. All 123 versions with the same major version number should share 124 binary compatibility. Any addition or deletion of a new 125 library results in a new version number. Interfaces marked 126 as deprecated may be removed from the specification at a 127 major version change. 128 * The second number (y) is the minor version number. 129 Individual interfaces may be added if all certified 130 implementations already had that (previously undocumented) 131 interface. Interfaces may be marked as deprecated at a 132 minor version change. Other minor changes may be permitted 133 at the discretion of the LSB workgroup. 134 * The third number (z), if present, is the editorial level. 135 Only editorial changes should be included in such 136 versions. 137 138 I. Introductory Elements 139 140 Table of Contents 141 1. Scope 142 2. Normative References 143 3. Requirements 144 4. Definitions 145 5. Terminology 146 6. Documentation Conventions 147 7. Relationship To ISO/IEC 9945 POSIX 148 _________________________________________________________ 149 150 Chapter 1. Scope 151 152 1.1. General 153 154 The Linux Standard Base (LSB) defines a system interface for 155 compiled applications and a minimal environment for support of 156 installation scripts. Its purpose is to enable a uniform 157 industry standard environment for high-volume applications 158 conforming to the LSB. 159 160 These specifications are composed of two basic parts: A common 161 specification ("LSB-generic") describing those parts of the 162 interface that remain constant across all implementations of 163 the LSB, and an architecture-specific specification 164 ("LSB-arch") describing the parts of the interface that vary 165 by processor architecture. Together, the LSB-generic and the 166 architecture-specific supplement for a single hardware 167 architecture provide a complete interface specification for 168 compiled application programs on systems that share a common 169 hardware architecture. 170 171 The LSB-generic document shall be used in conjunction with an 172 architecture-specific supplement. Whenever a section of the 173 LSB-generic specification shall be supplemented by 174 architecture-specific information, the LSB-generic document 175 includes a reference to the architecture supplement. 176 Architecture supplements may also contain additional 177 information that is not referenced in the LSB-generic 178 document. 179 180 The LSB contains both a set of Application Program Interfaces 181 (APIs) and Application Binary Interfaces (ABIs). APIs may 182 appear in the source code of portable applications, while the 183 compiled binary of that application may use the larger set of 184 ABIs. A conforming implementation shall provide all of the 185 ABIs listed here. The compilation system may replace (e.g. by 186 macro definition) certain APIs with calls to one or more of 187 the underlying binary interfaces, and may insert calls to 188 binary interfaces as needed. 189 190 The LSB is primarily a binary interface definition. Not all of 191 the source level APIs available to applications may be 192 contained in this specification. 193 _________________________________________________________ 194 195 1.2. Module Specific Scope 196 197 This is the Core module of the Linux Standards Base (LSB). 198 This module provides the fundamental system interfaces, 199 libraries, and runtime environment upon which all conforming 200 applications and libraries depend. 201 202 Interfaces described in this module are mandatory except where 203 explicitly listed otherwise. Core interfaces may be 204 supplemented by other modules; all modules are built upon the 205 core. 206 _________________________________________________________ 207 208 Chapter 2. Normative References 209 210 The specifications listed below are referenced in whole or in 211 part by the Linux Standard Base. In this specification, where 212 only a particular section of one of these references is 213 identified, then the normative reference is to that section 214 alone, and the rest of the referenced document is informative. 215 216 Table 2-1. Normative References 217 Name Title URL 218 DWARF Debugging Information Format DWARF Debugging Information 219 Format, Revision 2.0.0 (July 27, 1993) 220 http://www.eagercon.com/dwarf/dwarf-2.0.0.pdf 221 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 222 (FHS) 2.3 http://www.pathname.com/fhs/ 223 Gdk 2.6.2 Reference Manual Gdk 2.6.2 Reference Manual 224 http://www.gtk.org/api/2.6/gdk/index.html 225 Gdk-pixbuf 2.6.2 Reference Manual Gdk-pixbuf 2.6.2 Reference 226 Manual http://www.gtk.org/api/2.6/gdk-pixbuf/index.html 227 Glib 2.6.2 Reference Manual Glib 2.6.2 Reference Manual 228 http://www.gtk.org/api/2.6/glib/index.html 229 Gobject 2.6.2 Reference Manual Gobject 2.6.2 Reference Manual 230 http://www.gtk.org/api/2.6/gobject/index.html 231 Gtk 2.6.2 Reference Manual Gtk 2.6.2 Reference Manual 232 http://www.gtk.org/api/2.6/gtk/index.html 233 IEEE Std 754-1985 IEEE Standard 754 for Binary Floating-Point 234 Arithmetic http://www.ieee.org/ 235 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 236 ISO POSIX (2003) 237 238 ISO/IEC 9945-1:2003 Information technology -- Portable 239 Operating System Interface (POSIX) -- Part 1: Base Definitions 240 241 ISO/IEC 9945-2:2003 Information technology -- Portable 242 Operating System Interface (POSIX) -- Part 2: System 243 Interfaces 244 245 ISO/IEC 9945-3:2003 Information technology -- Portable 246 Operating System Interface (POSIX) -- Part 3: Shell and 247 Utilities 248 249 ISO/IEC 9945-4:2003 Information technology -- Portable 250 Operating System Interface (POSIX) -- Part 4: Rationale 251 252 Including Technical Cor. 1: 2004 253 http://www.unix.org/version3/ 254 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 255 Specification method for cultural conventions 256 ITU-T V.42 International Telecommunication Union 257 Recommendation V.42 (2002): Error-correcting procedures for 258 DCEs using asynchronous-to-synchronous conversionITUV 259 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e& 260 parent=T-REC-V.42 261 Large File Support Large File Support 262 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 263 Li18nux Globalization Specification LI18NUX 2000 Globalization 264 Specification, Version 1.0 with Amendment 4 265 http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm 266 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 267 http://www.lanana.org/docs/device-list/devices.txt 268 PAM Open Software Foundation, Request For Comments: 86.0 , 269 October 1995, V. Samar & R.Schemers (SunSoft) 270 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 271 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 272 MD5 Message-Digest Algorithm 273 http://www.ietf.org/rfc/rfc1321.txt 274 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 275 1833: Binding Protocols for ONC RPC Version 2 276 http://www.ietf.org/rfc/rfc1833.txt 277 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 278 1950: ZLIB Compressed Data Format Specification 279 http://www.ietf.org/rfc/rfc1950.txt 280 RFC 1951: DEFLATE Compressed Data Format Specification IETF 281 RFC 1951: DEFLATE Compressed Data Format Specification version 282 1.3 http://www.ietf.org/rfc/rfc1951.txt 283 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 284 file format specification version 4.3 285 http://www.ietf.org/rfc/rfc1952.txt 286 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP 287 Message Format http://www.ietf.org/rfc/rfc2440.txt 288 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 289 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 290 RFC 2822:Internet Message Format IETF RFC 2822: Internet 291 Message Format http://www.ietf.org/rfc/rfc2822.txt 292 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 293 Specification http://www.ietf.org/rfc/rfc791.txt 294 SUSv2 CAE Specification, January 1997, System Interfaces and 295 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 296 http://www.opengroup.org/publications/catalog/un.htm 297 SUSv2 Commands and Utilities The Single UNIX® 298 Specification(SUS) Version 2, Commands and Utilities (XCU), 299 Issue 5 (ISBN: 1-85912-191-8, C604) 300 http://www.opengroup.org/publications/catalog/un.htm 301 SVID Issue 3 American Telephone and Telegraph Company, System 302 V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 303 1989.(ISBN 0201566524) 304 SVID Issue 4 System V Interface Definition,Fourth Edition 305 System V ABI System V Application Binary Interface, Edition 306 4.1 http://www.caldera.com/developers/devspecs/gabi41.pdf 307 System V ABI Update System V Application Binary Interface - 308 DRAFT - 17 December 2003 309 http://www.caldera.com/developers/gabi/2003-12-17/contents.htm 310 l 311 this specification Linux Standard Base 312 http://www.linuxbase.org/spec/ 313 X/Open Curses CAE Specification, May 1996, X/Open Curses, 314 Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus 315 Corrigendum U018 316 http://www.opengroup.org/publications/catalog/un.htm 317 _________________________________________________________ 318 319 Chapter 3. Requirements 320 321 3.1. Relevant Libraries 322 323 The libraries listed in Table 3-1 shall be available on a 324 Linux Standard Base system, with the specified runtime names. 325 The libraries listed in Table 3-2 are architecture specific, 326 but shall be available on all LSB conforming systems. This 327 list may be supplemented or amended by the 328 architecture-specific specification. 329 330 Table 3-1. Standard Library Names 331 Library Runtime Name 332 libdl libdl.so.2 333 libcrypt libcrypt.so.1 334 libz libz.so.1 335 libncurses libncurses.so.5 336 libutil libutil.so.1 337 libpthread libpthread.so.0 338 libpam libpam.so.0 339 libgcc_s libgcc_s.so.1 340 341 Table 3-2. Standard Library Names defined in the Architecture 342 Specific Supplement 343 Library Runtime Name 344 libm See archLSB 345 libc See archLSB 346 proginterp See archLSB 347 348 These libraries will be in an implementation-defined directory 349 which the dynamic linker shall search by default. 350 _________________________________________________________ 351 352 3.2. LSB Implementation Conformance 353 354 A conforming implementation shall satisfy the following 355 requirements: 356 357 * The implementation shall implement fully the architecture 358 described in the hardware manual for the target processor 359 architecture. 360 * The implementation shall be capable of executing compiled 361 applications having the format and using the system 362 interfaces described in this document. 363 * The implementation shall provide libraries containing the 364 interfaces specified by this document, and shall provide a 365 dynamic linking mechanism that allows these interfaces to 366 be attached to applications at runtime. All the interfaces 367 shall behave as specified in this document. 368 * The map of virtual memory provided by the implementation 369 shall conform to the requirements of this document. 370 * The implementation's low-level behavior with respect to 371 function call linkage, system traps, signals, and other 372 such activities shall conform to the formats described in 373 this document. 374 * The implementation shall provide all of the mandatory 375 interfaces in their entirety. 376 * The implementation may provide one or more of the optional 377 interfaces. Each optional interface that is provided shall 378 be provided in its entirety. The product documentation 379 shall state which optional interfaces are provided. 380 * The implementation shall provide all files and utilities 381 specified as part of this document in the format defined 382 here and in other referenced documents. All commands and 383 utilities shall behave as required by this document. The 384 implementation shall also provide all mandatory components 385 of an application's runtime environment that are included 386 or referenced in this document. 387 * The implementation, when provided with standard data 388 formats and values at a named interface, shall provide the 389 behavior defined for those values and data formats at that 390 interface. However, a conforming implementation may 391 consist of components which are separately packaged and/or 392 sold. For example, a vendor of a conforming implementation 393 might sell the hardware, operating system, and windowing 394 system as separately packaged items. 395 * The implementation may provide additional interfaces with 396 different names. It may also provide additional behavior 397 corresponding to data values outside the standard ranges, 398 for standard named interfaces. 399 _________________________________________________________ 400 401 3.3. LSB Application Conformance 402 403 A conforming application shall satisfy the following 404 requirements: 405 406 * Its executable files are either shell scripts or object 407 files in the format defined for the Object File Format 408 system interface. 409 * Its object files participate in dynamic linking as defined 410 in the Program Loading and Linking System interface. 411 * It employs only the instructions, traps, and other 412 low-level facilities defined in the Low-Level System 413 interface as being for use by applications. 414 * If it requires any optional interface defined in this 415 document in order to be installed or to execute 416 successfully, the requirement for that optional interface 417 is stated in the application's documentation. 418 * It does not use any interface or data format that is not 419 required to be provided by a conforming implementation, 420 unless: 421 + If such an interface or data format is supplied by 422 another application through direct invocation of that 423 application during execution, that application is in 424 turn an LSB conforming application. 425 + The use of that interface or data format, as well as 426 its source, is identified in the documentation of the 427 application. 428 * It shall not use any values for a named interface that are 429 reserved for vendor extensions. 430 431 A strictly conforming application does not require or use any 432 interface, facility, or implementation-defined extension that 433 is not defined in this document in order to be installed or to 434 execute successfully. 435 _________________________________________________________ 436 437 Chapter 4. Definitions 438 439 For the purposes of this document, the following definitions, 440 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 441 Edition, apply: 442 443 can 444 be able to; there is a possibility of; it is possible 445 to 446 447 cannot 448 be unable to; there is no possibilty of; it is not 449 possible to 450 451 may 452 is permitted; is allowed; is permissible 453 454 need not 455 it is not required that; no...is required 456 457 shall 458 is to; is required to; it is required that; has to; 459 only...is permitted; it is necessary 460 461 shall not 462 is not allowed [permitted] [acceptable] [permissible]; 463 is required to be not; is required that...be not; is 464 not to be 465 466 should 467 it is recommended that; ought to 468 469 should not 470 it is not recommended that; ought not to 471 _________________________________________________________ 472 473 Chapter 5. Terminology 474 475 For the purposes of this document, the following terms apply: 476 477 archLSB 478 The architectural part of the LSB Specification which 479 describes the specific parts of the interface that are 480 platform specific. The archLSB is complementary to the 481 gLSB. 482 483 Binary Standard 484 The total set of interfaces that are available to be 485 used in the compiled binary code of a conforming 486 application. 487 488 gLSB 489 The common part of the LSB Specification that describes 490 those parts of the interface that remain constant 491 across all hardware implementations of the LSB. 492 493 implementation-defined 494 Describes a value or behavior that is not defined by 495 this document but is selected by an implementor. The 496 value or behavior may vary among implementations that 497 conform to this document. An application should not 498 rely on the existence of the value or behavior. An 499 application that relies on such a value or behavior 500 cannot be assured to be portable across conforming 501 implementations. The implementor shall document such a 502 value or behavior so that it can be used correctly by 503 an application. 504 505 Shell Script 506 A file that is read by an interpreter (e.g., awk). The 507 first line of the shell script includes a reference to 508 its interpreter binary. 509 510 Source Standard 511 The set of interfaces that are available to be used in 512 the source code of a conforming application. 513 514 undefined 515 Describes the nature of a value or behavior not defined 516 by this document which results from use of an invalid 517 program construct or invalid data input. The value or 518 behavior may vary among implementations that conform to 519 this document. An application should not rely on the 520 existence or validity of the value or behavior. An 521 application that relies on any particular value or 522 behavior cannot be assured to be portable across 523 conforming implementations. 524 525 unspecified 526 Describes the nature of a value or behavior not 527 specified by this document which results from use of a 528 valid program construct or valid data input. The value 529 or behavior may vary among implementations that conform 530 to this document. An application should not rely on the 531 existence or validity of the value or behavior. An 532 application that relies on any particular value or 533 behavior cannot be assured to be portable across 534 conforming implementations. 535 536 Other terms and definitions used in this document shall have 537 the same meaning as defined in Chapter 3 of the Base 538 Definitions volume of ISO POSIX (2003). 539 _________________________________________________________ 540 541 Chapter 6. Documentation Conventions 542 543 Throughout this document, the following typographic 544 conventions are used: 545 546 function() 547 the name of a function 548 549 command 550 the name of a command or utility 551 552 CONSTANT 553 a constant value 554 555 parameter 556 a parameter 557 558 variable 559 a variable 560 561 Throughout this specification, several tables of interfaces 562 are presented. Each entry in these tables has the following 563 format: 564 565 name 566 the name of the interface 567 568 (symver) 569 An optional symbol version identifier, if required. 570 571 [refno] 572 A reference number indexing the table of referenced 573 specifications that follows this table. 574 575 For example, 576 577 forkpty(GLIBC_2.0) [1] 578 579 refers to the interface named forkpty() with symbol version 580 GLIBC_2.0 that is defined in the first of the listed 581 references below the table. 582 _________________________________________________________ 583 584 Chapter 7. Relationship To ISO/IEC 9945 POSIX 585 586 This specification includes many interfaces described in ISO 587 POSIX (2003). Unless otherwise specified, such interfaces 588 should behave exactly as described in that specification. Any 589 conflict between the requirements described here and the ISO 590 POSIX (2003) standard is unintentional, except as explicitly 591 noted otherwise. 592 593 Note: In addition to the differences noted inline in this 594 specification, PDTR 24715 has extracted the differences 595 between this specification and ISO POSIX (2003) into a 596 single place. It is the long term plan of the LSB to 597 converge with ISO/IEC 9945 POSIX. 598 599 The LSB Specification Authority is responsible for deciding 600 the meaning of conformance to normative referenced standards 601 in the LSB context. Problem Reports regarding underlying or 602 referenced standards in any other context will be referred to 603 the relevant maintenance body for that standard. 604 605 ELF Specification 606 _________________________________________________________ 607 608 Table of Contents 609 I. Low Level System Information 610 611 1. Operating System Interface 612 2. Machine Interface 613 614 2.1. Data Representation 615 616 II. Object Format 617 618 3. Object Files 619 4. Sections 620 621 4.1. Introduction 622 4.2. Sections Types 623 624 5. Special Sections 625 626 5.1. Special Sections 627 628 6. Symbol Mapping 629 630 6.1. Introduction 631 6.2. Symbol Mapping 632 633 7. DWARF Extensions 634 8. EH Frame 635 9. EH Frame Header 636 637 9.1. Introduction 638 9.2. DWARF Exception Header Encoding 639 640 10. Symbol Versioning 641 642 10.1. Introduction 643 10.2. Symbol Version Table 644 10.3. Version Definitions 645 10.4. Version Requirements 646 10.5. Startup Sequence 647 10.6. Symbol Resolution 648 649 11. ABI note tag 650 651 III. Dynamic Linking 652 653 12. Program Loading and Dynamic Linking 654 13. Program Header 655 14. Dynamic Entries 656 657 14.1. Introduction 658 14.2. Dynamic Entries 659 660 List of Figures 661 10-1. Version Definition Entries 662 10-2. Version Definition Auxiliary Entries 663 10-3. Version Needed Entries 664 10-4. Version Needed Auxiliary Entries 665 14-1. Dynamic Structure 666 667 List of Tables 668 2-1. Scalar Types 669 4-1. ELF Section Types 670 4-2. Additional Section Types 671 5-1. ELF Special Sections 672 5-2. Additional Special Sections 673 7-1. Additional DWARF Call Frame Instructions 674 9-1. .eh_frame_hdr Section Format 675 9-2. DWARF Exception Header value format 676 9-3. DWARF Exception Header application 677 13-1. Linux Segment Types 678 679 I. Low Level System Information 680 681 Table of Contents 682 1. Operating System Interface 683 2. Machine Interface 684 _________________________________________________________ 685 686 Chapter 1. Operating System Interface 687 688 LSB-conforming applications shall assume that stack, heap and 689 other allocated memory regions will be non-executable. The 690 application must take steps to make them executable if needed. 691 _________________________________________________________ 692 693 Chapter 2. Machine Interface 694 695 2.1. Data Representation 696 697 LSB-conforming applications shall use the data representation 698 as defined in the Arcitecture specific ELF documents. 699 _________________________________________________________ 700 701 2.1.1. Fundamental Types 702 703 In addition to the fundamental types specified in the 704 Architecture specific ELF documents, a 1 byte data type is 705 defined here. 706 707 Table 2-1. Scalar Types 708 Type C C++ sizeof Alignment (bytes) Architecture 709 Representation 710 Integral _Bool bool 1 1 byte 711 712 II. Object Format 713 714 Table of Contents 715 3. Object Files 716 4. Sections 717 5. Special Sections 718 6. Symbol Mapping 719 7. DWARF Extensions 720 8. EH Frame 721 9. EH Frame Header 722 10. Symbol Versioning 723 11. ABI note tag 724 _________________________________________________________ 725 726 Chapter 3. Object Files 727 728 LSB-conforming implementations shall support the object file 729 Executable and Linking Format (ELF), which is defined by the 730 following documents: 731 732 * System V ABI 733 * System V ABI Update 734 * this document 735 * an architecture-specific LSB specification 736 737 Conforming implementations may also support other unspecified 738 object file formats. 739 _________________________________________________________ 740 741 Chapter 4. Sections 742 743 4.1. Introduction 744 745 As described in System V ABI, an ELF object file contains a 746 number of sections. 747 _________________________________________________________ 748 749 4.2. Sections Types 750 751 The section header table is an array of Elf32_Shdr or 752 Elf64_Shdr structures as described in System V ABI. The 753 sh_type member shall be either a value from Table 4-1, drawn 754 from the System V ABI, or one of the additional values 755 specified in Table 4-2. 756 757 A section header's sh_type member specifies the sections's 758 semantics. 759 _________________________________________________________ 760 761 4.2.1. ELF Section Types 762 763 The following section types are defined in the System V ABI 764 and the System V ABI Update. 765 766 Table 4-1. ELF Section Types 767 Name Value Description 768 SHT_DYNAMIC 0x6 The section holds information for dynamic 769 linking. Currently, an object file shall have only one dynamic 770 section, but this restriction may be relaxed in the future. 771 See `Dynamic Section' in Chapter 5 for details. 772 SHT_DYNSYM 0xb This section holds a minimal set of symbols 773 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 774 an object file may have either a section of SHT_SYMTAB type or 775 a section of SHT_DYNSYM type, but not both. This restriction 776 may be relaxed in the future. 777 SHT_FINI_ARRAY 0xf This section contains an array of pointers 778 to termination functions, as described in `Initialization and 779 Termination Functions' in Chapter 5. Each pointer in the array 780 is taken as a parameterless procedure with a void return. 781 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 782 an object file shall have only one hash table, but this 783 restriction may be relaxed in the future. See `Hash Table' in 784 the Chapter 5 for details. 785 SHT_HIPROC 0x7fffffff Values in this inclusive range are 786 reserved for processor-specific semantics. 787 SHT_HIUSER 0xffffffff This value specifies the upper bound of 788 the range of indexes reserved for application programs. 789 Section types between SHT_LOUSER and SHT_HIUSER can be used by 790 the application, without conflicting with current or future 791 system-defined section types. 792 SHT_INIT_ARRAY 0xe This section contains an array of pointers 793 to initialization functions, as described in `Initialization 794 and Termination Functions' in Chapter 5. Each pointer in the 795 array is taken as a parameterless procedure with a void 796 return. 797 SHT_LOPROC 0x70000000 Values in this inclusive range are 798 reserved for processor-specific semantics. 799 SHT_LOUSER 0x80000000 This value specifies the lower bound of 800 the range of indexes reserved for application programs. 801 SHT_NOBITS 0x8 A section of this type occupies no space in the 802 file but otherwise resembles SHT_PROGBITS. Although this 803 section contains no bytes, the sh_offset member contains the 804 conceptual file offset. 805 SHT_NOTE 0x7 The section holds information that marks the file 806 in some way. See `Note Section' in Chapter 5 for details. 807 SHT_NULL 0x0 This value marks the section header as inactive; 808 it does not have an associated section. Other members of the 809 section header have undefined values. 810 SHT_PREINIT_ARRAY 0x10 This section contains an array of 811 pointers to functions that are invoked before all other 812 initialization functions, as described in `Initialization and 813 Termination Functions' in Chapter 5. Each pointer in the array 814 is taken as a parameterless proceure with a void return. 815 SHT_PROGBITS 0x1 The section holds information defined by the 816 program, whose format and meaning are determined solely by the 817 program. 818 SHT_REL 0x9 The section holds relocation entries without 819 explicit addends, such as type Elf32_Rel for the 32-bit class 820 of object files or type Elf64_Rel for the 64-bit class of 821 object files. An object file may have multiple relocation 822 sections. See "Relocation" 823 SHT_RELA 0x4 The section holds relocation entries with 824 explicit addends, such as type Elf32_Rela for the 32-bit class 825 of object files or type Elf64_Rela for the 64-bit class of 826 object files. An object file may have multiple relocation 827 sections. `Relocation' b 828 SHT_SHLIB 0xa This section type is reserved but has 829 unspecified semantics. 830 SHT_STRTAB 0x3 The section holds a string table. An object 831 file may have multiple string table sections. See `String 832 Table' below for details. 833 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, 834 an object file may have either a section of SHT_SYMTAB type or 835 a section of SHT_DYNSYM type, but not both. This restriction 836 may be relaxed in the future. Typically, SHT_SYMTAB provides 837 symbols for link editing, though it may also be used for 838 dynamic linking. As a complete symbol table, it may contain 839 many symbols unnecessary for dynamic linking. 840 _________________________________________________________ 841 842 4.2.2. Additional Section Types 843 844 The following additional section types are defined here. 845 846 Table 4-2. Additional Section Types 847 Name Value Description 848 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 849 versions that are provided. 850 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 851 versions that are required. 852 SHT_GNU_versym 0x6fffffff This section contains the Symbol 853 Version Table. 854 _________________________________________________________ 855 856 Chapter 5. Special Sections 857 858 5.1. Special Sections 859 860 Various sections hold program and control information. 861 Sections in the lists below are used by the system and have 862 the indicated types and attributes. 863 _________________________________________________________ 864 865 5.1.1. ELF Special Sections 866 867 The following sections are defined in the System V ABI and the 868 System V ABI Update. 869 870 Table 5-1. ELF Special Sections 871 Name Type Attributes 872 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 873 .comment SHT_PROGBITS 0 874 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 875 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 876 .debug SHT_PROGBITS 0 877 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 878 .dynstr SHT_STRTAB SHF_ALLOC 879 .dynsym SHT_DYNSYM SHF_ALLOC 880 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 881 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 882 .hash SHT_HASH SHF_ALLOC 883 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 884 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 885 .interp SHT_PROGBITS SHF_ALLOC 886 .line SHT_PROGBITS 0 887 .note SHT_NOTE 0 888 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 889 .rodata SHT_PROGBITS SHF_ALLOC 890 .rodata1 SHT_PROGBITS SHF_ALLOC 891 .shstrtab SHT_STRTAB 0 892 .strtab SHT_STRTAB SHF_ALLOC 893 .symtab SHT_SYMTAB SHF_ALLOC 894 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 895 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 896 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 897 898 .bss 899 This section holds data that contributes to the 900 program's memory image. The program may treat this data 901 as uninitialized. However, the system shall initialize 902 this data with zeroes when the program begins to run. 903 The section occupies no file space, as indicated by the 904 section type, SHT_NOBITS 905 906 .comment 907 This section holds version control information. 908 909 .data 910 This section holds initialized data that contribute to 911 the program's memory image. 912 913 .data1 914 This section holds initialized data that contribute to 915 the program's memory image. 916 917 .debug 918 This section holds information for symbolic debugging. 919 The contents are unspecified. All section names with 920 the prefix .debug hold information for symbolic 921 debugging. The contents of these sections are 922 unspecified. 923 924 .dynamic 925 This section holds dynamic linking information. The 926 section's attributes will include the SHF_ALLOC bit. 927 Whether the SHF_WRITE bit is set is processor specific. 928 See Chapter 5 for more information. 929 930 .dynstr 931 This section holds strings needed for dynamic linking, 932 most commonly the strings that represent the names 933 associated with symbol table entries. See Chapter 5 for 934 more information. 935 936 .dynsym 937 This section holds the dynamic linking symbol table, as 938 described in `Symbol Table'. See Chapter 5 for more 939 information. 940 941 .fini 942 This section holds executable instructions that 943 contribute to the process termination code. That is, 944 when a program exits normally, the system arranges to 945 execute the code in this section. 946 947 .fini_array 948 This section holds an array of function pointers that 949 contributes to a single termination array for the 950 executable or shared object containing the section. 951 952 .hash 953 This section holds a symbol hash table. See `Hash 954 Table' in Chapter 5 for more information. 955 956 .init 957 This section holds executable instructions that 958 contribute to the process initialization code. When a 959 program starts to run, the system arranges to execute 960 the code in this section before calling the main 961 program entry point (called main for C programs) 962 963 .init_array 964 This section holds an array of function pointers that 965 contributes to a single initialization array for the 966 executable or shared object containing the section. 967 968 .interp 969 This section holds the path name of a program 970 interpreter. If the file has a loadable segment that 971 includes relocation, the sections' attributes will 972 include the SHF_ALLOC bit; otherwise, that bit will be 973 off. See Chapter 5 for more information. 974 975 .line 976 This section holds line number information for symbolic 977 debugging, which describes the correspondence between 978 the source program and the machine code. The contents 979 are unspecified. 980 981 .note 982 This section holds information in the format that `Note 983 Section' in Chapter 5 describes of the System V 984 Application Binary Interface, Edition 4.1. 985 986 .preinit_array 987 This section holds an array of function pointers that 988 contributes to a single pre-initialization array for 989 the executable or shared object containing the section. 990 991 .rodata 992 This section holds read-only data that typically 993 contribute to a non-writable segment in the process 994 image. See `Program Header' in Chapter 5 for more 995 information. 996 997 .rodata1 998 This section hold sread-only data that typically 999 contribute to a non-writable segment in the process 1000 image. See `Program Header' in Chapter 5 for more 1001 information. 1002 1003 .shstrtab 1004 This section holds section names. 1005 1006 .strtab 1007 This section holds strings, most commonly the strings 1008 that represent the names associated with symbol table 1009 entries. If the file has a loadable segment that 1010 includes the symbol string table, the section's 1011 attributes will include the SHF_ALLOC bit; otherwi 1012 1013 .symtab 1014 This section holds a symbol table, as `Symbol Table'. 1015 in this chapter describes. If the file has a loadable 1016 segment that includes the symbol table, the section's 1017 attributes will include the SHF_ALLOC bit; otherwise, 1018 that bit will be off. 1019 1020 .tbss 1021 This section holds uninitialized thread-local data that 1022 contribute to the program's memory image. By 1023 definition, the system initializes the data with zeros 1024 when the data is instantiated for each new execution 1025 flow. The section occupies no file space, as indicated 1026 by the section type, SHT_NOBITS. Implementations need 1027 not support thread-local storage. 1028 1029 .tdata 1030 This section holds initialized thread-local data that 1031 contributes to the program's memory image. A copy of 1032 its contents is instantiated by the system for each new 1033 execution flow. Implementations need not support 1034 thread-local storage. 1035 1036 .text 1037 This section holds the `text,' or executable 1038 instructions, of a program. 1039 _________________________________________________________ 1040 1041 5.1.2. Additional Special Sections 1042 1043 Object files in an LSB conforming application may also contain 1044 one or more of the additional special sections described 1045 below. 1046 1047 Table 5-2. Additional Special Sections 1048 Name Type Attributes 1049 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1050 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1051 .eh_frame SHT_PROGBITS SHF_ALLOC 1052 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1053 .gnu.version SHT_GNU_versym SHF_ALLOC 1054 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1055 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1056 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1057 .note.ABI-tag SHT_NOTE SHF_ALLOC 1058 .stab SHT_PROGBITS 0 1059 .stabstr SHT_STRTAB 0 1060 1061 .ctors 1062 This section contains a list of global constructor 1063 function pointers. 1064 1065 .dtors 1066 This section contains a list of global destructor 1067 function pointers. 1068 1069 .eh_frame 1070 This section contains information necessary for frame 1071 unwinding during exception handling. 1072 1073 .eh_frame_hdr 1074 This section contains a pointer to the .eh_frame 1075 section which is accessible to the runtime support code 1076 of a C++ application. This section may also contain a 1077 binary search table which may be used by the runtime 1078 support code to more efficiently access records in the 1079 .eh_frame section. 1080 1081 .gnu.version 1082 This section contains the Symbol Version Table. 1083 1084 .gnu.version_d 1085 This section contains the Version Definitions. 1086 1087 .gnu.version_r 1088 This section contains the Version Requirments. 1089 1090 .jcr 1091 This section contains information necessary for 1092 registering compiled Java classes. The contents are 1093 compiler-specific and used by compiler initialization 1094 functions. 1095 1096 .note.ABI-tag 1097 Specify ABI details. 1098 1099 .stab 1100 This section contains debugging information. The 1101 contents are not specified as part of the LSB. 1102 1103 .stabstr 1104 This section contains strings associated with the 1105 debugging infomation contained in the .stab section. 1106 _________________________________________________________ 1107 1108 Chapter 6. Symbol Mapping 1109 1110 6.1. Introduction 1111 1112 This chapter defines how names are mapped from the source 1113 symbol to the object symbol. 1114 _________________________________________________________ 1115 1116 6.2. Symbol Mapping 1117 1118 Symbols in a source program are translated by the compilation 1119 system into symbols that exist in the object file. The rules 1120 for this translation are defined here. 1121 _________________________________________________________ 1122 1123 6.2.1. C Language 1124 1125 External C symbols have the same names in C and object files' 1126 symbol tables. 1127 _________________________________________________________ 1128 1129 Chapter 7. DWARF Extensions 1130 1131 In addition to the Call Frame Instructions defined in section 1132 6.4.2 of DWARF Debugging Information Format, the following 1133 Call Frame Instructions may also be used. 1134 1135 Table 7-1. Additional DWARF Call Frame Instructions 1136 Name Value Meaning 1137 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1138 two operands: an unsigned LEB128 value representing a register 1139 number, and a DW_FORM_block value representing a DWARF 1140 expression. The required action is to establish the DWARF 1141 expression as the means by which the address in which the 1142 given register contents are found may be computed. The value 1143 of the CFA is pushed on the DWARF evaluation stack prior to 1144 execution of the DWARF expression. The DW_OP_call2, 1145 DW_OP_call4, DW_OP_call_ref and DW_OP_push_object_address 1146 DWARF operators (see Section 2.4.1 of DWARF Debugging 1147 Information Format) cannot be used in such a DWARF expression. 1148 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1149 instruction takes two operands: an unsigned LEB128 value 1150 representing a register number and a signed LEB128 factored 1151 offset. This instruction is identical to 1152 DW_CFA_offset_extended except that the second operand is 1153 signed. 1154 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1155 two operands: an unsigned LEB128 value representing a register 1156 number and a signed LEB128 factored offset. This instruction 1157 is identical to DW_CFA_def_cfa except that the second operand 1158 is signed and factored. 1159 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1160 instruction takes a signed LEB128 operand representing a 1161 factored offset. This instruction is identical to 1162 DW_CFA_def_cfa_offset except that the operand is signed and 1163 factored. 1164 DW_CFA_GNU_args_size 0x2e The DW_CFA_def_cfa_offset_sf 1165 instruction takes an unsigned LEB128 operand representing an 1166 argument size. 1167 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1168 instruction takes two operands: an unsigned LEB128 value 1169 representing a register number and an unsigned LEB128 which 1170 represents the magnitude of the offset. This instruction is 1171 identical to DW_CFA_offset_extended_sf except that the operand 1172 is subtracted to produce the offset. This instructions is 1173 obsoleted by DW_CFA_offset_extended_sf. 1174 _________________________________________________________ 1175 1176 Chapter 8. EH Frame 1177 1178 This chapter will contain a formal description of the contents 1179 of the .eh_frame_hdr section. 1180 _________________________________________________________ 1181 1182 Chapter 9. EH Frame Header 1183 1184 9.1. Introduction 1185 1186 The .eh_frame_hdr section contains additional information 1187 about the .eh_frame section. A pointer to the start of the 1188 .eh_frame data, and optionally, a binary search table of 1189 pointers to the .eh_frame records are found in this section. 1190 1191 Data in this section is encoded according to the DWARF 1192 Exception Header Encoding described below. 1193 1194 Table 9-1. .eh_frame_hdr Section Format 1195 Encoding Field 1196 unsigned byte version 1197 unsigned byte eh_frame_ptr_enc 1198 unsigned byte fde_count_enc 1199 unsigned byte table_enc 1200 encoded eh_frame_ptr 1201 encoded fde_count 1202 binary search table 1203 1204 version 1205 Version of the .eh_frame_hdr format. This value shall 1206 be 1. 1207 1208 eh_frame_ptr_enc 1209 The encoding format of the eh_frame_ptr field. 1210 1211 fde_count_enc 1212 The encoding format of the fde_count field. A value of 1213 DW_EH_PE_omit indicates the binary search table is not 1214 present. 1215 1216 table_enc 1217 The encoding format of the entries in the binary search 1218 table. A value of DW_EH_PE_omit indicates the binary 1219 search table is not present. 1220 1221 eh_frame_ptr 1222 The encoded value of the pointer to the start of the 1223 .eh_frame section. 1224 1225 fde_count 1226 The encoded value of the count of entries in the binary 1227 search table. 1228 1229 binary search table 1230 A binary search table containing fde_count entries. 1231 Each entry of the table consist of two encoded values, 1232 the initial location, and the address. The entries are 1233 sorted in an increasing order by the initial location 1234 value. 1235 _________________________________________________________ 1236 1237 9.2. DWARF Exception Header Encoding 1238 1239 The DWARF Exception Header Encoding is used to describe the 1240 type of data used in the .eh_frame_hdr section. The upper 4 1241 bits indicate how the value is to be applied. The lower 4 bits 1242 indicate the format of the data. 1243 1244 Table 9-2. DWARF Exception Header value format 1245 Name Value Meaning 1246 DW_EH_PE_omit 0xff No value is present. 1247 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1248 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1249 Information Format. 1250 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1251 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1252 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1253 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1254 Endian Base 128 (LEB128) as defined by DWARF Debugging 1255 Information Format. 1256 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1257 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1258 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1259 1260 Table 9-3. DWARF Exception Header application 1261 Name Value Meaning 1262 DW_EH_PE_absptr 0x00 Value is used with no modification. 1263 DW_EH_PE_pcrel 0x10 Value is reletive to the current program 1264 counter. 1265 DW_EH_PE_datarel 0x30 Value is reletive to the beginning of 1266 the .eh_frame_hdr section. 1267 DW_EH_PE_omit 0xff No value is present. 1268 _________________________________________________________ 1269 1270 Chapter 10. Symbol Versioning 1271 1272 10.1. Introduction 1273 1274 This chapter describes the Symbol Versioning mechanism. All 1275 ELF objects may provide or depend on versioned symbols. Symbol 1276 Versioning is implemented by 3 section types: SHT_GNU_versym, 1277 SHT_GNU_verdef, and SHT_GNU_verneed. 1278 1279 The prefix Elfxx in the following descriptions and code 1280 fragments stands for either "Elf32" or "Elf64", depending on 1281 the architecture. 1282 1283 Versions are described by strings. The structures that are 1284 used for symbol versions also contain a member that holds the 1285 ELF hashing values of the strings. This allows for more 1286 efficient processing. 1287 _________________________________________________________ 1288 1289 10.2. Symbol Version Table 1290 1291 The special section .gnu.version which has a section type of 1292 SHT_GNU_versym shall contain the Symbol Version Table. This 1293 section shall have the same number of entries as the Dynamic 1294 Symbol Table in the .dynsym section. 1295 1296 The .gnu.version section shall contain an array of elements of 1297 type Elfxx_Half. Each entry specifies the version defined for 1298 or required by the corresponding symbol in the Dynamic Symbol 1299 Table. 1300 1301 The values in the Symbol Version Table are specific to the 1302 object in which they are located. These values are identifiers 1303 that are provided by the the vna_other member of the 1304 Elfxx_Vernaux structure or the vd_ndx member of the 1305 Elfxx_Verdef structure. 1306 1307 The values 0 and 1 are reserved. 1308 1309 0 1310 The symbol is local, not available outside the object. 1311 1312 1 1313 The symbol is defined in this object and is globally 1314 available. 1315 1316 All other values are used to identify version strings located 1317 in one of the other Symbol Version sections. The value itself 1318 is not the version associated with the symbol. The string 1319 identified by the value defines the version of the symbol. 1320 _________________________________________________________ 1321 1322 10.3. Version Definitions 1323 1324 Symbol definitions are contained in the special section 1325 .gnu.version_d which has a section type of SHT_GNU_verdef. The 1326 number of entries in this section is contained in the 1327 DT_VERDEFNUM entry of the Dynamic Section. The sh_link member 1328 of the section header points to the section that contains the 1329 strings referenced by this section. 1330 1331 The special section .gnu.version_d which has a section type of 1332 SHT_GNU_verdef shall contain symbol version definitions. The 1333 number of entries in this section shall be contained in the 1334 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The 1335 sh_link member of the section header (see figure 4-8 in the 1336 System V ABI) shall point to the section that contains the 1337 strings referenced by this section. 1338 1339 The section shall contain an array of Elfxx_Verdef structures, 1340 as described in Figure 10-1, optionally followed by an array 1341 of Elfxx_Verdaux structures, as defined in Figure 10-2. 1342 typedef struct { 1343 Elfxx_Half vd_version; 1344 Elfxx_Half vd_flags; 1345 Elfxx_Half vd_ndx; 1346 Elfxx_Half vd_cnt; 1347 Elfxx_Word vd_hash; 1348 Elfxx_Word vd_aux; 1349 Elfxx_Word vd_next; 1350 } Elfxx_Verdef; 1351 1352 Figure 10-1. Version Definition Entries 1353 1354 vd_version 1355 Version revision. This field shall be set to 1. 1356 1357 vd_flags 1358 Version information flag bitmask. 1359 1360 vd_ndx 1361 Version index numeric value referencing the 1362 SHT_GNU_versym section. 1363 1364 vd_cnt 1365 Number of associated verdaux array entries. 1366 1367 vd_hash 1368 Version name hash value (ELF hash function). 1369 1370 vd_aux 1371 Offset in bytes to a corresponding entry in an array of 1372 Elfxx_Verdaux structures as defined in Figure 10-2 1373 1374 vd_next 1375 Offset to the next verdef entry, in bytes. 1376 1377 typedef struct { 1378 Elfxx_Word vda_name; 1379 Elfxx_Word vda_next; 1380 } Elfxx_Verdaux; 1381 1382 Figure 10-2. Version Definition Auxiliary Entries 1383 1384 vda_name 1385 Offset to the version or dependency name string in the 1386 section header, in bytes. 1387 1388 vda_next 1389 Offset to the next verdaux entry, in bytes. 1390 _________________________________________________________ 1391 1392 10.4. Version Requirements 1393 1394 The special section .gnu.version_r which has a section type of 1395 SHT_GNU_verneed shall contain required symbol version 1396 definitions. The number of entries in this section shall be 1397 contained in the DT_VERNEEDNUM entry of the Dynamic Section 1398 .dynamic. The sh_link member of the section header (see figure 1399 4-8 in System V ABI) shall point to the section that contains 1400 the strings referenced by this section. 1401 1402 The section shall contain an array of Elfxx_Verneed 1403 structures, as described in Figure 10-3, optionally followed 1404 by an array of Elfxx_Vernaux structures, as defined in Figure 1405 10-4. 1406 typedef struct { 1407 Elfxx_Half vn_version; 1408 Elfxx_Half vn_cnt; 1409 Elfxx_Word vn_file; 1410 Elfxx_Word vn_aux; 1411 Elfxx_Word vn_next; 1412 } Elfxx_Verneed; 1413 1414 Figure 10-3. Version Needed Entries 1415 1416 vn_version 1417 Version of structure. This value is currently set to 1, 1418 and will be reset if the versioning implementation is 1419 incompatibly altered. 1420 1421 vn_cnt 1422 Number of associated verneed array entries. 1423 1424 vn_file 1425 Offset to the file name string in the section header, 1426 in bytes. 1427 1428 vn_aux 1429 Offset to a corresponding entry in the vernaux array, 1430 in bytes. 1431 1432 vn_next 1433 Offset to the next verneed entry, in bytes. 1434 1435 typedef struct { 1436 Elfxx_Word vna_hash; 1437 Elfxx_Half vna_flags; 1438 Elfxx_Half vna_other; 1439 Elfxx_Word vna_name; 1440 Elfxx_Word vna_next; 1441 } Elfxx_Vernaux; 1442 1443 Figure 10-4. Version Needed Auxiliary Entries 1444 1445 vna_hash 1446 Dependency name hash value (ELF hash function). 1447 1448 vna_flags 1449 Dependency information flag bitmask. 1450 1451 vna_other 1452 Object file version identifier used in the .gnu.version 1453 symbol version array. Bit number 15 controls whether or 1454 not the object is hidden; if this bit is set, the 1455 object cannot be used and the static linker will ignore 1456 the symbol's presence in the object. 1457 1458 vna_name 1459 Offset to the dependency name string in the section 1460 header, in bytes. 1461 1462 vna_next 1463 Offset to the next vernaux entry, in bytes. 1464 _________________________________________________________ 1465 1466 10.5. Startup Sequence 1467 1468 When loading a sharable object the system shall analyze 1469 version definition data from the loaded object to assure that 1470 it meets the version requirements of the calling object. This 1471 step is referred to as definition testing. The dynamic loader 1472 shall retrieve the entries in the caller's Elfxx_Verneed array 1473 and attempt to find matching definition information in the 1474 loaded Elfxx_Verdef table. 1475 1476 Each object and dependency shall be tested in turn. If a 1477 symbol definition is missing and the vna_flags bit for 1478 VER_FLG_WEAK is not set, the loader shall return an error and 1479 exit. If the vna_flags bit for VER_FLG_WEAK is set in the 1480 Elfxx_Vernaux entry, and the loader shall issue a warning and 1481 continue operation. 1482 1483 When the versions referenced by undefined symbols in the 1484 loaded object are found, version availability is certified. 1485 The test completes without error and the object shall be made 1486 available. 1487 _________________________________________________________ 1488 1489 10.6. Symbol Resolution 1490 1491 When symbol versioning is used in an object, relocations 1492 extend definition testing beyond the simple match of symbol 1493 name strings: the version of the reference shall also equal 1494 the name of the definition. 1495 1496 The same index that is used in the symbol table can be 1497 referenced in the SHT_GNU_versym section, and the value of 1498 this index is then used to acquire name data. The 1499 corresponding requirement string is retrieved from the 1500 Elfxx_Verneed array, and likewise, the corresponding 1501 definition string from the Elfxx_Verdef table. 1502 1503 If the high order bit (bit number 15) of the version symbolis 1504 set, the object cannot be used and the static linker shall 1505 ignore the symbol's presence in the object. 1506 1507 When an object with a reference and an object with the 1508 definition are being linked, the following rules shall govern 1509 the result: 1510 1511 * The object with the reference and the object with the 1512 definitions both use versioning. All described matching is 1513 processed in this case. A fatal error shall be triggered 1514 when no matching definition can be found in the object 1515 whose name is the one referenced by the vn_name element in 1516 the Elfxx_Verneed entry. 1517 * The object with the reference does not use versioning, 1518 while the object with the definitions does. In this 1519 instance, only the definitions with index numbers 1 and 2 1520 will be used in the reference match, the same identified 1521 by the static linker as the base definition. In cases 1522 where the static linker was not used, such as in calls to 1523 dlopen(), a version that does not have the base definition 1524 index shall be acceptable if it is the only version for 1525 which the symbol is defined. 1526 * The object with the reference uses versioning, but the 1527 object with the definitions specifies none. A matching 1528 symbol shall be accepted in this case. A fatal error shall 1529 be triggered if a corruption in the required symbols list 1530 obscures an outdated object file and causes a match on the 1531 object filename in the Elfxx_Verneed entry. 1532 * Neither the object with the reference nor the object with 1533 the definitions use versioning. The behavior in this 1534 instance shall default to pre-existing symbol rules. 1535 _________________________________________________________ 1536 1537 Chapter 11. ABI note tag 1538 1539 Every executable shall contain a section named .note.ABI-tag 1540 of type SHT_NOTE. This section is structured as a note section 1541 as documented in the ELF spec. The section shall contain at 1542 least the following entry. The name field (namesz/name) 1543 contains the string "GNU". The type field shall be 1. The 1544 descsz field shall be at least 16, and the first 16 bytes of 1545 the desc field shall be as follows. 1546 1547 The first 32-bit word of the desc field shall be 0 (this 1548 signifies a Linux executable). The second, third, and fourth 1549 32-bit words of the desc field contain the earliest compatible 1550 kernel version. For example, if the 3 words are 2, 2, and 5, 1551 this signifies a 2.2.5 kernel. 1552 1553 III. Dynamic Linking 1554 1555 Table of Contents 1556 12. Program Loading and Dynamic Linking 1557 13. Program Header 1558 14. Dynamic Entries 1559 _________________________________________________________ 1560 1561 Chapter 12. Program Loading and Dynamic Linking 1562 1563 LSB-conforming implementations shall support the object file 1564 information and system actions that create running programs as 1565 specified in the System V ABI and System V ABI Update and as 1566 supplemented by this document and an architecture-specific LSB 1567 specification. 1568 1569 Any shared object that is loaded shall contain sufficient 1570 DT_NEEDED records to satisfy the symbols on the shared 1571 library. 1572 _________________________________________________________ 1573 1574 Chapter 13. Program Header 1575 1576 In addition to the Segment Types defined in the System V ABI 1577 and System V ABI Update the following Segment Types shall also 1578 be supported. 1579 1580 Table 13-1. Linux Segment Types 1581 Name Value 1582 PT_GNU_EH_FRAME 0x6474e550 1583 PT_GNU_STACK 0x6474e551 1584 1585 PT_GNU_EH_FRAME 1586 The array element specifies the location and size of 1587 the exception handling information as defined by the 1588 .eh_frame_hdr section. 1589 1590 PT_GNU_STACK 1591 The p_flags member specifies the permissions on the 1592 segment containing the stack and is used to indicate 1593 wether the stack should be executable. The absense of 1594 this header indicates that the stack will be 1595 executable. 1596 _________________________________________________________ 1597 1598 Chapter 14. Dynamic Entries 1599 1600 14.1. Introduction 1601 1602 As described in System V ABI, if an object file participates 1603 in dynamic linking, its program header table shall have an 1604 element of type PT_DYNAMIC. This `segment' contains the 1605 .dynamic section. A special symbol, _DYNAMIC, labels the 1606 section, which contains an array of the following structures. 1607 typedef struct { 1608 Elf32_Sword d_tag; 1609 union { 1610 Elf32_Word d_val; 1611 Elf32_Addr d_ptr; 1612 } d_un; 1613 } Elf32_Dyn; 1614 1615 extern Elf32_Dyn _DYNAMIC[]; 1616 1617 typedef struct { 1618 Elf64_Sxword d_tag; 1619 union { 1620 Elf64_Xword d_val; 1621 Elf64_Addr d_ptr; 1622 } d_un; 1623 } Elf64_Dyn; 1624 1625 extern Elf64_Dyn _DYNAMIC[]; 1626 1627 Figure 14-1. Dynamic Structure 1628 1629 For each object with this type, d_tag controls the 1630 interpretation of d_un. 1631 _________________________________________________________ 1632 1633 14.2. Dynamic Entries 1634 _________________________________________________________ 1635 1636 14.2.1. ELF Dynamic Entries 1637 1638 The following dynamic entries are defined in the System V ABI 1639 and System V ABI Update. 1640 1641 DT_BIND_NOW 1642 Process relocations of object 1643 1644 DT_DEBUG 1645 For debugging; unspecified 1646 1647 DT_FINI 1648 Address of termination function 1649 1650 DT_HASH 1651 Address of symbol hash table 1652 1653 DT_HIPROC 1654 End of processor-specific 1655 1656 DT_INIT 1657 Address of init function 1658 1659 DT_JMPREL 1660 Address of PLT relocs 1661 1662 DT_LOPROC 1663 Start of processor-specific 1664 1665 DT_NEEDED 1666 Name of needed library 1667 1668 DT_NULL 1669 Marks end of dynamic section 1670 1671 DT_PLTREL 1672 Type of reloc in PLT 1673 1674 DT_PLTRELSZ 1675 Size in bytes of PLT relocs 1676 1677 DT_REL 1678 Address of Rel relocs 1679 1680 DT_RELA 1681 Address of Rela relocs 1682 1683 DT_RELAENT 1684 Size of one Rela reloc 1685 1686 DT_RELASZ 1687 Total size of Rela relocs 1688 1689 DT_RELENT 1690 Size of one Rel reloc 1691 1692 DT_RELSZ 1693 Total size of Rel relocs 1694 1695 DT_RPATH 1696 Library search path 1697 1698 DT_SONAME 1699 Name of shared object 1700 1701 DT_STRSZ 1702 Size of string table 1703 1704 DT_STRTAB 1705 Address of string table 1706 1707 DT_SYMBOLIC 1708 Start symbol search here 1709 1710 DT_SYMENT 1711 Size of one symbol table entry 1712 1713 DT_SYMTAB 1714 Address of symbol table 1715 1716 DT_TEXTREL 1717 Reloc might modify .text 1718 _________________________________________________________ 1719 1720 14.2.2. Additional Dynamic Entries 1721 1722 An LSB conforming object may also use the following additional 1723 Dynamic Entry types. 1724 1725 DT_ADDRRNGHI 1726 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are 1727 reserved for definition by an archLSB. 1728 1729 DT_ADDRRNGLO 1730 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are 1731 reserved for definition by an archLSB. 1732 1733 DT_AUXILIARY 1734 Shared object to load before self 1735 1736 DT_FILTER 1737 Shared object to get values from 1738 1739 DT_FINI_ARRAY 1740 The address of an array of pointers to termination 1741 functions. 1742 1743 DT_FINI_ARRAYSZ 1744 Size in bytes of DT_FINI_ARRAY 1745 1746 DT_HIOS 1747 Values from DT_LOOS through DT_HIOS are reserved for 1748 definition by specific operating systems. 1749 1750 DT_INIT_ARRAY 1751 The address of an array of pointers to initialization 1752 functions. 1753 1754 DT_INIT_ARRAYSZ 1755 Size in bytes of DT_INIT_ARRAY 1756 1757 DT_LOOS 1758 Values from DT_LOOS through DT_HIOS are reserved for 1759 definition by specific operating systems. 1760 1761 DT_NUM 1762 Number of dynamic entry tags defined (excepting 1763 reserved ranges). 1764 1765 DT_POSFLAG_1 1766 Flags for DT_* entries, effecting the following DT_* 1767 entry 1768 1769 DT_RELCOUNT 1770 All Elf32_Rel R_*_RELATIVE relocations have been placed 1771 into a single block and this entry specifies the number 1772 of entries in that block. This permits ld.so.1 to 1773 streamline the processing of RELATIVE relocations. 1774 1775 DT_RUNPATH 1776 null-terminated library search path string 1777 1778 DT_SYMINENT 1779 Entry size of syminfo 1780 1781 DT_SYMINFO 1782 Address of the Syminfo table. 1783 1784 DT_SYMINSZ 1785 Size of syminfo table (in bytes) 1786 1787 DT_VALRNGHI 1788 Entries which fall between DT_VALRNGHI & DT_VALRNGLO 1789 use the Dyn.d_un.d_val field of the Elf*_Dyn structure. 1790 1791 DT_VALRNGLO 1792 Entries which fall between DT_VALRNGHI & DT_VALRNGLO 1793 use the Dyn.d_un.d_val field of the Elf*_Dyn structure. 1794 1795 DT_VERDEF 1796 Address of version definition table 1797 1798 DT_VERDEFNUM 1799 Number of version definitions 1800 1801 DT_VERNEED 1802 Address of table with needed versions 1803 1804 DT_VERNEEDNUM 1805 Number of needed versions 1806 1807 DT_VERSYM 1808 Address of the table provided by the .gnu.version 1809 section. 1810 1811 Linux Standard Base Specification 1812 _________________________________________________________ 1813 1814 Table of Contents 1815 I. Base Libraries 1816 1817 1. Libraries 1818 1819 1.1. Introduction 1820 1.2. Program Interpreter 1821 1.3. Interfaces for libc 1822 1.4. Data Definitions for libc 1823 1.5. Interface Definitions for libc 1824 1.6. Interfaces for libm 1825 1.7. Data Definitions for libm 1826 1.8. Interface Definitions for libm 1827 1.9. Interfaces for libpthread 1828 1.10. Data Definitions for libpthread 1829 1.11. Interface Definitions for libpthread 1830 1.12. Interfaces for libgcc_s 1831 1.13. Data Definitions for libgcc_s 1832 1.14. Interfaces for libdl 1833 1.15. Data Definitions for libdl 1834 1.16. Interface Definitions for libdl 1835 1.17. Interfaces for libcrypt 1836 1.18. Interfaces for libpam 1837 1.19. Data Definitions for libpam 1838 1.20. Interface Definitions for libpam 1839 1840 II. Utility Libraries 1841 1842 2. Utility Libraries 1843 1844 2.1. Introduction 1845 2.2. Interfaces for libz 1846 2.3. Data Definitions for libz 1847 2.4. Interface Definitions for libz 1848 2.5. Interfaces for libncurses 1849 2.6. Data Definitions for libncurses 1850 2.7. Interfaces for libutil 1851 2.8. Interface Definitions for libutil 1852 1853 III. Commands and Utilities 1854 1855 3. Commands and Utilities 1856 1857 3.1. Commands and Utilities 1858 3.2. Command Behavior 1859 1860 IV. Execution Environment 1861 1862 4. File System Hierarchy 1863 1864 4.1. /dev 1865 4.2. User Accounting Databases 1866 4.3. Path For System Administration Utilities 1867 1868 5. Additional Recommendations 1869 1870 5.1. Minimal granted Directory and File permissions 1871 5.2. Recommendations for applications on ownership 1872 and permissions 1873 1874 6. Additional Behaviors 1875 1876 6.1. Mandatory Optional Behaviors 1877 1878 7. Localization 1879 1880 7.1. Introduction 1881 7.2. Regular Expressions 1882 7.3. Pattern Matching Notation 1883 1884 V. System Initialization 1885 1886 8. System Initialization 1887 1888 8.1. Cron Jobs 1889 8.2. Init Script Actions 1890 8.3. Comment Conventions for Init Scripts 1891 8.4. Installation and Removal of init.d Files 1892 8.5. Run Levels 1893 8.6. Facility Names 1894 8.7. Script Names 1895 8.8. Init Script Functions 1896 1897 VI. Users & Groups 1898 1899 9. Users & Groups 1900 1901 9.1. User and Group Database 1902 9.2. User & Group Names 1903 9.3. UID Ranges 1904 9.4. Rationale 1905 1906 A. Alphabetical Listing of Interfaces 1907 1908 A.1. libc 1909 A.2. libcrypt 1910 A.3. libdl 1911 A.4. libm 1912 A.5. libncurses 1913 A.6. libpam 1914 A.7. libpthread 1915 A.8. libutil 1916 A.9. libz 1917 1918 List of Tables 1919 1-1. libc Definition 1920 1-2. libc - RPC Function Interfaces 1921 1-3. libc - System Calls Function Interfaces 1922 1-4. libc - Standard I/O Function Interfaces 1923 1-5. libc - Standard I/O Data Interfaces 1924 1-6. libc - Signal Handling Function Interfaces 1925 1-7. libc - Signal Handling Data Interfaces 1926 1-8. libc - Localization Functions Function Interfaces 1927 1-9. libc - Localization Functions Data Interfaces 1928 1-10. libc - Socket Interface Function Interfaces 1929 1-11. libc - Wide Characters Function Interfaces 1930 1-12. libc - String Functions Function Interfaces 1931 1-13. libc - IPC Functions Function Interfaces 1932 1-14. libc - Regular Expressions Function Interfaces 1933 1-15. libc - Character Type Functions Function Interfaces 1934 1-16. libc - Time Manipulation Function Interfaces 1935 1-17. libc - Time Manipulation Data Interfaces 1936 1-18. libc - Terminal Interface Functions Function Interfaces 1937 1-19. libc - System Database Interface Function Interfaces 1938 1-20. libc - Language Support Function Interfaces 1939 1-21. libc - Large File Support Function Interfaces 1940 1-22. libc - Standard Library Function Interfaces 1941 1-23. libc - Standard Library Data Interfaces 1942 1-24. libm Definition 1943 1-25. libm - Math Function Interfaces 1944 1-26. libm - Math Data Interfaces 1945 1-27. libpthread Definition 1946 1-28. libpthread - Realtime Threads Function Interfaces 1947 1-29. libpthread - Posix Threads Function Interfaces 1948 1-30. libgcc_s Definition 1949 1-31. libdl Definition 1950 1-32. libdl - Dynamic Loader Function Interfaces 1951 1-33. libcrypt Definition 1952 1-34. libcrypt - Encryption Function Interfaces 1953 1-35. libpam Definition 1954 1-36. libpam - Pluggable Authentication API Function 1955 Interfaces 1956 1957 2-1. libz Definition 1958 2-2. libz - Compression Library Function Interfaces 1959 2-3. libncurses Definition 1960 2-4. libncurses - Curses Function Interfaces 1961 2-5. libncurses - Curses Data Interfaces 1962 2-6. libutil Definition 1963 2-7. libutil - Utility Functions Function Interfaces 1964 3-1. Commands And Utilities 1965 3-2. Built In Utilities 1966 3-1. Escape Sequences 1967 9-1. Required User & Group Names 1968 9-2. Optional User & Group Names 1969 A-1. libc Function Interfaces 1970 A-2. libc Data Interfaces 1971 A-3. libcrypt Function Interfaces 1972 A-4. libdl Function Interfaces 1973 A-5. libm Function Interfaces 1974 A-6. libm Data Interfaces 1975 A-7. libncurses Function Interfaces 1976 A-8. libncurses Data Interfaces 1977 A-9. libpam Function Interfaces 1978 A-10. libpthread Function Interfaces 1979 A-11. libutil Function Interfaces 1980 A-12. libz Function Interfaces 1981 1982 I. Base Libraries 1983 1984 Table of Contents 1985 1. Libraries 1986 _________________________________________________________ 1987 1988 Chapter 1. Libraries 1989 1990 1.1. Introduction 1991 1992 An LSB-conforming implementation shall support the following 1993 base libraries which provide interfaces for accessing the 1994 operating system, processor and other hardware in the system. 1995 1996 * libc 1997 * libm 1998 * libgcc_s 1999 * libdl 2000 * libcrypt 2001 * libpam 2002 _________________________________________________________ 2003 2004 1.2. Program Interpreter 2005 2006 The Program Interpreter is specified in the appropriate 2007 architecture-specific LSB specification. 2008 _________________________________________________________ 2009 2010 1.3. Interfaces for libc 2011 2012 Table 1-1 defines the library name and shared object name for 2013 the libc library 2014 2015 Table 1-1. libc Definition 2016 Library: libc 2017 SONAME: See archLSB. 2018 2019 The behavior of the interfaces in this library is specified by 2020 the following specifications: 2021 2022 Large File Support 2023 this specification 2024 SUSv2 2025 ISO POSIX (2003) 2026 SVID Issue 3 2027 SVID Issue 4 2028 _________________________________________________________ 2029 2030 1.3.1. RPC 2031 _________________________________________________________ 2032 2033 1.3.1.1. Interfaces for RPC 2034 2035 An LSB conforming implementation shall provide the generic 2036 functions for RPC specified in Table 1-2, with the full 2037 mandatory functionality as described in the referenced 2038 underlying specification. 2039 2040 Table 1-2. libc - RPC Function Interfaces 2041 authnone_create [1] svc_getreqset [2] svcudp_create [3] 2042 xdr_int [2] xdr_u_long [2] 2043 clnt_create [1] svc_register [3] xdr_accepted_reply [2] 2044 xdr_long [2] xdr_u_short [2] 2045 clnt_pcreateerror [1] svc_run [3] xdr_array [2] xdr_opaque [2] 2046 xdr_union [2] 2047 clnt_perrno [1] svc_sendreply [3] xdr_bool [2] xdr_opaque_auth 2048 [2] xdr_vector [2] 2049 clnt_perror [1] svcerr_auth [2] xdr_bytes [2] xdr_pointer [2] 2050 xdr_void [2] 2051 clnt_spcreateerror [1] svcerr_decode [2] xdr_callhdr [2] 2052 xdr_reference [2] xdr_wrapstring [2] 2053 clnt_sperrno [1] svcerr_noproc [2] xdr_callmsg [2] 2054 xdr_rejected_reply [2] xdrmem_create [2] 2055 clnt_sperror [1] svcerr_noprog [2] xdr_char [2] xdr_replymsg 2056 [2] xdrrec_create [2] 2057 key_decryptsession [2] svcerr_progvers [2] xdr_double [2] 2058 xdr_short [2] xdrrec_eof [2] 2059 pmap_getport [3] svcerr_systemerr [2] xdr_enum [2] xdr_string 2060 [2] 2061 pmap_set [3] svcerr_weakauth [2] xdr_float [2] xdr_u_char [2] 2062 2063 pmap_unset [3] svctcp_create [3] xdr_free [2] xdr_u_int [3] 2064 2065 Referenced Specification(s) 2066 2067 [1]. SVID Issue 4 2068 2069 [2]. SVID Issue 3 2070 2071 [3]. this specification 2072 _________________________________________________________ 2073 2074 1.3.2. System Calls 2075 _________________________________________________________ 2076 2077 1.3.2.1. Interfaces for System Calls 2078 2079 An LSB conforming implementation shall provide the generic 2080 functions for System Calls specified in Table 1-3, with the 2081 full mandatory functionality as described in the referenced 2082 underlying specification. 2083 2084 Table 1-3. libc - System Calls Function Interfaces 2085 __fxstat [1] fchmod [2] getwd [2] read [2] setrlimit [2] 2086 __getpgid [1] fchown [2] initgroups [1] readdir [2] 2087 setrlimit64 [3] 2088 __lxstat [1] fcntl [1] ioctl [1] readdir_r [2] setsid [2] 2089 __xmknod [1] fdatasync [2] kill [1] readlink [2] setuid [2] 2090 __xstat [1] flock [1] killpg [2] readv [2] sleep [2] 2091 access [2] fork [2] lchown [2] rename [2] statvfs [2] 2092 acct [1] fstatvfs [2] link [1] rmdir [2] stime [1] 2093 alarm [2] fsync [2] lockf [2] sbrk [4] symlink [2] 2094 brk [4] ftime [2] lseek [2] sched_get_priority_max [2] sync 2095 [2] 2096 chdir [2] ftruncate [2] mkdir [2] sched_get_priority_min [2] 2097 sysconf [2] 2098 chmod [2] getcontext [2] mkfifo [2] sched_getparam [2] time 2099 [2] 2100 chown [2] getegid [2] mlock [2] sched_getscheduler [2] times 2101 [2] 2102 chroot [4] geteuid [2] mlockall [2] sched_rr_get_interval [2] 2103 truncate [2] 2104 clock [2] getgid [2] mmap [2] sched_setparam [2] ulimit [2] 2105 close [2] getgroups [2] mprotect [2] sched_setscheduler [2] 2106 umask [2] 2107 closedir [2] getitimer [2] msync [2] sched_yield [2] uname [2] 2108 creat [2] getloadavg [1] munlock [2] select [2] unlink [1] 2109 dup [2] getpagesize [4] munlockall [2] setcontext [2] utime 2110 [2] 2111 dup2 [2] getpgid [2] munmap [2] setegid [2] utimes [2] 2112 execl [2] getpgrp [2] nanosleep [2] seteuid [2] vfork [2] 2113 execle [2] getpid [2] nice [2] setgid [2] wait [2] 2114 execlp [2] getppid [2] open [2] setitimer [2] wait4 [1] 2115 execv [2] getpriority [2] opendir [2] setpgid [2] waitpid [1] 2116 execve [2] getrlimit [2] pathconf [2] setpgrp [2] write [2] 2117 execvp [2] getrusage [2] pause [2] setpriority [2] writev [2] 2118 exit [2] getsid [2] pipe [2] setregid [2] 2119 fchdir [2] getuid [2] poll [2] setreuid [2] 2120 2121 Referenced Specification(s) 2122 2123 [1]. this specification 2124 2125 [2]. ISO POSIX (2003) 2126 2127 [3]. Large File Support 2128 2129 [4]. SUSv2 2130 _________________________________________________________ 2131 2132 1.3.3. Standard I/O 2133 _________________________________________________________ 2134 2135 1.3.3.1. Interfaces for Standard I/O 2136 2137 An LSB conforming implementation shall provide the generic 2138 functions for Standard I/O specified in Table 1-4, with the 2139 full mandatory functionality as described in the referenced 2140 underlying specification. 2141 2142 Table 1-4. libc - Standard I/O Function Interfaces 2143 _IO_feof [1] fgetpos [2] fsetpos [2] putchar [2] sscanf [1] 2144 _IO_getc [1] fgets [2] ftell [2] putchar_unlocked [2] telldir 2145 [2] 2146 _IO_putc [1] fgetwc_unlocked [1] ftello [2] puts [2] tempnam 2147 [2] 2148 _IO_puts [1] fileno [2] fwrite [2] putw [3] ungetc [2] 2149 asprintf [1] flockfile [2] getc [2] remove [2] vasprintf [1] 2150 clearerr [2] fopen [2] getc_unlocked [2] rewind [2] vdprintf 2151 [1] 2152 ctermid [2] fprintf [2] getchar [2] rewinddir [2] vfprintf [2] 2153 fclose [2] fputc [2] getchar_unlocked [2] scanf [1] vprintf 2154 [2] 2155 fdopen [2] fputs [2] getw [3] seekdir [2] vsnprintf [2] 2156 feof [2] fread [2] pclose [2] setbuf [2] vsprintf [2] 2157 ferror [2] freopen [2] popen [2] setbuffer [1] 2158 fflush [2] fscanf [1] printf [2] setvbuf [2] 2159 fflush_unlocked [1] fseek [2] putc [2] snprintf [2] 2160 fgetc [2] fseeko [2] putc_unlocked [2] sprintf [2] 2161 2162 Referenced Specification(s) 2163 2164 [1]. this specification 2165 2166 [2]. ISO POSIX (2003) 2167 2168 [3]. SUSv2 2169 2170 An LSB conforming implementation shall provide the generic 2171 data interfaces for Standard I/O specified in Table 1-5, with 2172 the full mandatory functionality as described in the 2173 referenced underlying specification. 2174 2175 Table 1-5. libc - Standard I/O Data Interfaces 2176 stderr [1] stdin [1] stdout [1] 2177 2178 Referenced Specification(s) 2179 2180 [1]. ISO POSIX (2003) 2181 _________________________________________________________ 2182 2183 1.3.4. Signal Handling 2184 _________________________________________________________ 2185 2186 1.3.4.1. Interfaces for Signal Handling 2187 2188 An LSB conforming implementation shall provide the generic 2189 functions for Signal Handling specified in Table 1-6, with the 2190 full mandatory functionality as described in the referenced 2191 underlying specification. 2192 2193 Table 1-6. libc - Signal Handling Function Interfaces 2194 __libc_current_sigrtmax [1] sigaction [2] sighold [2] sigorset 2195 [1] sigset [2] 2196 __libc_current_sigrtmin [1] sigaddset [2] sigignore [2] 2197 sigpause [2] sigsuspend [2] 2198 __sigsetjmp [1] sigaltstack [2] siginterrupt [2] sigpending 2199 [2] sigtimedwait [2] 2200 __sysv_signal [1] sigandset [1] sigisemptyset [1] sigprocmask 2201 [2] sigwait [2] 2202 bsd_signal [2] sigdelset [2] sigismember [2] sigqueue [2] 2203 sigwaitinfo [2] 2204 psignal [1] sigemptyset [2] siglongjmp [2] sigrelse [2] 2205 raise [2] sigfillset [2] signal [2] sigreturn [1] 2206 2207 Referenced Specification(s) 2208 2209 [1]. this specification 2210 2211 [2]. ISO POSIX (2003) 2212 2213 An LSB conforming implementation shall provide the generic 2214 data interfaces for Signal Handling specified in Table 1-7, 2215 with the full mandatory functionality as described in the 2216 referenced underlying specification. 2217 2218 Table 1-7. libc - Signal Handling Data Interfaces 2219 _sys_siglist [1] 2220 2221 Referenced Specification(s) 2222 2223 [1]. this specification 2224 _________________________________________________________ 2225 2226 1.3.5. Localization Functions 2227 _________________________________________________________ 2228 2229 1.3.5.1. Interfaces for Localization Functions 2230 2231 An LSB conforming implementation shall provide the generic 2232 functions for Localization Functions specified in Table 1-8, 2233 with the full mandatory functionality as described in the 2234 referenced underlying specification. 2235 2236 Table 1-8. libc - Localization Functions Function Interfaces 2237 bind_textdomain_codeset [1] dcgettext [1] 2238 freelocale(GLIBC_2.3) [1] localeconv [2] textdomain [1] 2239 bindtextdomain [1] dcngettext [1] gettext [1] 2240 newlocale(GLIBC_2.3) [1] uselocale(GLIBC_2.3) [1] 2241 catclose [2] dgettext [1] iconv [2] ngettext [1] 2242 catgets [2] dngettext [1] iconv_close [2] nl_langinfo [2] 2243 catopen [2] duplocale(GLIBC_2.3) [1] iconv_open [2] setlocale 2244 [2] 2245 2246 Referenced Specification(s) 2247 2248 [1]. this specification 2249 2250 [2]. ISO POSIX (2003) 2251 2252 An LSB conforming implementation shall provide the generic 2253 data interfaces for Localization Functions specified in Table 2254 1-9, with the full mandatory functionality as described in the 2255 referenced underlying specification. 2256 2257 Table 1-9. libc - Localization Functions Data Interfaces 2258 _nl_msg_cat_cntr [1] 2259 2260 Referenced Specification(s) 2261 2262 [1]. this specification 2263 _________________________________________________________ 2264 2265 1.3.6. Socket Interface 2266 _________________________________________________________ 2267 2268 1.3.6.1. Interfaces for Socket Interface 2269 2270 An LSB conforming implementation shall provide the generic 2271 functions for Socket Interface specified in Table 1-10, with 2272 the full mandatory functionality as described in the 2273 referenced underlying specification. 2274 2275 Table 1-10. libc - Socket Interface Function Interfaces 2276 __h_errno_location [1] gethostname [2] if_nameindex [2] send 2277 [2] socket [2] 2278 accept [2] getpeername [2] if_nametoindex [2] sendmsg [2] 2279 socketpair [2] 2280 bind [2] getsockname [2] listen [2] sendto [2] 2281 bindresvport [1] getsockopt [1] recv [2] setsockopt [1] 2282 connect [2] if_freenameindex [2] recvfrom [2] shutdown [2] 2283 gethostid [2] if_indextoname [2] recvmsg [2] sockatmark [2] 2284 2285 Referenced Specification(s) 2286 2287 [1]. this specification 2288 2289 [2]. ISO POSIX (2003) 2290 _________________________________________________________ 2291 2292 1.3.7. Wide Characters 2293 _________________________________________________________ 2294 2295 1.3.7.1. Interfaces for Wide Characters 2296 2297 An LSB conforming implementation shall provide the generic 2298 functions for Wide Characters specified in Table 1-11, with 2299 the full mandatory functionality as described in the 2300 referenced underlying specification. 2301 2302 Table 1-11. libc - Wide Characters Function Interfaces 2303 __wcstod_internal [1] mbsinit [2] vwscanf [1] wcsnlen [1] 2304 wcstoumax [2] 2305 __wcstof_internal [1] mbsnrtowcs [1] wcpcpy [1] wcsnrtombs [1] 2306 wcstouq [1] 2307 __wcstol_internal [1] mbsrtowcs [2] wcpncpy [1] wcspbrk [2] 2308 wcswcs [2] 2309 __wcstold_internal [1] mbstowcs [2] wcrtomb [2] wcsrchr [2] 2310 wcswidth [2] 2311 __wcstoul_internal [1] mbtowc [2] wcscasecmp [1] wcsrtombs [2] 2312 wcsxfrm [2] 2313 btowc [2] putwc [2] wcscat [2] wcsspn [2] wctob [2] 2314 fgetwc [2] putwchar [2] wcschr [2] wcsstr [2] wctomb [2] 2315 fgetws [2] swprintf [2] wcscmp [2] wcstod [2] wctrans [2] 2316 fputwc [2] swscanf [1] wcscoll [2] wcstof [2] wctype [2] 2317 fputws [2] towctrans [2] wcscpy [2] wcstoimax [2] wcwidth [2] 2318 fwide [2] towlower [2] wcscspn [2] wcstok [2] wmemchr [2] 2319 fwprintf [2] towupper [2] wcsdup [1] wcstol [2] wmemcmp [2] 2320 fwscanf [1] ungetwc [2] wcsftime [2] wcstold [2] wmemcpy [2] 2321 getwc [2] vfwprintf [2] wcslen [2] wcstoll [2] wmemmove [2] 2322 getwchar [2] vfwscanf [1] wcsncasecmp [1] wcstombs [2] wmemset 2323 [2] 2324 mblen [2] vswprintf [2] wcsncat [2] wcstoq [1] wprintf [2] 2325 mbrlen [2] vswscanf [1] wcsncmp [2] wcstoul [2] wscanf [1] 2326 mbrtowc [2] vwprintf [2] wcsncpy [2] wcstoull [2] 2327 2328 Referenced Specification(s) 2329 2330 [1]. this specification 2331 2332 [2]. ISO POSIX (2003) 2333 _________________________________________________________ 2334 2335 1.3.8. String Functions 2336 _________________________________________________________ 2337 2338 1.3.8.1. Interfaces for String Functions 2339 2340 An LSB conforming implementation shall provide the generic 2341 functions for String Functions specified in Table 1-12, with 2342 the full mandatory functionality as described in the 2343 referenced underlying specification. 2344 2345 Table 1-12. libc - String Functions Function Interfaces 2346 __mempcpy [1] bzero [2] strcasestr [1] strncat [2] strtok [2] 2347 __rawmemchr [1] ffs [2] strcat [2] strncmp [2] strtok_r [2] 2348 __stpcpy [1] index [2] strchr [2] strncpy [2] strtold [2] 2349 __strdup [1] memccpy [2] strcmp [2] strndup [1] strtoll [2] 2350 __strtod_internal [1] memchr [2] strcoll [2] strnlen [1] 2351 strtoq [1] 2352 __strtof_internal [1] memcmp [2] strcpy [2] strpbrk [2] 2353 strtoull [2] 2354 __strtok_r [1] memcpy [2] strcspn [2] strptime [1] strtoumax 2355 [2] 2356 __strtol_internal [1] memmove [2] strdup [2] strrchr [2] 2357 strtouq [1] 2358 __strtold_internal [1] memrchr [1] strerror [2] strsep [1] 2359 strxfrm [2] 2360 __strtoll_internal [1] memset [2] strerror_r [1] strsignal [1] 2361 swab [2] 2362 __strtoul_internal [1] rindex [2] strfmon [2] strspn [2] 2363 __strtoull_internal [1] stpcpy [1] strftime [2] strstr [2] 2364 bcmp [2] stpncpy [1] strlen [2] strtof [2] 2365 bcopy [2] strcasecmp [2] strncasecmp [2] strtoimax [2] 2366 2367 Referenced Specification(s) 2368 2369 [1]. this specification 2370 2371 [2]. ISO POSIX (2003) 2372 _________________________________________________________ 2373 2374 1.3.9. IPC Functions 2375 _________________________________________________________ 2376 2377 1.3.9.1. Interfaces for IPC Functions 2378 2379 An LSB conforming implementation shall provide the generic 2380 functions for IPC Functions specified in Table 1-13, with the 2381 full mandatory functionality as described in the referenced 2382 underlying specification. 2383 2384 Table 1-13. libc - IPC Functions Function Interfaces 2385 ftok [1] msgrcv [1] semget [1] shmctl [1] 2386 msgctl [1] msgsnd [1] semop [1] shmdt [1] 2387 msgget [1] semctl [1] shmat [1] shmget [1] 2388 2389 Referenced Specification(s) 2390 2391 [1]. ISO POSIX (2003) 2392 _________________________________________________________ 2393 2394 1.3.10. Regular Expressions 2395 _________________________________________________________ 2396 2397 1.3.10.1. Interfaces for Regular Expressions 2398 2399 An LSB conforming implementation shall provide the generic 2400 functions for Regular Expressions specified in Table 1-14, 2401 with the full mandatory functionality as described in the 2402 referenced underlying specification. 2403 2404 Table 1-14. libc - Regular Expressions Function Interfaces 2405 regcomp [1] regerror [1] regexec [2] regfree [1] 2406 2407 Referenced Specification(s) 2408 2409 [1]. ISO POSIX (2003) 2410 2411 [2]. this specification 2412 _________________________________________________________ 2413 2414 1.3.11. Character Type Functions 2415 _________________________________________________________ 2416 2417 1.3.11.1. Interfaces for Character Type Functions 2418 2419 An LSB conforming implementation shall provide the generic 2420 functions for Character Type Functions specified in Table 2421 1-15, with the full mandatory functionality as described in 2422 the referenced underlying specification. 2423 2424 Table 1-15. libc - Character Type Functions Function 2425 Interfaces 2426 __ctype_b_loc(GLIBC_2.3) [1] isalpha [2] ispunct [2] iswctype 2427 [2] iswupper [2] 2428 __ctype_get_mb_cur_max [1] isascii [2] isspace [2] iswdigit 2429 [2] iswxdigit [2] 2430 __ctype_tolower_loc(GLIBC_2.3) [1] iscntrl [2] isupper [2] 2431 iswgraph [2] isxdigit [2] 2432 __ctype_toupper_loc(GLIBC_2.3) [1] isdigit [2] iswalnum [2] 2433 iswlower [2] toascii [2] 2434 _tolower [2] isgraph [2] iswalpha [2] iswprint [2] tolower [2] 2435 _toupper [2] islower [2] iswblank [2] iswpunct [2] toupper [2] 2436 isalnum [2] isprint [2] iswcntrl [2] iswspace [2] 2437 2438 Referenced Specification(s) 2439 2440 [1]. this specification 2441 2442 [2]. ISO POSIX (2003) 2443 _________________________________________________________ 2444 2445 1.3.12. Time Manipulation 2446 _________________________________________________________ 2447 2448 1.3.12.1. Interfaces for Time Manipulation 2449 2450 An LSB conforming implementation shall provide the generic 2451 functions for Time Manipulation specified in Table 1-16, with 2452 the full mandatory functionality as described in the 2453 referenced underlying specification. 2454 2455 Table 1-16. libc - Time Manipulation Function Interfaces 2456 adjtime [1] ctime [2] gmtime [2] localtime_r [2] ualarm [2] 2457 asctime [2] ctime_r [2] gmtime_r [2] mktime [2] 2458 asctime_r [2] difftime [2] localtime [2] tzset [2] 2459 2460 Referenced Specification(s) 2461 2462 [1]. this specification 2463 2464 [2]. ISO POSIX (2003) 2465 2466 An LSB conforming implementation shall provide the generic 2467 data interfaces for Time Manipulation specified in Table 1-17, 2468 with the full mandatory functionality as described in the 2469 referenced underlying specification. 2470 2471 Table 1-17. libc - Time Manipulation Data Interfaces 2472 __daylight [1] __tzname [1] timezone [2] 2473 __timezone [1] daylight [2] tzname [2] 2474 2475 Referenced Specification(s) 2476 2477 [1]. this specification 2478 2479 [2]. ISO POSIX (2003) 2480 _________________________________________________________ 2481 2482 1.3.13. Terminal Interface Functions 2483 _________________________________________________________ 2484 2485 1.3.13.1. Interfaces for Terminal Interface Functions 2486 2487 An LSB conforming implementation shall provide the generic 2488 functions for Terminal Interface Functions specified in Table 2489 1-18, with the full mandatory functionality as described in 2490 the referenced underlying specification. 2491 2492 Table 1-18. libc - Terminal Interface Functions Function 2493 Interfaces 2494 cfgetispeed [1] cfsetispeed [1] tcdrain [1] tcgetattr [1] 2495 tcsendbreak [1] 2496 cfgetospeed [1] cfsetospeed [1] tcflow [1] tcgetpgrp [1] 2497 tcsetattr [1] 2498 cfmakeraw [2] cfsetspeed [2] tcflush [1] tcgetsid [1] 2499 tcsetpgrp [1] 2500 2501 Referenced Specification(s) 2502 2503 [1]. ISO POSIX (2003) 2504 2505 [2]. this specification 2506 _________________________________________________________ 2507 2508 1.3.14. System Database Interface 2509 _________________________________________________________ 2510 2511 1.3.14.1. Interfaces for System Database Interface 2512 2513 An LSB conforming implementation shall provide the generic 2514 functions for System Database Interface specified in Table 2515 1-19, with the full mandatory functionality as described in 2516 the referenced underlying specification. 2517 2518 Table 1-19. libc - System Database Interface Function 2519 Interfaces 2520 endgrent [1] getgrgid_r [1] getprotoent [1] getservent [1] 2521 setgroups [2] 2522 endprotoent [1] getgrnam [1] getpwent [1] getutent [2] 2523 setprotoent [1] 2524 endpwent [1] getgrnam_r [1] getpwnam [1] getutent_r [2] 2525 setpwent [1] 2526 endservent [1] getgrouplist [2] getpwnam_r [1] getutxent [1] 2527 setservent [1] 2528 endutent [3] gethostbyaddr [1] getpwuid [1] getutxid [1] 2529 setutent [2] 2530 endutxent [1] gethostbyname [1] getpwuid_r [1] getutxline [1] 2531 setutxent [1] 2532 getgrent [1] getprotobyname [1] getservbyname [1] pututxline 2533 [1] utmpname [2] 2534 getgrgid [1] getprotobynumber [1] getservbyport [1] setgrent 2535 [1] 2536 2537 Referenced Specification(s) 2538 2539 [1]. ISO POSIX (2003) 2540 2541 [2]. this specification 2542 2543 [3]. SUSv2 2544 _________________________________________________________ 2545 2546 1.3.15. Language Support 2547 _________________________________________________________ 2548 2549 1.3.15.1. Interfaces for Language Support 2550 2551 An LSB conforming implementation shall provide the generic 2552 functions for Language Support specified in Table 1-20, with 2553 the full mandatory functionality as described in the 2554 referenced underlying specification. 2555 2556 Table 1-20. libc - Language Support Function Interfaces 2557 __libc_start_main [1] __register_atfork(GLIBC_2.3.2) [1] 2558 2559 Referenced Specification(s) 2560 2561 [1]. this specification 2562 _________________________________________________________ 2563 2564 1.3.16. Large File Support 2565 _________________________________________________________ 2566 2567 1.3.16.1. Interfaces for Large File Support 2568 2569 An LSB conforming implementation shall provide the generic 2570 functions for Large File Support specified in Table 1-21, with 2571 the full mandatory functionality as described in the 2572 referenced underlying specification. 2573 2574 Table 1-21. libc - Large File Support Function Interfaces 2575 __fxstat64 [1] fopen64 [2] ftello64 [2] lseek64 [2] readdir64 2576 [2] 2577 __lxstat64 [1] freopen64 [2] ftruncate64 [2] mkstemp64 [2] 2578 statvfs64 [2] 2579 __xstat64 [1] fseeko64 [2] ftw64 [2] mmap64 [2] tmpfile64 [2] 2580 creat64 [2] fsetpos64 [2] getrlimit64 [2] nftw64 [2] 2581 truncate64 [2] 2582 fgetpos64 [2] fstatvfs64 [2] lockf64 [2] open64 [2] 2583 2584 Referenced Specification(s) 2585 2586 [1]. this specification 2587 2588 [2]. Large File Support 2589 _________________________________________________________ 2590 2591 1.3.17. Standard Library 2592 _________________________________________________________ 2593 2594 1.3.17.1. Interfaces for Standard Library 2595 2596 An LSB conforming implementation shall provide the generic 2597 functions for Standard Library specified in Table 1-22, with 2598 the full mandatory functionality as described in the 2599 referenced underlying specification. 2600 2601 Table 1-22. libc - Standard Library Function Interfaces 2602 _Exit [1] dirname [1] glob [1] lsearch [1] srand48 [1] 2603 __assert_fail [2] div [1] glob64 [2] makecontext [1] srandom 2604 [1] 2605 __cxa_atexit [2] drand48 [1] globfree [1] malloc [1] strtod 2606 [1] 2607 __errno_location [2] ecvt [1] globfree64 [2] memmem [2] strtol 2608 [1] 2609 __fpending [2] erand48 [1] grantpt [1] mkstemp [1] strtoul [1] 2610 __getpagesize [2] err [2] hcreate [1] mktemp [1] swapcontext 2611 [1] 2612 __isinf [2] error [2] hdestroy [1] mrand48 [1] syslog [1] 2613 __isinff [2] errx [2] hsearch [1] nftw [1] system [2] 2614 __isinfl [2] fcvt [1] htonl [1] nrand48 [1] tdelete [1] 2615 __isnan [2] fmtmsg [1] htons [1] ntohl [1] tfind [1] 2616 __isnanf [2] fnmatch [1] imaxabs [1] ntohs [1] tmpfile [1] 2617 __isnanl [2] fpathconf [1] imaxdiv [1] openlog [1] tmpnam [1] 2618 __sysconf [2] free [1] inet_addr [1] perror [1] tsearch [1] 2619 _exit [1] freeaddrinfo [1] inet_ntoa [1] posix_memalign [1] 2620 ttyname [1] 2621 _longjmp [1] ftrylockfile [1] inet_ntop [1] posix_openpt [1] 2622 ttyname_r [1] 2623 _setjmp [1] ftw [1] inet_pton [1] ptsname [1] twalk [1] 2624 a64l [1] funlockfile [1] initstate [1] putenv [1] unlockpt [1] 2625 abort [1] gai_strerror [1] insque [1] qsort [1] unsetenv [1] 2626 abs [1] gcvt [1] isatty [1] rand [1] usleep [1] 2627 atof [1] getaddrinfo [1] isblank [1] rand_r [1] verrx [2] 2628 atoi [1] getcwd [1] jrand48 [1] random [1] vfscanf [2] 2629 atol [1] getdate [1] l64a [1] realloc [1] vscanf [2] 2630 atoll [1] getenv [1] labs [1] realpath [1] vsscanf [2] 2631 basename [1] getlogin [1] lcong48 [1] remque [1] vsyslog [2] 2632 bsearch [1] getnameinfo [1] ldiv [1] seed48 [1] warn [2] 2633 calloc [1] getopt [2] lfind [1] setenv [1] warnx [2] 2634 closelog [1] getopt_long [2] llabs [1] sethostname [2] wordexp 2635 [1] 2636 confstr [1] getopt_long_only [2] lldiv [1] setlogmask [1] 2637 wordfree [1] 2638 cuserid [3] getsubopt [1] longjmp [1] setstate [1] 2639 daemon [2] gettimeofday [1] lrand48 [1] srand [1] 2640 2641 Referenced Specification(s) 2642 2643 [1]. ISO POSIX (2003) 2644 2645 [2]. this specification 2646 2647 [3]. SUSv2 2648 2649 An LSB conforming implementation shall provide the generic 2650 data interfaces for Standard Library specified in Table 1-23, 2651 with the full mandatory functionality as described in the 2652 referenced underlying specification. 2653 2654 Table 1-23. libc - Standard Library Data Interfaces 2655 __environ [1] _sys_errlist [1] getdate_err [2] opterr [2] 2656 optopt [2] 2657 _environ [1] environ [2] optarg [2] optind [2] 2658 2659 Referenced Specification(s) 2660 2661 [1]. this specification 2662 2663 [2]. ISO POSIX (2003) 2664 _________________________________________________________ 2665 2666 1.4. Data Definitions for libc 2667 2668 This section defines global identifiers and their values that 2669 are associated with interfaces contained in libc. These 2670 definitions are organized into groups that correspond to 2671 system headers. This convention is used as a convenience for 2672 the reader, and does not imply the existence of these headers, 2673 or their content. 2674 2675 These definitions are intended to supplement those provided in 2676 the referenced underlying specifications. 2677 2678 This specification uses ISO/IEC 9899 C Language as the 2679 reference programming language, and data definitions are 2680 specified in ISO C format. The C language is used here as a 2681 convenient notation. Using a C language description of these 2682 data objects does not preclude their use by other programming 2683 languages. 2684 _________________________________________________________ 2685 2686 1.4.1. ctype.h 2687 2688 enum 2689 { 2690 _ISupper, _ISlower, _ISalpha, _ISdigit, _ISxdigit, _ISspace, _ISprint 2691 , 2692 _ISgraph, _ISblank, _IScntrl, _ISpunct, _ISalnum 2693 } 2694 ; 2695 _________________________________________________________ 2696 2697 1.4.2. dirent.h 2698 2699 typedef struct __dirstream DIR; 2700 2701 struct dirent 2702 { 2703 long int d_ino; 2704 off_t d_off; 2705 unsigned short d_reclen; 2706 unsigned char d_type; 2707 char d_name[256]; 2708 } 2709 ; 2710 struct dirent64 2711 { 2712 uint64_t d_ino; 2713 int64_t d_off; 2714 unsigned short d_reclen; 2715 unsigned char d_type; 2716 char d_name[256]; 2717 } 2718 ; 2719 _________________________________________________________ 2720 2721 1.4.3. errno.h 2722 2723 ISO POSIX (2003) requires that each error value shall be 2724 unique, with permission for EAGAIN and EWOULDBLOCK possibly 2725 having the same value. This specification also requires that 2726 ENOTSUP and EOPNOTSUPP have the same value. 2727 2728 Note: A defect report against ISO POSIX (2003) has been 2729 filed to request that specification also permit these two 2730 symbols to have the same value. 2731 2732 #define errno (*__errno_location()) 2733 2734 #define EPERM 1 2735 #define ECHILD 10 2736 #define ENETDOWN 100 2737 #define ENETUNREACH 101 2738 #define ENETRESET 102 2739 #define ECONNABORTED 103 2740 #define ECONNRESET 104 2741 #define ENOBUFS 105 2742 #define EISCONN 106 2743 #define ENOTCONN 107 2744 #define ESHUTDOWN 108 2745 #define ETOOMANYREFS 109 2746 #define EAGAIN 11 2747 #define ETIMEDOUT 110 2748 #define ECONNREFUSED 111 2749 #define EHOSTDOWN 112 2750 #define EHOSTUNREACH 113 2751 #define EALREADY 114 2752 #define EINPROGRESS 115 2753 #define ESTALE 116 2754 #define EUCLEAN 117 2755 #define ENOTNAM 118 2756 #define ENAVAIL 119 2757 #define ENOMEM 12 2758 #define EISNAM 120 2759 #define EREMOTEIO 121 2760 #define EDQUOT 122 2761 #define ENOMEDIUM 123 2762 #define EMEDIUMTYPE 124 2763 #define ECANCELED 125 2764 #define EACCES 13 2765 #define EFAULT 14 2766 #define ENOTBLK 15 2767 #define EBUSY 16 2768 #define EEXIST 17 2769 #define EXDEV 18 2770 #define ENODEV 19 2771 #define ENOENT 2 2772 #define ENOTDIR 20 2773 #define EISDIR 21 2774 #define EINVAL 22 2775 #define ENFILE 23 2776 #define EMFILE 24 2777 #define ENOTTY 25 2778 #define ETXTBSY 26 2779 #define EFBIG 27 2780 #define ENOSPC 28 2781 #define ESPIPE 29 2782 #define ESRCH 3 2783 #define EROFS 30 2784 #define EMLINK 31 2785 #define EPIPE 32 2786 #define EDOM 33 2787 #define ERANGE 34 2788 #define EDEADLK 35 2789 #define ENAMETOOLONG 36 2790 #define ENOLCK 37 2791 #define ENOSYS 38 2792 #define ENOTEMPTY 39 2793 #define EINTR 4 2794 #define ELOOP 40 2795 #define ENOMSG 42 2796 #define EIDRM 43 2797 #define ECHRNG 44 2798 #define EL2NSYNC 45 2799 #define EL3HLT 46 2800 #define EL3RST 47 2801 #define ELNRNG 48 2802 #define EUNATCH 49 2803 #define EIO 5 2804 #define ENOANO 55 2805 #define EBADRQC 56 2806 #define EBADSLT 57 2807 #define EBFONT 59 2808 #define ENXIO 6 2809 #define ENOSTR 60 2810 #define ENODATA 61 2811 #define ETIME 62 2812 #define ENOSR 63 2813 #define ENONET 64 2814 #define ENOPKG 65 2815 #define EREMOTE 66 2816 #define ENOLINK 67 2817 #define EADV 68 2818 #define ESRMNT 69 2819 #define E2BIG 7 2820 #define ECOMM 70 2821 #define EPROTO 71 2822 #define EMULTIHOP 72 2823 #define EDOTDOT 73 2824 #define EBADMSG 74 2825 #define EOVERFLOW 75 2826 #define ENOTUNIQ 76 2827 #define EBADFD 77 2828 #define EREMCHG 78 2829 #define ELIBACC 79 2830 #define ENOEXEC 8 2831 #define ELIBBAD 80 2832 #define ELIBSCN 81 2833 #define ELIBMAX 82 2834 #define ELIBEXEC 83 2835 #define EILSEQ 84 2836 #define ERESTART 85 2837 #define ESTRPIPE 86 2838 #define EUSERS 87 2839 #define ENOTSOCK 88 2840 #define EDESTADDRREQ 89 2841 #define EBADF 9 2842 #define EMSGSIZE 90 2843 #define EPROTOTYPE 91 2844 #define ENOPROTOOPT 92 2845 #define EPROTONOSUPPORT 93 2846 #define ESOCKTNOSUPPORT 94 2847 #define EOPNOTSUPP 95 2848 #define EPFNOSUPPORT 96 2849 #define EAFNOSUPPORT 97 2850 #define EADDRINUSE 98 2851 #define EADDRNOTAVAIL 99 2852 #define EWOULDBLOCK EAGAIN 2853 #define ENOTSUP EOPNOTSUPP 2854 _________________________________________________________ 2855 2856 1.4.4. fcntl.h 2857 2858 #define O_RDONLY 00 2859 #define O_ACCMODE 0003 2860 #define O_WRONLY 01 2861 #define O_CREAT 0100 2862 #define O_TRUNC 01000 2863 #define O_SYNC 010000 2864 #define O_RDWR 02 2865 #define O_EXCL 0200 2866 #define O_APPEND 02000 2867 #define O_ASYNC 020000 2868 #define O_NOCTTY 0400 2869 #define O_NDELAY 04000 2870 #define O_NONBLOCK 04000 2871 #define FD_CLOEXEC 1 2872 2873 struct flock 2874 { 2875 short l_type; 2876 short l_whence; 2877 off_t l_start; 2878 off_t l_len; 2879 pid_t l_pid; 2880 } 2881 ; 2882 struct flock64 2883 { 2884 short l_type; 2885 short l_whence; 2886 loff_t l_start; 2887 loff_t l_len; 2888 pid_t l_pid; 2889 } 2890 ; 2891 2892 #define F_DUPFD 0 2893 #define F_RDLCK 0 2894 #define F_GETFD 1 2895 #define F_WRLCK 1 2896 #define F_SETFD 2 2897 #define F_UNLCK 2 2898 #define F_GETFL 3 2899 #define F_SETFL 4 2900 #define F_GETLK 5 2901 #define F_SETLK 6 2902 #define F_SETLKW 7 2903 #define F_SETOWN 8 2904 #define F_GETOWN 9 2905 _________________________________________________________ 2906 2907 1.4.5. fmtmsg.h 2908 2909 #define MM_HARD 1 2910 #define MM_NRECOV 128 2911 #define MM_UTIL 16 2912 #define MM_SOFT 2 2913 #define MM_OPSYS 32 2914 #define MM_FIRM 4 2915 #define MM_RECOVER 64 2916 #define MM_APPL 8 2917 2918 #define MM_NOSEV 0 2919 #define MM_HALT 1 2920 #define MM_ERROR 2 2921 2922 #define MM_NULLLBL ((char *) 0) 2923 _________________________________________________________ 2924 2925 1.4.6. fnmatch.h 2926 2927 #define FNM_PATHNAME (1<<0) 2928 #define FNM_NOESCAPE (1<<1) 2929 #define FNM_PERIOD (1<<2) 2930 #define FNM_NOMATCH 1 2931 _________________________________________________________ 2932 2933 1.4.7. ftw.h 2934 2935 #define FTW_D FTW_D 2936 #define FTW_DNR FTW_DNR 2937 #define FTW_DP FTW_DP 2938 #define FTW_F FTW_F 2939 #define FTW_NS FTW_NS 2940 #define FTW_SL FTW_SL 2941 #define FTW_SLN FTW_SLN 2942 2943 enum 2944 { 2945 FTW_F, FTW_D, FTW_DNR, FTW_NS, FTW_SL, FTW_DP, FTW_SLN 2946 } 2947 ; 2948 2949 enum 2950 { 2951 FTW_PHYS, FTW_MOUNT, FTW_CHDIR, FTW_DEPTH 2952 } 2953 ; 2954 2955 struct FTW 2956 { 2957 int base; 2958 int level; 2959 } 2960 ; 2961 2962 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status, 2963 int __flag); 2964 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __stat 2965 us, 2966 int __flag); 2967 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status, 2968 int __flag, struct FTW * __info); 2969 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __sta 2970 tus, 2971 int __flag, struct FTW * __info); 2972 _________________________________________________________ 2973 2974 1.4.8. getopt.h 2975 2976 #define no_argument 0 2977 #define required_argument 1 2978 #define optional_argument 2 2979 2980 struct option 2981 { 2982 char *name; 2983 int has_arg; 2984 int *flag; 2985 int val; 2986 } 2987 ; 2988 _________________________________________________________ 2989 2990 1.4.9. glob.h 2991 2992 #define GLOB_ERR (1<<0) 2993 #define GLOB_MARK (1<<1) 2994 #define GLOB_BRACE (1<<10) 2995 #define GLOB_NOMAGIC (1<<11) 2996 #define GLOB_TILDE (1<<12) 2997 #define GLOB_ONLYDIR (1<<13) 2998 #define GLOB_TILDE_CHECK (1<<14) 2999 #define GLOB_NOSORT (1<<2) 3000 #define GLOB_DOOFFS (1<<3) 3001 #define GLOB_NOCHECK (1<<4) 3002 #define GLOB_APPEND (1<<5) 3003 #define GLOB_NOESCAPE (1<<6) 3004 #define GLOB_PERIOD (1<<7) 3005 #define GLOB_MAGCHAR (1<<8) 3006 #define GLOB_ALTDIRFUNC (1<<9) 3007 3008 #define GLOB_NOSPACE 1 3009 #define GLOB_ABORTED 2 3010 #define GLOB_NOMATCH 3 3011 #define GLOB_NOSYS 4 3012 3013 typedef struct 3014 { 3015 size_t gl_pathc; 3016 char **gl_pathv; 3017 size_t gl_offs; 3018 int gl_flags; 3019 void (*gl_closedir) (void *); 3020 struct dirent *(*gl_readdir) (void *); 3021 void *(*gl_opendir) (const char *); 3022 int (*gl_lstat) (const char *, struct stat *); 3023 int (*gl_stat) (const char *, struct stat *); 3024 } 3025 glob_t; 3026 3027 typedef struct 3028 { 3029 size_t gl_pathc; 3030 char **gl_pathv; 3031 size_t gl_offs; 3032 int gl_flags; 3033 void (*gl_closedir) (void *); 3034 struct dirent64 *(*gl_readdir64) (void *); 3035 void *(*gl_opendir) (const char *); 3036 int (*gl_lstat) (const char *, struct stat *); 3037 int (*gl_stat) (const char *, struct stat *); 3038 } 3039 glob64_t; 3040 _________________________________________________________ 3041 3042 1.4.10. grp.h 3043 3044 struct group 3045 { 3046 char *gr_name; 3047 char *gr_passwd; 3048 gid_t gr_gid; 3049 char **gr_mem; 3050 } 3051 ; 3052 _________________________________________________________ 3053 3054 1.4.11. iconv.h 3055 3056 typedef void *iconv_t; 3057 _________________________________________________________ 3058 3059 1.4.12. inttypes.h 3060 3061 typedef lldiv_t imaxdiv_t; 3062 typedef unsigned char uint8_t; 3063 typedef unsigned short uint16_t; 3064 typedef unsigned int uint32_t; 3065 _________________________________________________________ 3066 3067 1.4.13. langinfo.h 3068 3069 #define ABDAY_1 0x20000 3070 #define ABDAY_2 0x20001 3071 #define ABDAY_3 0x20002 3072 #define ABDAY_4 0x20003 3073 #define ABDAY_5 0x20004 3074 #define ABDAY_6 0x20005 3075 #define ABDAY_7 0x20006 3076 3077 #define DAY_1 0x20007 3078 #define DAY_2 0x20008 3079 #define DAY_3 0x20009 3080 #define DAY_4 0x2000A 3081 #define DAY_5 0x2000B 3082 #define DAY_6 0x2000C 3083 #define DAY_7 0x2000D 3084 3085 #define ABMON_1 0x2000E 3086 #define ABMON_2 0x2000F 3087 #define ABMON_3 0x20010 3088 #define ABMON_4 0x20011 3089 #define ABMON_5 0x20012 3090 #define ABMON_6 0x20013 3091 #define ABMON_7 0x20014 3092 #define ABMON_8 0x20015 3093 #define ABMON_9 0x20016 3094 #define ABMON_10 0x20017 3095 #define ABMON_11 0x20018 3096 #define ABMON_12 0x20019 3097 3098 #define MON_1 0x2001A 3099 #define MON_2 0x2001B 3100 #define MON_3 0x2001C 3101 #define MON_4 0x2001D 3102 #define MON_5 0x2001E 3103 #define MON_6 0x2001F 3104 #define MON_7 0x20020 3105 #define MON_8 0x20021 3106 #define MON_9 0x20022 3107 #define MON_10 0x20023 3108 #define MON_11 0x20024 3109 #define MON_12 0x20025 3110 3111 #define AM_STR 0x20026 3112 #define PM_STR 0x20027 3113 3114 #define D_T_FMT 0x20028 3115 #define D_FMT 0x20029 3116 #define T_FMT 0x2002A 3117 #define T_FMT_AMPM 0x2002B 3118 3119 #define ERA 0x2002C 3120 #define ERA_D_FMT 0x2002E 3121 #define ALT_DIGITS 0x2002F 3122 #define ERA_D_T_FMT 0x20030 3123 #define ERA_T_FMT 0x20031 3124 3125 #define CODESET 14 3126 3127 #define CRNCYSTR 0x4000F 3128 3129 #define RADIXCHAR 0x10000 3130 #define THOUSEP 0x10001 3131 #define YESEXPR 0x50000 3132 #define NOEXPR 0x50001 3133 #define YESSTR 0x50002 3134 #define NOSTR 0x50003 3135 _________________________________________________________ 3136 3137 1.4.14. limits.h 3138 3139 #define LLONG_MIN (-LLONG_MAX-1LL) 3140 #define ULLONG_MAX 18446744073709551615ULL 3141 #define OPEN_MAX 256 3142 #define PATH_MAX 4096 3143 #define LLONG_MAX 9223372036854775807LL 3144 #define SSIZE_MAX LONG_MAX 3145 3146 #define MB_LEN_MAX 16 3147 3148 #define SCHAR_MIN (-128) 3149 #define SCHAR_MAX 127 3150 #define UCHAR_MAX 255 3151 #define CHAR_BIT 8 3152 3153 #define SHRT_MIN (-32768) 3154 #define SHRT_MAX 32767 3155 #define USHRT_MAX 65535 3156 3157 #define INT_MIN (-INT_MAX-1) 3158 #define INT_MAX 2147483647 3159 #define __INT_MAX__ 2147483647 3160 #define UINT_MAX 4294967295U 3161 3162 #define LONG_MIN (-LONG_MAX-1L) 3163 3164 #define PTHREAD_KEYS_MAX 1024 3165 #define PTHREAD_STACK_MIN 16384 3166 #define PTHREAD_THREADS_MAX 16384 3167 #define PTHREAD_DESTRUCTOR_ITERATIONS 4 3168 _________________________________________________________ 3169 3170 1.4.15. locale.h 3171 3172 struct lconv 3173 { 3174 char *decimal_point; 3175 char *thousands_sep; 3176 char *grouping; 3177 char *int_curr_symbol; 3178 char *currency_symbol; 3179 char *mon_decimal_point; 3180 char *mon_thousands_sep; 3181 char *mon_grouping; 3182 char *positive_sign; 3183 char *negative_sign; 3184 char int_frac_digits; 3185 char frac_digits; 3186 char p_cs_precedes; 3187 char p_sep_by_space; 3188 char n_cs_precedes; 3189 char n_sep_by_space; 3190 char p_sign_posn; 3191 char n_sign_posn; 3192 char int_p_cs_precedes; 3193 char int_p_sep_by_space; 3194 char int_n_cs_precedes; 3195 char int_n_sep_by_space; 3196 char int_p_sign_posn; 3197 char int_n_sign_posn; 3198 } 3199 ; 3200 #define LC_GLOBAL_LOCALE ((locale_t) -1L) 3201 #define LC_CTYPE 0 3202 #define LC_NUMERIC 1 3203 #define LC_TELEPHONE 10 3204 #define LC_MEASUREMENT 11 3205 #define LC_IDENTIFICATION 12 3206 #define LC_TIME 2 3207 #define LC_COLLATE 3 3208 #define LC_MONETARY 4 3209 #define LC_MESSAGES 5 3210 #define LC_ALL 6 3211 #define LC_PAPER 7 3212 #define LC_NAME 8 3213 #define LC_ADDRESS 9 3214 3215 typedef struct __locale_struct 3216 { 3217 struct locale_data *__locales[13]; 3218 const unsigned short *__ctype_b; 3219 const int *__ctype_tolower; 3220 const int *__ctype_toupper; 3221 const char *__names[13]; 3222 } 3223 *__locale_t; 3224 3225 typedef struct __locale_struct *locale_t; 3226 #define LC_ADDRESS_MASK (1 << LC_ADDRESS) 3227 #define LC_COLLATE_MASK (1 << LC_COLLATE) 3228 #define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) 3229 #define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) 3230 #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 3231 #define LC_MONETARY_MASK (1 << LC_MONETARY) 3232 #define LC_NAME_MASK (1 << LC_NAME) 3233 #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 3234 #define LC_PAPER_MASK (1 << LC_PAPER) 3235 #define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) 3236 #define LC_TIME_MASK (1 << LC_TIME) 3237 #define LC_CTYPE_MASK (1<cl_ops->cl_control)(cl,rq,in)) 3655 #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 3656 #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) ((*(rh) 3657 ->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) 3658 #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) 3659 #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh 3660 ,xres,resp)) 3661 #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) 3662 #define NULLPROC ((u_long)0) 3663 #define CLSET_TIMEOUT 1 3664 #define CLGET_XID 10 3665 #define CLSET_XID 11 3666 #define CLGET_VERS 12 3667 #define CLSET_VERS 13 3668 #define CLGET_PROG 14 3669 #define CLSET_PROG 15 3670 #define CLGET_TIMEOUT 2 3671 #define CLGET_SERVER_ADDR 3 3672 #define CLSET_RETRY_TIMEOUT 4 3673 #define CLGET_RETRY_TIMEOUT 5 3674 #define CLGET_FD 6 3675 #define CLGET_SVC_ADDR 7 3676 #define CLSET_FD_CLOSE 8 3677 #define CLSET_FD_NCLOSE 9 3678 3679 enum clnt_stat 3680 { 3681 RPC_SUCCESS, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 2, RPC_CANTS 3682 END = 3683 3, RPC_CANTRECV = 4, RPC_TIMEDOUT = 5, RPC_VERSMISMATCH = 3684 6, RPC_AUTHERROR = 7, RPC_PROGUNAVAIL = 8, RPC_PROGVERSMISMATCH = 3685 9, RPC_PROCUNAVAIL = 10, RPC_CANTDECODEARGS = 11, RPC_SYSTEMERROR = 3686 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 3687 17, RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 14, RPC_PROGNOTREGISTER 3688 ED = 3689 15, RPC_N2AXLATEFAILURE = 22, RPC_FAILED = 16, RPC_INTR = 3690 18, RPC_TLIERROR = 20, RPC_UDERROR = 23, RPC_INPROGRESS = 3691 24, RPC_STALERACHANDLE = 25 3692 } 3693 ; 3694 struct rpc_err 3695 { 3696 enum clnt_stat re_status; 3697 union 3698 { 3699 int RE_errno; 3700 enum auth_stat RE_why; 3701 struct 3702 { 3703 u_long low; 3704 u_long high; 3705 } 3706 RE_vers; 3707 struct 3708 { 3709 long int s1; 3710 long int s2; 3711 } 3712 RE_lb; 3713 } 3714 ru; 3715 } 3716 ; 3717 3718 typedef struct CLIENT 3719 { 3720 struct AUTH *cl_auth; 3721 struct clnt_ops *cl_ops; 3722 caddr_t cl_private; 3723 } 3724 CLIENT; 3725 3726 struct clnt_ops 3727 { 3728 enum clnt_stat (*cl_call) (struct CLIENT *, u_long, xdrproc_t, caddr_ 3729 t, 3730 xdrproc_t, caddr_t, struct timeval); 3731 void (*cl_abort) (void); 3732 void (*cl_geterr) (struct CLIENT *, struct rpc_err *); 3733 bool_t (*cl_freeres) (struct CLIENT *, xdrproc_t, caddr_t); 3734 void (*cl_destroy) (struct CLIENT *); 3735 bool_t (*cl_control) (struct CLIENT *, int, char *); 3736 } 3737 ; 3738 _________________________________________________________ 3739 3740 1.4.28. rpc/rpc_msg.h 3741 3742 enum msg_type 3743 { 3744 CALL, REPLY = 1 3745 } 3746 ; 3747 enum reply_stat 3748 { 3749 MSG_ACCEPTED, MSG_DENIED = 1 3750 } 3751 ; 3752 enum accept_stat 3753 { 3754 SUCCESS, PROG_UNAVAIL = 1, PROG_MISMATCH = 2, PROC_UNAVAIL = 3755 3, GARBAGE_ARGS = 4, SYSTEM_ERR = 5 3756 } 3757 ; 3758 enum reject_stat 3759 { 3760 RPC_MISMATCH, AUTH_ERROR = 1 3761 } 3762 ; 3763 3764 struct accepted_reply 3765 { 3766 struct opaque_auth ar_verf; 3767 enum accept_stat ar_stat; 3768 union 3769 { 3770 struct 3771 { 3772 unsigned long int low; 3773 unsigned long int high; 3774 } 3775 AR_versions; 3776 struct 3777 { 3778 caddr_t where; 3779 xdrproc_t proc; 3780 } 3781 AR_results; 3782 } 3783 ru; 3784 } 3785 ; 3786 3787 struct rejected_reply 3788 { 3789 enum reject_stat rj_stat; 3790 union 3791 { 3792 struct 3793 { 3794 unsigned long int low; 3795 unsigned long int high; 3796 } 3797 RJ_versions; 3798 enum auth_stat RJ_why; 3799 } 3800 ru; 3801 } 3802 ; 3803 3804 struct reply_body 3805 { 3806 enum reply_stat rp_stat; 3807 union 3808 { 3809 struct accepted_reply RP_ar; 3810 struct rejected_reply RP_dr; 3811 } 3812 ru; 3813 } 3814 ; 3815 3816 struct call_body 3817 { 3818 unsigned long int cb_rpcvers; 3819 unsigned long int cb_prog; 3820 unsigned long int cb_vers; 3821 unsigned long int cb_proc; 3822 struct opaque_auth cb_cred; 3823 struct opaque_auth cb_verf; 3824 } 3825 ; 3826 3827 struct rpc_msg 3828 { 3829 unsigned long int rm_xid; 3830 enum msg_type rm_direction; 3831 union 3832 { 3833 struct call_body RM_cmb; 3834 struct reply_body RM_rmb; 3835 } 3836 ru; 3837 } 3838 ; 3839 _________________________________________________________ 3840 3841 1.4.29. rpc/svc.h 3842 3843 #define svc_freeargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_freeargs)( 3844 (xprt), (xargs), (argsp)) 3845 #define svc_getargs(xprt,xargs, argsp) (*(xprt)->xp_ops->xp_getargs)(( 3846 xprt), (xargs), (argsp)) 3847 #define RPC_ANYSOCK -1 3848 3849 typedef struct SVCXPRT 3850 { 3851 int xp_sock; 3852 u_short xp_port; 3853 struct xp_ops *xp_ops; 3854 int xp_addrlen; 3855 struct sockaddr_in xp_raddr; 3856 struct opaque_auth xp_verf; 3857 caddr_t xp_p1; 3858 caddr_t xp_p2; 3859 char xp_pad[256]; 3860 } 3861 SVCXPRT; 3862 3863 struct svc_req 3864 { 3865 rpcprog_t rq_prog; 3866 rpcvers_t rq_vers; 3867 rpcproc_t rq_proc; 3868 struct opaque_auth rq_cred; 3869 caddr_t rq_clntcred; 3870 SVCXPRT *rq_xprt; 3871 } 3872 ; 3873 3874 typedef void (*__dispatch_fn_t) (struct svc_req *, SVCXPRT *); 3875 3876 struct xp_ops 3877 { 3878 bool_t (*xp_recv) (SVCXPRT * __xprt, struct rpc_msg * __msg); 3879 enum xprt_stat (*xp_stat) (SVCXPRT * __xprt); 3880 bool_t (*xp_getargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 3881 caddr_t args_ptr); 3882 bool_t (*xp_reply) (SVCXPRT * __xprt, struct rpc_msg * __msg); 3883 bool_t (*xp_freeargs) (SVCXPRT * __xprt, xdrproc_t __xdr_args, 3884 caddr_t args_ptr); 3885 void (*xp_destroy) (SVCXPRT * __xprt); 3886 } 3887 ; 3888 _________________________________________________________ 3889 3890 1.4.30. rpc/types.h 3891 3892 typedef int bool_t; 3893 typedef int enum_t; 3894 typedef unsigned long int rpcprog_t; 3895 typedef unsigned long int rpcvers_t; 3896 typedef unsigned long int rpcproc_t; 3897 typedef unsigned long int rpcprot_t; 3898 _________________________________________________________ 3899 3900 1.4.31. rpc/xdr.h 3901 3902 enum xdr_op 3903 { 3904 XDR_ENCODE, XDR_DECODE, XDR_FREE 3905 } 3906 ; 3907 typedef struct XDR 3908 { 3909 enum xdr_op x_op; 3910 struct xdr_ops *x_ops; 3911 caddr_t x_public; 3912 caddr_t x_private; 3913 caddr_t x_base; 3914 int x_handy; 3915 } 3916 XDR; 3917 3918 struct xdr_ops 3919 { 3920 bool_t (*x_getlong) (XDR * __xdrs, long int *__lp); 3921 bool_t (*x_putlong) (XDR * __xdrs, long int *__lp); 3922 bool_t (*x_getbytes) (XDR * __xdrs, caddr_t __addr, u_int __len); 3923 bool_t (*x_putbytes) (XDR * __xdrs, char *__addr, u_int __len); 3924 u_int (*x_getpostn) (XDR * __xdrs); 3925 bool_t (*x_setpostn) (XDR * __xdrs, u_int __pos); 3926 int32_t *(*x_inline) (XDR * __xdrs, int __len); 3927 void (*x_destroy) (XDR * __xdrs); 3928 bool_t (*x_getint32) (XDR * __xdrs, int32_t * __ip); 3929 bool_t (*x_putint32) (XDR * __xdrs, int32_t * __ip); 3930 } 3931 ; 3932 3933 typedef bool_t (*xdrproc_t) (XDR *, void *, ...); 3934 3935 struct xdr_discrim 3936 { 3937 int value; 3938 xdrproc_t proc; 3939 } 3940 ; 3941 _________________________________________________________ 3942 3943 1.4.32. sched.h 3944 3945 #define SCHED_OTHER 0 3946 #define SCHED_FIFO 1 3947 #define SCHED_RR 2 3948 3949 struct sched_param 3950 { 3951 int sched_priority; 3952 } 3953 ; 3954 _________________________________________________________ 3955 3956 1.4.33. search.h 3957 3958 typedef struct entry 3959 { 3960 char *key; 3961 void *data; 3962 } 3963 ENTRY; 3964 typedef enum 3965 { 3966 FIND, ENTER 3967 } 3968 ACTION; 3969 typedef enum 3970 { 3971 preorder, postorder, endorder, leaf 3972 } 3973 VISIT; 3974 3975 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __leve 3976 l); 3977 _________________________________________________________ 3978 3979 1.4.34. setjmp.h 3980 3981 #define setjmp(env) _setjmp(env) 3982 #define sigsetjmp(a,b) __sigsetjmp(a,b) 3983 3984 struct __jmp_buf_tag 3985 { 3986 __jmp_buf __jmpbuf; 3987 int __mask_was_saved; 3988 sigset_t __saved_mask; 3989 } 3990 ; 3991 3992 typedef struct __jmp_buf_tag jmp_buf[1]; 3993 typedef jmp_buf sigjmp_buf; 3994 _________________________________________________________ 3995 3996 1.4.35. signal.h 3997 3998 #define _SIGSET_NWORDS (1024/(8*sizeof(unsigned long))) 3999 #define SIGRTMAX (__libc_current_sigrtmax ()) 4000 #define SIGRTMIN (__libc_current_sigrtmin ()) 4001 #define SIG_BLOCK 0 4002 #define SIG_UNBLOCK 1 4003 #define SIG_SETMASK 2 4004 #define NSIG 65 4005 4006 typedef int sig_atomic_t; 4007 4008 typedef void (*sighandler_t) (int); 4009 #define SIG_HOLD ((sighandler_t) 2) 4010 #define SIG_ERR ((sighandler_t)-1) 4011 #define SIG_DFL ((sighandler_t)0) 4012 #define SIG_IGN ((sighandler_t)1) 4013 4014 #define SIGHUP 1 4015 #define SIGUSR1 10 4016 #define SIGSEGV 11 4017 #define SIGUSR2 12 4018 #define SIGPIPE 13 4019 #define SIGALRM 14 4020 #define SIGTERM 15 4021 #define SIGSTKFLT 16 4022 #define SIGCHLD 17 4023 #define SIGCONT 18 4024 #define SIGSTOP 19 4025 #define SIGINT 2 4026 #define SIGTSTP 20 4027 #define SIGTTIN 21 4028 #define SIGTTOU 22 4029 #define SIGURG 23 4030 #define SIGXCPU 24 4031 #define SIGXFSZ 25 4032 #define SIGVTALRM 26 4033 #define SIGPROF 27 4034 #define SIGWINCH 28 4035 #define SIGIO 29 4036 #define SIGQUIT 3 4037 #define SIGPWR 30 4038 #define SIGSYS 31 4039 #define SIGUNUSED 31 4040 #define SIGILL 4 4041 #define SIGTRAP 5 4042 #define SIGABRT 6 4043 #define SIGIOT 6 4044 #define SIGBUS 7 4045 #define SIGFPE 8 4046 #define SIGKILL 9 4047 #define SIGCLD SIGCHLD 4048 #define SIGPOLL SIGIO 4049 4050 #define SV_ONSTACK (1<<0) 4051 #define SV_INTERRUPT (1<<1) 4052 #define SV_RESETHAND (1<<2) 4053 4054 typedef union sigval 4055 { 4056 int sival_int; 4057 void *sival_ptr; 4058 } 4059 sigval_t; 4060 #define SIGEV_SIGNAL 0 4061 #define SIGEV_NONE 1 4062 #define SIGEV_THREAD 2 4063 #define SIGEV_MAX_SIZE 64 4064 4065 typedef struct sigevent 4066 { 4067 sigval_t sigev_value; 4068 int sigev_signo; 4069 int sigev_notify; 4070 union 4071 { 4072 int _pad[SIGEV_PAD_SIZE]; 4073 struct 4074 { 4075 void (*sigev_thread_func) (sigval_t); 4076 void *_attribute; 4077 } 4078 _sigev_thread; 4079 } 4080 _sigev_un; 4081 } 4082 sigevent_t; 4083 #define SI_MAX_SIZE 128 4084 #define si_pid _sifields._kill._pid 4085 #define si_uid _sifields._kill._uid 4086 #define si_value _sifields._rt._sigval 4087 #define si_int _sifields._rt._sigval.sival_int 4088 #define si_ptr _sifields._rt._sigval.sival_ptr 4089 #define si_status _sifields._sigchld._status 4090 #define si_stime _sifields._sigchld._stime 4091 #define si_utime _sifields._sigchld._utime 4092 #define si_addr _sifields._sigfault._addr 4093 #define si_band _sifields._sigpoll._band 4094 #define si_fd _sifields._sigpoll._fd 4095 #define si_timer1 _sifields._timer._timer1 4096 #define si_timer2 _sifields._timer._timer2 4097 4098 typedef struct siginfo 4099 { 4100 int si_signo; 4101 int si_errno; 4102 int si_code; 4103 union 4104 { 4105 int _pad[SI_PAD_SIZE]; 4106 struct 4107 { 4108 pid_t _pid; 4109 uid_t _uid; 4110 } 4111 _kill; 4112 struct 4113 { 4114 unsigned int _timer1; 4115 unsigned int _timer2; 4116 } 4117 _timer; 4118 struct 4119 { 4120 pid_t _pid; 4121 uid_t _uid; 4122 sigval_t _sigval; 4123 } 4124 _rt; 4125 struct 4126 { 4127 pid_t _pid; 4128 uid_t _uid; 4129 int _status; 4130 clock_t _utime; 4131 clock_t _stime; 4132 } 4133 _sigchld; 4134 struct 4135 { 4136 void *_addr; 4137 } 4138 _sigfault; 4139 struct 4140 { 4141 int _band; 4142 int _fd; 4143 } 4144 _sigpoll; 4145 } 4146 _sifields; 4147 } 4148 siginfo_t; 4149 #define SI_QUEUE -1 4150 #define SI_TIMER -2 4151 #define SI_MESGQ -3 4152 #define SI_ASYNCIO -4 4153 #define SI_SIGIO -5 4154 #define SI_TKILL -6 4155 #define SI_ASYNCNL -60 4156 #define SI_USER 0 4157 #define SI_KERNEL 0x80 4158 4159 #define ILL_ILLOPC 1 4160 #define ILL_ILLOPN 2 4161 #define ILL_ILLADR 3 4162 #define ILL_ILLTRP 4 4163 #define ILL_PRVOPC 5 4164 #define ILL_PRVREG 6 4165 #define ILL_COPROC 7 4166 #define ILL_BADSTK 8 4167 4168 #define FPE_INTDIV 1 4169 #define FPE_INTOVF 2 4170 #define FPE_FLTDIV 3 4171 #define FPE_FLTOVF 4 4172 #define FPE_FLTUND 5 4173 #define FPE_FLTRES 6 4174 #define FPE_FLTINV 7 4175 #define FPE_FLTSUB 8 4176 4177 #define SEGV_MAPERR 1 4178 #define SEGV_ACCERR 2 4179 4180 #define BUS_ADRALN 1 4181 #define BUS_ADRERR 2 4182 #define BUS_OBJERR 3 4183 4184 #define TRAP_BRKPT 1 4185 #define TRAP_TRACE 2 4186 4187 #define CLD_EXITED 1 4188 #define CLD_KILLED 2 4189 #define CLD_DUMPED 3 4190 #define CLD_TRAPPED 4 4191 #define CLD_STOPPED 5 4192 #define CLD_CONTINUED 6 4193 4194 #define POLL_IN 1 4195 #define POLL_OUT 2 4196 #define POLL_MSG 3 4197 #define POLL_ERR 4 4198 #define POLL_PRI 5 4199 #define POLL_HUP 6 4200 4201 typedef struct 4202 { 4203 unsigned long int sig[_SIGSET_NWORDS]; 4204 } 4205 sigset_t; 4206 #define SA_NOCLDSTOP 0x00000001 4207 #define SA_NOCLDWAIT 0x00000002 4208 #define SA_SIGINFO 0x00000004 4209 #define SA_ONSTACK 0x08000000 4210 #define SA_RESTART 0x10000000 4211 #define SA_INTERRUPT 0x20000000 4212 #define SA_NODEFER 0x40000000 4213 #define SA_RESETHAND 0x80000000 4214 #define SA_NOMASK SA_NODEFER 4215 #define SA_ONESHOT SA_RESETHAND 4216 4217 typedef struct sigaltstack 4218 { 4219 void *ss_sp; 4220 int ss_flags; 4221 size_t ss_size; 4222 } 4223 stack_t; 4224 #define SS_ONSTACK 1 4225 #define SS_DISABLE 2 4226 _________________________________________________________ 4227 4228 1.4.36. stddef.h 4229 4230 #define offsetof(TYPE,MEMBER) ((size_t)& ((TYPE*)0)->MEMBER) 4231 #define NULL (0L) 4232 4233 typedef int wchar_t; 4234 _________________________________________________________ 4235 4236 1.4.37. stdio.h 4237 4238 #define EOF (-1) 4239 #define P_tmpdir "/tmp" 4240 #define FOPEN_MAX 16 4241 #define L_tmpnam 20 4242 #define FILENAME_MAX 4096 4243 #define BUFSIZ 8192 4244 #define L_ctermid 9 4245 #define L_cuserid 9 4246 4247 typedef struct 4248 { 4249 off_t __pos; 4250 mbstate_t __state; 4251 } 4252 fpos_t; 4253 typedef struct 4254 { 4255 off64_t __pos; 4256 mbstate_t __state; 4257 } 4258 fpos64_t; 4259 4260 typedef struct _IO_FILE FILE; 4261 #define _IOFBF 0 4262 #define _IOLBF 1 4263 #define _IONBF 2 4264 _________________________________________________________ 4265 4266 1.4.38. stdlib.h 4267 4268 #define MB_CUR_MAX (__ctype_get_mb_cur_max()) 4269 #define EXIT_SUCCESS 0 4270 #define EXIT_FAILURE 1 4271 #define RAND_MAX 2147483647 4272 4273 typedef int (*__compar_fn_t) (const void *, const void *); 4274 struct random_data 4275 { 4276 int32_t *fptr; 4277 int32_t *rptr; 4278 int32_t *state; 4279 int rand_type; 4280 int rand_deg; 4281 int rand_sep; 4282 int32_t *end_ptr; 4283 } 4284 ; 4285 4286 typedef struct 4287 { 4288 int quot; 4289 int rem; 4290 } 4291 div_t; 4292 4293 typedef struct 4294 { 4295 long int quot; 4296 long int rem; 4297 } 4298 ldiv_t; 4299 4300 typedef struct 4301 { 4302 long long int quot; 4303 long long int rem; 4304 } 4305 lldiv_t; 4306 _________________________________________________________ 4307 4308 1.4.39. sys/file.h 4309 4310 #define LOCK_SH 1 4311 #define LOCK_EX 2 4312 #define LOCK_NB 4 4313 #define LOCK_UN 8 4314 _________________________________________________________ 4315 4316 1.4.40. sys/ipc.h 4317 4318 #define IPC_PRIVATE ((key_t)0) 4319 #define IPC_RMID 0 4320 #define IPC_CREAT 00001000 4321 #define IPC_EXCL 00002000 4322 #define IPC_NOWAIT 00004000 4323 #define IPC_SET 1 4324 #define IPC_STAT 2 4325 _________________________________________________________ 4326 4327 1.4.41. sys/mman.h 4328 4329 #define MAP_FAILED ((void*)-1) 4330 #define PROT_NONE 0x0 4331 #define MAP_SHARED 0x01 4332 #define MAP_PRIVATE 0x02 4333 #define PROT_READ 0x1 4334 #define MAP_FIXED 0x10 4335 #define PROT_WRITE 0x2 4336 #define MAP_ANONYMOUS 0x20 4337 #define PROT_EXEC 0x4 4338 #define MS_ASYNC 1 4339 #define MS_INVALIDATE 2 4340 #define MS_SYNC 4 4341 #define MAP_ANON MAP_ANONYMOUS 4342 _________________________________________________________ 4343 4344 1.4.42. sys/msg.h 4345 4346 #define MSG_NOERROR 010000 4347 _________________________________________________________ 4348 4349 1.4.43. sys/param.h 4350 4351 #define NOFILE 256 4352 #define MAXPATHLEN 4096 4353 _________________________________________________________ 4354 4355 1.4.44. sys/poll.h 4356 4357 #define POLLIN 0x0001 4358 #define POLLPRI 0x0002 4359 #define POLLOUT 0x0004 4360 #define POLLERR 0x0008 4361 #define POLLHUP 0x0010 4362 #define POLLNVAL 0x0020 4363 4364 struct pollfd 4365 { 4366 int fd; 4367 short events; 4368 short revents; 4369 } 4370 ; 4371 typedef unsigned long int nfds_t; 4372 _________________________________________________________ 4373 4374 1.4.45. sys/resource.h 4375 4376 #define RUSAGE_CHILDREN (-1) 4377 #define RUSAGE_BOTH (-2) 4378 #define RLIM_INFINITY (~0UL) 4379 #define RLIM_SAVED_CUR -1 4380 #define RLIM_SAVED_MAX -1 4381 #define RLIMIT_CPU 0 4382 #define RUSAGE_SELF 0 4383 #define RLIMIT_FSIZE 1 4384 #define RLIMIT_DATA 2 4385 #define RLIMIT_STACK 3 4386 #define RLIMIT_CORE 4 4387 #define RLIMIT_NOFILE 7 4388 #define RLIMIT_AS 9 4389 4390 typedef unsigned long int rlim_t; 4391 typedef unsigned long long int rlim64_t; 4392 typedef int __rlimit_resource_t; 4393 4394 struct rlimit 4395 { 4396 rlim_t rlim_cur; 4397 rlim_t rlim_max; 4398 } 4399 ; 4400 struct rlimit64 4401 { 4402 rlim64_t rlim_cur; 4403 rlim64_t rlim_max; 4404 } 4405 ; 4406 4407 struct rusage 4408 { 4409 struct timeval ru_utime; 4410 struct timeval ru_stime; 4411 long int ru_maxrss; 4412 long int ru_ixrss; 4413 long int ru_idrss; 4414 long int ru_isrss; 4415 long int ru_minflt; 4416 long int ru_majflt; 4417 long int ru_nswap; 4418 long int ru_inblock; 4419 long int ru_oublock; 4420 long int ru_msgsnd; 4421 long int ru_msgrcv; 4422 long int ru_nsignals; 4423 long int ru_nvcsw; 4424 long int ru_nivcsw; 4425 } 4426 ; 4427 4428 enum __priority_which 4429 { 4430 PRIO_PROCESS, PRIO_PGRP = 1, PRIO_USER = 2 4431 } 4432 ; 4433 #define PRIO_PGRP PRIO_PGRP 4434 #define PRIO_PROCESS PRIO_PROCESS 4435 #define PRIO_USER PRIO_USER 4436 4437 typedef enum __priority_which __priority_which_t; 4438 _________________________________________________________ 4439 4440 1.4.46. sys/sem.h 4441 4442 #define SEM_UNDO 0x1000 4443 #define GETPID 11 4444 #define GETVAL 12 4445 #define GETALL 13 4446 #define GETNCNT 14 4447 #define GETZCNT 15 4448 #define SETVAL 16 4449 #define SETALL 17 4450 4451 struct sembuf 4452 { 4453 short sem_num; 4454 short sem_op; 4455 short sem_flg; 4456 } 4457 ; 4458 _________________________________________________________ 4459 4460 1.4.47. sys/shm.h 4461 4462 #define SHM_RDONLY 010000 4463 #define SHM_W 0200 4464 #define SHM_RND 020000 4465 #define SHM_R 0400 4466 #define SHM_REMAP 040000 4467 #define SHM_LOCK 11 4468 #define SHM_UNLOCK 12 4469 _________________________________________________________ 4470 4471 1.4.48. sys/socket.h 4472 4473 #define CMSG_NXTHDR(mhdr,cmsg) ( ((cmsg) == NULL) ? CMSG_FIRSTHDR(mhd 4474 r) : (((unsigned char *)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) + CMSG_AL 4475 IGN(sizeof(struct cmsghdr)) > (unsigned char *)((mhdr)->msg_control) + 4476 (mhdr)->msg_controllen) ? (struct cmsghdr *)NULL :(struct cmsghdr *)((u 4477 nsi 4478 #define CMSG_ALIGN(len) (((len)+sizeof(size_t)-1)& (size_t)~(sizeof(siz 4479 e_t)-1)) 4480 #define CMSG_FIRSTHDR(msg) ((size_t) (mhdr)->msg_controllen >= siz 4481 eof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct 4482 cmsghdr *) NULL) 4483 #define CMSG_DATA(cmsg) ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof(s 4484 truct cmsghdr))) 4485 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len)) 4486 #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN( 4487 len)) 4488 #define SCM_RIGHTS 0x01 4489 #define SOL_SOCKET 1 4490 #define SOMAXCONN 128 4491 #define SOL_RAW 255 4492 4493 struct linger 4494 { 4495 int l_onoff; 4496 int l_linger; 4497 } 4498 ; 4499 struct cmsghdr 4500 { 4501 size_t cmsg_len; 4502 int cmsg_level; 4503 int cmsg_type; 4504 } 4505 ; 4506 struct iovec 4507 { 4508 void *iov_base; 4509 size_t iov_len; 4510 } 4511 ; 4512 4513 typedef unsigned short sa_family_t; 4514 typedef unsigned int socklen_t; 4515 4516 struct sockaddr 4517 { 4518 sa_family_t sa_family; 4519 char sa_data[14]; 4520 } 4521 ; 4522 struct sockaddr_storage 4523 { 4524 sa_family_t ss_family; 4525 __ss_aligntype __ss_align; 4526 char __ss_padding[(128 - (2 * sizeof (__ss_aligntype)))]; 4527 } 4528 ; 4529 4530 struct msghdr 4531 { 4532 void *msg_name; 4533 int msg_namelen; 4534 struct iovec *msg_iov; 4535 size_t msg_iovlen; 4536 void *msg_control; 4537 size_t msg_controllen; 4538 unsigned int msg_flags; 4539 } 4540 ; 4541 #define AF_UNSPEC 0 4542 #define AF_UNIX 1 4543 #define AF_INET6 10 4544 #define AF_INET 2 4545 4546 #define PF_INET AF_INET 4547 #define PF_INET6 AF_INET6 4548 #define PF_UNIX AF_UNIX 4549 #define PF_UNSPEC AF_UNSPEC 4550 4551 #define SOCK_STREAM 1 4552 #define SOCK_PACKET 10 4553 #define SOCK_DGRAM 2 4554 #define SOCK_RAW 3 4555 #define SOCK_RDM 4 4556 #define SOCK_SEQPACKET 5 4557 4558 #define SO_DEBUG 1 4559 #define SO_OOBINLINE 10 4560 #define SO_NO_CHECK 11 4561 #define SO_PRIORITY 12 4562 #define SO_LINGER 13 4563 #define SO_REUSEADDR 2 4564 #define SO_TYPE 3 4565 #define SO_ACCEPTCONN 30 4566 #define SO_ERROR 4 4567 #define SO_DONTROUTE 5 4568 #define SO_BROADCAST 6 4569 #define SO_SNDBUF 7 4570 #define SO_RCVBUF 8 4571 #define SO_KEEPALIVE 9 4572 4573 #define SIOCGIFFLAGS 0x8913 4574 #define SIOCGIFADDR 0x8915 4575 #define SIOCGIFNETMASK 0x891b 4576 4577 #define SHUT_RD 0 4578 #define SHUT_WR 1 4579 #define SHUT_RDWR 2 4580 #define MSG_DONTROUTE 4 4581 4582 #define MSG_WAITALL 0x100 4583 #define MSG_TRUNC 0x20 4584 #define MSG_EOR 0x80 4585 #define MSG_OOB 1 4586 #define MSG_PEEK 2 4587 #define MSG_CTRUNC 8 4588 _________________________________________________________ 4589 4590 1.4.49. sys/stat.h 4591 4592 #define S_ISBLK(m) (((m)& S_IFMT)==S_IFBLK) 4593 #define S_ISCHR(m) (((m)& S_IFMT)==S_IFCHR) 4594 #define S_ISDIR(m) (((m)& S_IFMT)==S_IFDIR) 4595 #define S_ISFIFO(m) (((m)& S_IFMT)==S_IFIFO) 4596 #define S_ISLNK(m) (((m)& S_IFMT)==S_IFLNK) 4597 #define S_ISREG(m) (((m)& S_IFMT)==S_IFREG) 4598 #define S_ISSOCK(m) (((m)& S_IFMT)==S_IFSOCK) 4599 #define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) 4600 #define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) 4601 #define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) 4602 #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) 4603 #define S_IROTH (S_IRGRP>>3) 4604 #define S_IRGRP (S_IRUSR>>3) 4605 #define S_IRWXO (S_IRWXG>>3) 4606 #define S_IRWXG (S_IRWXU>>3) 4607 #define S_IWOTH (S_IWGRP>>3) 4608 #define S_IWGRP (S_IWUSR>>3) 4609 #define S_IXOTH (S_IXGRP>>3) 4610 #define S_IXGRP (S_IXUSR>>3) 4611 #define S_ISVTX 01000 4612 #define S_IXUSR 0x0040 4613 #define S_IWUSR 0x0080 4614 #define S_IRUSR 0x0100 4615 #define S_ISGID 0x0400 4616 #define S_ISUID 0x0800 4617 #define S_IFIFO 0x1000 4618 #define S_IFCHR 0x2000 4619 #define S_IFDIR 0x4000 4620 #define S_IFBLK 0x6000 4621 #define S_IFREG 0x8000 4622 #define S_IFLNK 0xa000 4623 #define S_IFSOCK 0xc000 4624 #define S_IFMT 0xf000 4625 #define st_atime st_atim.tv_sec 4626 #define st_ctime st_ctim.tv_sec 4627 #define st_mtime st_mtim.tv_sec 4628 #define S_IREAD S_IRUSR 4629 #define S_IWRITE S_IWUSR 4630 #define S_IEXEC S_IXUSR 4631 _________________________________________________________ 4632 4633 1.4.50. sys/time.h 4634 4635 #define ITIMER_REAL 0 4636 #define ITIMER_VIRTUAL 1 4637 #define ITIMER_PROF 2 4638 4639 struct timezone 4640 { 4641 int tz_minuteswest; 4642 int tz_dsttime; 4643 } 4644 ; 4645 4646 typedef int __itimer_which_t; 4647 4648 struct timespec 4649 { 4650 time_t tv_sec; 4651 long int tv_nsec; 4652 } 4653 ; 4654 4655 struct timeval 4656 { 4657 time_t tv_sec; 4658 suseconds_t tv_usec; 4659 } 4660 ; 4661 4662 struct itimerval 4663 { 4664 struct timeval it_interval; 4665 struct timeval it_value; 4666 } 4667 ; 4668 _________________________________________________________ 4669 4670 1.4.51. sys/timeb.h 4671 4672 struct timeb 4673 { 4674 time_t time; 4675 unsigned short millitm; 4676 short timezone; 4677 short dstflag; 4678 } 4679 ; 4680 _________________________________________________________ 4681 4682 1.4.52. sys/times.h 4683 4684 struct tms 4685 { 4686 clock_t tms_utime; 4687 clock_t tms_stime; 4688 clock_t tms_cutime; 4689 clock_t tms_cstime; 4690 } 4691 ; 4692 _________________________________________________________ 4693 4694 1.4.53. sys/types.h 4695 4696 #define FD_ISSET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& (1<<( 4697 (d)%(8*sizeof(long))))) 4698 #define FD_CLR(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]& =~(1< 4699 <((d)%(8*sizeof(long))))) 4700 #define FD_SET(d,set) ((set)->fds_bits[((d)/(8*sizeof(long)))]|=(1<<( 4701 (d)%(8*sizeof(long))))) 4702 #define FALSE 0 4703 #define TRUE 1 4704 #define FD_SETSIZE 1024 4705 #define FD_ZERO(fdsetp) bzero(fdsetp, sizeof(*(fdsetp))) 4706 4707 typedef signed char int8_t; 4708 typedef short int16_t; 4709 typedef int int32_t; 4710 typedef unsigned char u_int8_t; 4711 typedef unsigned short u_int16_t; 4712 typedef unsigned int u_int32_t; 4713 typedef unsigned int uid_t; 4714 typedef int pid_t; 4715 typedef unsigned long int off_t; 4716 typedef int key_t; 4717 typedef long int suseconds_t; 4718 typedef unsigned int u_int; 4719 typedef struct 4720 { 4721 int __val[2]; 4722 } 4723 fsid_t; 4724 typedef unsigned int useconds_t; 4725 typedef unsigned long int blksize_t; 4726 typedef long int fd_mask; 4727 typedef int timer_t; 4728 typedef int clockid_t; 4729 4730 typedef unsigned int id_t; 4731 4732 typedef unsigned long long int ino64_t; 4733 typedef long long int loff_t; 4734 typedef unsigned long int blkcnt_t; 4735 typedef unsigned long int fsblkcnt_t; 4736 typedef unsigned long int fsfilcnt_t; 4737 typedef unsigned long long int blkcnt64_t; 4738 typedef unsigned long long int fsblkcnt64_t; 4739 typedef unsigned long long int fsfilcnt64_t; 4740 typedef unsigned char u_char; 4741 typedef unsigned short u_short; 4742 typedef unsigned long int u_long; 4743 4744 typedef unsigned long int ino_t; 4745 typedef unsigned int gid_t; 4746 typedef unsigned long long int dev_t; 4747 typedef unsigned int mode_t; 4748 typedef unsigned long int nlink_t; 4749 typedef char *caddr_t; 4750 4751 typedef struct 4752 { 4753 unsigned long int fds_bits[__FDSET_LONGS]; 4754 } 4755 fd_set; 4756 4757 typedef long int clock_t; 4758 typedef long int time_t; 4759 _________________________________________________________ 4760 4761 1.4.54. sys/un.h 4762 4763 #define UNIX_PATH_MAX 108 4764 4765 struct sockaddr_un 4766 { 4767 sa_family_t sun_family; 4768 char sun_path[UNIX_PATH_MAX]; 4769 } 4770 ; 4771 _________________________________________________________ 4772 4773 1.4.55. sys/utsname.h 4774 4775 #define SYS_NMLN 65 4776 4777 struct utsname 4778 { 4779 char sysname[65]; 4780 char nodename[65]; 4781 char release[65]; 4782 char version[65]; 4783 char machine[65]; 4784 char domainname[65]; 4785 } 4786 ; 4787 _________________________________________________________ 4788 4789 1.4.56. sys/wait.h 4790 4791 #define WIFSIGNALED(status) (!WIFSTOPPED(status) & & !WIFEXITED(sta 4792 tus)) 4793 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) 4794 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) 4795 #define WTERMSIG(status) ((status) & 0x7f) 4796 #define WCOREDUMP(status) ((status) & 0x80) 4797 #define WIFEXITED(status) (WTERMSIG(status) == 0) 4798 #define WNOHANG 0x00000001 4799 #define WUNTRACED 0x00000002 4800 #define WCOREFLAG 0x80 4801 #define WSTOPSIG(status) WEXITSTATUS(status) 4802 4803 typedef enum 4804 { 4805 P_ALL, P_PID, P_PGID 4806 } 4807 idtype_t; 4808 _________________________________________________________ 4809 4810 1.4.57. syslog.h 4811 4812 #define LOG_EMERG 0 4813 #define LOG_PRIMASK 0x07 4814 #define LOG_ALERT 1 4815 #define LOG_CRIT 2 4816 #define LOG_ERR 3 4817 #define LOG_WARNING 4 4818 #define LOG_NOTICE 5 4819 #define LOG_INFO 6 4820 #define LOG_DEBUG 7 4821 4822 #define LOG_KERN (0<<3) 4823 #define LOG_AUTHPRIV (10<<3) 4824 #define LOG_FTP (11<<3) 4825 #define LOG_USER (1<<3) 4826 #define LOG_MAIL (2<<3) 4827 #define LOG_DAEMON (3<<3) 4828 #define LOG_AUTH (4<<3) 4829 #define LOG_SYSLOG (5<<3) 4830 #define LOG_LPR (6<<3) 4831 #define LOG_NEWS (7<<3) 4832 #define LOG_UUCP (8<<3) 4833 #define LOG_CRON (9<<3) 4834 #define LOG_FACMASK 0x03f8 4835 4836 #define LOG_LOCAL0 (16<<3) 4837 #define LOG_LOCAL1 (17<<3) 4838 #define LOG_LOCAL2 (18<<3) 4839 #define LOG_LOCAL3 (19<<3) 4840 #define LOG_LOCAL4 (20<<3) 4841 #define LOG_LOCAL5 (21<<3) 4842 #define LOG_LOCAL6 (22<<3) 4843 #define LOG_LOCAL7 (23<<3) 4844 4845 #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) 4846 #define LOG_MASK(pri) (1 << (pri)) 4847 4848 #define LOG_PID 0x01 4849 #define LOG_CONS 0x02 4850 #define LOG_ODELAY 0x04 4851 #define LOG_NDELAY 0x08 4852 #define LOG_NOWAIT 0x10 4853 #define LOG_PERROR 0x20 4854 _________________________________________________________ 4855 4856 1.4.58. termios.h 4857 4858 #define TCIFLUSH 0 4859 #define TCOOFF 0 4860 #define TCSANOW 0 4861 #define BS0 0000000 4862 #define CR0 0000000 4863 #define FF0 0000000 4864 #define NL0 0000000 4865 #define TAB0 0000000 4866 #define VT0 0000000 4867 #define OPOST 0000001 4868 #define OCRNL 0000010 4869 #define ONOCR 0000020 4870 #define ONLRET 0000040 4871 #define OFILL 0000100 4872 #define OFDEL 0000200 4873 #define NL1 0000400 4874 #define TCOFLUSH 1 4875 #define TCOON 1 4876 #define TCSADRAIN 1 4877 #define TCIOFF 2 4878 #define TCIOFLUSH 2 4879 #define TCSAFLUSH 2 4880 #define TCION 3 4881 4882 typedef unsigned int speed_t; 4883 typedef unsigned char cc_t; 4884 typedef unsigned int tcflag_t; 4885 #define NCCS 32 4886 4887 struct termios 4888 { 4889 tcflag_t c_iflag; 4890 tcflag_t c_oflag; 4891 tcflag_t c_cflag; 4892 tcflag_t c_lflag; 4893 cc_t c_line; 4894 cc_t c_cc[NCCS]; 4895 speed_t c_ispeed; 4896 speed_t c_ospeed; 4897 } 4898 ; 4899 #define VINTR 0 4900 #define VQUIT 1 4901 #define VLNEXT 15 4902 #define VERASE 2 4903 #define VKILL 3 4904 #define VEOF 4 4905 4906 #define IGNBRK 0000001 4907 #define BRKINT 0000002 4908 #define IGNPAR 0000004 4909 #define PARMRK 0000010 4910 #define INPCK 0000020 4911 #define ISTRIP 0000040 4912 #define INLCR 0000100 4913 #define IGNCR 0000200 4914 #define ICRNL 0000400 4915 #define IXANY 0004000 4916 #define IMAXBEL 0020000 4917 4918 #define CS5 0000000 4919 4920 #define ECHO 0000010 4921 4922 #define B0 0000000 4923 #define B50 0000001 4924 #define B75 0000002 4925 #define B110 0000003 4926 #define B134 0000004 4927 #define B150 0000005 4928 #define B200 0000006 4929 #define B300 0000007 4930 #define B600 0000010 4931 #define B1200 0000011 4932 #define B1800 0000012 4933 #define B2400 0000013 4934 #define B4800 0000014 4935 #define B9600 0000015 4936 #define B19200 0000016 4937 #define B38400 0000017 4938 _________________________________________________________ 4939 4940 1.4.59. time.h 4941 4942 #define CLK_TCK ((clock_t)__sysconf(2)) 4943 #define CLOCK_REALTIME 0 4944 #define TIMER_ABSTIME 1 4945 #define CLOCKS_PER_SEC 1000000l 4946 4947 struct tm 4948 { 4949 int tm_sec; 4950 int tm_min; 4951 int tm_hour; 4952 int tm_mday; 4953 int tm_mon; 4954 int tm_year; 4955 int tm_wday; 4956 int tm_yday; 4957 int tm_isdst; 4958 long int tm_gmtoff; 4959 char *tm_zone; 4960 } 4961 ; 4962 struct itimerspec 4963 { 4964 struct timespec it_interval; 4965 struct timespec it_value; 4966 } 4967 ; 4968 _________________________________________________________ 4969 4970 1.4.60. ulimit.h 4971 4972 #define UL_GETFSIZE 1 4973 #define UL_SETFSIZE 2 4974 _________________________________________________________ 4975 4976 1.4.61. unistd.h 4977 4978 The LSB requires _XOPEN_REALTIME to be defined to 1, but does 4979 not require all the set of functions required by the ISO POSIX 4980 (2003) XSI Option Group _XOPEN_REALTIME. For example, the 4981 asynchronous input/output functions are optional for LSB 4982 conforming systems. 4983 #define SEEK_SET 0 4984 #define STDIN_FILENO 0 4985 #define SEEK_CUR 1 4986 #define STDOUT_FILENO 1 4987 #define SEEK_END 2 4988 #define STDERR_FILENO 2 4989 4990 typedef long long int off64_t; 4991 #define F_OK 0 4992 #define X_OK 1 4993 #define W_OK 2 4994 #define R_OK 4 4995 4996 #define _POSIX_VDISABLE '\0' 4997 #define _POSIX_CHOWN_RESTRICTED 1 4998 #define _POSIX_JOB_CONTROL 1 4999 #define _POSIX_NO_TRUNC 1 5000 #define _POSIX_SHELL 1 5001 #define _POSIX_FSYNC 200112 5002 #define _POSIX_MAPPED_FILES 200112 5003 #define _POSIX_MEMLOCK 200112 5004 #define _POSIX_MEMLOCK_RANGE 200112 5005 #define _POSIX_MEMORY_PROTECTION 200112 5006 #define _POSIX_SEMAPHORES 200112 5007 #define _POSIX_SHARED_MEMORY_OBJECTS 200112 5008 #define _POSIX_TIMERS 200112 5009 #define _POSIX2_C_BIND 200112L 5010 #define _POSIX_THREADS 200112L 5011 5012 #define _PC_LINK_MAX 0 5013 #define _PC_MAX_CANON 1 5014 #define _PC_ASYNC_IO 10 5015 #define _PC_PRIO_IO 11 5016 #define _PC_FILESIZEBITS 13 5017 #define _PC_REC_INCR_XFER_SIZE 14 5018 #define _PC_REC_MIN_XFER_SIZE 16 5019 #define _PC_REC_XFER_ALIGN 17 5020 #define _PC_ALLOC_SIZE_MIN 18 5021 #define _PC_MAX_INPUT 2 5022 #define _PC_2_SYMLINKS 20 5023 #define _PC_NAME_MAX 3 5024 #define _PC_PATH_MAX 4 5025 #define _PC_PIPE_BUF 5 5026 #define _PC_CHOWN_RESTRICTED 6 5027 #define _PC_NO_TRUNC 7 5028 #define _PC_VDISABLE 8 5029 #define _PC_SYNC_IO 9 5030 5031 #define _SC_ARG_MAX 0 5032 #define _SC_CHILD_MAX 1 5033 #define _SC_PRIORITY_SCHEDULING 10 5034 #define _SC_TIMERS 11 5035 #define _SC_ASYNCHRONOUS_IO 12 5036 #define _SC_XBS5_ILP32_OFF32 125 5037 #define _SC_XBS5_ILP32_OFFBIG 126 5038 #define _SC_XBS5_LP64_OFF64 127 5039 #define _SC_XBS5_LPBIG_OFFBIG 128 5040 #define _SC_XOPEN_LEGACY 129 5041 #define _SC_PRIORITIZED_IO 13 5042 #define _SC_XOPEN_REALTIME 130 5043 #define _SC_XOPEN_REALTIME_THREADS 131 5044 #define _SC_ADVISORY_INFO 132 5045 #define _SC_BARRIERS 133 5046 #define _SC_CLOCK_SELECTION 137 5047 #define _SC_CPUTIME 138 5048 #define _SC_THREAD_CPUTIME 139 5049 #define _SC_SYNCHRONIZED_IO 14 5050 #define _SC_MONOTONIC_CLOCK 149 5051 #define _SC_FSYNC 15 5052 #define _SC_READER_WRITER_LOCKS 153 5053 #define _SC_SPIN_LOCKS 154 5054 #define _SC_REGEXP 155 5055 #define _SC_SHELL 157 5056 #define _SC_SPAWN 159 5057 #define _SC_MAPPED_FILES 16 5058 #define _SC_SPORADIC_SERVER 160 5059 #define _SC_THREAD_SPORADIC_SERVER 161 5060 #define _SC_TIMEOUTS 164 5061 #define _SC_TYPED_MEMORY_OBJECTS 165 5062 #define _SC_2_PBS_ACCOUNTING 169 5063 #define _SC_MEMLOCK 17 5064 #define _SC_2_PBS_LOCATE 170 5065 #define _SC_2_PBS_MESSAGE 171 5066 #define _SC_2_PBS_TRACK 172 5067 #define _SC_SYMLOOP_MAX 173 5068 #define _SC_2_PBS_CHECKPOINT 175 5069 #define _SC_V6_ILP32_OFF32 176 5070 #define _SC_V6_ILP32_OFFBIG 177 5071 #define _SC_V6_LP64_OFF64 178 5072 #define _SC_V6_LPBIG_OFFBIG 179 5073 #define _SC_MEMLOCK_RANGE 18 5074 #define _SC_HOST_NAME_MAX 180 5075 #define _SC_TRACE 181 5076 #define _SC_TRACE_EVENT_FILTER 182 5077 #define _SC_TRACE_INHERIT 183 5078 #define _SC_TRACE_LOG 184 5079 #define _SC_MEMORY_PROTECTION 19 5080 #define _SC_CLK_TCK 2 5081 #define _SC_MESSAGE_PASSING 20 5082 #define _SC_SEMAPHORES 21 5083 #define _SC_SHARED_MEMORY_OBJECTS 22 5084 #define _SC_AIO_LISTIO_MAX 23 5085 #define _SC_AIO_MAX 24 5086 #define _SC_AIO_PRIO_DELTA_MAX 25 5087 #define _SC_DELAYTIMER_MAX 26 5088 #define _SC_MQ_OPEN_MAX 27 5089 #define _SC_MQ_PRIO_MAX 28 5090 #define _SC_VERSION 29 5091 #define _SC_NGROUPS_MAX 3 5092 #define _SC_PAGESIZE 30 5093 #define _SC_PAGE_SIZE 30 5094 #define _SC_RTSIG_MAX 31 5095 #define _SC_SEM_NSEMS_MAX 32 5096 #define _SC_SEM_VALUE_MAX 33 5097 #define _SC_SIGQUEUE_MAX 34 5098 #define _SC_TIMER_MAX 35 5099 #define _SC_BC_BASE_MAX 36 5100 #define _SC_BC_DIM_MAX 37 5101 #define _SC_BC_SCALE_MAX 38 5102 #define _SC_BC_STRING_MAX 39 5103 #define _SC_OPEN_MAX 4 5104 #define _SC_COLL_WEIGHTS_MAX 40 5105 #define _SC_EXPR_NEST_MAX 42 5106 #define _SC_LINE_MAX 43 5107 #define _SC_RE_DUP_MAX 44 5108 #define _SC_2_VERSION 46 5109 #define _SC_2_C_BIND 47 5110 #define _SC_2_C_DEV 48 5111 #define _SC_2_FORT_DEV 49 5112 #define _SC_STREAM_MAX 5 5113 #define _SC_2_FORT_RUN 50 5114 #define _SC_2_SW_DEV 51 5115 #define _SC_2_LOCALEDEF 52 5116 #define _SC_TZNAME_MAX 6 5117 #define _SC_IOV_MAX 60 5118 #define _SC_THREADS 67 5119 #define _SC_THREAD_SAFE_FUNCTIONS 68 5120 #define _SC_GETGR_R_SIZE_MAX 69 5121 #define _SC_JOB_CONTROL 7 5122 #define _SC_GETPW_R_SIZE_MAX 70 5123 #define _SC_LOGIN_NAME_MAX 71 5124 #define _SC_TTY_NAME_MAX 72 5125 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 73 5126 #define _SC_THREAD_KEYS_MAX 74 5127 #define _SC_THREAD_STACK_MIN 75 5128 #define _SC_THREAD_THREADS_MAX 76 5129 #define _SC_THREAD_ATTR_STACKADDR 77 5130 #define _SC_THREAD_ATTR_STACKSIZE 78 5131 #define _SC_THREAD_PRIORITY_SCHEDULING 79 5132 #define _SC_SAVED_IDS 8 5133 #define _SC_THREAD_PRIO_INHERIT 80 5134 #define _SC_THREAD_PRIO_PROTECT 81 5135 #define _SC_THREAD_PROCESS_SHARED 82 5136 #define _SC_ATEXIT_MAX 87 5137 #define _SC_PASS_MAX 88 5138 #define _SC_XOPEN_VERSION 89 5139 #define _SC_REALTIME_SIGNALS 9 5140 #define _SC_XOPEN_UNIX 91 5141 #define _SC_XOPEN_CRYPT 92 5142 #define _SC_XOPEN_ENH_I18N 93 5143 #define _SC_XOPEN_SHM 94 5144 #define _SC_2_CHAR_TERM 95 5145 #define _SC_2_C_VERSION 96 5146 #define _SC_2_UPE 97 5147 5148 #define _CS_PATH 0 5149 #define _POSIX_REGEXP 1 5150 #define _CS_XBS5_ILP32_OFF32_CFLAGS 1100 5151 #define _CS_XBS5_ILP32_OFF32_LDFLAGS 1101 5152 #define _CS_XBS5_ILP32_OFF32_LIBS 1102 5153 #define _CS_XBS5_ILP32_OFF32_LINTFLAGS 1103 5154 #define _CS_XBS5_ILP32_OFFBIG_CFLAGS 1104 5155 #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 1105 5156 #define _CS_XBS5_ILP32_OFFBIG_LIBS 1106 5157 #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 1107 5158 #define _CS_XBS5_LP64_OFF64_CFLAGS 1108 5159 #define _CS_XBS5_LP64_OFF64_LDFLAGS 1109 5160 #define _CS_XBS5_LP64_OFF64_LIBS 1110 5161 #define _CS_XBS5_LP64_OFF64_LINTFLAGS 1111 5162 #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 1112 5163 #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 1113 5164 #define _CS_XBS5_LPBIG_OFFBIG_LIBS 1114 5165 #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 1115 5166 5167 #define _XOPEN_XPG4 1 5168 5169 #define F_ULOCK 0 5170 #define F_LOCK 1 5171 #define F_TLOCK 2 5172 #define F_TEST 3 5173 _________________________________________________________ 5174 5175 1.4.62. utime.h 5176 5177 struct utimbuf 5178 { 5179 time_t actime; 5180 time_t modtime; 5181 } 5182 ; 5183 _________________________________________________________ 5184 5185 1.4.63. utmp.h 5186 5187 #define UT_HOSTSIZE 256 5188 #define UT_LINESIZE 32 5189 #define UT_NAMESIZE 32 5190 5191 struct exit_status 5192 { 5193 short e_termination; 5194 short e_exit; 5195 } 5196 ; 5197 5198 #define EMPTY 0 5199 #define RUN_LVL 1 5200 #define BOOT_TIME 2 5201 #define NEW_TIME 3 5202 #define OLD_TIME 4 5203 #define INIT_PROCESS 5 5204 #define LOGIN_PROCESS 6 5205 #define USER_PROCESS 7 5206 #define DEAD_PROCESS 8 5207 #define ACCOUNTING 9 5208 _________________________________________________________ 5209 5210 1.4.64. wchar.h 5211 5212 #define WEOF (0xffffffffu) 5213 #define WCHAR_MAX 0x7FFFFFFF 5214 #define WCHAR_MIN 0x80000000 5215 _________________________________________________________ 5216 5217 1.4.65. wctype.h 5218 5219 typedef unsigned long int wctype_t; 5220 typedef unsigned int wint_t; 5221 typedef const int32_t *wctrans_t; 5222 typedef struct 5223 { 5224 int count; 5225 wint_t value; 5226 } 5227 __mbstate_t; 5228 5229 typedef __mbstate_t mbstate_t; 5230 _________________________________________________________ 5231 5232 1.4.66. wordexp.h 5233 5234 enum 5235 { 5236 WRDE_DOOFFS, WRDE_APPEND, WRDE_NOCMD, WRDE_REUSE, WRDE_SHOWERR, WRDE_ 5237 UNDEF, 5238 __WRDE_FLAGS 5239 } 5240 ; 5241 5242 typedef struct 5243 { 5244 int we_wordc; 5245 char **we_wordv; 5246 int we_offs; 5247 } 5248 wordexp_t; 5249 5250 enum 5251 { 5252 WRDE_NOSYS, WRDE_NOSPACE, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB, 5253 WRDE_SYNTAX 5254 } 5255 ; 5256 _________________________________________________________ 5257 5258 1.5. Interface Definitions for libc 5259 5260 Table of Contents 5261 _IO_feof -- alias for feof 5262 _IO_getc -- alias for getc 5263 _IO_putc -- alias for putc 5264 _IO_puts -- alias for puts 5265 __assert_fail -- abort the program after false assertion 5266 __ctype_b_loc -- accessor function for __ctype_b array for 5267 ctype functions 5268 5269 __ctype_get_mb_cur_max -- maximum length of a multibyte 5270 character in the current locale 5271 5272 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 5273 array for ctype tolower() function 5274 5275 __ctype_toupper_loc -- accessor function for 5276 __ctype_b_toupper() array for ctype toupper() function 5277 5278 __cxa_atexit -- register a function to be called by exit or 5279 when a shared library is unloaded 5280 5281 __daylight -- Daylight savings time flag 5282 __environ -- alias for environ - user environment 5283 __errno_location -- address of errno variable 5284 __fpending -- returns in bytes the amount of output pending on 5285 a stream 5286 5287 __getpagesize -- alias for getpagesize - get current page size 5288 5289 __getpgid -- get the process group id 5290 __h_errno_location -- address of h_errno variable 5291 __isinf -- test for infinity 5292 __isinff -- test for infinity 5293 __isinfl -- test for infinity 5294 __isnan -- test for infinity 5295 __isnanf -- test for infinity 5296 __isnanl -- test for infinity 5297 __libc_current_sigrtmax -- return number of available 5298 real-time signal with lowest priority 5299 5300 __libc_current_sigrtmin -- return number of available 5301 real-time signal with highest priority 5302 5303 __libc_start_main -- initialization routine 5304 __lxstat -- inline wrapper around call to lxstat 5305 __mempcpy -- copy given number of bytes of source to 5306 destination 5307 5308 __rawmemchr -- scan memory 5309 __register_atfork -- alias for register_atfork 5310 __sigsetjmp -- save stack context for non-local goto 5311 __stpcpy -- copy a string returning a pointer to its end 5312 __strdup -- alias for strdup 5313 __strtod_internal -- underlying function for strtod 5314 __strtof_internal -- underlying function for strtof 5315 __strtok_r -- alias for strtok_r 5316 __strtol_internal -- alias for strtol 5317 __strtold_internal -- underlying function for strtold 5318 __strtoll_internal -- underlying function for strtoll 5319 __strtoul_internal -- underlying function for strtoul 5320 __strtoull_internal -- underlying function for strtoull 5321 __sysconf -- get configuration information at runtime 5322 __sysv_signal -- signal handling 5323 __timezone -- global variable containing timezone 5324 __tzname -- global variable containing the timezone 5325 __wcstod_internal -- underlying function for wcstod 5326 __wcstof_internal -- underlying function for wcstof 5327 __wcstol_internal -- underlying function for wcstol 5328 __wcstold_internal -- underlying function for wcstold 5329 __wcstoul_internal -- underlying function for wcstoul 5330 __xmknod -- make block or character special file 5331 __xstat -- Get File Status 5332 __xstat64 -- Get File Status 5333 _environ -- alias for environ - user environment 5334 _nl_msg_cat_cntr -- new catalog load counter 5335 _sys_errlist -- array containing the "C" locale strings used 5336 by strerror() 5337 5338 _sys_siglist -- array containing the names of the signal names 5339 acct -- switch process accounting on or off 5340 adjtime -- correct the time to allow synchronization of the 5341 system clock 5342 5343 asprintf -- write formatted output to a dynamically allocated 5344 string 5345 5346 bind_textdomain_codeset -- specify encoding for message 5347 retrieval 5348 5349 bindresvport -- bind socket to privileged IP port 5350 bindtextdomain -- specify the location of a message catalog 5351 cfmakeraw -- get and set terminal attributes 5352 cfsetspeed -- set terminal input and output data rate 5353 daemon -- run in the background 5354 dcgettext -- perform domain and category specific lookup in 5355 message catalog 5356 5357 dcngettext -- perform domain and category specific lookup in 5358 message catalog with plural 5359 5360 dgettext -- perform lookup in message catalog for the current 5361 LC_MESSAGES locale 5362 5363 dngettext -- perform lookup in message catalog for the current 5364 locale 5365 5366 duplocale -- provide new handle for selection of locale 5367 err -- display formatted error messages 5368 error -- print error message 5369 errx -- display formatted error message and exit 5370 fcntl -- file control 5371 fflush_unlocked -- non thread safe fflush 5372 fgetwc_unlocked -- non thread safe fgetwc 5373 flock -- apply or remove an advisory lock on an open file 5374 freelocale -- free a locale object 5375 fscanf -- convert formatted input 5376 fwscanf -- convert formatted input 5377 getgrouplist -- get network group entry 5378 getloadavg -- get system load averages 5379 getopt -- parse command line options 5380 getopt_long -- parse command line options 5381 getopt_long_only -- parse command line options 5382 getsockopt -- get socket options 5383 gettext -- Search message catalogs for a string 5384 getutent -- access user accounting database entries 5385 getutent_r -- access user accounting database entries 5386 glob64 -- find pathnames matching a pattern (Large File 5387 Support) 5388 5389 globfree64 -- free memory from glob64() (Large File Support) 5390 initgroups -- initialize the supplementary group access list 5391 ioctl -- control device 5392 sockio -- socket ioctl commands 5393 ttyio -- tty ioctl commands 5394 kill -- send a signal 5395 link -- create a link to a file 5396 mbsnrtowcs -- convert a multibyte string to a wide character 5397 string 5398 5399 memmem -- locate bytes 5400 memrchr -- scan memory for a character 5401 newlocale -- allocate a locale object 5402 ngettext -- Search message catalogs for plural string 5403 pmap_getport -- Find the port number assigned to a service 5404 registered with a portmapper. 5405 5406 pmap_set -- Establishes mapping to machine's RPC Bind service. 5407 pmap_unset -- Destroys RPC Binding 5408 psignal -- print signal message 5409 regexec -- regular expression matching 5410 scanf -- convert formatted input 5411 setbuffer -- stream buffering operation 5412 setgroups -- set list of supplementary group IDs 5413 sethostname -- set host name 5414 setsockopt -- set socket options 5415 setutent -- access user accounting database entries 5416 sigandset -- build a new signal set by combining the two input 5417 sets using logical AND 5418 5419 sigisemptyset -- check for empty signal set 5420 sigorset -- build a new signal set by combining the two input 5421 sets using logical OR 5422 5423 sigreturn -- return from signal handler and cleanup stack 5424 frame 5425 5426 sscanf -- convert formatted input 5427 stime -- set time 5428 stpcpy -- copy a string returning a pointer to its end 5429 stpncpy -- copy a fixed-size string, returning a pointer to 5430 its end 5431 5432 strcasestr -- locate a substring ignoring case 5433 strerror_r -- reentrant version of strerror 5434 strndup -- return a malloc'd copy of at most the specified 5435 number of bytes of a string 5436 5437 strnlen -- determine the length of a fixed-size string 5438 strptime -- parse a time string 5439 strsep -- extract token from string 5440 strsignal -- return string describing signal 5441 strtoq -- convert string value to a long or quad_t integer 5442 strtouq -- convert a string to an unsigned long long 5443 svc_register -- Register Remote Procedure Call Interface 5444 svc_run -- Waits for RPC requests to arrive and calls service 5445 procedure. 5446 5447 svc_sendreply -- called by RPC service's dispatch routine 5448 svctcp_create -- Creates a TCP/IP-based RPC service transport. 5449 svcudp_create -- Creates a UDP-based RPC service transport. 5450 swscanf -- convert formatted input 5451 system -- execute a shell command 5452 textdomain -- set the current default message domain 5453 unlink -- remove a directory entry 5454 uselocale -- Set locale for thread 5455 utmpname -- set user accounting database 5456 vasprintf -- write formatted output to a dynamically allocated 5457 string 5458 5459 vdprintf -- write formatted output to a file descriptor 5460 verrx -- display formatted error message and exit 5461 vfscanf -- convert formatted input 5462 vfwscanf -- convert formatted input 5463 vscanf -- convert formatted input 5464 vsscanf -- convert formatted input 5465 vswscanf -- convert formatted input 5466 vsyslog -- log to system log 5467 vwscanf -- convert formatted input 5468 wait4 -- wait for process termination, BSD style 5469 waitpid -- wait for child process 5470 warn -- formatted error messages 5471 warnx -- formatted error messages 5472 wcpcpy -- copy a wide character string, returning a pointer to 5473 its end 5474 5475 wcpncpy -- copy a fixed-size string of wide characters, 5476 returning a pointer to its end 5477 5478 wcscasecmp -- compare two wide-character strings, ignoring 5479 case 5480 5481 wcsdup -- duplicate a wide-character string 5482 wcsncasecmp -- compare two fixed-size wide-character strings, 5483 ignoring case 5484 5485 wcsnlen -- determine the length of a fixed-size wide-character 5486 string 5487 5488 wcsnrtombs -- convert a wide character string to a multi-byte 5489 string 5490 5491 wcstoq -- convert wide string to long long int representation 5492 wcstouq -- convert wide string to unsigned long long int 5493 representation 5494 5495 wscanf -- convert formatted input 5496 xdr_u_int -- library routines for external data representation 5497 5498 The following interfaces are included in libc and are defined 5499 by this specification. Unless otherwise noted, these 5500 interfaces shall be included in the source standard. 5501 5502 Other interfaces listed above for libc shall behave as 5503 described in the referenced base document. 5504 5505 _IO_feof 5506 5507 Name 5508 5509 _IO_feof -- alias for feof 5510 5511 Synopsis 5512 5513 int _IO_feof(_IO_FILE * __fp); 5514 5515 Description 5516 5517 _IO_feof() tests the end-of-file indicator for the stream 5518 pointed to by __fp, returning a non-zero value if it is set. 5519 5520 _IO_feof() is not in the source standard; it is only in the 5521 binary standard. 5522 5523 _IO_getc 5524 5525 Name 5526 5527 _IO_getc -- alias for getc 5528 5529 Synopsis 5530 5531 int _IO_getc(_IO_FILE * __fp); 5532 5533 Description 5534 5535 _IO_getc() reads the next character from __fp and returns it 5536 as an unsigned char cast to an int, or EOF on end-of-file or 5537 error. 5538 5539 _IO_getc() is not in the source standard; it is only in the 5540 binary standard. 5541 5542 _IO_putc 5543 5544 Name 5545 5546 _IO_putc -- alias for putc 5547 5548 Synopsis 5549 5550 int _IO_putc(int __c, _IO_FILE * __fp); 5551 5552 Description 5553 5554 _IO_putc() writes the character __c, cast to an unsigned char, 5555 to __fp. 5556 5557 _IO_putc() is not in the source standard; it is only in the 5558 binary standard. 5559 5560 _IO_puts 5561 5562 Name 5563 5564 _IO_puts -- alias for puts 5565 5566 Synopsis 5567 5568 int _IO_puts(const char * __c); 5569 5570 Description 5571 5572 _IO_puts() writes the string __s and a trailing newline to 5573 stdout. 5574 5575 _IO_puts() is not in the source standard; it is only in the 5576 binary standard. 5577 5578 __assert_fail 5579 5580 Name 5581 5582 __assert_fail -- abort the program after false assertion 5583 5584 Synopsis 5585 5586 void __assert_fail(const char * assertion, const char * file, 5587 unsigned int line, const char * function); 5588 5589 Description 5590 5591 The __assert_fail() function is used to implement the assert() 5592 interface of ISO POSIX (2003). The __assert_fail() function 5593 shall print the given file filename, line line number, 5594 function function name and a message on the standard error 5595 stream in an unspecified format, and abort program execution 5596 via the abort() function. For example: 5597 5598 a.c:10: foobar: Assertion a == b failed. 5599 5600 If function is NULL, __assert_fail() shall omit information 5601 about the function. 5602 5603 assertion, file, and line shall be non-NULL. 5604 5605 The __assert_fail() function is not in the source standard; it 5606 is only in the binary standard. The assert() interface is not 5607 in the binary standard; it is only in the source standard. The 5608 assert() may be implemented as a macro. 5609 5610 __ctype_b_loc 5611 5612 Name 5613 5614 __ctype_b_loc -- accessor function for __ctype_b array for 5615 ctype functions 5616 5617 Synopsis 5618 5619 #include 5620 5621 const unsigned short * * __ctype_b_loc (void); 5622 5623 Description 5624 5625 The __ctype_b_loc() function shall return a pointer into an 5626 array of characters in the current locale that contains 5627 characteristics for each character in the current character 5628 set. The array shall contain a total of 384 characters, and 5629 can be indexed with any signed or unsigned char (i.e. with an 5630 index value between -128 and 255). If the application is 5631 multithreaded, the array shall be local to the current thread. 5632 5633 This interface is not in the source standard; it is only in 5634 the binary standard. 5635 5636 Return Value 5637 5638 The __ctype_b_loc() function shall return a pointer to the 5639 array of characters to be used for the ctype() family of 5640 functions (see ). 5641 5642 __ctype_get_mb_cur_max 5643 5644 Name 5645 5646 __ctype_get_mb_cur_max -- maximum length of a multibyte 5647 character in the current locale 5648 5649 Synopsis 5650 5651 size_t __ctype_get_mb_cur_max(void); 5652 5653 Description 5654 5655 __ctype_get_mb_cur_max() returns the maximum length of a 5656 multibyte character in the current locale. 5657 5658 __ctype_get_mb_cur_max() is not in the source standard; it is 5659 only in the binary standard. 5660 5661 __ctype_tolower_loc 5662 5663 Name 5664 5665 __ctype_tolower_loc -- accessor function for __ctype_b_tolower 5666 array for ctype tolower() function 5667 5668 Synopsis 5669 5670 #include 5671 5672 int32_t * * __ctype_tolower_loc(void); 5673 5674 Description 5675 5676 The __ctype_tolower_loc() function shall return a pointer into 5677 an array of characters in the current locale that contains 5678 lower case equivalents for each character in the current 5679 character set. The array shall contain a total of 384 5680 characters, and can be indexed with any signed or unsigned 5681 char (i.e. with an index value between -128 and 255). If the 5682 application is multithreaded, the array shall be local to the 5683 current thread. 5684 5685 This interface is not in the source standard; it is only in 5686 the binary standard. 5687 5688 Return Value 5689 5690 The __ctype_tolower_loc() function shall return a pointer to 5691 the array of characters to be used for the ctype() family of 5692 functions (see ). 5693 5694 __ctype_toupper_loc 5695 5696 Name 5697 5698 __ctype_toupper_loc -- accessor function for 5699 __ctype_b_toupper() array for ctype toupper() function 5700 5701 Synopsis 5702 5703 #include 5704 5705 int32_t * * __ctype_toupper_loc(void); 5706 5707 Description 5708 5709 The __ctype_toupper_loc() function shall return a pointer into 5710 an array of characters in the current locale that contains 5711 upper case equivalents for each character in the current 5712 character set. The array shall contain a total of 384 5713 characters, and can be indexed with any signed or unsigned 5714 char (i.e. with an index value between -128 and 255). If the 5715 application is multithreaded, the array shall be local to the 5716 current thread. 5717 5718 This interface is not in the source standard; it is only in 5719 the binary standard. 5720 5721 Return Value 5722 5723 The __ctype_toupper_loc() function shall return a pointer to 5724 the array of characters to be used for the ctype() family of 5725 functions (see ). 5726 5727 __cxa_atexit 5728 5729 Name 5730 5731 __cxa_atexit -- register a function to be called by exit or 5732 when a shared library is unloaded 5733 5734 Synopsis 5735 5736 int __cxa_atexit(void (*func) (void *), void * arg, void * 5737 dso_handle); 5738 5739 Description 5740 5741 __cxa_atexit() registers a function to be called by exit or 5742 when a shared library is unloaded. 5743 5744 The __cxa_atexit() function is used to implement atexit(), as 5745 described in ISO POSIX (2003). Calling 5746 atexit(func) 5747 5748 from the statically linked part of an application shall be 5749 equivalent to 5750 __cxa_atexit(func, NULL, NULL) 5751 5752 . 5753 5754 __cxa_atexit() is not in the source standard; it is only in 5755 the binary standard. atexit() is not in the binary standard; 5756 it is only in the source standard. 5757 5758 __daylight 5759 5760 Name 5761 5762 __daylight -- Daylight savings time flag 5763 5764 Synopsis 5765 5766 int __daylight; 5767 5768 Description 5769 5770 The integer variable __daylight shall implement the daylight 5771 savings time flag daylight as specified in the ISO POSIX 5772 (2003) header file . 5773 5774 __daylight is not in the source standard; it is only in the 5775 binary standard. daylight is not in the binary standard; it is 5776 only in the source standard. 5777 5778 __environ 5779 5780 Name 5781 5782 __environ -- alias for environ - user environment 5783 5784 Synopsis 5785 5786 extern char * *__environ; 5787 5788 Description 5789 5790 __environ is an alias for environ - user environment. 5791 5792 __environ has the same specification as environ. 5793 5794 __environ is not in the source standard; it is only in the 5795 binary standard. 5796 5797 __errno_location 5798 5799 Name 5800 5801 __errno_location -- address of errno variable 5802 5803 Synopsis 5804 5805 int * __errno_location(void); 5806 5807 Description 5808 5809 __errno_location() is not in the source standard; it is only 5810 in the binary standard. 5811 5812 __fpending 5813 5814 Name 5815 5816 __fpending -- returns in bytes the amount of output pending on 5817 a stream 5818 5819 Synopsis 5820 5821 #include 5822 5823 size_t __fpending(FILE * stream); 5824 5825 Description 5826 5827 __fpending() returns the amount of output in bytes pending on 5828 a stream. 5829 5830 __fpending() is not in the source standard; it is only in the 5831 binary standard. 5832 5833 __getpagesize 5834 5835 Name 5836 5837 __getpagesize -- alias for getpagesize - get current page size 5838 5839 Synopsis 5840 5841 int __getpagesize(void); 5842 5843 Description 5844 5845 __getpagesize() is an alias for getpagesize() - get current 5846 page size. 5847 5848 __getpagesize() has the same specification as getpagesize(). 5849 5850 __getpagesize() is not in the source standard; it is only in 5851 the binary standard. 5852 5853 __getpgid 5854 5855 Name 5856 5857 __getpgid -- get the process group id 5858 5859 Synopsis 5860 5861 pid_t __getpgid(pid_t pid); 5862 5863 Description 5864 5865 __getpgid() has the same specification as getpgid(). 5866 5867 __getpgid() is not in the source standard; it is only in the 5868 binary standard. 5869 5870 __h_errno_location 5871 5872 Name 5873 5874 __h_errno_location -- address of h_errno variable 5875 5876 Synopsis 5877 5878 int * __h_errno_location(void); 5879 5880 Description 5881 5882 __h_errno_location() returns the address of the h_errno 5883 variable, where h_errno is as specified in ISO POSIX (2003). 5884 5885 __h_errno_location() is not in the source standard; it is only 5886 in the binary standard. Note that h_errno itself is only in 5887 the source standard; it is not in the binary standard. 5888 5889 __isinf 5890 5891 Name 5892 5893 __isinf -- test for infinity 5894 5895 Synopsis 5896 5897 int __isinf(double arg); 5898 5899 Description 5900 5901 __isinf() has the same specification as isinf() in ISO POSIX 5902 (2003), except that the argument type for __isinf() is known 5903 to be double. 5904 5905 __isinf() is not in the source standard; it is only in the 5906 binary standard. 5907 5908 __isinff 5909 5910 Name 5911 5912 __isinff -- test for infinity 5913 5914 Synopsis 5915 5916 int __isinff(float arg); 5917 5918 Description 5919 5920 __isinff() has the same specification as isinf() in ISO POSIX 5921 (2003) except that the argument type for __isinff() is known 5922 to be float. 5923 5924 __isinff() is not in the source standard; it is only in the 5925 binary standard. 5926 5927 __isinfl 5928 5929 Name 5930 5931 __isinfl -- test for infinity 5932 5933 Synopsis 5934 5935 int __isinfl(long double arg); 5936 5937 Description 5938 5939 __isinfl() has the same specification as isinf() in the ISO 5940 POSIX (2003), except that the argument type for __isinfl() is 5941 known to be long double. 5942 5943 __isinfl() is not in the source standard; it is only in the 5944 binary standard. 5945 5946 __isnan 5947 5948 Name 5949 5950 __isnan -- test for infinity 5951 5952 Synopsis 5953 5954 int __isnan(double arg); 5955 5956 Description 5957 5958 __isnan() has the same specification as isnan() in ISO POSIX 5959 (2003), except that the argument type for __isnan() is known 5960 to be double. 5961 5962 __isnan() is not in the source standard; it is only in the 5963 binary standard. 5964 5965 __isnanf 5966 5967 Name 5968 5969 __isnanf -- test for infinity 5970 5971 Synopsis 5972 5973 int __isnanf(float arg); 5974 5975 Description 5976 5977 __isnanf() has the same specification as isnan() in ISO POSIX 5978 (2003), except that the argument type for __isnanf() is known 5979 to be float. 5980 5981 __isnanf() is not in the source standard; it is only in the 5982 binary standard. 5983 5984 __isnanl 5985 5986 Name 5987 5988 __isnanl -- test for infinity 5989 5990 Synopsis 5991 5992 int __isnanl(long double arg); 5993 5994 Description 5995 5996 __isnanl() has the same specification as isnan() in ISO POSIX 5997 (2003), except that the argument type for __isnanl() is known 5998 to be long double. 5999 6000 __isnanl() is not in the source standard; it is only in the 6001 binary standard. 6002 6003 __libc_current_sigrtmax 6004 6005 Name 6006 6007 __libc_current_sigrtmax -- return number of available 6008 real-time signal with lowest priority 6009 6010 Synopsis 6011 6012 int __libc_current_sigrtmax(void); 6013 6014 Description 6015 6016 __libc_current_sigrtmax() returns the number of an available 6017 real-time signal with the lowest priority. 6018 6019 __libc_current_sigrtmax() is not in the source standard; it is 6020 only in the binary standard. 6021 6022 __libc_current_sigrtmin 6023 6024 Name 6025 6026 __libc_current_sigrtmin -- return number of available 6027 real-time signal with highest priority 6028 6029 Synopsis 6030 6031 int __libc_current_sigrtmin(void); 6032 6033 Description 6034 6035 __libc_current_sigrtmin() returns the number of an available 6036 real-time signal with the highest priority. 6037 6038 __libc_current_sigrtmin() is not in the source standard; it is 6039 only in the binary standard. 6040 6041 __libc_start_main 6042 6043 Name 6044 6045 __libc_start_main -- initialization routine 6046 6047 Synopsis 6048 6049 int __libc_start_main(int *(main) (int, char * *, char * *), 6050 int argc, char * * ubp_av, void (*init) (void), void (*fini) 6051 (void), void (*rtld_fini) (void), void (* stack_end)); 6052 6053 Description 6054 6055 The __libc_start_main() function shall initialize the process, 6056 call the main function with appropriate arguments, and handle 6057 the return from main(). 6058 6059 __libc_start_main() is not in the source standard; it is only 6060 in the binary standard. 6061 6062 __lxstat 6063 6064 Name 6065 6066 __lxstat -- inline wrapper around call to lxstat 6067 6068 Synopsis 6069 6070 #include 6071 6072 int __lxstat(int version, char * __path, struct stat 6073 __statbuf); 6074 6075 Description 6076 6077 __lxstat() is an inline wrapper around call to lxstat(). 6078 6079 __lxstat() is not in the source standard; it is only in the 6080 binary standard. 6081 6082 __mempcpy 6083 6084 Name 6085 6086 __mempcpy -- copy given number of bytes of source to 6087 destination 6088 6089 Synopsis 6090 6091 #include 6092 6093 ptr_t __mempcpy(ptr_t restrict dest, const ptr_t restrict src, 6094 size_t n); 6095 6096 Description 6097 6098 __mempcpy() copies n bytes of source to destination, returning 6099 pointer to bytes after the last written byte. 6100 6101 __mempcpy() is not in the source standard; it is only in the 6102 binary standard. 6103 6104 __rawmemchr 6105 6106 Name 6107 6108 __rawmemchr -- scan memory 6109 6110 Synopsis 6111 6112 #include 6113 6114 ptr_t __rawmemchr(const ptr_t s, int c); 6115 6116 Description 6117 6118 __rawmemchr() searches in s for c. 6119 6120 __rawmemchr() is a weak alias to rawmemchr(). It is similar to 6121 memchr(), but it has no length limit. 6122 6123 __rawmemchr() is not in the source standard; it is only in the 6124 binary standard. 6125 6126 __register_atfork 6127 6128 Name 6129 6130 __register_atfork -- alias for register_atfork 6131 6132 Synopsis 6133 6134 int __register_atfork(void (*prepare) (void), void (*parent) 6135 (void), void (*child) (void), void * __dso_handle); 6136 6137 Description 6138 6139 __register_atfork() implements pthread_atfork() as specified 6140 in ISO POSIX (2003). The additional parameter __dso_handle 6141 allows a shared object to pass in it's handle so that 6142 functions registered by __register_atfork() can be 6143 unregistered by the runtime when the shared object is 6144 unloaded. 6145 6146 __sigsetjmp 6147 6148 Name 6149 6150 __sigsetjmp -- save stack context for non-local goto 6151 6152 Synopsis 6153 6154 int __sigsetjmp(jmp_buf env, int savemask); 6155 6156 Description 6157 6158 __sigsetjmp() has the same behavior as sigsetjmp() as 6159 specified by ISO POSIX (2003). 6160 6161 __sigsetjmp() is not in the source standard; it is only in the 6162 binary standard. 6163 6164 __stpcpy 6165 6166 Name 6167 6168 __stpcpy -- copy a string returning a pointer to its end 6169 6170 Synopsis 6171 6172 #include 6173 6174 char * __stpcpy(char * dest, const char * src); 6175 6176 Description 6177 6178 __stpcpy() copies the string src (including the terminating /0 6179 character) to the array dest. The strings may not overlap, and 6180 dest must be large enough to receive the copy. 6181 6182 Return Value 6183 6184 __stpcpy() returns a pointer to the end of the string dest 6185 (that is, the address of the terminating NULL character) 6186 rather than the beginning. 6187 6188 __stpcpy() has the same specification as stpcpy(). 6189 6190 __stpcpy() is not in the source standard; it is only in the 6191 binary standard. 6192 6193 __strdup 6194 6195 Name 6196 6197 __strdup -- alias for strdup 6198 6199 Synopsis 6200 6201 char * __strdup(const char string); 6202 6203 Description 6204 6205 __strdup() has the same specification as strdup(). 6206 6207 __strdup() is not in the source standard; it is only in the 6208 binary standard. 6209 6210 __strtod_internal 6211 6212 Name 6213 6214 __strtod_internal -- underlying function for strtod 6215 6216 Synopsis 6217 6218 double __strtod_internal(const char * __nptr, char * * 6219 __endptr, int __group); 6220 6221 Description 6222 6223 __group shall be 0 or the behavior of __strtod_internal() is 6224 undefined. 6225 6226 __strtod_internal(__nptr, __endptr, 0)() has the same 6227 specification as strtod(__nptr, __endptr)(). 6228 6229 __strtod_internal() is not in the source standard; it is only 6230 in the binary standard. 6231 6232 __strtof_internal 6233 6234 Name 6235 6236 __strtof_internal -- underlying function for strtof 6237 6238 Synopsis 6239 6240 float __strtof_internal(const char * __nptr, char * * 6241 __endptr, int __group); 6242 6243 Description 6244 6245 __group shall be 0 or the behavior of __strtof_internal() is 6246 undefined. 6247 6248 __strtof_internal(__nptr, __endptr, 0)() has the same 6249 specification as strtof(__nptr, __endptr)(). 6250 6251 __strtof_internal() is not in the source standard; it is only 6252 in the binary standard. 6253 6254 __strtok_r 6255 6256 Name 6257 6258 __strtok_r -- alias for strtok_r 6259 6260 Synopsis 6261 6262 char * __strtok_r(char * restrict s, const char * restrict 6263 delim, char * * restrict save_ptr); 6264 6265 Description 6266 6267 __strtok_r() has the same specification as strtok_r(). 6268 6269 __strtok_r() is not in the source standard; it is only in the 6270 binary standard. 6271 6272 __strtol_internal 6273 6274 Name 6275 6276 __strtol_internal -- alias for strtol 6277 6278 Synopsis 6279 6280 long int __strtol_internal(const char * __nptr, char * * 6281 __endptr, int __base, int __group); 6282 6283 Description 6284 6285 __group shall be 0 or the behavior of __strtol_internal() is 6286 undefined. 6287 6288 __strtol_internal(__nptr, __endptr, __base, 0) has the same 6289 specification as strtol(__nptr, __endptr, __base). 6290 6291 __strtol_internal() is not in the source standard; it is only 6292 in the binary standard. 6293 6294 __strtold_internal 6295 6296 Name 6297 6298 __strtold_internal -- underlying function for strtold 6299 6300 Synopsis 6301 6302 long double __strtold_internal(const char * __nptr, char * * 6303 __endptr, int __group); 6304 6305 Description 6306 6307 __group shall be 0 or the behavior of __strtold_internal() is 6308 undefined. 6309 6310 __strtold_internal(__nptr, __endptr, 0) has the same 6311 specification as strtold(__nptr, __endptr). 6312 6313 __strtold_internal() is not in the source standard; it is only 6314 in the binary standard. 6315 6316 __strtoll_internal 6317 6318 Name 6319 6320 __strtoll_internal -- underlying function for strtoll 6321 6322 Synopsis 6323 6324 long long __strtoll_internal(const char * __nptr, char * * 6325 __endptr, int __base, int __group); 6326 6327 Description 6328 6329 __group shall be 0 or the behavior of __strtoll_internal() is 6330 undefined. 6331 6332 __strtoll_internal(__nptr, __endptr, __base, 0) has the same 6333 specification as strtoll(__nptr, __endptr, __base). 6334 6335 __strtoll_internal() is not in the source standard; it is only 6336 in the binary standard. 6337 6338 __strtoul_internal 6339 6340 Name 6341 6342 __strtoul_internal -- underlying function for strtoul 6343 6344 Synopsis 6345 6346 unsigned long int __strtoul_internal(const char * __nptr, char 6347 * * __endptr, int __base, int __group); 6348 6349 Description 6350 6351 __group shall be 0 or the behavior of __strtoul_internal() is 6352 undefined. 6353 6354 __strtoul_internal(__nptr, __endptr, __base, 0) has the same 6355 specification as strtoul(__nptr, __endptr, __base). 6356 6357 __strtoul_internal() is not in the source standard; it is only 6358 in the binary standard. 6359 6360 __strtoull_internal 6361 6362 Name 6363 6364 __strtoull_internal -- underlying function for strtoull 6365 6366 Synopsis 6367 6368 unsigned long long __strtoull_internal(const char * __nptr, 6369 char * * __endptr, int __base, int __group); 6370 6371 Description 6372 6373 __group shall be 0 or the behavior of __strtoull_internal() is 6374 undefined. 6375 6376 __strtoull_internal(__nptr, __endptr, __base, 0) has the same 6377 specification as strtoull(__nptr, __endptr, __base). 6378 6379 __strtoull_internal() is not in the source standard; it is 6380 only in the binary standard. 6381 6382 __sysconf 6383 6384 Name 6385 6386 __sysconf -- get configuration information at runtime 6387 6388 Synopsis 6389 6390 #include 6391 6392 long __sysconf(int name); 6393 6394 Description 6395 6396 __sysconf() gets configuration information at runtime. 6397 6398 __sysconf() is weak alias to sysconf(). 6399 6400 __sysconf() has the same specification as sysconf(). 6401 6402 __sysconf() is not in the source standard; it is only in the 6403 binary standard. 6404 6405 __sysv_signal 6406 6407 Name 6408 6409 __sysv_signal -- signal handling 6410 6411 Synopsis 6412 6413 __sighandler_t __sysv_signal(int sig, __sighandler_t handler); 6414 6415 Description 6416 6417 __sysv_signal() has the same behavior as signal() as specified 6418 by ISO POSIX (2003). 6419 6420 __sysv_signal() is not in the source standard; it is only in 6421 the binary standard. 6422 6423 __timezone 6424 6425 Name 6426 6427 -- global variable containing timezone 6428 6429 Synopsis 6430 6431 long int __timezone; 6432 6433 Description 6434 6435 __timezone() has the same specification as timezone() in the 6436 ISO POSIX (2003) 6437 6438 __tzname 6439 6440 Name 6441 6442 -- global variable containing the timezone 6443 6444 Synopsis 6445 6446 char * __tzname[2]; 6447 6448 Description 6449 6450 __tzname has the same specification as tzname in the ISO POSIX 6451 (2003). 6452 6453 Note that the array size of 2 is explicit in the ISO POSIX 6454 (2003), but not in the SUSv2. 6455 6456 __wcstod_internal 6457 6458 Name 6459 6460 __wcstod_internal -- underlying function for wcstod 6461 6462 Synopsis 6463 6464 double __wcstod_internal(const wchar_t * nptr, wchar_t * * 6465 endptr, int group); 6466 6467 Description 6468 6469 group shall be 0 or the behavior of __wcstod_internal() is 6470 undefined. 6471 6472 __wcstod_internal(nptr, endptr, 0) has the same specification 6473 as wcstod(nptr, endptr). 6474 6475 __wcstod_internal() is not in the source standard; it is only 6476 in the binary standard. 6477 6478 __wcstof_internal 6479 6480 Name 6481 6482 __wcstof_internal -- underlying function for wcstof 6483 6484 Synopsis 6485 6486 float __wcstof_internal(const wchar_t * nptr, wchar_t * * 6487 endptr, int group); 6488 6489 Description 6490 6491 group shall be 0 or the behavior of __wcstof_internal() is 6492 undefined. 6493 6494 __wcstof_internal(nptr, endptr, 0) has the same specification 6495 as wcstof(nptr, endptr). 6496 6497 __wcstof_internal() is not in the source standard; it is only 6498 in the binary standard. 6499 6500 __wcstol_internal 6501 6502 Name 6503 6504 __wcstol_internal -- underlying function for wcstol 6505 6506 Synopsis 6507 6508 long __wcstol_internal(const wchar_t * nptr, wchar_t * * 6509 endptr, int base, int group); 6510 6511 Description 6512 6513 group shall be 0 or the behavior of __wcstol_internal() is 6514 undefined. 6515 6516 __wcstol_internal(nptr, endptr, base, 0) has the same 6517 specification as wcstol(nptr, endptr, base). 6518 6519 __wcstol_internal() is not in the source standard; it is only 6520 in the binary standard. 6521 6522 __wcstold_internal 6523 6524 Name 6525 6526 __wcstold_internal -- underlying function for wcstold 6527 6528 Synopsis 6529 6530 long double __wcstold_internal(const wchar_t * nptr, wchar_t * 6531 * endptr, int group); 6532 6533 Description 6534 6535 group shall be 0 or the behavior of __wcstold_internal() is 6536 undefined. 6537 6538 __wcstold_internal(nptr, endptr, 0) has the same specification 6539 as wcstold(nptr, endptr). 6540 6541 __wcstold_internal() is not in the source standard; it is only 6542 in the binary standard. 6543 6544 __wcstoul_internal 6545 6546 Name 6547 6548 __wcstoul_internal -- underlying function for wcstoul 6549 6550 Synopsis 6551 6552 unsigned long __wcstoul_internal(const wchar_t * restrict 6553 nptr, wchar_t * * restrict endptr, int base, int group); 6554 6555 Description 6556 6557 group shall be 0 or the behavior of __wcstoul_internal() is 6558 undefined. 6559 6560 __wcstoul_internal(nptr, endptr, base, 0)() has the same 6561 specification as wcstoul(nptr, endptr, base)(). 6562 6563 __wcstoul_internal() is not in the source standard; it is only 6564 in the binary standard. 6565 6566 __xmknod 6567 6568 Name 6569 6570 __xmknod -- make block or character special file 6571 6572 Synopsis 6573 6574 int __xmknod(int ver, const char * path, mode_t mode, dev_t * 6575 dev); 6576 6577 Description 6578 6579 The __xmknod() shall implement the mknod() interface from ISO 6580 POSIX (2003). 6581 6582 __xmknod(1, path, mode, dev) has the same specification as 6583 mknod(path, mode, dev). 6584 6585 ver shall be 1 or the behavior of __xmknod() is undefined. 6586 6587 The __xmknod() function is not in the source standard; it is 6588 only in the binary standard. The mknod() function is not in 6589 the binary standard; it is only in the source standard. 6590 6591 __xstat 6592 6593 Name 6594 6595 __xstat -- Get File Status 6596 6597 Synopsis 6598 6599 #include 6600 #include 6601 6602 int __xstat(int ver, const char * path, struct stat * 6603 stat_buf); 6604 6605 int __lxstat(int ver, const char * path, struct stat * 6606 stat_buf); 6607 6608 int __fxstat(int ver, int fildes, struct stat * stat_buf); 6609 6610 Description 6611 6612 The functions __xstat(), __lxstat(), and __fxstat() shall 6613 implement the ISO POSIX (2003) functions stat(), lstat(), and 6614 fstat() respectively. 6615 6616 ver shall be 3 or the behavior of these functions is 6617 undefined. 6618 6619 __xstat(3, path, stat_buf) shall behave as stat(path, 6620 stat_buf) as specified by ISO POSIX (2003). 6621 6622 __lxstat(3, path, stat_buf) shall behave as lstat(path, 6623 stat_buf) as specified by ISO POSIX (2003). 6624 6625 __fxstat(3, fildes, stat_buf) shall behave as fstat(fildes, 6626 stat_buf) as specified by ISO POSIX (2003). 6627 6628 __xstat(), __lxstat(), and __fxstat() are not in the source 6629 standard; they are only in the binary standard. 6630 6631 stat(), lstat(), and fstat() are not in the binary standard; 6632 they are only in the source standard. 6633 6634 __xstat64 6635 6636 Name 6637 6638 __xstat64 -- Get File Status 6639 6640 Synopsis 6641 6642 #define _LARGEFILE_SOURCE 1 6643 #include 6644 #include 6645 6646 int __xstat64(int ver, const char * path, struct stat64 * 6647 stat_buf); 6648 6649 int __lxstat64(int ver, const char * path, struct stat64 * 6650 stat_buf); 6651 6652 int __fxstat64(int ver, int fildes, struct stat64 * stat_buf); 6653 6654 Description 6655 6656 The functions __xstat64(), __lxstat64(), and __fxstat64() 6657 shall implement the Large File Support functions stat64(), 6658 lstat64(), and fstat64() respectively. 6659 6660 ver shall be 3 or the behavior of these functions is 6661 undefined. 6662 6663 __xstat64(3, path, stat_buf) shall behave as stat(path, 6664 stat_buf) as specified by Large File Support. 6665 6666 __lxstat64(3, path, stat_buf) shall behave as lstat(path, 6667 stat_buf) as specified by Large File Support. 6668 6669 __fxstat64(3, fildes, stat_buf) shall behave as fstat(fildes, 6670 stat_buf) as specified by Large File Support. 6671 6672 __xstat64(), __lxstat64(), and __fxstat64() are not in the 6673 source standard; they are only in the binary standard. 6674 6675 stat64(), lstat64(), and fstat64() are not in the binary 6676 standard; they are only in the source standard. 6677 6678 _environ 6679 6680 Name 6681 6682 _environ -- alias for environ - user environment 6683 6684 Synopsis 6685 6686 extern char * *_environ; 6687 6688 Description 6689 6690 _environ is an alias for environ - user environment. 6691 6692 _nl_msg_cat_cntr 6693 6694 Name 6695 6696 _nl_msg_cat_cntr -- new catalog load counter 6697 6698 Synopsis 6699 6700 #include 6701 6702 extern int _nl_msg_cat_cntr; 6703 6704 Description 6705 6706 _nl_msg_cat_cntr is incremented each time a new catalong is 6707 loaded. It is a variable defined in loadmsgcat.c and is used 6708 by Message catalogs for internationalization. 6709 6710 _sys_errlist 6711 6712 Name 6713 6714 _sys_errlist -- array containing the "C" locale strings used 6715 by strerror() 6716 6717 Synopsis 6718 6719 #include 6720 6721 extern const char *const _sys_errlist[]; 6722 6723 Description 6724 6725 _sys_errlist is an array containing the "C" locale strings 6726 used by strerror(). This normally should not be used directly. 6727 strerror() provides all of the needed functionality. 6728 6729 _sys_siglist 6730 6731 Name 6732 6733 _sys_siglist -- array containing the names of the signal names 6734 6735 Synopsis 6736 6737 #include 6738 6739 extern const char *const _sys_siglist[NSIG]; 6740 6741 Description 6742 6743 _sys_siglist is an array containing the names of the signal 6744 names. 6745 6746 The _sys_siglist array is only in the binary standard; it is 6747 not in the source standard. Applications wishing to access the 6748 names of signals should use the strsignal() function. 6749 6750 acct 6751 6752 Name 6753 6754 acct -- switch process accounting on or off 6755 6756 Synopsis 6757 6758 #include 6759 6760 int acct(const char * filename); 6761 6762 Description 6763 6764 When filename is the name of an existing file, acct() turns 6765 accounting on and appends a record to filename for each 6766 terminating process. When filename is NULL, acct() turns 6767 accounting off. 6768 6769 Return Value 6770 6771 On success, 0 is returned. On error, -1 is returned and the 6772 global variable errno is set appropriately. 6773 6774 Errors 6775 6776 ENOSYS 6777 BSD process accounting has not been enabled when the 6778 operating system kernel was compiled. The kernel 6779 configuration parameter controlling this feature is 6780 CONFIG_BSD_PROCESS_ACCT. 6781 6782 ENOMEM 6783 Out of memory. 6784 6785 EPERM 6786 The calling process has no permission to enable process 6787 accounting. 6788 6789 EACCES 6790 filename is not a regular file. 6791 6792 EIO 6793 Error writing to the filename. 6794 6795 EUSERS 6796 There are no more free file structures or we run out of 6797 memory. 6798 6799 adjtime 6800 6801 Name 6802 6803 adjtime -- correct the time to allow synchronization of the 6804 system clock 6805 6806 Synopsis 6807 6808 #include 6809 6810 int adjtime(const struct timeval * delta, struct timeval * 6811 olddelta); 6812 6813 Description 6814 6815 adjtime() makes small adjustments to the system time as 6816 returned by gettimeofday()(2), advancing or retarding it by 6817 the time specified by the timeval delta. If delta is negative, 6818 the clock is slowed down by incrementing it more slowly than 6819 normal until the correction is complete. If delta is positive, 6820 a larger increment than normal is used. The skew used to 6821 perform the correction is generally a fraction of one percent. 6822 Thus, the time is always a monotonically increasing function. 6823 A time correction from an earlier call to adjtime() may not be 6824 finished when adjtime() is called again. If olddelta is 6825 non-NULL, the structure pointed to will contain, upon return, 6826 the number of microseconds still to be corrected from the 6827 earlier call. 6828 6829 adjtime() may be used by time servers that synchronize the 6830 clocks of computers in a local area network. Such time servers 6831 would slow down the clocks of some machines and speed up the 6832 clocks of others to bring them to the average network time. 6833 6834 The adjtime() is restricted to the super-user. 6835 6836 Return Value 6837 6838 On success, 0 is returned. On error, -1 is returned and the 6839 global variable errno is set appropriately. 6840 6841 Errors 6842 6843 EFAULT 6844 An argument points outside the process's allocated 6845 address space. 6846 6847 EPERM 6848 The process's effective user ID is not that of the 6849 super-user. 6850 6851 asprintf 6852 6853 Name 6854 6855 asprintf -- write formatted output to a dynamically allocated 6856 string 6857 6858 Synopsis 6859 6860 #include 6861 6862 int asprintf(char ** restrict ptr, const char * restrict 6863 format, ...); 6864 6865 Description 6866 6867 The asprintf() function shall behave as sprintf(), except that 6868 the output string shall be dynamically allocated space of 6869 sufficient length to hold the resulting string. The address of 6870 this dynamically allocated string shall be stored in the 6871 location referenced by ptr. 6872 6873 Return Value 6874 6875 Refer to fprintf(). 6876 6877 Errors 6878 6879 Refer to fprintf(). 6880 6881 bind_textdomain_codeset 6882 6883 Name 6884 6885 bind_textdomain_codeset -- specify encoding for message 6886 retrieval 6887 6888 Synopsis 6889 6890 #include 6891 6892 char * bind_textdomain_codeset (const char * domainname , 6893 const char * codeset ); 6894 6895 Description 6896 6897 The bind_textdomain_codeset function can be used to specify 6898 the output codeset for message catalogs for domain domainname. 6899 The codeset argument shall be a valid codeset name which can 6900 be used tor the iconv_open function, or a null pointer. If the 6901 codeset argument is the null pointer, then function returns 6902 the currently selected codeset for the domain with the name 6903 domainname. It shall return a null pointer if no codeset has 6904 yet been selected 6905 6906 Each successive call to bind_textdomain_codeset() function 6907 overrrides the settings made by the preceding call with the 6908 same domainname. 6909 6910 The bind_textdomain_codeset() function shall return a pointer 6911 to a string containing the name of the selected codeset. The 6912 string shall be allocated internally in the function and shall 6913 not be changed or freed by the user. 6914 6915 The bind_textdomain_codeset() function returns a pointer to a 6916 string containing the name of the selected codeset. The string 6917 is allocated internally in the function and shall not be 6918 changed by the user. 6919 6920 Parameters 6921 6922 domainname 6923 The domainname argument is applied to the currently 6924 active LC_MESSAGE locale. It is equivalent in syntax 6925 and meaning to the domainname argument to textdomain, 6926 except that the selection of the domain is valid only 6927 for the duration of the call. 6928 6929 codeset 6930 The name of the output codeset for the selected domain, 6931 or NULL to select the current codeset. 6932 6933 If domainname is the null pointer, or is an empty 6934 string, bind_textdomain_codeset() shall fail, but need 6935 not set errno. 6936 6937 Return Value 6938 6939 Returns the currently selected codeset name. It returns a null 6940 pointer if no codeset has yet been selected. 6941 6942 Errors 6943 6944 ENOMEM 6945 Insufficient memory available to allocate return value. 6946 6947 See Also 6948 6949 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 6950 textdomain, bindtextdomain 6951 6952 bindresvport 6953 6954 Name 6955 6956 bindresvport -- bind socket to privileged IP port 6957 6958 Synopsis 6959 6960 #include 6961 #include 6962 6963 int bindresvport(int sd, struct sockaddr_in * sin); 6964 6965 Description 6966 6967 If the process has appropriate privilege, the bindresvport() 6968 function shall bind a socket to a privileged IP port. 6969 6970 Return Value 6971 6972 On success, 0 is returned. On error, -1 is returned and the 6973 global variable errno is set appropriately. 6974 6975 Errors 6976 6977 EPERM 6978 The process did not have appropriate privilege. 6979 6980 EPFNOSUPPORT 6981 Address of sin did not match address family of sd. 6982 6983 bindtextdomain 6984 6985 Name 6986 6987 bindtextdomain -- specify the location of a message catalog 6988 6989 Synopsis 6990 6991 #include 6992 6993 char * bindtextdomain(const char * domainname, const char * 6994 dirname); 6995 6996 Description 6997 6998 The bindtextdomain() shall set the the base directory of the 6999 hierarchy containing message catalogs for a given message 7000 domain. 7001 7002 The bindtextdomain() function specifies that the domainname 7003 message catalog can be found in the dirname directory 7004 hierarchy, rather than in the system default locale data base. 7005 7006 If dirname is not NULL, the base directory for message 7007 catalogs belonging to domain domainname shall be set to 7008 dirname. If dirname is NULL, the base directory for message 7009 catalogs shall not be altered. 7010 7011 The function shall make copies of the argument strings as 7012 needed. 7013 7014 dirname can be an absolute or relative pathname. 7015 7016 Note: Applications that wish to use chdir() should always 7017 use absolute pathnames to avoid misadvertently selecting 7018 the wrong or non-existant directory. 7019 7020 If domainname is the null pointer, or is an empty string, 7021 bindtextdomain() shall fail, but need not set errno. 7022 7023 The bindtextdomain() function shall return a pointer to a 7024 string containing the name of the selected directory. The 7025 string shall be allocated internally in the function and shall 7026 not be changed or freed by the user. 7027 7028 Return Value 7029 7030 On success, bindtextdomain() shall return a pointer to a 7031 string containing the directory pathname currently bound to 7032 the domain. On failure, a NULL pointer is returned, and the 7033 global variable errno may be set to indicate the error. 7034 7035 Errors 7036 7037 ENOMEM 7038 Insufficient memory was available. 7039 7040 See Also 7041 7042 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 7043 textdomain, bind_textdomain_codeset 7044 7045 cfmakeraw 7046 7047 Name 7048 7049 cfmakeraw -- get and set terminal attributes 7050 7051 Synopsis 7052 7053 #include 7054 7055 void cfmakeraw(struct termios * termios_p); 7056 7057 Description 7058 7059 The cfmakeraw() function shall set the attributes of the 7060 termios structure referenced by termios_p as follows: 7061 termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP 7062 |INLCR|IGNCR|ICRNL|IXON); 7063 7064 termios_p->c_oflag &= ~OPOST; 7065 7066 termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); 7067 7068 termios_p->c_cflag &= ~(CSIZE|PARENB); 7069 7070 termios_p->c_cflag |= CS8; 7071 7072 termios_p shall point to a termios structure that contains the 7073 following members: 7074 tcflag_t c_iflag; /* input modes */ 7075 tcflag_t c_oflag; /* output modes */ 7076 tcflag_t c_cflag; /* control modes */ 7077 tcflag_t c_lflag; /* local modes */ 7078 cc_t c_cc[NCCS]; /* control chars */ 7079 7080 cfsetspeed 7081 7082 Name 7083 7084 cfsetspeed -- set terminal input and output data rate 7085 7086 Synopsis 7087 7088 #include 7089 7090 int cfsetspeed(struct termios *t, speed_t speed); 7091 7092 Description 7093 7094 cfsetspeed() sets the baud rate values in the termios 7095 structure. The effects of the function on the terminal as 7096 described below do not become effective, nor are all errors 7097 detected, until the tcsetattr() function is called. Certain 7098 values for baud rates set in termios and passed to tcsetattr() 7099 have special meanings. 7100 7101 Getting and Setting the Baud Rate 7102 7103 Input and output baud rates are found in the termios 7104 structure. The unsigned integer speed_t is typdef'd in the 7105 include file termios.h. The value of the integer corresponds 7106 directly to the baud rate being represented; however, the 7107 following symbolic values are defined. 7108 #define B0 0 7109 #define B50 50 7110 #define B75 75 7111 #define B110 110 7112 #define B134 134 7113 #define B150 150 7114 #define B200 200 7115 #define B300 300 7116 #define B600 600 7117 #define B1200 1200 7118 #define B1800 1800 7119 #define B2400 2400 7120 #define B4800 4800 7121 #define B9600 9600 7122 #define B19200 19200 7123 #define B38400 38400 7124 #ifndef _POSIX_SOURCE 7125 #define EXTA 19200 7126 #define EXTB 38400 7127 #endif /*_POSIX_SOURCE */ 7128 7129 cfsetspeed() sets both the input and output baud rates in the 7130 termios structure referenced by t to speed. 7131 7132 Return Value 7133 7134 On success, 0 is returned. On error, -1 is returned and the 7135 global variable errno is set appropriately. 7136 7137 Errors 7138 7139 EINVAL 7140 Invalid speed argument 7141 7142 daemon 7143 7144 Name 7145 7146 daemon -- run in the background 7147 7148 Synopsis 7149 7150 #include 7151 7152 int daemon(int nochdir, int noclose); 7153 7154 Description 7155 7156 The daemon() function shall create a new process, detached 7157 from the controlling terminal. If successful, the calling 7158 process shall exit and the new process shall continue to 7159 execute the application in the background. If nochdir 7160 evaluates to true, the current directory shall not be changed. 7161 Otherwise, daemon() shall change the current working directory 7162 to the root (`/'). If noclose evaluates to true the standard 7163 input, standard output, and standard error file descriptors 7164 shall not be altered. Otherwise, daemon() shall close the 7165 standard input, standard output and standard error file 7166 descriptors and reopen them attached to /dev/null. 7167 7168 Return Value 7169 7170 On error, -1 is returned, and the global variable errno is set 7171 to any of the errors specified for the library functions 7172 fork() and setsid(). 7173 7174 dcgettext 7175 7176 Name 7177 7178 dcgettext -- perform domain and category specific lookup in 7179 message catalog 7180 7181 Synopsis 7182 7183 #include 7184 #include 7185 7186 char * dcgettext(const char * domainname, const char * msgid, 7187 int category); 7188 7189 Description 7190 7191 The dcgettext() function is a domain specified version of 7192 gettext(). 7193 7194 The dcgettext() function shall lookup the translation in the 7195 current locale of the message identified by msgid in the 7196 domain specified by domainname and in the locale category 7197 specified by category. If domainname is NULL, the current 7198 default domain shall be used. The msgid argument shall be a 7199 NULL-terminated string to be matched in the catalogue. 7200 category shall specify the locale category to be used for 7201 retrieving message strings. The category parameter shall be 7202 one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, 7203 LC_NUMERIC, or LC_TIME. The default domain shall not be 7204 changed by a call to dcgettext. 7205 7206 Return Value 7207 7208 If a translation was found in one of the specified catalogs, 7209 it shall be converted to the current locale's codeset and 7210 returned. The resulting NULL-terminated string shall be 7211 allocated by the dcgettext function, and must not be modified 7212 or freed. If no translation was found, or category was 7213 invalid, msgid shall be returned. 7214 7215 Errors 7216 7217 dcgettext() shall not modify the errno global variable. 7218 7219 See Also 7220 7221 gettext, dgettext, ngettext, dngettext, dcngettext, 7222 textdomain, bindtextdomain, bind_textdomain_codeset 7223 7224 dcngettext 7225 7226 Name 7227 7228 dcngettext -- perform domain and category specific lookup in 7229 message catalog with plural 7230 7231 Synopsis 7232 7233 #include 7234 #include 7235 7236 char * dcngettext(const char * domainname, const char * 7237 msgid1, const char * msgid2, unsigned long int n, int 7238 category); 7239 7240 Description 7241 7242 The dcngettext() function is a domain specific version of 7243 gettext, capable of returning either a singular or plural form 7244 of the message. The dcngettext() function shall lookup the 7245 translation in the current locale of the message identified by 7246 msgid1 in the domain specified by domainname and in the locale 7247 category specified by category. If domainname is NULL, the 7248 current default domain shall be used. The msgid1 argument 7249 shall be a NULL-terminated string to be matched in the 7250 catalogue. category shall specify the locale category to be 7251 used for retrieving message strings. The category parameter 7252 shall be one of LC_CTYPE, LC_COLLATE, LC_MESSAGES, 7253 LC_MONETARY, LC_NUMERIC, or LC_TIME. The default domain shall 7254 not be changed by a call to dcgettext(). If n is 1 then the 7255 singular version of the message is returned, otherwise one of 7256 the plural forms is returned, depending on the value of n and 7257 the current locale settings. 7258 7259 Return Value 7260 7261 If a translation corresponding to the value of n was found in 7262 one of the specified catalogs for msgid1, it shall be 7263 converted to the current locale's codeset and returned. The 7264 resulting NULL-terminated string shall be allocated by the 7265 dcngettext() function, and must not be modified or freed. If 7266 no translation was found, or category was invalid, msgid1 7267 shall be returned if n has the value 1, otherwise msgid2 shall 7268 be returned. 7269 7270 Errors 7271 7272 dcngettext() shall not modify the errno global variable. 7273 7274 See Also 7275 7276 gettext, dgettext, ngettext, dngettext, dcgettext, textdomain, 7277 bindtextdomain, bind_textdomain_codeset 7278 7279 dgettext 7280 7281 Name 7282 7283 dgettext -- perform lookup in message catalog for the current 7284 LC_MESSAGES locale 7285 7286 Synopsis 7287 7288 #include 7289 7290 char * dgettext(const char * domainname, const char * msgid); 7291 7292 Description 7293 7294 dgettext() is a domain specified version of gettext(). 7295 7296 Parameters 7297 7298 domainname 7299 dgettext() applies domainname to the currently active 7300 LC_MESSAGE locale. This usage is equivalent in syntax 7301 and meaning to the textdomain() function's application 7302 of domainname, except that the selection of the domain 7303 in dgettext() is valid only for the duration of the 7304 call. 7305 7306 msgid 7307 a NULL-terminated string to be matched in the catalogue 7308 with respect to a specific domain and the current 7309 locale. 7310 7311 Return Value 7312 7313 On success of a msgid query, the translated NULL-terminated 7314 string is returned. On error, the original msgid is returned. 7315 The length of the string returned is undetermined until 7316 dgettext() is called. 7317 7318 Errors 7319 7320 dgettext() will not modify the errno global variable. 7321 7322 See Also 7323 7324 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 7325 textdomain, bindtextdomain, bind_textdomain_codeset 7326 7327 dngettext 7328 7329 Name 7330 7331 dngettext -- perform lookup in message catalog for the current 7332 locale 7333 7334 Synopsis 7335 7336 #include 7337 7338 char * dngettext(const char * domainname, const char * msgid1, 7339 const char * msgid2, unsigned long int n); 7340 7341 Description 7342 7343 dngettext() shall be equivalent to a call to 7344 dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES) 7345 7346 See dgettext() for more information. 7347 7348 See Also 7349 7350 gettext, dgettext, ngettext, dcgettext, dcngettext, 7351 textdomain, bindtextdomain, bind_textdomain_codeset 7352 7353 duplocale 7354 7355 Name 7356 7357 duplocale -- provide new handle for selection of locale 7358 7359 Synopsis 7360 7361 #include 7362 7363 locale_t duplocale(locale_t locale); 7364 7365 Description 7366 7367 The duplocale() function shall provide a new locale object 7368 based on the locale object provided in locale, suitable for 7369 use in the newlocale() or uselocale() functions. The new 7370 object may be released by calling freelocale(). 7371 7372 Return Value 7373 7374 On success, the duplocale() function shall return a locale 7375 object. Otherwise, it shall return NULL, and set errno to 7376 indicate the error. 7377 7378 Errors 7379 7380 The duplocale() function shall fail if: 7381 7382 ENOMEM 7383 Insufficient memory. 7384 7385 See Also 7386 7387 setlocale(), freelocale(), newlocale(), uselocale() 7388 7389 err 7390 7391 Name 7392 7393 err -- display formatted error messages 7394 7395 Synopsis 7396 7397 #include 7398 7399 void err(int eval, const char * fmt, ...); 7400 7401 Description 7402 7403 The err() function shall display a formatted error message on 7404 the standard error stream. First, err() shall write the last 7405 component of the program name, a colon character, and a space 7406 character. If fmt is non-NULL, it shall be used as a format 7407 string for the printf() family of functions, and err() shall 7408 write the formatted message, a colon character, and a space. 7409 Finally, the error message string affiliated with the current 7410 value of the global variable errno shall be written, followed 7411 by a newline character. 7412 7413 The err() function shall not return, the program shall 7414 terminate with the exit value of eval. 7415 7416 See Also 7417 7418 error(), errx() 7419 7420 Return Value 7421 7422 None. 7423 7424 Errors 7425 7426 None. 7427 7428 error 7429 7430 Name 7431 7432 error -- print error message 7433 7434 Synopsis 7435 7436 void error(int exitstatus, int errnum, const char * format, 7437 ...); 7438 7439 Description 7440 7441 error() shall print a message to standard error. 7442 7443 error() shall build the message from the following elements in 7444 their specified order: 7445 7446 1. the program name. If the application has provided a 7447 function named error_print_progname(), error() shall call 7448 this to supply the program name; otherwise, error() uses 7449 the content of the global variable program_name. 7450 2. the colon and space characters, then the result of using 7451 the printf-style format and the optional arguments. 7452 3. if errnum is nonzero, error() shall add the colon and 7453 space characters, then the result of strerror(errnum). 7454 4. a newline. 7455 7456 If exitstatus is nonzero, error() shall call exit(exitstatus). 7457 7458 See Also 7459 7460 err(), errx() 7461 7462 errx 7463 7464 Name 7465 7466 errx -- display formatted error message and exit 7467 7468 Synopsis 7469 7470 #include 7471 7472 void errx(int eval, const char * fmt, ...); 7473 7474 Description 7475 7476 The errx() function shall display a formatted error message on 7477 the standard error stream. The last component of the program 7478 name, a colon character, and a space shall be output. If fmt 7479 is non-NULL, it shall be used as the format string for the 7480 printf() family of functions, and the formatted error message, 7481 a colon character, and a space shall be output. The output 7482 shall be followed by a newline character. 7483 7484 errx() does not return, but shall exit with the value of eval. 7485 7486 Return Value 7487 7488 None. 7489 7490 Errors 7491 7492 None. 7493 7494 See Also 7495 7496 error(), err() 7497 7498 fcntl 7499 7500 Name 7501 7502 fcntl -- file control 7503 7504 Description 7505 7506 fcntl() is as specified in ISO POSIX (2003), but with 7507 differences as listed below. 7508 7509 Implementation may set O_LARGEFILE 7510 7511 According to ISO POSIX (2003), only an application sets 7512 fcntl() flags, for example O_LARGEFILE. However, this 7513 specification also allows an implementation to set the 7514 O_LARGEFILE flag in the case where the programming environment 7515 is one of _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF64, 7516 _POSIX_V6_LPBIG_OFFBIG. See getconf and c99 in ISO POSIX 7517 (2003) for a description of these environments. Thus, calling 7518 fcntl() with the F_GETFL command may return O_LARGEFILE as 7519 well as flags explicitly set by the application in the case 7520 that both the implementation and the application support an 7521 off_t of at least 64 bits. 7522 7523 fflush_unlocked 7524 7525 Name 7526 7527 fflush_unlocked -- non thread safe fflush 7528 7529 Description 7530 7531 fflush_unlocked() is the same as fflush() except that it need 7532 not be thread safe. That is, it may only be invoked in the 7533 ways which are legal for getc_unlocked(). 7534 7535 fgetwc_unlocked 7536 7537 Name 7538 7539 fgetwc_unlocked -- non thread safe fgetwc 7540 7541 Description 7542 7543 fgetwc_unlocked() is the same as fgetwc() except that it need 7544 not be thread safe. That is, it may only be invoked in the 7545 ways which are legal for getc_unlocked(). 7546 7547 flock 7548 7549 Name 7550 7551 flock -- apply or remove an advisory lock on an open file 7552 7553 Synopsis 7554 7555 int flock(int fd, int operation); 7556 7557 Description 7558 7559 flock() applies or removes an advisory lock on the open file 7560 fd. Valid operation types are: 7561 7562 LOCK_SH 7563 Shared lock. More than one process may hold a shared 7564 lock for a given file at a given time. 7565 7566 LOCK_EX 7567 Exclusive lock. Only one process may hold an exclusive 7568 lock for a given file at a given time. 7569 7570 LOCK_UN 7571 Unlock. 7572 7573 LOCK_NB 7574 Don't block when locking. May be specified (by oring) 7575 along with one of the other operations. 7576 7577 A single file may not simultaneously have both shared and 7578 exclusive locks. 7579 7580 Return Value 7581 7582 On success, 0 is returned. On error, -1 is returned and the 7583 global variable errno is set appropriately. 7584 7585 Errors 7586 7587 EWOULDBLOCK 7588 The file is locked and the LOCK_NB flag was selected. 7589 7590 freelocale 7591 7592 Name 7593 7594 freelocale -- free a locale object 7595 7596 Synopsis 7597 7598 #include 7599 7600 void freelocale(locale_t locale); 7601 7602 Description 7603 7604 The freelocale() function shall free the locale object locale, 7605 and release any resources associated with it. 7606 7607 Return Value 7608 7609 None. 7610 7611 Errors 7612 7613 None defined. 7614 7615 See Also 7616 7617 setlocale(), newlocale(), duplocale(), uselocale() 7618 7619 fscanf 7620 7621 Name 7622 7623 fscanf -- convert formatted input 7624 7625 Description 7626 7627 The scanf() family of functions shall behave as described in 7628 ISO POSIX (2003), except as noted below. 7629 7630 Differences 7631 7632 The %s, %S and %[ conversion specifiers shall accept an option 7633 length modifier a, which shall cause a memory buffer to be 7634 allocated to hold the string converted. In such a case, the 7635 argument corresponding to the conversion specifier should be a 7636 reference to a pointer value that will receive a pointer to 7637 the allocated buffer. If there is insufficient memory to 7638 allocate a buffer, the function may set errno to ENOMEM and a 7639 conversion error results. 7640 7641 Note: This directly conflicts with the ISO C (1999) usage 7642 of %a as a conversion specifier for hexadecimal float 7643 values. While this conversion specifier should be 7644 supported, a format specifier such as "%aseconds" will have 7645 a different meaning on an LSB conforming system. 7646 7647 fwscanf 7648 7649 Name 7650 7651 fwscanf -- convert formatted input 7652 7653 Description 7654 7655 The scanf() family of functions shall behave as described in 7656 ISO POSIX (2003), except as noted below. 7657 7658 Differences 7659 7660 The %s, %S and %[ conversion specifiers shall accept an option 7661 length modifier a, which shall cause a memory buffer to be 7662 allocated to hold the string converted. In such a case, the 7663 argument corresponding to the conversion specifier should be a 7664 reference to a pointer value that will receive a pointer to 7665 the allocated buffer. If there is insufficient memory to 7666 allocate a buffer, the function may set errno to ENOMEM and a 7667 conversion error results. 7668 7669 Note: This directly conflicts with the ISO C (1999) usage 7670 of %a as a conversion specifier for hexadecimal float 7671 values. While this conversion specifier should be 7672 supported, a format specifier such as "%aseconds" will have 7673 a different meaning on an LSB conforming system. 7674 7675 getgrouplist 7676 7677 Name 7678 7679 getgrouplist -- get network group entry 7680 7681 Synopsis 7682 7683 #include 7684 7685 int getgrouplist(const char * user, gid_t group, gid_t * 7686 groups, int * ngroups); 7687 7688 Description 7689 7690 The getgrouplist() function shall fill in the array groups 7691 with the supplementary groups for the user specified by user. 7692 On entry, ngroups shall refer to an integer containing the 7693 maximum number of gid_t members in the groups array. The group 7694 group shall also be included. On success, the value referred 7695 to by ngroups shall be updated to contain the number of gid_t 7696 objects copied. 7697 7698 Return Value 7699 7700 On success, if there was sufficient room to copy all the 7701 supplementatry group identifiers to the array identified by 7702 groups, getgrouplist() shall return the number of gid_t 7703 objects copied, and the value referenced by ngroups shall be 7704 updated. If there was not sufficient room to copy all the 7705 supplementary group identifiers, grouplist() shall return -1, 7706 and update the value referenced by ngroups to the number 7707 actually copied. 7708 7709 If user does not refer to a valid user on the system, 7710 getgrouplist() shall return 0, and set the value referenced by 7711 ngroups to 0. 7712 7713 Errors 7714 7715 None defined. 7716 7717 See Also 7718 7719 getgroups() 7720 7721 getloadavg 7722 7723 Name 7724 7725 getloadavg -- get system load averages 7726 7727 Synopsis 7728 7729 #include 7730 7731 int getloadavg(double loadavg[], int nelem); 7732 7733 Description 7734 7735 getloadavg() returns the number of processes in the system run 7736 queue averaged over various periods of time. Up to nelem 7737 samples are retrieved and assigned to successive elements of 7738 loadavg[]. The system imposes a maximum of 3 samples, 7739 representing averages over the last 1, 5, and 15 minutes, 7740 respectively. 7741 7742 getopt 7743 7744 Name 7745 7746 getopt -- parse command line options 7747 7748 Synopsis 7749 7750 #include 7751 7752 int getopt(int argc, char * const argv[], const char * 7753 optstring); 7754 7755 extern char *optarg; 7756 extern int optind, opterr, optopt; 7757 7758 Description 7759 7760 The getopt() function shall parse command line arguments as 7761 described in ISO POSIX (2003), with the following exceptions, 7762 where LSB and POSIX specifications vary. LSB systems shall 7763 implement the modified behaviors described below. 7764 7765 Argument Ordering 7766 7767 The getopt() function can process command line arguments 7768 referenced by argv in one of three ways: 7769 7770 PERMUTE 7771 the order of arguments in argv is altered so that all 7772 options (and their arguments) are moved in front of all 7773 of the operands. This is the default behavior. 7774 7775 Note: This behavior has undefined results if argv is not 7776 modifiable. This is to support historic behavior predating 7777 the use of const and ISO C (1999). The function prototype 7778 was aligned with ISO POSIX (2003) despite the fact that it 7779 modifies argv, and the library maintainers are unwilling to 7780 change this. 7781 7782 REQUIRE_ORDER 7783 The arguments in argv are processed in exactly the 7784 order given, and option processing stops when the first 7785 non-option argument is reached, or when the element of 7786 argv is "--". This ordering can be enforced either by 7787 setting the environment variable POSIXLY_CORRECT, or by 7788 setting the first character of optstring to '+'. 7789 7790 RETURN_IN_ORDER 7791 The order of arguments is not altered, and all 7792 arguments are processed. Non-option arguments 7793 (operands) are handled as if they were the argument to 7794 an option with the value 1 ('\001'). This ordering is 7795 selected by setting the first character of optstring to 7796 '-'; 7797 7798 Option Characteristics 7799 7800 LSB specifies that: 7801 7802 * an element of argv that starts with "-" (and is not 7803 exactly "-" or "--") is an option element. 7804 * characters of an option element, aside from the initial 7805 "-", are option characters. 7806 7807 POSIX specifies that: 7808 7809 * applications using getopt() shall obey the following 7810 syntax guidelines: 7811 + option name is a single alphanumeric character from 7812 the portable character set 7813 + option is preceded by the '-' delimiter character 7814 + options without option-arguments should be accepted 7815 when grouped behind one '-' delimiter 7816 + each option and option-argument is a separate 7817 argument 7818 + option-arguments are not optional 7819 + all options should precede operands on the command 7820 line 7821 + the argument "--" is accepted as a delimiter 7822 indicating the end of options and the consideration 7823 of subsequent arguments, if any, as operands 7824 * historical implementations of getopt() support other 7825 characters as options as an allowed extension, but 7826 applications that use extensions are not maximally 7827 portable. 7828 * support for multi-byte option characters is only possible 7829 when such characters can be represented as type int. 7830 * applications that call any utility with a first operand 7831 starting with '-' should usually specify "--" to mark the 7832 end of the options. Standard utilities that do not support 7833 this guideline indicate that fact in the OPTIONS section 7834 of the utility description. 7835 7836 Extensions 7837 7838 LSB specifies that: 7839 7840 * if a character is followed by two colons, the option takes 7841 an optional argument; if there is text in the current argv 7842 element, it is returned in optarg, otherwise optarg is set 7843 to 0. 7844 * if optstring contains W followed by a semi-colon (;), then 7845 -W foo is treated as the long option --foo. 7846 7847 Note: See getopt_long() for a description of long options. 7848 * The first character of optstring shall modify the behavior 7849 of getopt() as follows: 7850 + if the first character is '+', then REQUIRE_ORDER 7851 processing shall be in effect (see above) 7852 + if the first character is '-', then RETURN_IN_ORDER 7853 processing shall be in effect (see above) 7854 + if the first character is ':', then getopt() shall 7855 return ':' instead of '?' to indicate a missing 7856 option argument, and shall not print any diagnostic 7857 message to stderr. 7858 7859 POSIX specifies that: 7860 7861 * the -W option is reserved for implementation extensions. 7862 7863 Return Values 7864 7865 LSB specifies the following additional getopt() return values: 7866 7867 * '\001' is returned if RETURN_IN_ORDER argument ordering is 7868 in effect, and the next argument is an operand, not an 7869 option. The argument is available in optarg. 7870 7871 Any other return value has the same meaning as for POSIX. 7872 7873 POSIX specifies the following getopt() return values: 7874 7875 * the next option character is returned, if found 7876 successfully. 7877 * ':' is returned if a parameter is missing for one of the 7878 options and the first character of optstring is ':'. 7879 * '?' is returned if an unknown option character not in 7880 optstring is encountered, or if getopt() detects a missing 7881 argument and the first character of optstring is not ':'. 7882 * -1 is returned for the end of the option list. 7883 7884 Environment Variables 7885 7886 LSB specifies that: 7887 7888 * if the variable POSIXLY_CORRECT is set, option processing 7889 stops as soon as a non-option argument is encountered. 7890 * the variable _[PID]_GNU_nonoption_argv_flags_ (where [PID] 7891 is the process ID for the current process), contains a 7892 space separated list of arguments that should not be 7893 treated as arguments even though they appear to be so. 7894 7895 Rationale: This was used by bash 2.0 to communicate to GNU 7896 libc which arguments resulted from wildcard expansion and 7897 so should not be considered as options. This behavior was 7898 removed in bash version 2.01, but the support remains in 7899 GNU libc. 7900 This behavior is DEPRECATED in this version of the LSB; 7901 future revisions of this specification may not include 7902 this requirement. 7903 7904 getopt_long 7905 7906 Name 7907 7908 getopt_long -- parse command line options 7909 7910 Synopsis 7911 7912 #define _GNU_SOURCE 7913 #include 7914 7915 int getopt_long(int argc, char * const argv[], const char * 7916 opstring, const struct option * longopts, int * longindex); 7917 7918 Description 7919 7920 getopt_long() works like getopt() except that it also accepts 7921 long options, started out by two dashes. Long option names may 7922 be abbreviated if the abbreviation is unique or is an exact 7923 match for some defined option. A long option may take a 7924 parameter, of the form --arg=param or --arg param. 7925 7926 longopts is a pointer to the first element of an array of 7927 struct option declared in getopt.h as: 7928 struct option { 7929 const char *name; 7930 int has_arg; 7931 int *flag; 7932 int val; 7933 }; 7934 7935 The fields in this structure have the following meaning: 7936 7937 name 7938 The name of the long option. 7939 7940 has_arg 7941 One of: 7942 7943 no_argument (or 0) if the option does not take an argument, 7944 required_argument (or 1) if the option requires an argument, 7945 or 7946 optional_argument (or 2) if the option takes an optional 7947 argument. 7948 7949 flag 7950 specifies how results are returned for a long option. 7951 If flag is NULL, then getopt_long() shall return val. 7952 (For example, the calling program may set val to the 7953 equivalent short option character.) Otherwise, 7954 getopt_long() returns 0, and flag shall point to a 7955 variable which shall be set to val if the option is 7956 found, but left unchanged if the option is not found. 7957 7958 val 7959 The value to return, or to load into the variable 7960 pointed to by flag. 7961 7962 Return Value 7963 7964 getopt_long() returns the option character if a short option 7965 was found successfully, or ":" if there was a missing 7966 parameter for one of the options, or "?" for an unknown option 7967 character, or -1 for the end of the option list. 7968 7969 For a long option, getopt_long() returns val if flag is NULL, 7970 and 0 otherwise. Error and -1 returns are the same as for 7971 getopt(), plus "?" for an ambiguous match or an extraneous 7972 parameter. 7973 7974 getopt_long_only 7975 7976 Name 7977 7978 getopt_long_only -- parse command line options 7979 7980 Synopsis 7981 7982 #define _GNU_SOURCE 7983 #include 7984 7985 int getopt_long_only(int argc, char * const argv[], const char 7986 * optstring, const struct option * longopts, int * longindex); 7987 7988 Description 7989 7990 getopt_long_only() is like getopt_long(), but "-" as well as 7991 "--" can indicate a long option. If an option that starts with 7992 "-" (not "--") doesn't match a long option, but does match a 7993 short option, it is parsed as a short option instead. 7994 7995 Note: The getopt_long_only() function is intended only for 7996 supporting certain programs whose command line syntax was 7997 designed before the Utility Syntax Guidelines of ISO POSIX 7998 (2003) were developed. New programs should generally call 7999 getopt_long() instead, which provides the --option syntax 8000 for long options, which is preferred by GNU and consistent 8001 with ISO POSIX (2003). 8002 8003 Return Value 8004 8005 getopt_long_only() returns the option character if the option 8006 was found successfully, or ":" if there was a missing 8007 parameter for one of the options, or "?" for an unknown option 8008 character, or -1 for the end of the option list. 8009 8010 getopt_long_only() also returns the option character when a 8011 short option is recognized. For a long option, they return val 8012 if flag is NULL, and 0 otherwise. Error and -1 returns are the 8013 same as for getopt(), plus "?" for an ambiguous match or an 8014 extraneous parameter. 8015 8016 getsockopt 8017 8018 Name 8019 8020 getsockopt -- get socket options 8021 8022 Synopsis 8023 8024 #include 8025 #include 8026 8027 int getsockopt(int socket, int level, int option_name, void * 8028 restrict option_value, socklen_t * restrict option_len); 8029 8030 Description 8031 8032 The getsockopt() function shall behave as specified in ISO 8033 POSIX (2003), with the following extensions. 8034 8035 IP Protocol Level Options 8036 8037 If the level parameter is IPPROTO_IP, the following values 8038 shall be supported for option_name (see RFC 791:Internet 8039 Protocol for further details): 8040 8041 IP_OPTIONS 8042 Get the Internet Protocol options sent with every 8043 packet from this socket. The option_value shall point 8044 to a memory buffer in which the options shall be 8045 placed; on entry option_len shall point to an integer 8046 value indicating the maximum size of the memory buffer, 8047 in bytes. On successful return, the value referenced by 8048 option_len shall be updated to the size of data copied 8049 to the buffer. For IPv4, the maximum length of options 8050 is 40 bytes. 8051 8052 IP_TTL 8053 Get the current unicast Internet Protocol Time To Live 8054 value used when sending packets with this socket. The 8055 option_value shall point to a buffer large enough to 8056 hold the time to live value (at least 1 byte), and 8057 option_len shall point to an integer value holding the 8058 maximum size of that buffer. On successful return, the 8059 value referenced by option_len shall be updated to 8060 contain the number of bytes copied into the buffer, 8061 which shall be no larger than the initial value, and 8062 option_value shall point to an integer containing the 8063 time to live value. 8064 8065 IP_TOS 8066 Get the Internet Protocol type of service indicator 8067 used when sending packets with this socket. The 8068 option_value shall point to a buffer large enough to 8069 hold the type of service indicator (at least 1 byte), 8070 and option_len shall point to an integer value holding 8071 the maximum size of that buffer. On successful return, 8072 the value referenced by option_len shall be updated to 8073 contain the number of bytes copied into the buffer, 8074 which shall be no larger than the initial value, and 8075 option_value shall point to an integer containing the 8076 time to live value. 8077 8078 gettext 8079 8080 Name 8081 8082 gettext -- Search message catalogs for a string 8083 8084 Synopsis 8085 8086 #include 8087 8088 char * gettext(const char * msgid); 8089 8090 Description 8091 8092 The gettext() function shall search the currently selected 8093 message catalogs for a string identified by the string msgid. 8094 If a string is located, that string shall be returned. 8095 8096 The gettext() function is equivalent to dcgettext(NULL, msgid, 8097 LC_MESSAGES). 8098 8099 Return Value 8100 8101 If a string is found in the currently selected message 8102 catalogs for msgid, then a pointer to that string shall be 8103 returned. Otherwise, a pointer to msgid shall be returned. 8104 8105 Applications shall not modify the string returned by 8106 gettext(). 8107 8108 Errors 8109 8110 None. 8111 8112 The gettext() function shall not modify errno. 8113 8114 See Also 8115 8116 dgettext, ngettext, dngettext, dcgettext, dcngettext, 8117 textdomain, bindtextdomain, bind_textdomain_codeset 8118 8119 getutent 8120 8121 Name 8122 8123 getutent -- access user accounting database entries 8124 8125 Synopsis 8126 8127 #include 8128 8129 struct utmp *getutent(void); 8130 8131 Description 8132 8133 The getutent() function shall read the next entry from the 8134 user accounting database. 8135 8136 Return Value 8137 8138 Upon successful completion, getutent() shall return a pointer 8139 to a utmp structure containing a copy of the requested entry 8140 in the user accounting database. Otherwise, a null pointer 8141 shall be returned. The return value may point to a static area 8142 which is overwritten by a subsequent call to getutent(). 8143 8144 Errors 8145 8146 None defined. 8147 8148 getutent_r 8149 8150 Name 8151 8152 getutent_r -- access user accounting database entries 8153 8154 Synopsis 8155 8156 int getutent_r(struct utmp * buffer, struct utmp ** result); 8157 8158 Description 8159 8160 The getutent_r() function is a reentrant version of the 8161 getutent() function. On entry, buffer should point to a user 8162 supplied buffer to which the next entry in the database will 8163 be copied, and result should point to a location where the 8164 result will be stored. 8165 8166 Return Value 8167 8168 On success, getutent_r() shall return 0 and set the location 8169 referenced by result to a pointer to buffer. Otherwise, 8170 getutent_r() shall return -1 and set the location referenced 8171 by result to NULL. 8172 8173 glob64 8174 8175 Name 8176 8177 glob64 -- find pathnames matching a pattern (Large File 8178 Support) 8179 8180 Synopsis 8181 8182 #include 8183 8184 int glob64(const char * pattern, int flags, int (*errfunc) 8185 (const char *, int), glob64_t * pglob); 8186 8187 Description 8188 8189 The glob64() function is a large-file version of the glob() 8190 defined in ISO POSIX (2003). It shall search for pathnames 8191 matching pattern according to the rules used by the shell, 8192 /bin/sh. No tilde expansion or parameter substitution is done; 8193 see wordexp(). 8194 8195 The results of a glob64() call are stored in the structure 8196 pointed to by pglob, which is a glob64_t declared in glob.h 8197 with the following members: 8198 typedef struct 8199 { 8200 size_t gl_pathc; 8201 char **gl_pathv; 8202 size_t gl_offs; 8203 int gl_flags; 8204 void (*gl_closedir) (void *); 8205 struct dirent64 *(*gl_readdir64) (void *); 8206 void *(*gl_opendir) (const char *); 8207 int (*gl_lstat) (const char *, struct stat *); 8208 int (*gl_stat) (const char *, struct stat *); 8209 } 8210 glob64_t; 8211 8212 Structure members with the same name as corresponding members 8213 of a glob_t as defined in ISO POSIX (2003) shall have the same 8214 purpose. 8215 8216 Other members are defined as follows: 8217 8218 gl_flags 8219 reserved for internal use 8220 8221 gl_closedir 8222 pointer to a function capable of closing a directory 8223 opened by gl_opendir 8224 8225 gl_readdir64 8226 pointer to a function capable of reading entries in a 8227 large directory 8228 8229 gl_opendir 8230 pointer to a function capable of opening a large 8231 directory 8232 8233 gl_stat 8234 pointer to a function capable of returning file status 8235 for a large file 8236 8237 gl_lstat 8238 pointer to a function capable of returning file status 8239 information for a large file or symbolic link 8240 8241 A large file or large directory is one with a size which 8242 cannot be represented by a variable of type off_t. 8243 8244 Return Value 8245 8246 On success, 0 is returned. Other possible returns are: 8247 8248 GLOB_NOSPACE 8249 out of memory 8250 8251 GLOB_ABORTED 8252 read error 8253 8254 GLOB_NOMATCH 8255 no match found 8256 8257 globfree64 8258 8259 Name 8260 8261 globfree64 -- free memory from glob64() (Large File Support) 8262 8263 Synopsis 8264 8265 #include 8266 8267 void globfree64(glob64_t * pglob); 8268 8269 Description 8270 8271 globfree64() frees the dynamically allocated storage from an 8272 earlier call to glob64(). 8273 8274 globfree64() is a 64-bit version of globfree(). 8275 8276 initgroups 8277 8278 Name 8279 8280 initgroups -- initialize the supplementary group access list 8281 8282 Synopsis 8283 8284 #include 8285 #include 8286 8287 int initgroups(const char * user, gid_t group); 8288 8289 Description 8290 8291 If the process has appropriate privilege, the initgroups() 8292 function shall initialize the Supplementary Group IDs for the 8293 current process by reading the group database and using all 8294 groups of which user is a member. The additional group group 8295 is also added to the list. 8296 8297 Return Value 8298 8299 On success, 0 is returned. On error, -1 is returned and the 8300 global variable errno is set appropriately. 8301 8302 Errors 8303 8304 EPERM 8305 The calling process does not have sufficient 8306 privileges. 8307 8308 ENOMEM 8309 Insufficient memory to allocate group information 8310 structure. 8311 8312 See Also 8313 8314 setgroups() 8315 8316 ioctl 8317 8318 Name 8319 8320 ioctl -- control device 8321 8322 Synopsis 8323 8324 #include 8325 8326 int ioctl (int fildes , int request , ...); 8327 8328 Description 8329 8330 The ioctl() function shall manipulate the underlying device 8331 parameters of special files. fildes shall be an open file 8332 descriptor referring to a special file. The ioctl() function 8333 shall take three parameters; the type and value of the third 8334 parameter is dependent on the device and request. 8335 8336 Conforming LSB applications shall not call ioctl() except in 8337 situations explicitly stated in this specification. 8338 8339 Return Value 8340 8341 On success, 0 is returned. An ioctl() may use the return value 8342 as an output parameter and return a non-negative value on 8343 success. On error, -1 is returned and the global variable 8344 errno is set appropriately. 8345 8346 Errors 8347 8348 EBADF 8349 fildes is not a valid descriptor. 8350 8351 EFAULT 8352 The third parameter references an inaccessible memory 8353 area. 8354 8355 ENOTTY 8356 fildes is not associated with a character special 8357 device. 8358 8359 ENOTTY 8360 The specified request does not apply to the kind of 8361 object that fildes references. 8362 8363 EINVAL 8364 request or the third parameter is not valid. 8365 8366 Relationship to POSIX (Informative) 8367 8368 It should be noted that ISO POSIX (2003) contains an interface 8369 named ioctl(). The LSB only defines behavior when fildes 8370 refers to a socket (see sockio) or terminal device (see 8371 ttyio), while ISO POSIX (2003) only defines behavior when 8372 fildes refers to a STREAMS device. An implementation may 8373 support both behaviors; the LSB does not require any STREAMS 8374 support. 8375 8376 sockio 8377 8378 Name 8379 8380 sockio -- socket ioctl commands 8381 8382 Synopsis 8383 8384 #include 8385 #include 8386 #include 8387 8388 int ioctl(int sockfd, int request, char * argp); 8389 8390 Description 8391 8392 Socket ioctl() commands are a subset of the ioctl() calls, 8393 which can perform a variety of functions on sockets. sockfd 8394 shall be an open file descriptor referring to a socket (see 8395 the socket() or accept() functions). 8396 8397 Socket ioctl() commands apply to the underlying network 8398 interfaces, and affect the entire system, not just the file 8399 descriptor used to issue the ioctl(). 8400 8401 The following values for request are accepted: 8402 8403 SIOCGIFCONF (Deprecated) 8404 Get the interface configuration list for the system. 8405 8406 Note: The SIOCGIFCONF interface is superceded by the 8407 if_nameindex() family of functions (see ISO POSIX (2003)). 8408 A future version of this specification may withdraw this 8409 value for request. 8410 8411 argp shall point to a ifconf structure, as described in 8412 . Before calling, the caller shall set the 8413 ifc_ifcu.ifcu_req field to point to an array of ifreq 8414 structures, and set ifc_len to the size in bytes of 8415 this allocated array. Upon return, ifc_len will contain 8416 the size in bytes of the array which was actually used. 8417 If it is the same as the length upon calling, the 8418 caller should assume that the array was too small and 8419 try again with a larger array. 8420 8421 On success, SIOCGIFCONF shall return a nonnegative 8422 value. 8423 8424 Rationale: Historical UNIX systems disagree on the meaning 8425 of the return value. 8426 8427 SIOCGIFFLAGS 8428 Get the interface flags for the indicated interface. 8429 argp shall point to a ifreq structure. Before calling, 8430 the caller should fill in the ifr_name field with the 8431 interface name, and upon return, the 8432 ifr_ifru.ifru_flags field is set with the interface 8433 flags. 8434 8435 SIOCGIFADDR 8436 Get the interface address for the given interface. argp 8437 shall point to a ifreq structure. Before calling, the 8438 caller should fill in the ifr_name field with the 8439 interface name, and upon return, the ifr_ifru.ifru_addr 8440 field is set with the interface address. 8441 8442 SIOCGIFBRDADDR 8443 Get the interface broadcast address for the given 8444 interface. argp shall point to a ifreq structure. 8445 Before calling, the caller should fill in the ifr_name 8446 field with the interface name, and upon return, the 8447 ifr_ifru.ifru_broadcast field is set with the interface 8448 broadcast address. 8449 8450 SIOCGIFNETMASK 8451 Get the network mask for the given interface. argp 8452 shall point to a ifreq structure. Before calling, the 8453 caller should fill in the ifr_name field with the 8454 interface name, and upon return, the 8455 ifr_ifru.ifru_netmask field is set with the network 8456 mask. 8457 8458 SIOCGIFMTU 8459 Get the Maximum Transmission Unit (MTU) size for the 8460 given interface. argp shall point to a ifreq structure. 8461 Before calling, the caller should fill in the ifr_name 8462 field with the interface name, and upon return, the 8463 ifr_ifru.ifru_mtu field is set with the MTU. 8464 8465 FIONREAD 8466 Get the amount of queued unread data in the receive 8467 buffer. argp shall point to an integer where the result 8468 is to be placed. 8469 8470 Return Value 8471 8472 On success, if request is SIOCGIFCONF, a non-negative integer 8473 shall be returned. If request is not SIOCGIFCONF, on success 0 8474 is returned. On error, -1 is returned and the global variable 8475 errno is set appropriately. 8476 8477 Errors 8478 8479 EBADF 8480 sockfd is not a valid descriptor. 8481 8482 EFAULT 8483 argp references an inaccessible memory area. 8484 8485 ENOTTY 8486 The specified request does not apply to the kind of 8487 object that the descriptor sockfd references. 8488 8489 EINVAL 8490 Either request or argp is invalid. 8491 8492 ENOTCONN 8493 The operation is only defined on a connected socket, 8494 but the socket wasn't connected. 8495 8496 ttyio 8497 8498 Name 8499 8500 ttyio -- tty ioctl commands 8501 8502 Synopsis 8503 8504 #include 8505 8506 int ioctl(int fd, unsigned long request, int * argp); 8507 8508 Description 8509 8510 Tty ioctl commands are a subset of the ioctl() calls, which 8511 can perform a variety of functions on tty devices. fd shall be 8512 an open file descriptor referring to a terminal device. 8513 8514 The following ioctl()s are provided: 8515 8516 TIOCGWINSZ 8517 Get the size attributes of the tty. argp is a pointer 8518 to a winsize structure. 8519 8520 Return Value 8521 8522 On success, 0 is returned. On error, -1 is returned and the 8523 global variable errno is set appropriately. 8524 8525 Errors 8526 8527 EBADF 8528 fd is not a valid descriptor. 8529 8530 EFAULT 8531 argp references an inaccessible memory area. 8532 8533 EINVAL 8534 request and argp are not valid. 8535 8536 kill 8537 8538 Name 8539 8540 kill -- send a signal 8541 8542 Synopsis 8543 8544 #include 8545 8546 int kill(pid_t pid, int sig); 8547 8548 Description 8549 8550 kill() is as specified in the ISO POSIX (2003), but with 8551 differences as listed below. 8552 8553 Process ID -1 doesn't affect calling process 8554 8555 If pid is specified as -1, sig shall not be sent to the 8556 calling process. Other than this, the rules in the ISO POSIX 8557 (2003) apply. 8558 8559 Rationale: This was a deliberate Linus decision after an 8560 unpopular experiment in including the calling process in 8561 the 2.5.1 kernel. See "What does it mean to signal 8562 everybody?", Linux Weekly News, 20 December 2001, 8563 http://lwn.net/2001/1220/kernel.php3 8564 8565 link 8566 8567 Name 8568 8569 link -- create a link to a file 8570 8571 Synopsis 8572 8573 #include 8574 8575 int link(const char * path1, const char * path2); 8576 8577 Description 8578 8579 The link() function shall behave as specified in ISO POSIX 8580 (2003), except with differences as listed below. 8581 8582 Need Not Follow Symlinks 8583 8584 ISO POSIX (2003) specifies that pathname resolution shall 8585 follow symbolic links during pathname resolution unless the 8586 function is required to act on the symbolic link itself, or 8587 certain arguments direct that the function act on the symbolic 8588 link itself. The link() function in ISO POSIX (2003) contains 8589 no such requirement to operate on a symbolic link. However, a 8590 conforming LSB implementation need not follow a symbolic link 8591 for the path1 argument. 8592 8593 mbsnrtowcs 8594 8595 Name 8596 8597 mbsnrtowcs -- convert a multibyte string to a wide character 8598 string 8599 8600 Synopsis 8601 8602 #include 8603 8604 size_t mbsnrtowcs(wchar_t * dest, const char * * src, size_t 8605 nms, size_t len, mbstate_t * ps); 8606 8607 Description 8608 8609 mbsnrtowcs() is like mbsrtowcs(), except that the number of 8610 bytes to be converted, starting at src, is limited to nms. 8611 8612 If dest is not a NULL pointer, mbsnrtowcs() converts at most 8613 nms bytes from the multibyte string src to a wide-character 8614 string starting at dest. At most, len wide characters are 8615 written to dest. The state ps is updated. 8616 8617 The conversion is effectively performed by repeatedly calling: 8618 8619 mbrtowc(dest, *src, n, ps) 8620 8621 where n is some positive number, as long as this call 8622 succeeds, and then incrementing dest by one and src by the 8623 number of bytes consumed. 8624 8625 The conversion can stop for three reasons: 8626 8627 * An invalid multibyte sequence has been encountered. In 8628 this case src is left pointing to the invalid multibyte 8629 sequence, (size_t)(-1) is returned, and errno is set to 8630 EILSEQ. 8631 * The nms limit forces a stop, or len non-L'\0' wide 8632 characters have been stored at dest. In this case, src is 8633 left pointing to the next multibyte sequence to be 8634 converted, and the number of wide characters written to 8635 dest is returned. 8636 * The multibyte string has been completely converted, 8637 including the terminating '\0' (which has the side effect 8638 of bringing back ps to the initial state). In this case, 8639 src is set to NULL, and the number of wide characters 8640 written to dest, excluding the terminating L'\0' 8641 character, is returned. 8642 8643 If dest is NULL, len is ignored, and the conversion proceeds 8644 as above, except that the converted wide characters are not 8645 written out to memory, and that no destination length limit 8646 exists. 8647 8648 In both of the above cases, if ps is a NULL pointer, a static 8649 anonymous state only known to mbsnrtowcs() is used instead. 8650 8651 The programmer shall ensure that there is room for at least 8652 len wide characters at dest. 8653 8654 Return Value 8655 8656 mbsnrtowcs() returns the number of wide characters that make 8657 up the converted part of the wide character string, not 8658 including the terminating null wide character. If an invalid 8659 multibyte sequence was encountered, (size_t)(-1) is returned, 8660 and the global variable errno is set to EILSEQ. 8661 8662 Notes 8663 8664 The behavior of mbsnrtowcs() depends on the LC_CTYPE category 8665 of the current locale. 8666 8667 Passing NULL as ps is not multi-thread safe. 8668 8669 memmem 8670 8671 Name 8672 8673 memmem -- locate bytes 8674 8675 Synopsis 8676 8677 #define _GNU_SOURCE 8678 #include 8679 8680 void * memmem(const void * haystack, size_t haystacklen, const 8681 void * needle, size_t needlelen); 8682 8683 Description 8684 8685 memmem() finds the start of the first occurrence of the byte 8686 array referenced by needle of length needlelen in the memory 8687 area haystack of length haystacklen. 8688 8689 Return Value 8690 8691 memmem() returns a pointer to the beginning of the byte array, 8692 or NULL if the byte array is not found. 8693 8694 Notes 8695 8696 Earlier versions of the C library (prior to glibc 2.1) 8697 contained a memmem() with various problems, and application 8698 developers should treat this function with care. 8699 8700 memrchr 8701 8702 Name 8703 8704 memrchr -- scan memory for a character 8705 8706 Synopsis 8707 8708 #include 8709 8710 void * memrchr(const void * s, int c, size_t n); 8711 8712 Description 8713 8714 The memrchr() function shall locate the last occurence of c 8715 (converted to an unsigned char) in the initial n bytes (each 8716 interpreted as an unsigned char) of the object pointed to by 8717 s. 8718 8719 Return Value 8720 8721 The memrchr() shall return a pointer to the located byte, or a 8722 null pointer if the byte does not occur in the object. 8723 8724 Errors 8725 8726 No errors are defined. 8727 8728 See Also 8729 8730 memchr() 8731 8732 newlocale 8733 8734 Name 8735 8736 newlocale -- allocate a locale object 8737 8738 Synopsis 8739 8740 #include 8741 8742 locale_t newlocale(int category_mask, const char * locale, 8743 locale_t base); 8744 8745 Description 8746 8747 The newlocale() function shall initialize a locale object. If 8748 base is NULL, then newlocale() shall first allocate the 8749 object; otherwise it shall use the locale object referenced by 8750 base. 8751 8752 The object shall be initialized for the locale named by 8753 locale, and for the categories selected in category_mask. The 8754 category_mask value is a bitwise inclusive OR of the required 8755 LC_name_MASK values, or the value LC_ALL_MASK. 8756 8757 Return Value 8758 8759 On success, the newlocale() function shall return the 8760 initialized locale object. Otherwise, it shall return NULL, 8761 and set errno to indicate the error. 8762 8763 Errors 8764 8765 The newlocale() function shall fail if: 8766 8767 ENOMEM 8768 Insufficient memory. 8769 8770 EINVAL 8771 An invalid category_mask was provided, or the locale 8772 was NULL. 8773 8774 Application Usage (Informative) 8775 8776 The only portable way to allocate a locale object is to call 8777 newlocale() with a NULL base. The allocated object may be 8778 reinitialized to a new locale by passing it back to 8779 newlocale(). The new object may be released by calling 8780 freelocale(). 8781 8782 See Also 8783 8784 setlocale(), freelocale(), duplocale(), uselocale() 8785 8786 ngettext 8787 8788 Name 8789 8790 ngettext -- Search message catalogs for plural string 8791 8792 Synopsis 8793 8794 #include 8795 8796 char * ngettext(const char * msgid1, const char * msgid2, 8797 unsigned long int n); 8798 8799 Description 8800 8801 The ngettext() function shall search the currently selected 8802 message catalogs for a string matching the singular string 8803 msgid1. If a string is located, and if n is 1, that string 8804 shall be returned. If n is not 1, a pluralized version 8805 (dependant on n) of the string shall be returned. 8806 8807 The ngettext() function is equivalent to dcngettext(NULL, 8808 msgid1, msgid2, n, LC_MESSAGES)(). 8809 8810 Return Value 8811 8812 If a string is found in the currently selected message 8813 catalogs for msgid1, then if n is 1 a pointer to the located 8814 string shall be returned. If n is not 1, a pointer to an 8815 appropriately pluralized version of the string shall be 8816 returned. If no message could be found in the currently 8817 selected mesage catalogs, then if n is 1, a pointer to msgid1 8818 shall be returned, otherwise a pointer to msgid2 shall be 8819 returned. 8820 8821 Applications shall not modify the string returned by 8822 ngettext(). 8823 8824 Errors 8825 8826 None. 8827 8828 The ngettext() function shall not modify errno. 8829 8830 See Also 8831 8832 gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, 8833 textdomain, bindtextdomain, bind_textdomain_codeset 8834 8835 pmap_getport 8836 8837 Name 8838 8839 pmap_getport -- Find the port number assigned to a service 8840 registered with a portmapper. 8841 8842 Synopsis 8843 8844 #include 8845 8846 u_short * pmap_getport(struct sockaddr_in * address, const 8847 u_long program, const u_long * version, u_int protocol); 8848 8849 Description 8850 8851 The pmap_getport() function shall return the port number 8852 assigned to a service registered with a RPC Binding service 8853 running on a given target system, using the protocol described 8854 in RFC 1833: Binding Protocols for ONC RPC Version 2. The 8855 pmap_getport() function shall be called given the RPC program 8856 number program, the program version version, and transport 8857 protocol protocol. Conforming implementations shall support 8858 both IPPROTO_UDP and IPPROTO_TCP protocols. On entry, address 8859 shall specify the address of the system on which the 8860 portmapper to be contacted resides. The value of 8861 address->sin_port shall be ignored, and the standard value for 8862 the portmapper port shall always be used. 8863 8864 Note: Security and network restrictions may prevent a 8865 conforming application from contacting a remote RPC Binding 8866 Service. 8867 8868 Return Value 8869 8870 On success, the pmap_getport() function shall return the port 8871 number in host byte order of the RPC application registered 8872 with the remote portmapper. On failure, if either the program 8873 was not registered or the remote portmapper service could not 8874 be reached, the pmap_getport() function shall return 0. If the 8875 remote portmap service could not be reached, the status is 8876 left in the global variable rpc_createerr. 8877 8878 pmap_set 8879 8880 Name 8881 8882 pmap_set -- Establishes mapping to machine's RPC Bind service. 8883 8884 Synopsis 8885 8886 #include 8887 8888 bool_t pmap_set(const u_long program, const u_long version, 8889 int protocol, u_short port); 8890 8891 Description 8892 8893 pmap_set() establishes a mapping between the triple 8894 [program,version,protocol] and port on the machine's RPC Bind 8895 service. The value of protocol is most likely IPPROTO_UDP or 8896 IPPROTO_TCP. Automatically done by svc_register(). 8897 8898 Return Value 8899 8900 pmap_set() returns 1 if it suceeds, 0 otherwise. 8901 8902 pmap_unset 8903 8904 Name 8905 8906 pmap_unset -- Destroys RPC Binding 8907 8908 Synopsis 8909 8910 #include 8911 8912 bool_t pmap_unset(u_long prognum, u_long versnum); 8913 8914 Description 8915 8916 As a user interface to the RPC Bind service, pmap_unset() 8917 destroys all mapping between the triple [prognum,versnum, *] 8918 and ports on the machine's RPC Bind service. 8919 8920 Return Value 8921 8922 pmap_unset() returns 1 if it succeeds, zero otherwise. 8923 8924 psignal 8925 8926 Name 8927 8928 psignal -- print signal message 8929 8930 Synopsis 8931 8932 #include 8933 8934 void psignal(int sig, const char * s); 8935 8936 extern const char *const sys_siglist[] 8937 8938 Description 8939 8940 The psignal() function shall display a message on the stderr 8941 stream. If s is not the null pointer, and does not point to an 8942 empty string (e.g. "\0"), the message shall consist of the 8943 string s, a colon, a space, and a string describing the signal 8944 number sig; otherwise psignal() shall display only a message 8945 describing the signal number sig. If sig is invalid, the 8946 message displayed shall indicate an unknown signal. 8947 8948 The array sys_siglist holds the signal description strings 8949 indexed by signal number. 8950 8951 Return Value 8952 8953 psignal() returns no value. 8954 8955 regexec 8956 8957 Name 8958 8959 regexec -- regular expression matching 8960 8961 Description 8962 8963 The regexec() function shall behave as specified in ISO POSIX 8964 (2003), except with differences as listed below. 8965 8966 Differences 8967 8968 Certain aspects of regular expression matching are optional; 8969 see Internationalization and Regular Expressions. 8970 8971 scanf 8972 8973 Name 8974 8975 scanf -- convert formatted input 8976 8977 Description 8978 8979 The scanf() family of functions shall behave as described in 8980 ISO POSIX (2003), except as noted below. 8981 8982 Differences 8983 8984 The %s, %S and %[ conversion specifiers shall accept an option 8985 length modifier a, which shall cause a memory buffer to be 8986 allocated to hold the string converted. In such a case, the 8987 argument corresponding to the conversion specifier should be a 8988 reference to a pointer value that will receive a pointer to 8989 the allocated buffer. If there is insufficient memory to 8990 allocate a buffer, the function may set errno to ENOMEM and a 8991 conversion error results. 8992 8993 Note: This directly conflicts with the ISO C (1999) usage 8994 of %a as a conversion specifier for hexadecimal float 8995 values. While this conversion specifier should be 8996 supported, a format specifier such as "%aseconds" will have 8997 a different meaning on an LSB conforming system. 8998 8999 setbuffer 9000 9001 Name 9002 9003 setbuffer -- stream buffering operation 9004 9005 Synopsis 9006 9007 #include 9008 9009 void setbuffer(FILE * stream, char * buf, size_t size); 9010 9011 Description 9012 9013 setbuffer() is an alias for the call to setvbuf(). It works 9014 the same, except that the size of the buffer in setbuffer() is 9015 up to the caller, rather than being determined by the default 9016 BUFSIZ. 9017 9018 setgroups 9019 9020 Name 9021 9022 setgroups -- set list of supplementary group IDs 9023 9024 Synopsis 9025 9026 #include 9027 9028 int setgroups(size_t size, const gid_t * list); 9029 9030 Description 9031 9032 If the process has appropriate privilege, the setgroups() 9033 function shall set the supplementary group IDs for the current 9034 process. list shall reference an array of size group IDs. A 9035 process may have at most NGROUPS_MAX supplementary group IDs. 9036 9037 Return Value 9038 9039 On successful completion, 0 is returned. On error, -1 is 9040 returned and the errno is set to indicate the error. 9041 9042 Errors 9043 9044 EFAULT 9045 list has an invalid address. 9046 9047 EPERM 9048 The process does not have appropriate privileges. 9049 9050 EINVAL 9051 size is greater than NGROUPS_MAX. 9052 9053 sethostname 9054 9055 Name 9056 9057 sethostname -- set host name 9058 9059 Synopsis 9060 9061 #include 9062 #include 9063 #include 9064 9065 int sethostname(const char * name, size_t len); 9066 9067 Description 9068 9069 If the process has appropriate privileges, the sethostname() 9070 function shall change the host name for the current macine. 9071 The name shall point to a null-terminated string of at most 9072 len bytes that holds the new hostname. 9073 9074 If the symbol HOST_NAME_MAX is defined, or if 9075 sysconf(_SC_HOST_NAME_MAX)() returns a value greater than 0, 9076 this value shall represent the maximum length of the new 9077 hostname. Otherwise, if the symbol MAXHOSTLEN is defined, this 9078 value shall represent the maximum length for the new hostname. 9079 If none of these values are defined, the maximum length shall 9080 be the size of the nodename field of the utsname structure. 9081 9082 Return Value 9083 9084 On success, 0 is returned. On error, -1 is returned and the 9085 global variable errno is set appropriately. 9086 9087 Errors 9088 9089 EINVAL 9090 len is negative or larger than the maximum allowed 9091 size. 9092 9093 EPERM 9094 the process did not have appropriate privilege. 9095 9096 EFAULT 9097 name is an invalid address. 9098 9099 Rationale 9100 9101 ISO POSIX (2003) guarantees that: 9102 9103 Maximum length of a host name (not including the 9104 terminating null) as returned from the gethostname() 9105 function shall be at least 255 bytes. 9106 9107 The glibc C library does not currently define HOST_NAME_MAX, 9108 and although it provides the name _SC_HOST_NAME_MAX a call to 9109 sysconf() returns -1 and does not alter errno in this case 9110 (indicating that there is no restriction on the hostname 9111 length). However, the glibc manual idicates that some 9112 implementations may have MAXHOSTNAMELEN as a means of 9113 detecting the maximum length, while the Linux kernel at 9114 release 2.4 and 2.6 stores this hostname in the utsname 9115 structure. While the glibc manual suggests simply shortening 9116 the name until sethostname() succeeds, the LSB requires that 9117 one of the first four mechanisms works. Future versions of 9118 glibc may provide a more reasonable result from 9119 sysconf(_SC_HOST_NAME_MAX). 9120 9121 setsockopt 9122 9123 Name 9124 9125 setsockopt -- set socket options 9126 9127 Synopsis 9128 9129 #include 9130 #include 9131 9132 int setsockopt(int socket, int level, int option_name, const 9133 void * option_value, socklen_t option_len); 9134 9135 Description 9136 9137 The setsockopt() function shall behave as specified in ISO 9138 POSIX (2003), with the following extensions. 9139 9140 IP Protocol Level Options 9141 9142 If the level parameter is IPPROTO_IP, the following values 9143 shall be supported for option_name (see RFC 791:Internet 9144 Protocol for further details): 9145 9146 IP_OPTIONS 9147 Set the Internet Protocol options sent with every 9148 packet from this socket. The option_value shall point 9149 to a memory buffer containing the options and 9150 option_len shall contain the size in bytes of that 9151 buffer. For IPv4, the maximum length of options is 40 9152 bytes. 9153 9154 IP_TOS 9155 Set the Type of Service flags to use when sending 9156 packets with this socket. The option_value shall point 9157 to a value containing the type of service value. The 9158 least significant two bits of the value shall contain 9159 the new Type of Service indicator. Use of other bits in 9160 the value is unspecified. The option_len parameter 9161 shall hold the size, in bytes, of the buffer referred 9162 to by option_value. 9163 9164 IP_TTL 9165 Set the current unicast Internet Protocol Time To Live 9166 value used when sending packets with this socket. The 9167 option_value shall point to a value containing the time 9168 to live value, which shall be between 1 and 255. The 9169 option_len parameter shall hold the size, in bytes, of 9170 the buffer referred to by option_value. 9171 9172 setutent 9173 9174 Name 9175 9176 setutent -- access user accounting database entries 9177 9178 Synopsis 9179 9180 #include 9181 9182 void setutent(void); 9183 9184 Description 9185 9186 The setutent() function shall reset the user accounting 9187 database such that the next call to getutent() shall be return 9188 the first record in the database. It is recommended to call it 9189 before any of the other functions that operate on the user 9190 accounting databases (e.g. getutent()) 9191 9192 Return Value 9193 9194 None. 9195 9196 sigandset 9197 9198 Name 9199 9200 sigandset -- build a new signal set by combining the two input 9201 sets using logical AND 9202 9203 Synopsis 9204 9205 #include 9206 9207 int sigandset(sigset_t * set, const sigset_t * left, const 9208 sigset_t * right); 9209 9210 Description 9211 9212 The sigandset() shall combine the two signal sets referenced 9213 by left and right, using a logical AND operation, and shall 9214 place the result in the location referenced by set, The 9215 resulting signal set shall contain only signals that are in 9216 both the set referenced by left and the set referenced by 9217 right. 9218 9219 Return Value 9220 9221 On success, sigandset() shall return 0. Otherise, sigandset() 9222 shall return -1 and set errno to indicate the error. 9223 9224 Errors 9225 9226 EINVAL 9227 One or more of set, left, or right was a null pointer. 9228 9229 See Also 9230 9231 sigorset() 9232 9233 sigisemptyset 9234 9235 Name 9236 9237 sigisemptyset -- check for empty signal set 9238 9239 Synopsis 9240 9241 #include 9242 9243 int sigisemptyset(const sigset_t * set); 9244 9245 Description 9246 9247 The sigisemptyset() function shall check for empty signal set 9248 referenced by set. 9249 9250 Return Value 9251 9252 The sigisemptyset() function shall return a positive non-zero 9253 value if the signal set referenced by set is empty, or zero if 9254 this set is empty. On error, sigisemptyset() shall return -1 9255 and set errno to indicate the error. 9256 9257 Errors 9258 9259 EINVAL 9260 set is a null pointer. 9261 9262 sigorset 9263 9264 Name 9265 9266 sigorset -- build a new signal set by combining the two input 9267 sets using logical OR 9268 9269 Synopsis 9270 9271 #include 9272 9273 int sigorset(sigset_t * set, const sigset_t * left, const 9274 sigset_t * right); 9275 9276 Description 9277 9278 The sigorset() shall combine the two signal sets referenced by 9279 left and right, using a logical OR operation, and shall place 9280 the result in the location referenced by set, The resulting 9281 signal set shall contain only signals that are in either the 9282 set referenced by left or the set referenced by right. 9283 9284 Return Value 9285 9286 On success, sigorset() shall return 0. Otherise, sigorset() 9287 shall return -1 and set errno to indicate the error. 9288 9289 Errors 9290 9291 EINVAL 9292 One or more of set, left, or right was a null pointer. 9293 9294 See Also 9295 9296 sigorset() 9297 9298 sigreturn 9299 9300 Name 9301 9302 sigreturn -- return from signal handler and cleanup stack 9303 frame 9304 9305 Synopsis 9306 9307 int sigreturn(struct sigcontext * scp); 9308 9309 Description 9310 9311 The sigreturn() function is used by the system to cleanup 9312 after a signal handler has returned. This function is not in 9313 the source standard; it is only in the binary standard. 9314 9315 Return Value 9316 9317 sigreturn() never returns. 9318 9319 sscanf 9320 9321 Name 9322 9323 sscanf -- convert formatted input 9324 9325 Description 9326 9327 The scanf() family of functions shall behave as described in 9328 ISO POSIX (2003), except as noted below. 9329 9330 Differences 9331 9332 The %s, %S and %[ conversion specifiers shall accept an option 9333 length modifier a, which shall cause a memory buffer to be 9334 allocated to hold the string converted. In such a case, the 9335 argument corresponding to the conversion specifier should be a 9336 reference to a pointer value that will receive a pointer to 9337 the allocated buffer. If there is insufficient memory to 9338 allocate a buffer, the function may set errno to ENOMEM and a 9339 conversion error results. 9340 9341 Note: This directly conflicts with the ISO C (1999) usage 9342 of %a as a conversion specifier for hexadecimal float 9343 values. While this conversion specifier should be 9344 supported, a format specifier such as "%aseconds" will have 9345 a different meaning on an LSB conforming system. 9346 9347 stime 9348 9349 Name 9350 9351 stime -- set time 9352 9353 Synopsis 9354 9355 #define _SVID_SOURCE 9356 #include 9357 9358 int stime(const time_t * t); 9359 9360 Description 9361 9362 If the process has appropriate privilege, the stime() function 9363 shall set the system's idea of the time and date. Time, 9364 referenced by t, is measured in seconds from the epoch 9365 (defined in ISO POSIX (2003) as 00:00:00 UTC January 1, 1970). 9366 9367 Return Value 9368 9369 On success, stime() shall return 0. Otherwise, stime() shall 9370 return -1 and errno shall be set to indicate the error. 9371 9372 Errors 9373 9374 EPERM 9375 The process does not have appropriate privilege. 9376 9377 EINVAL 9378 t is a null pointer. 9379 9380 stpcpy 9381 9382 Name 9383 9384 stpcpy -- copy a string returning a pointer to its end 9385 9386 Synopsis 9387 9388 #include 9389 9390 char * stpcpy(char * restrict dest, const char * restrict 9391 src); 9392 9393 Description 9394 9395 The stpcpy() function shall copy the string pointed to by src 9396 (including the terminating '\0' character) to the array 9397 pointed to by dest. The strings may not overlap, and the 9398 destination string dest shall be large enough to receive the 9399 copy. 9400 9401 Return Value 9402 9403 stpcpy() returns a pointer to the end of the string dest (that 9404 is, the address of the terminating '\0' character) rather than 9405 the beginning. 9406 9407 Example 9408 9409 This program uses stpcpy() to concatenate foo and bar to 9410 produce foobar, which it then prints. 9411 #include 9412 9413 int 9414 main (void) 9415 { 9416 char buffer[256]; 9417 char *to = buffer; 9418 to = stpcpy (to, "foo"); 9419 to = stpcpy (to, "bar"); 9420 printf ("%s\n", buffer); 9421 } 9422 9423 stpncpy 9424 9425 Name 9426 9427 stpncpy -- copy a fixed-size string, returning a pointer to 9428 its end 9429 9430 Synopsis 9431 9432 #include 9433 9434 char * stpncpy(char * restrict dest, const char * restrict 9435 src, size_t n); 9436 9437 Description 9438 9439 The stpncpy() function shall copy at most n characters from 9440 the string pointed to by src, including the terminating \0 9441 character, to the array pointed to by dest. Exactly n 9442 characters are written at dest. If the length strlen()(src) is 9443 smaller than n, the remaining characters in dest are filled 9444 with \0 characters. If the length strlen()(src) is greater 9445 than or equal to n, dest will not be \0 terminated. 9446 9447 The strings may not overlap. 9448 9449 The programmer shall ensure that there is room for at least n 9450 characters at dest. 9451 9452 Return Value 9453 9454 The stpncpy() function shall return a pointer to the 9455 terminating NULL in dest, or, if dest is not NULL-terminated, 9456 dest + n. 9457 9458 strcasestr 9459 9460 Name 9461 9462 strcasestr -- locate a substring ignoring case 9463 9464 Synopsis 9465 9466 #include 9467 9468 char * strcasestr(const char * s1, const char * s2); 9469 9470 Description 9471 9472 The strcasestr() shall behave as strstr(), except that it 9473 shall ignore the case of both strings. The strcasestr() 9474 function shall be locale aware; that is strcasestr() shall 9475 behave as if both strings had been converted to lower case in 9476 the current locale before the comparison is performed. 9477 9478 Return Value 9479 9480 Upon successful completion, strcasestr() shall return a 9481 pointer to the located string or a null pointer if the string 9482 is not found. If s2 points to a string with zero length, the 9483 function shall return s1. 9484 9485 strerror_r 9486 9487 Name 9488 9489 strerror_r -- reentrant version of strerror 9490 9491 Synopsis 9492 9493 #include 9494 9495 char * strerror_r(int errnum, char * buf, size_t buflen); 9496 9497 Description 9498 9499 The strerror_r() shall behave as specified in ISO POSIX 9500 (2003), except as described below. 9501 9502 Returns String, not Error Value 9503 9504 The strerror_r() function shall return a pointer to the string 9505 corresponding to errno. The returned pointer may point within 9506 the buffer buf (at most buflen bytes). 9507 9508 Return Value 9509 9510 On success, strerror_r() shall return a pointer to the 9511 generated message string (determined by the setting of the 9512 LC_MESSAGES category in the current locale). Otherwise, 9513 strerror_r() shall return the string corresponding to "Unknown 9514 error". 9515 9516 strndup 9517 9518 Name 9519 9520 strndup -- return a malloc'd copy of at most the specified 9521 number of bytes of a string 9522 9523 Synopsis 9524 9525 #include 9526 9527 char * strndup(const char * string, size_t n); 9528 9529 Description 9530 9531 The strndup() function shall return a malloc()'d copy of at 9532 most n bytes of string. The resultant string shall be 9533 terminated even if no NULL terminator appears before string+n. 9534 9535 Return Value 9536 9537 On success, strndup() shall return a pointer to a newly 9538 allocated block of memory containing a copy of at most n bytes 9539 of string. Otherwise, strndup() shall return NULL and set 9540 errno to indicate the error. 9541 9542 Errors 9543 9544 ENOMEM 9545 Insufficient memory available. 9546 9547 strnlen 9548 9549 Name 9550 9551 strnlen -- determine the length of a fixed-size string 9552 9553 Synopsis 9554 9555 #include 9556 9557 size_t strnlen(const char * s, size_t maxlen); 9558 9559 Description 9560 9561 strnlen() returns the number of characters in the string s, 9562 not including the terminating \0 character, but at most 9563 maxlen. In doing this, strnlen() looks only at the first 9564 maxlen characters at s and never beyond s + maxlen. 9565 9566 Return Value 9567 9568 strnlen() returns strlen(s), if that is less than maxlen, or 9569 maxlen if there is no \0 character among the first maxlen 9570 characters pointed to by s. 9571 9572 strptime 9573 9574 Name 9575 9576 strptime -- parse a time string 9577 9578 Description 9579 9580 The strptime() shall behave as specified in the ISO POSIX 9581 (2003) with differences as listed below. 9582 9583 Number of leading zeroes may be limited 9584 9585 The ISO POSIX (2003) specifies fields for which "leading zeros 9586 are permitted but not required"; however, applications shall 9587 not expect to be able to supply more leading zeroes for these 9588 fields than would be implied by the range of the field. 9589 Implementations may choose to either match an input with 9590 excess leading zeroes, or treat this as a non-matching input. 9591 For example, %j has a range of 001 to 366, so 0, 00, 000, 001, 9592 and 045 are acceptable inputs, but inputs such as 0000, 0366 9593 and the like are not. 9594 9595 Rationale 9596 9597 glibc developers consider it appropriate behavior to forbid 9598 excess leading zeroes. When trying to parse a given input 9599 against several format strings, forbidding excess leading 9600 zeroes could be helpful. For example, if one matches 9601 0011-12-26 against %m-%d-%Y and then against %Y-%m-%d, it 9602 seems useful for the first match to fail, as it would be 9603 perverse to parse that date as November 12, year 26. The 9604 second pattern parses it as December 26, year 11. 9605 9606 The ISO POSIX (2003) is not explicit that an unlimited number 9607 of leading zeroes are required, although it may imply this. 9608 The LSB explicitly allows implementations to have either 9609 behavior. Future versions of this standard may require 9610 implementations to forbid excess leading zeroes. 9611 9612 An Interpretation Request is currently pending against ISO 9613 POSIX (2003) for this matter. 9614 9615 strsep 9616 9617 Name 9618 9619 strsep -- extract token from string 9620 9621 Synopsis 9622 9623 #include 9624 9625 char * strsep(char * * stringp, const char * delim); 9626 9627 Description 9628 9629 The strsep() function shall find the first token in the string 9630 referenced by the pointer stringp, using the characters in 9631 delim as delimiters. 9632 9633 If stringp is NULL, strsep() shall return NULL and do nothing 9634 else. 9635 9636 If stringp is non-NULL, strsep() shall find the first token in 9637 the string referenced by stringp, where tokens are delimited 9638 by characters in the string delim. This token shall be 9639 terminated with a \0 character by overwriting the delimiter, 9640 and stringp shall be updated to point past the token. In case 9641 no delimiter was found, the token is taken to be the entire 9642 string referenced by stringp, and the location referenced by 9643 stringp is made NULL. 9644 9645 Return Value 9646 9647 strsep() shall return a pointer to the beginning of the token. 9648 9649 Notes 9650 9651 The strsep() function was introduced as a replacement for 9652 strtok(), since the latter cannot handle empty fields. 9653 However, strtok() conforms to ISO C (1999) and to ISO POSIX 9654 (2003) and hence is more portable. 9655 9656 See Also 9657 9658 strtok(), strtok_r(). 9659 9660 strsignal 9661 9662 Name 9663 9664 strsignal -- return string describing signal 9665 9666 Synopsis 9667 9668 #define _GNU_SOURCE 9669 #include 9670 9671 char * strsignal(int sig); 9672 9673 extern const char * const sys_siglist[]; 9674 9675 Description 9676 9677 The strsignal() function shall return a pointer to a string 9678 describing the signal number sig. The string can only be used 9679 until the next call to strsignal(). 9680 9681 The array sys_siglist holds the signal description strings 9682 indexed by signal number. This array should not be accessed 9683 directly by applications. 9684 9685 Return Value 9686 9687 If sig is a valid signal number, strsignal() shall return a 9688 pointer to the appropriate description string. Otherwise, 9689 strsignal() shall return either a pointer to the string 9690 "unknown signal", or a null pointer. 9691 9692 Although the function is not declared as returning a pointer 9693 to a constant character string, applications shall not modify 9694 the returned string. 9695 9696 strtoq 9697 9698 Name 9699 9700 strtoq -- convert string value to a long or quad_t integer 9701 9702 Synopsis 9703 9704 #include 9705 #include 9706 #include 9707 9708 long long strtoq(const char * nptr, char * * endptr, int 9709 base); 9710 9711 Description 9712 9713 strtoq() converts the string nptr to a quadt value. The 9714 conversion is done according to the given base, which shall be 9715 between 2 and 36 inclusive, or be the special value 0. 9716 9717 nptr may begin with an arbitrary amount of white space (as 9718 determined by isspace()(3)), followed by a single optional + 9719 or - sign character. If base is 0 or 16, the string may then 9720 include a 0x prefix, and the number will be read in base 16; 9721 otherwise, a 0 base is taken as 10 (decimal), unless the next 9722 character is 0, in which case it is taken as 8 (octal). 9723 9724 The remainder of the string is converted to a long value in 9725 the obvious manner, stopping at the first character which is 9726 not a valid digit in the given base. (In bases above 10, the 9727 letter A in either upper or lower case represents 10, B 9728 represents 11, and so forth, with Z representing 35.) 9729 9730 Return Value 9731 9732 strtoq() returns the result of the conversion, unless the 9733 value would underflow or overflow. If an underflow occurs, 9734 strtoq() returns QUAD_MIN. If an overflow occurs, strtoq() 9735 returns QUAD_MAX. In both cases, the global variable errno is 9736 set to ERANGE. 9737 9738 Errors 9739 9740 ERANGE 9741 The given string was out of range; the value converted 9742 has been clamped. 9743 9744 strtouq 9745 9746 Name 9747 9748 strtouq -- convert a string to an unsigned long long 9749 9750 Synopsis 9751 9752 #include 9753 #include 9754 #include 9755 9756 unsigned long long strtouq(const char * nptr, char * * endptr, 9757 int base); 9758 9759 Description 9760 9761 strtouq() converts the string nptr to an unsigned long long 9762 value. The conversion is done according to the given base, 9763 which shall be between 2 and 36 inclusive, or be the special 9764 value 0. 9765 9766 nptr may begin with an arbitrary amount of white space (as 9767 determined by isspace()(3)), followed by a single optional + 9768 or - sign character. If base is 0 or 16, the string may then 9769 include a 0x prefix, and the number will be read in base 16; 9770 otherwise, a 0 base is taken as 10 (decimal), unless the next 9771 character is 0, in which case it is taken as 8 (octal). 9772 9773 The remainder of the string is converted to an unsigned long 9774 value in the obvious manner, stopping at the end of the string 9775 or at the first character that does not produce a valid digit 9776 in the given base. (In bases above 10, the letter A in either 9777 upper or lower case represents 10, B represents 11, and so 9778 forth, with Z representing 35.) 9779 9780 Return Value 9781 9782 On success, strtouq() returns either the result of the 9783 conversion or, if there was a leading minus sign, the negation 9784 of the result of the conversion, unless the original 9785 (non-negated) value would overflow. In the case of an overflow 9786 the function returns UQUAD_MAX and the global variable errno 9787 is set to ERANGE. 9788 9789 Errors 9790 9791 ERANGE 9792 The given string was out of range; the value converted 9793 has been clamped. 9794 9795 svc_register 9796 9797 Name 9798 9799 svc_register -- Register Remote Procedure Call Interface 9800 9801 Synopsis 9802 9803 #include 9804 9805 bool_t svc_register(SVCXPRT * xprt, rpcprog_t prognum, 9806 rpcvers_t versnum, __dispatch_fn_t dispatch, rpcprot_t 9807 protocol); 9808 9809 Description 9810 9811 The svc_register() function shall associate the program 9812 identified by prognum at version versnum with the service 9813 dispatch procedure, dispatch. If protocol is zero, the service 9814 is not registered with the portmap service. If protocol is 9815 non-zero, then a mapping of the triple [prognum, versnum, 9816 protocol] to xprt->xp_port is established with the local 9817 portmap service. The procedure dispatch has the following 9818 form: 9819 9820 int dispatch(struct svc_req * request, SVCXPRT * xprt); 9821 9822 Return Value 9823 9824 svc_register() returns 1 if it succeeds, and zero otherwise. 9825 9826 svc_run 9827 9828 Name 9829 9830 svc_run -- Waits for RPC requests to arrive and calls service 9831 procedure. 9832 9833 Synopsis 9834 9835 #include 9836 9837 void svc_run(void); 9838 9839 Description 9840 9841 The svc_run() function shall wait for RPC requests to arrive, 9842 read and unpack each request, and dispatch it to the 9843 appropriate registered handler. Under normal conditions, 9844 svc_run() shall not return; it shall only return if serious 9845 errors occur that prevent further processing. 9846 9847 svc_sendreply 9848 9849 Name 9850 9851 svc_sendreply -- called by RPC service's dispatch routine 9852 9853 Synopsis 9854 9855 bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, caddr_t 9856 out); 9857 9858 Description 9859 9860 Called by an RPC service's dispatch routine to send the 9861 results of a remote procedure call. The parameter xprt is the 9862 request's associated transport handle; outproc is the XDR 9863 routine which is used to encode the results; and out is the 9864 address of the results. This routine returns one if it 9865 succeeds, zero other-wise. 9866 9867 svctcp_create 9868 9869 Name 9870 9871 svctcp_create -- Creates a TCP/IP-based RPC service transport. 9872 9873 Synopsis 9874 9875 #include 9876 9877 SVCXPRT * svctcp_create(int sock, u_int send_buf_size, u_int 9878 recv_buf_size); 9879 9880 Description 9881 9882 svctcp_create() cretes a TCP/IP-based RPC service transport, 9883 to which it returns a pointer. The transport is associated 9884 with the socket sock, which may be RPC_ANYSOCK, in which case 9885 a new socket is created. If the socket is not bound to a local 9886 TCP port, then this routine binds it to an arbitrary port. 9887 Upon completion, xprt->xp_sock is the transport's socket 9888 descriptor, and xprt->xp_port is the transport's port number. 9889 Since TCP-based RPC uses buffered I/O, users may specify the 9890 size of buffers; values of zero choose suitable defaults. 9891 9892 Return Value 9893 9894 svctcp_create() returns NULL if it fails, or a pointer to the 9895 RPC service transport otherwise. 9896 9897 svcudp_create 9898 9899 Name 9900 9901 svcudp_create -- Creates a UDP-based RPC service transport. 9902 9903 Synopsis 9904 9905 SVCXPRT * 9906 9907 svcudp_create(int sock); 9908 9909 Description 9910 9911 This call is equivalent to svcudp_bufcreate( sock, SZ, SZ) for 9912 some default size SZ. 9913 9914 swscanf 9915 9916 Name 9917 9918 swscanf -- convert formatted input 9919 9920 Description 9921 9922 The scanf() family of functions shall behave as described in 9923 ISO POSIX (2003), except as noted below. 9924 9925 Differences 9926 9927 The %s, %S and %[ conversion specifiers shall accept an option 9928 length modifier a, which shall cause a memory buffer to be 9929 allocated to hold the string converted. In such a case, the 9930 argument corresponding to the conversion specifier should be a 9931 reference to a pointer value that will receive a pointer to 9932 the allocated buffer. If there is insufficient memory to 9933 allocate a buffer, the function may set errno to ENOMEM and a 9934 conversion error results. 9935 9936 Note: This directly conflicts with the ISO C (1999) usage 9937 of %a as a conversion specifier for hexadecimal float 9938 values. While this conversion specifier should be 9939 supported, a format specifier such as "%aseconds" will have 9940 a different meaning on an LSB conforming system. 9941 9942 system 9943 9944 Name 9945 9946 system -- execute a shell command 9947 9948 Synopsis 9949 9950 #include 9951 9952 int system(const char * string); 9953 9954 Description 9955 9956 The system() function shall behave as described in ISO POSIX 9957 (2003). 9958 9959 Notes 9960 9961 The fact that system() ignores interrupts is often not what a 9962 program wants. ISO POSIX (2003) describes some of the 9963 consequences; an additional consequence is that a program 9964 calling system() from a loop cannot be reliably interrupted. 9965 Many programs will want to use the exec() family of functions 9966 instead. 9967 9968 Do not use system() from a program with suid or sgid 9969 privileges, because unexpected values for some environment 9970 variables might be used to subvert system integrity. Use the 9971 exec() family of functions instead, but not execlp() or 9972 execvp(). system() will not, in fact, work properly from 9973 programs with suid or sgid privileges on systems on which 9974 /bin/sh is bash version 2, since bash 2 drops privileges on 9975 startup. (Debian uses a modified bash which does not do this 9976 when invoked as sh.) 9977 9978 The check for the availability of /bin/sh is not actually 9979 performed; it is always assumed to be available. ISO C (1999) 9980 specifies the check, but ISO POSIX (2003) specifies that the 9981 return shall always be nonzero, since a system without the 9982 shell is not conforming, and it is this that is implemented. 9983 9984 It is possible for the shell command to return 127, so that 9985 code is not a sure indication that the execve() call failed; 9986 check the global variable errno to make sure. 9987 9988 textdomain 9989 9990 Name 9991 9992 textdomain -- set the current default message domain 9993 9994 Synopsis 9995 9996 #include 9997 9998 char * textdomain(const char * domainname); 9999 10000 Description 10001 10002 The textdomain() function shall set the current default 10003 message domain to domainname. Subsequent calls to gettext() 10004 and ngettext() use the default message domain. 10005 10006 If domainname is NULL, the default message domain shall not be 10007 altered. 10008 10009 If domainname is "", textdomain() shall reset the default 10010 domain to the system default of "messages". 10011 10012 Return 10013 10014 On success, textdomain() shall return the currently selected 10015 domain. Otherwise, a null pointer shall be returned, and errno 10016 set to indicate the error. 10017 10018 Errors 10019 10020 ENOMEM 10021 Insufficent memory available. 10022 10023 unlink 10024 10025 Name 10026 10027 unlink -- remove a directory entry 10028 10029 Synopsis 10030 10031 int unlink(const char * path); 10032 10033 Description 10034 10035 unlink() is as specified in ISO POSIX (2003), but with 10036 differences as listed below. 10037 10038 See also Additional behaviors: unlink/link on directory. 10039 10040 May return EISDIR on directories 10041 10042 If path specifies a directory, the implementation may return 10043 EISDIR instead of EPERM as specified by ISO POSIX (2003). 10044 10045 Rationale: The Linux kernel has deliberately chosen EISDIR 10046 for this case and does not expect to change (Al Viro, 10047 personal communication). 10048 10049 uselocale 10050 10051 Name 10052 10053 uselocale -- Set locale for thread 10054 10055 Synopsis 10056 10057 #include 10058 10059 locale_t uselocale(locale_t newloc); 10060 10061 Description 10062 10063 The uselocale() function shall set the locale for the calling 10064 thread to the locale specified by newloc. 10065 10066 If newloc is the value LC_GLOBAL_LOCALE, the thread's locale 10067 shall be set to the process current global locale, as set by 10068 setlocale(). If newloc is NULL, the thread's locale is not 10069 altered. 10070 10071 Return Value 10072 10073 The uselocale() function shall return the previous locale, or 10074 LC_GLOBAL_LOCALE if the thread local locale has not been 10075 previously set. 10076 10077 Errors 10078 10079 None defined. 10080 10081 See Also 10082 10083 setlocale(), freelocale(), duplocale(), newlocale() 10084 10085 utmpname 10086 10087 Name 10088 10089 utmpname -- set user accounting database 10090 10091 Synopsis 10092 10093 #include 10094 10095 int utmpname(const char * dbname); 10096 10097 Description 10098 10099 The utmpname() function shall cause the user accounting 10100 database used by the getutent(), getutent_r(), getutxent(), 10101 getutxid(), getutxline(), and pututxline() functions to be 10102 that named by dbname, instead of the system default database. 10103 See Section 4.2 for further information. 10104 10105 Note: The LSB does not specify the format of the user 10106 accounting database, nor the names of the file or files 10107 that may contain it. 10108 10109 Return Value 10110 10111 None. 10112 10113 Errors 10114 10115 None defined. 10116 10117 vasprintf 10118 10119 Name 10120 10121 vasprintf -- write formatted output to a dynamically allocated 10122 string 10123 10124 Synopsis 10125 10126 #include 10127 #include 10128 10129 int vasprintf(char * * restrict ptr, const char * restrict 10130 format, va_list arg); 10131 10132 Description 10133 10134 The vasprintf() function shall write formatted output to a 10135 dynamically allocated string, and store the address of that 10136 string in the location referenced by ptr. It shall behave as 10137 asprintf(), except that instead of being called with a 10138 variable number of arguments, it is called with an argument 10139 list as defined by . 10140 10141 Return Value 10142 10143 Refer to fprintf(). 10144 10145 Errors 10146 10147 Refer to fprintf(). 10148 10149 vdprintf 10150 10151 Name 10152 10153 vdprintf -- write formatted output to a file descriptor 10154 10155 Synopsis 10156 10157 #include 10158 10159 int vdprintf(int fd, const char * restrict format, va_list 10160 arg); 10161 10162 Description 10163 10164 The vdprintf() shall behave as vfprintf(), except that the 10165 first argument is a file descriptor rather than a STDIO 10166 stream. 10167 10168 Return Value 10169 10170 Refer to fprintf(). 10171 10172 Errors 10173 10174 Refer to fprintf(). 10175 10176 verrx 10177 10178 Name 10179 10180 verrx -- display formatted error message and exit 10181 10182 Synopsis 10183 10184 #include 10185 #include 10186 10187 void verrx(int eval, const char * fmt, va_list args); 10188 10189 Description 10190 10191 The verrx() shall behave as errx() except that instead of 10192 being called with a variable number of arguments, it is called 10193 with an argument list as defined by . 10194 10195 verrx() does not return, but exits with the value of eval. 10196 10197 Return Value 10198 10199 None. 10200 10201 Errors 10202 10203 None. 10204 10205 vfscanf 10206 10207 Name 10208 10209 vfscanf -- convert formatted input 10210 10211 Description 10212 10213 The scanf() family of functions shall behave as described in 10214 ISO POSIX (2003), except as noted below. 10215 10216 Differences 10217 10218 The %s, %S and %[ conversion specifiers shall accept an option 10219 length modifier a, which shall cause a memory buffer to be 10220 allocated to hold the string converted. In such a case, the 10221 argument corresponding to the conversion specifier should be a 10222 reference to a pointer value that will receive a pointer to 10223 the allocated buffer. If there is insufficient memory to 10224 allocate a buffer, the function may set errno to ENOMEM and a 10225 conversion error results. 10226 10227 Note: This directly conflicts with the ISO C (1999) usage 10228 of %a as a conversion specifier for hexadecimal float 10229 values. While this conversion specifier should be 10230 supported, a format specifier such as "%aseconds" will have 10231 a different meaning on an LSB conforming system. 10232 10233 vfwscanf 10234 10235 Name 10236 10237 vfwscanf -- convert formatted input 10238 10239 Description 10240 10241 The scanf() family of functions shall behave as described in 10242 ISO POSIX (2003), except as noted below. 10243 10244 Differences 10245 10246 The %s, %S and %[ conversion specifiers shall accept an option 10247 length modifier a, which shall cause a memory buffer to be 10248 allocated to hold the string converted. In such a case, the 10249 argument corresponding to the conversion specifier should be a 10250 reference to a pointer value that will receive a pointer to 10251 the allocated buffer. If there is insufficient memory to 10252 allocate a buffer, the function may set errno to ENOMEM and a 10253 conversion error results. 10254 10255 Note: This directly conflicts with the ISO C (1999) usage 10256 of %a as a conversion specifier for hexadecimal float 10257 values. While this conversion specifier should be 10258 supported, a format specifier such as "%aseconds" will have 10259 a different meaning on an LSB conforming system. 10260 10261 vscanf 10262 10263 Name 10264 10265 vscanf -- convert formatted input 10266 10267 Description 10268 10269 The scanf() family of functions shall behave as described in 10270 ISO POSIX (2003), except as noted below. 10271 10272 Differences 10273 10274 The %s, %S and %[ conversion specifiers shall accept an option 10275 length modifier a, which shall cause a memory buffer to be 10276 allocated to hold the string converted. In such a case, the 10277 argument corresponding to the conversion specifier should be a 10278 reference to a pointer value that will receive a pointer to 10279 the allocated buffer. If there is insufficient memory to 10280 allocate a buffer, the function may set errno to ENOMEM and a 10281 conversion error results. 10282 10283 Note: This directly conflicts with the ISO C (1999) usage 10284 of %a as a conversion specifier for hexadecimal float 10285 values. While this conversion specifier should be 10286 supported, a format specifier such as "%aseconds" will have 10287 a different meaning on an LSB conforming system. 10288 10289 vsscanf 10290 10291 Name 10292 10293 vsscanf -- convert formatted input 10294 10295 Description 10296 10297 The scanf() family of functions shall behave as described in 10298 ISO POSIX (2003), except as noted below. 10299 10300 Differences 10301 10302 The %s, %S and %[ conversion specifiers shall accept an option 10303 length modifier a, which shall cause a memory buffer to be 10304 allocated to hold the string converted. In such a case, the 10305 argument corresponding to the conversion specifier should be a 10306 reference to a pointer value that will receive a pointer to 10307 the allocated buffer. If there is insufficient memory to 10308 allocate a buffer, the function may set errno to ENOMEM and a 10309 conversion error results. 10310 10311 Note: This directly conflicts with the ISO C (1999) usage 10312 of %a as a conversion specifier for hexadecimal float 10313 values. While this conversion specifier should be 10314 supported, a format specifier such as "%aseconds" will have 10315 a different meaning on an LSB conforming system. 10316 10317 vswscanf 10318 10319 Name 10320 10321 vswscanf -- convert formatted input 10322 10323 Description 10324 10325 The scanf() family of functions shall behave as described in 10326 ISO POSIX (2003), except as noted below. 10327 10328 Differences 10329 10330 The %s, %S and %[ conversion specifiers shall accept an option 10331 length modifier a, which shall cause a memory buffer to be 10332 allocated to hold the string converted. In such a case, the 10333 argument corresponding to the conversion specifier should be a 10334 reference to a pointer value that will receive a pointer to 10335 the allocated buffer. If there is insufficient memory to 10336 allocate a buffer, the function may set errno to ENOMEM and a 10337 conversion error results. 10338 10339 Note: This directly conflicts with the ISO C (1999) usage 10340 of %a as a conversion specifier for hexadecimal float 10341 values. While this conversion specifier should be 10342 supported, a format specifier such as "%aseconds" will have 10343 a different meaning on an LSB conforming system. 10344 10345 vsyslog 10346 10347 Name 10348 10349 vsyslog -- log to system log 10350 10351 Synopsis 10352 10353 #include 10354 #include 10355 10356 void vsyslog(int priority, char * message, va_list arglist); 10357 10358 Description 10359 10360 The vsyslog() function is identical to syslog() as specified 10361 in ISO POSIX (2003), except that arglist (as defined by 10362 stdarg.h) replaces the variable number of arguments. 10363 10364 vwscanf 10365 10366 Name 10367 10368 vwscanf -- convert formatted input 10369 10370 Description 10371 10372 The scanf() family of functions shall behave as described in 10373 ISO POSIX (2003), except as noted below. 10374 10375 Differences 10376 10377 The %s, %S and %[ conversion specifiers shall accept an option 10378 length modifier a, which shall cause a memory buffer to be 10379 allocated to hold the string converted. In such a case, the 10380 argument corresponding to the conversion specifier should be a 10381 reference to a pointer value that will receive a pointer to 10382 the allocated buffer. If there is insufficient memory to 10383 allocate a buffer, the function may set errno to ENOMEM and a 10384 conversion error results. 10385 10386 Note: This directly conflicts with the ISO C (1999) usage 10387 of %a as a conversion specifier for hexadecimal float 10388 values. While this conversion specifier should be 10389 supported, a format specifier such as "%aseconds" will have 10390 a different meaning on an LSB conforming system. 10391 10392 wait4 10393 10394 Name 10395 10396 wait4 -- wait for process termination, BSD style 10397 10398 Synopsis 10399 10400 #include 10401 #include 10402 #include 10403 10404 pid_t wait4(pid_t pid, int * status, int options, struct 10405 rusage * rusage); 10406 10407 Description 10408 10409 wait4() suspends execution of the current process until a 10410 child (as specified by pid) has exited, or until a signal is 10411 delivered whose action is to terminate the current process or 10412 to call a signal handling function. If a child (as requested 10413 by pid) has already exited by the time of the call (a 10414 so-called "zombie" process), the function returns immediately. 10415 Any system resources used by the child are freed. 10416 10417 The value of pid can be one of: 10418 10419 < -1 10420 wait for any child process whose process group ID is 10421 equal to the absolute value of pid. 10422 10423 -1 10424 wait for any child process; this is equivalent to 10425 calling wait3(). 10426 10427 0 10428 wait for any child process whose process group ID is 10429 equal to that of the calling process. 10430 10431 > 0 10432 wait for the child whose process ID is equal to the 10433 value of pid. 10434 10435 The value of options is a bitwise or of zero or more of the 10436 following constants: 10437 10438 WNOHANG 10439 return immediately if no child is there to be waited 10440 for. 10441 10442 WUNTRACED 10443 return for children that are stopped, and whose status 10444 has not been reported. 10445 10446 If status is not NULL, wait4() stores status information in 10447 the location status. This status can be evaluated with the 10448 following macros: 10449 10450 Note: These macros take the status value (an int) as an 10451 argument -- not a pointer to the value! 10452 10453 WIFEXITED(status) 10454 is nonzero if the child exited normally. 10455 10456 WEXITSTATUS(status) 10457 evaluates to the least significant eight bits of the 10458 return code of the child that terminated, which may 10459 have been set as the argument to a call to exit() or as 10460 the argument for a return statement in the main 10461 program. This macro can only be evaluated if 10462 WIFEXITED() returned nonzero. 10463 10464 WIFSIGNALED(status) 10465 returns true if the child process exited because of a 10466 signal that was not caught. 10467 10468 WTERMSIG(status) 10469 returns the number of the signal that caused the child 10470 process to terminate. This macro can only be evaluated 10471 if WIFSIGNALED() returned nonzero. 10472 10473 WIFSTOPPED(status) 10474 returns true if the child process that caused the 10475 return is currently stopped; this is only possible if 10476 the call was done using WUNTRACED(). 10477 10478 WSTOPSIG(status) 10479 returns the number of the signal that caused the child 10480 to stop. This macro can only be evaluated if 10481 WIFSTOPPED() returned nonzero. 10482 10483 If rusage is not NULL, the struct rusage (as defined in 10484 sys/resource.h) that it points to will be filled with 10485 accounting information. (See getrusage()(2) for details. 10486 10487 Return Value 10488 10489 On success, the process ID of the child that exited is 10490 returned. On error, -1 is returned (in particular, when no 10491 unwaited-for child processes of the specified kind exist), or 10492 0 if WNOHANG() was used and no child was available yet. In the 10493 latter two cases, the global variable errno is set 10494 appropriately. 10495 10496 Errors 10497 10498 ECHILD 10499 No unwaited-for child process as specified does exist. 10500 10501 ERESTARTSYS 10502 A WNOHANG() was not set and an unblocked signal or a 10503 SIGCHILD was caught. This error is returned by the 10504 system call. The library interface is not allowed to 10505 return ERESTARTSYS, but will return EINTR. 10506 10507 waitpid 10508 10509 Name 10510 10511 waitpid -- wait for child process 10512 10513 Description 10514 10515 waitpid() is as specified in ISO POSIX (2003), but with 10516 differences as listed below. 10517 10518 Need not support WCONTINUED or WIFCONTINUED 10519 10520 Implementations need not support the XSI optional 10521 functionality of WCONTINUED() or WIFCONTINUED(). 10522 10523 warn 10524 10525 Name 10526 10527 warn -- formatted error messages 10528 10529 Synopsis 10530 10531 #include 10532 10533 void warn(const char * fmt, ...); 10534 10535 Description 10536 10537 The warn() function shall display a formatted error message on 10538 the standard error stream. The output shall consist of the 10539 last component of the program name, a colon character, and a 10540 space character. If fmt is non-NULL, it shall be used as a 10541 format string for the printf() family of functions, and the 10542 formatted message, a colon character, and a space are written 10543 to stderr. Finally, the error message string affiliated with 10544 the current value of the global variable errno shall be 10545 written to stderr, followed by a newline character. 10546 10547 Return Value 10548 10549 None. 10550 10551 Errors 10552 10553 None. 10554 10555 warnx 10556 10557 Name 10558 10559 warnx -- formatted error messages 10560 10561 Synopsis 10562 10563 #include 10564 10565 void warnx(const char * fmt, ...); 10566 10567 Description 10568 10569 The warnx() function shall display a formatted error message 10570 on the standard error stream. The last component of the 10571 program name, a colon character, and a space shall be output. 10572 If fmt is non-NULL, it shall be used as the format string for 10573 the printf() family of functions, and the formatted error 10574 message, a colon character, and a space shall be output. The 10575 output shall be followed by a newline character. 10576 10577 Return Value 10578 10579 None. 10580 10581 Errors 10582 10583 None. 10584 10585 wcpcpy 10586 10587 Name 10588 10589 wcpcpy -- copy a wide character string, returning a pointer to 10590 its end 10591 10592 Synopsis 10593 10594 #include 10595 10596 wchar_t * wcpcpy(wchar_t * dest, const wchar_t * src); 10597 10598 Description 10599 10600 wcpcpy() is the wide-character equivalent of stpcpy(). It 10601 copies the wide character string src, including the 10602 terminating L'\0' character, to the array dest. 10603 10604 The strings may not overlap. 10605 10606 The programmer shall ensure that there is room for at least 10607 wcslen()(src)+1 wide characters at dest. 10608 10609 Return Value 10610 10611 wcpcpy() returns a pointer to the end of the wide-character 10612 string dest, that is, a pointer to the terminating L'\0' 10613 character. 10614 10615 wcpncpy 10616 10617 Name 10618 10619 wcpncpy -- copy a fixed-size string of wide characters, 10620 returning a pointer to its end 10621 10622 Synopsis 10623 10624 #include 10625 10626 wchar_t * wcpncpy(wchar_t * dest, const wchar_t * src, size_t 10627 n); 10628 10629 Description 10630 10631 wcpncpy() is the wide-character equivalent of stpncpy(). It 10632 copies at most n wide characters from the wide-character 10633 string src, including the terminating L'\0' character, to the 10634 array dest. Exactly n wide characters are written at dest. If 10635 the length wcslen()(src) is smaller than n, the remaining wide 10636 characters in the array dest are filled with L'\0' characters. 10637 If the length wcslen()(src) is greater than or equal to n, the 10638 string dest will not be L'\0' terminated. 10639 10640 The strings may not overlap. 10641 10642 The programmer shall ensure that there is room for at least n 10643 wide characters at dest. 10644 10645 Return Value 10646 10647 wcpncpy() returns a pointer to the wide character one past the 10648 last non-null wide character written. 10649 10650 wcscasecmp 10651 10652 Name 10653 10654 wcscasecmp -- compare two wide-character strings, ignoring 10655 case 10656 10657 Synopsis 10658 10659 #include 10660 10661 int wcscasecmp(const wchar_t * s1, const wchar_t * s2); 10662 10663 Description 10664 10665 wcscasecmp() is the wide-character equivalent of strcasecmp(). 10666 It compares the wide-character string s1 and the 10667 wide-character string s2, ignoring case differences (towupper, 10668 towlower). 10669 10670 Return Value 10671 10672 wcscasecmp() returns 0 if the wide-character strings s1 and s2 10673 are equal except for case distinctions. It returns a positive 10674 integer if s1 is greater than s2, ignoring case. It returns a 10675 negative integer if s1 is smaller than s2, ignoring case. 10676 10677 Notes 10678 10679 The behavior of wcscasecmp() depends upon the LC_CTYPE 10680 category of the current locale. 10681 10682 wcsdup 10683 10684 Name 10685 10686 wcsdup -- duplicate a wide-character string 10687 10688 Synopsis 10689 10690 #include 10691 10692 wchar_t * wcsdup(const wchar_t * s); 10693 10694 Description 10695 10696 wcsdup() is the wide-character equivalent of strdup(). It 10697 allocates and returns a new wide-character string whose 10698 initial contents is a duplicate of the wide-character string 10699 s. 10700 10701 Memory for the new wide-character string is obtained with 10702 malloc(), and can be freed with free(). 10703 10704 Return Value 10705 10706 wcsdup() returns a pointer to the new wide-character string, 10707 or NULL if sufficient memory was not available. 10708 10709 wcsncasecmp 10710 10711 Name 10712 10713 wcsncasecmp -- compare two fixed-size wide-character strings, 10714 ignoring case 10715 10716 Synopsis 10717 10718 #include 10719 10720 int wcsncasecmp(const wchar_t * s1, const wchar_t * s2, size_t 10721 n); 10722 10723 Description 10724 10725 wcsncasecmp() is the wide-character equivalent of 10726 strncasecmp(). It compares the wide-character string s1 and 10727 the wide-character string s2, but at most n wide characters 10728 from each string, ignoring case differences (towupper, 10729 towlower). 10730 10731 Return Value 10732 10733 wcscasecmp() returns 0 if the wide-character strings s1 and 10734 s2, truncated to at most length n, are equal except for case 10735 distinctions. It returns a positive integer if truncated s1 is 10736 greater than truncated s2, ignoring case. It returns a 10737 negative integer if truncated s1 is smaller than truncated s2, 10738 ignoring case. 10739 10740 Notes 10741 10742 The behavior of wcsncasecmp() depends upon the LC_CTYPE 10743 category of the current locale. 10744 10745 wcsnlen 10746 10747 Name 10748 10749 wcsnlen -- determine the length of a fixed-size wide-character 10750 string 10751 10752 Synopsis 10753 10754 #include 10755 10756 size_t wcsnlen(const wchar_t * s, size_t maxlen); 10757 10758 Description 10759 10760 wcsnlen() is the wide-character equivalent of strnlen(). It 10761 returns the number of wide-characters in the string s, not 10762 including the terminating L'\0' character, but at most maxlen. 10763 In doing this, wcsnlen() looks only at the first maxlen 10764 wide-characters at s and never beyond s + maxlen. 10765 10766 Return Value 10767 10768 wcsnlen() returns wcslen()(s) if that is less than maxlen, or 10769 maxlen if there is no L'\0' character among the first maxlen 10770 wide characters pointed to by s. 10771 10772 Notes 10773 10774 The behavior of wcsncasecmp() depends on the LC_CTYPE category 10775 of the current locale. 10776 10777 wcsnrtombs 10778 10779 Name 10780 10781 wcsnrtombs -- convert a wide character string to a multi-byte 10782 string 10783 10784 Synopsis 10785 10786 #include 10787 10788 size_t wcsnrtombs(char * dest, const wchar_t * * src, size_t 10789 nwc, size_t len, mbstate_t * ps); 10790 10791 Description 10792 10793 wcsnrtombs() is like wcsrtombs(), except that the number of 10794 wide characters to be converted, starting at src, is limited 10795 to nwc. 10796 10797 If dest is not a NULL pointer, wcsnrtombs() converts at most 10798 nwc wide characters from the wide-character string src to a 10799 multibyte string starting at dest. At most len bytes are 10800 written to dest. The state ps is updated. 10801 10802 The conversion is effectively performed by repeatedly calling: 10803 wcrtomb(dest, *src, ps) 10804 10805 as long as this call succeeds, and then incrementing dest by 10806 the number of bytes written and src by 1. 10807 10808 The conversion can stop for three reasons: 10809 10810 * A wide character has been encountered that cannot be 10811 represented as a multibyte sequence (according to the 10812 current locale). In this case src is left pointing to the 10813 invalid wide character, (size_t)(-1) is returned, and 10814 errno is set to EILSEQ. 10815 * nws wide characters have been converted without 10816 encountering a L'\0', or the length limit forces a stop. 10817 In this case, src is left pointing to the next wide 10818 character to be converted, and the number bytes written to 10819 dest is returned. 10820 * The wide-character string has been completely converted, 10821 including the terminating L'\0' (which has the side effect 10822 of bringing back ps to the initial state). In this case, 10823 src is set to NULL, and the number of bytes written to 10824 dest, excluding the terminating L'\0' byte, is returned. 10825 10826 If dest is NULL, len is ignored, and the conversion proceeds 10827 as above, except that the converted bytes are not written out 10828 to memory, and that no destination length limit exists. 10829 10830 In both of the above cases, if ps is a NULL pointer, a static 10831 anonymous state only known to wcsnrtombs() is used instead. 10832 10833 The programmer shall ensure that there is room for at least 10834 len bytes at dest. 10835 10836 Return Value 10837 10838 wcsnrtombs() returns the number of bytes that make up the 10839 converted part of multibyte sequence, not including the 10840 terminating L'\0' byte. If a wide character was encountered 10841 which could not be converted, (size_t)(-1) is returned, and 10842 the global variable errno set to EILSEQ. 10843 10844 Notes 10845 10846 The behavior of wcsnrtombs() depends on the LC_CTYPE category 10847 of the current locale. 10848 10849 Passing NULL as ps is not multi-thread safe. 10850 10851 wcstoq 10852 10853 Name 10854 10855 wcstoq -- convert wide string to long long int representation 10856 10857 Synopsis 10858 10859 #include 10860 10861 long long int wcstoq(const wchar_t * restrict nptr, wchar_t ** 10862 restrict endptr, int base); 10863 10864 Description 10865 10866 The wcstoq() function shall convert the initial portion of the 10867 wide string nptr to long long int representation. It is 10868 identical to wcstoll(). 10869 10870 Return Value 10871 10872 Refer to wcstoll(). 10873 10874 Errors 10875 10876 Refer to wcstoll(). 10877 10878 wcstouq 10879 10880 Name 10881 10882 wcstouq -- convert wide string to unsigned long long int 10883 representation 10884 10885 Synopsis 10886 10887 #include 10888 10889 unsigned long long wcstouq(const wchar_t * restrict nptr, 10890 wchar_t ** restrict endptr, int base); 10891 10892 Description 10893 10894 The wcstouq() function shall convert the initial portion of 10895 the wide string nptr to unsigned long long int representation. 10896 It is identical to wcstoull(). 10897 10898 Return Value 10899 10900 Refer to wcstoull(). 10901 10902 Errors 10903 10904 Refer to wcstoull(). 10905 10906 wscanf 10907 10908 Name 10909 10910 wscanf -- convert formatted input 10911 10912 Description 10913 10914 The scanf() family of functions shall behave as described in 10915 ISO POSIX (2003), except as noted below. 10916 10917 Differences 10918 10919 The %s, %S and %[ conversion specifiers shall accept an option 10920 length modifier a, which shall cause a memory buffer to be 10921 allocated to hold the string converted. In such a case, the 10922 argument corresponding to the conversion specifier should be a 10923 reference to a pointer value that will receive a pointer to 10924 the allocated buffer. If there is insufficient memory to 10925 allocate a buffer, the function may set errno to ENOMEM and a 10926 conversion error results. 10927 10928 Note: This directly conflicts with the ISO C (1999) usage 10929 of %a as a conversion specifier for hexadecimal float 10930 values. While this conversion specifier should be 10931 supported, a format specifier such as "%aseconds" will have 10932 a different meaning on an LSB conforming system. 10933 10934 xdr_u_int 10935 10936 Name 10937 10938 xdr_u_int -- library routines for external data representation 10939 10940 Synopsis 10941 10942 int xdr_u_int(XDR * xdrs, unsigned int * up); 10943 10944 Description 10945 10946 xdr_u_int() is a filter primitive that translates between C 10947 unsigned integers and their external representations. 10948 10949 Return Value 10950 10951 On success, 1 is returned. On error, 0 is returned. 10952 _________________________________________________________ 10953 10954 1.6. Interfaces for libm 10955 10956 Table 1-24 defines the library name and shared object name for 10957 the libm library 10958 10959 Table 1-24. libm Definition 10960 Library: libm 10961 SONAME: See archLSB. 10962 10963 The behavior of the interfaces in this library is specified by 10964 the following specifications: 10965 10966 ISO C (1999) 10967 this specification 10968 SUSv2 10969 ISO POSIX (2003) 10970 _________________________________________________________ 10971 10972 1.6.1. Math 10973 _________________________________________________________ 10974 10975 1.6.1.1. Interfaces for Math 10976 10977 An LSB conforming implementation shall provide the generic 10978 functions for Math specified in Table 1-25, with the full 10979 mandatory functionality as described in the referenced 10980 underlying specification. 10981 10982 Table 1-25. libm - Math Function Interfaces 10983 __finite [1] ccosl [2] exp [2] j1l [1] powf [2] 10984 __finitef [1] ceil [2] exp2 [2] jn [2] powl [2] 10985 __finitel [1] ceilf [2] exp2f [2] jnf [1] remainder [2] 10986 __fpclassify [3] ceill [2] expf [2] jnl [1] remainderf [2] 10987 __fpclassifyf [3] cexp [2] expl [2] ldexp [2] remainderl [2] 10988 __signbit [1] cexpf [2] expm1 [2] ldexpf [2] remquo [2] 10989 __signbitf [1] cexpl [2] expm1f [2] ldexpl [2] remquof [2] 10990 acos [2] cimag [2] expm1l [2] lgamma [2] remquol [2] 10991 acosf [2] cimagf [2] fabs [2] lgamma_r [1] rint [2] 10992 acosh [2] cimagl [2] fabsf [2] lgammaf [2] rintf [2] 10993 acoshf [2] clog [2] fabsl [2] lgammaf_r [1] rintl [2] 10994 acoshl [2] clog10 [1] fdim [2] lgammal [2] round [2] 10995 acosl [2] clog10f [1] fdimf [2] lgammal_r [1] roundf [2] 10996 asin [2] clog10l [1] fdiml [2] llrint [2] roundl [2] 10997 asinf [2] clogf [2] feclearexcept [2] llrintf [2] scalb [2] 10998 asinh [2] clogl [2] fegetenv [2] llrintl [2] scalbf [1] 10999 asinhf [2] conj [2] fegetexceptflag [2] llround [2] scalbl [1] 11000 asinhl [2] conjf [2] fegetround [2] llroundf [2] scalbln [2] 11001 asinl [2] conjl [2] feholdexcept [2] llroundl [2] scalblnf [2] 11002 atan [2] copysign [2] feraiseexcept [2] log [2] scalblnl [2] 11003 atan2 [2] copysignf [2] fesetenv [2] log10 [2] scalbn [2] 11004 atan2f [2] copysignl [2] fesetexceptflag [2] log10f [2] 11005 scalbnf [2] 11006 atan2l [2] cos [2] fesetround [2] log10l [2] scalbnl [2] 11007 atanf [2] cosf [2] fetestexcept [2] log1p [2] significand [1] 11008 atanh [2] cosh [2] feupdateenv [2] log1pf [2] significandf [1] 11009 atanhf [2] coshf [2] finite [4] log1pl [2] significandl [1] 11010 atanhl [2] coshl [2] finitef [1] log2 [2] sin [2] 11011 atanl [2] cosl [2] finitel [1] log2f [2] sincos [1] 11012 cabs [2] cpow [2] floor [2] log2l [2] sincosf [1] 11013 cabsf [2] cpowf [2] floorf [2] logb [2] sincosl [1] 11014 cabsl [2] cpowl [2] floorl [2] logbf [2] sinf [2] 11015 cacos [2] cproj [2] fma [2] logbl [2] sinh [2] 11016 cacosf [2] cprojf [2] fmaf [2] logf [2] sinhf [2] 11017 cacosh [2] cprojl [2] fmal [2] logl [2] sinhl [2] 11018 cacoshf [2] creal [2] fmax [2] lrint [2] sinl [2] 11019 cacoshl [2] crealf [2] fmaxf [2] lrintf [2] sqrt [2] 11020 cacosl [2] creall [2] fmaxl [2] lrintl [2] sqrtf [2] 11021 carg [2] csin [2] fmin [2] lround [2] sqrtl [2] 11022 cargf [2] csinf [2] fminf [2] lroundf [2] tan [2] 11023 cargl [2] csinh [2] fminl [2] lroundl [2] tanf [2] 11024 casin [2] csinhf [2] fmod [2] matherr [1] tanh [2] 11025 casinf [2] csinhl [2] fmodf [2] modf [2] tanhf [2] 11026 casinh [2] csinl [2] fmodl [2] modff [2] tanhl [2] 11027 casinhf [2] csqrt [2] frexp [2] modfl [2] tanl [2] 11028 casinhl [2] csqrtf [2] frexpf [2] nan [2] tgamma [2] 11029 casinl [2] csqrtl [2] frexpl [2] nanf [2] tgammaf [2] 11030 catan [2] ctan [2] gamma [4] nanl [2] tgammal [2] 11031 catanf [2] ctanf [2] gammaf [1] nearbyint [2] trunc [2] 11032 catanh [2] ctanh [2] gammal [1] nearbyintf [2] truncf [2] 11033 catanhf [2] ctanhf [2] hypot [2] nearbyintl [2] truncl [2] 11034 catanhl [2] ctanhl [2] hypotf [2] nextafter [2] y0 [2] 11035 catanl [2] ctanl [2] hypotl [2] nextafterf [2] y0f [1] 11036 cbrt [2] dremf [1] ilogb [2] nextafterl [2] y0l [1] 11037 cbrtf [2] dreml [1] ilogbf [2] nexttoward [2] y1 [2] 11038 cbrtl [2] erf [2] ilogbl [2] nexttowardf [2] y1f [1] 11039 ccos [2] erfc [2] j0 [2] nexttowardl [2] y1l [1] 11040 ccosf [2] erfcf [2] j0f [1] pow [2] yn [2] 11041 ccosh [2] erfcl [2] j0l [1] pow10 [1] ynf [1] 11042 ccoshf [2] erff [2] j1 [2] pow10f [1] ynl [1] 11043 ccoshl [2] erfl [2] j1f [1] pow10l [1] 11044 11045 Referenced Specification(s) 11046 11047 [1]. ISO C (1999) 11048 11049 [2]. ISO POSIX (2003) 11050 11051 [3]. this specification 11052 11053 [4]. SUSv2 11054 11055 An LSB conforming implementation shall provide the generic 11056 data interfaces for Math specified in Table 1-26, with the 11057 full mandatory functionality as described in the referenced 11058 underlying specification. 11059 11060 Table 1-26. libm - Math Data Interfaces 11061 signgam [1] 11062 11063 Referenced Specification(s) 11064 11065 [1]. ISO POSIX (2003) 11066 _________________________________________________________ 11067 11068 1.7. Data Definitions for libm 11069 11070 This section defines global identifiers and their values that 11071 are associated with interfaces contained in libm. These 11072 definitions are organized into groups that correspond to 11073 system headers. This convention is used as a convenience for 11074 the reader, and does not imply the existence of these headers, 11075 or their content. 11076 11077 These definitions are intended to supplement those provided in 11078 the referenced underlying specifications. 11079 11080 This specification uses ISO/IEC 9899 C Language as the 11081 reference programming language, and data definitions are 11082 specified in ISO C format. The C language is used here as a 11083 convenient notation. Using a C language description of these 11084 data objects does not preclude their use by other programming 11085 languages. 11086 _________________________________________________________ 11087 11088 1.7.1. complex.h 11089 11090 #define complex _Complex 11091 _________________________________________________________ 11092 11093 1.7.2. math.h 11094 11095 #define DOMAIN 1 11096 #define SING 2 11097 11098 struct exception 11099 { 11100 int type; 11101 char *name; 11102 double arg1; 11103 double arg2; 11104 double retval; 11105 } 11106 ; 11107 #define FP_NAN 0 11108 #define FP_INFINITE 1 11109 #define FP_ZERO 2 11110 #define FP_SUBNORMAL 3 11111 #define FP_NORMAL 4 11112 11113 #define isnormal(x) (fpclassify (x) == FP_NORMAL) 11114 #define isfinite(x) (sizeof (x) == sizeof (float) ? __finitef (x) : 11115 sizeof (x) == sizeof (double)? __finite (x) : __finitel (x)) 11116 #define isinf(x) (sizeof (x) == sizeof (float) ? __isinff (x): s 11117 izeof (x) == sizeof (double) ? __isinf (x) : __isinfl (x)) 11118 #define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) : 11119 sizeof (x) == sizeof (double) ? __isnan (x) : __isnanl (x)) 11120 11121 #define HUGE_VAL 0x1.0p2047 11122 #define HUGE_VALF 0x1.0p255f 11123 #define HUGE_VALL 0x1.0p32767L 11124 11125 #define NAN ((float)0x7fc00000UL) 11126 #define M_1_PI 0.31830988618379067154 11127 #define M_LOG10E 0.43429448190325182765 11128 #define M_2_PI 0.63661977236758134308 11129 #define M_LN2 0.69314718055994530942 11130 #define M_SQRT1_2 0.70710678118654752440 11131 #define M_PI_4 0.78539816339744830962 11132 #define M_2_SQRTPI 1.12837916709551257390 11133 #define M_SQRT2 1.41421356237309504880 11134 #define M_LOG2E 1.4426950408889634074 11135 #define M_PI_2 1.57079632679489661923 11136 #define M_LN10 2.30258509299404568402 11137 #define M_E 2.7182818284590452354 11138 #define M_PI 3.14159265358979323846 11139 #define INFINITY HUGE_VALF 11140 11141 #define MATH_ERRNO 1 11142 #define MATH_ERREXCEPT 2 11143 11144 #define isunordered(u, v) (__extension__({ __typeof__(u) __u = (u 11145 ); __typeof__(v) __v = (v);fpclassify (__u) == FP_NAN || fpclassify (__ 11146 v) == FP_NAN; })) 11147 #define islessgreater(x, y) (__extension__({ __typeof__(x) __x = (x 11148 ); __typeof__(y) __y = (y);!isunordered (__x, __y) & & (__x < __y || __ 11149 y < __x); })) 11150 #define isless(x,y) (__extension__({ __typeof__(x) __x = (x); __typ 11151 eof__(y) __y = (y);!isunordered (__x, __y) & & __x < __y; })) 11152 #define islessequal(x, y) (__extension__({ __typeof__(x) __x = (x 11153 ); __typeof__(y) __y = (y);!isunordered (__x, __y) & & __x <= __y; })) 11154 #define isgreater(x,y) (__extension__({ __typeof__(x) __x = (x); __typ 11155 eof__(y) __y = (y);!isunordered (__x, __y) & & __x > __y; })) 11156 #define isgreaterequal(x,y) (__extension__({ __typeof__(x) __x = (x 11157 ); __typeof__(y) __y = (y);!isunordered (__x, __y) & & __x >= __y; })) 11158 _________________________________________________________ 11159 11160 1.8. Interface Definitions for libm 11161 11162 Table of Contents 11163 __fpclassify -- Classify real floating type 11164 __fpclassifyf -- Classify real floating type 11165 11166 The following interfaces are included in libm and are defined 11167 by this specification. Unless otherwise noted, these 11168 interfaces shall be included in the source standard. 11169 11170 Other interfaces listed above for libm shall behave as 11171 described in the referenced base document. 11172 11173 __fpclassify 11174 11175 Name 11176 11177 __fpclassify -- Classify real floating type 11178 11179 Synopsis 11180 11181 int __fpclassify(double arg); 11182 11183 Description 11184 11185 __fpclassify() has the same specification as fpclassify() in 11186 ISO POSIX (2003), except that the argument type for 11187 __fpclassify() is known to be double. 11188 11189 __fpclassify() is not in the source standard; it is only in 11190 the binary standard. 11191 11192 __fpclassifyf 11193 11194 Name 11195 11196 __fpclassifyf -- Classify real floating type 11197 11198 Synopsis 11199 11200 int __fpclassifyf(float arg); 11201 11202 Description 11203 11204 __fpclassifyf() has the same specification as fpclassifyf() in 11205 ISO POSIX (2003), except that the argument type for 11206 __fpclassifyf() is known to be float. 11207 11208 __fpclassifyf() is not in the source standard; it is only in 11209 the binary standard. 11210 _________________________________________________________ 11211 11212 1.9. Interfaces for libpthread 11213 11214 Table 1-27 defines the library name and shared object name for 11215 the libpthread library 11216 11217 Table 1-27. libpthread Definition 11218 Library: libpthread 11219 SONAME: libpthread.so.0 11220 11221 The behavior of the interfaces in this library is specified by 11222 the following specifications: 11223 11224 Large File Support 11225 this specification 11226 ISO POSIX (2003) 11227 _________________________________________________________ 11228 11229 1.9.1. Realtime Threads 11230 _________________________________________________________ 11231 11232 1.9.1.1. Interfaces for Realtime Threads 11233 11234 An LSB conforming implementation shall provide the generic 11235 functions for Realtime Threads specified in Table 1-28, with 11236 the full mandatory functionality as described in the 11237 referenced underlying specification. 11238 11239 Table 1-28. libpthread - Realtime Threads Function Interfaces 11240 pthread_attr_getinheritsched [1] pthread_attr_getscope [1] 11241 pthread_attr_setschedpolicy [1] pthread_getschedparam [1] 11242 pthread_setschedprio(GLIBC_2.3.4) [1] 11243 pthread_attr_getschedpolicy [1] pthread_attr_setinheritsched 11244 [1] pthread_attr_setscope [1] pthread_setschedparam [1] 11245 11246 Referenced Specification(s) 11247 11248 [1]. ISO POSIX (2003) 11249 _________________________________________________________ 11250 11251 1.9.2. Advanced Realtime Threads 11252 _________________________________________________________ 11253 11254 1.9.2.1. Interfaces for Advanced Realtime Threads 11255 11256 No external functions are defined for libpthread - Advanced 11257 Realtime Threads 11258 _________________________________________________________ 11259 11260 1.9.3. Posix Threads 11261 _________________________________________________________ 11262 11263 1.9.3.1. Interfaces for Posix Threads 11264 11265 An LSB conforming implementation shall provide the generic 11266 functions for Posix Threads specified in Table 1-29, with the 11267 full mandatory functionality as described in the referenced 11268 underlying specification. 11269 11270 Table 1-29. libpthread - Posix Threads Function Interfaces 11271 _pthread_cleanup_pop [1] pthread_attr_setstacksize [2] 11272 pthread_getspecific [2] pthread_rwlock_destroy [2] 11273 pthread_setspecific [2] 11274 _pthread_cleanup_push [1] pthread_cancel [2] pthread_join [2] 11275 pthread_rwlock_init [2] pthread_sigmask [2] 11276 pread [2] pthread_cond_broadcast [2] pthread_key_create [2] 11277 pthread_rwlock_rdlock [2] pthread_testcancel [2] 11278 pread64 [3] pthread_cond_destroy [2] pthread_key_delete [2] 11279 pthread_rwlock_timedrdlock [2] pwrite [2] 11280 pthread_attr_destroy [2] pthread_cond_init [2] pthread_kill 11281 [2] pthread_rwlock_timedwrlock [2] pwrite64 [3] 11282 pthread_attr_getdetachstate [2] pthread_cond_signal [2] 11283 pthread_mutex_destroy [2] pthread_rwlock_tryrdlock [2] 11284 sem_close [2] 11285 pthread_attr_getguardsize [2] pthread_cond_timedwait [2] 11286 pthread_mutex_init [2] pthread_rwlock_trywrlock [2] 11287 sem_destroy [2] 11288 pthread_attr_getschedparam [2] pthread_cond_wait [2] 11289 pthread_mutex_lock [2] pthread_rwlock_unlock [2] sem_getvalue 11290 [2] 11291 pthread_attr_getstack [2] pthread_condattr_destroy [2] 11292 pthread_mutex_trylock [2] pthread_rwlock_wrlock [2] sem_init 11293 [2] 11294 pthread_attr_getstackaddr [2] pthread_condattr_getpshared [2] 11295 pthread_mutex_unlock [2] pthread_rwlockattr_destroy [2] 11296 sem_open [2] 11297 pthread_attr_getstacksize [2] pthread_condattr_init [2] 11298 pthread_mutexattr_destroy [2] pthread_rwlockattr_getpshared 11299 [2] sem_post [2] 11300 pthread_attr_init [2] pthread_condattr_setpshared [2] 11301 pthread_mutexattr_getpshared [2] pthread_rwlockattr_init [2] 11302 sem_timedwait [2] 11303 pthread_attr_setdetachstate [2] pthread_create [2] 11304 pthread_mutexattr_gettype [2] pthread_rwlockattr_setpshared 11305 [2] sem_trywait [2] 11306 pthread_attr_setguardsize [2] pthread_detach [2] 11307 pthread_mutexattr_init [2] pthread_self [2] sem_unlink [2] 11308 pthread_attr_setschedparam [2] pthread_equal [2] 11309 pthread_mutexattr_setpshared [2] pthread_setcancelstate [2] 11310 sem_wait [2] 11311 pthread_attr_setstack [2] pthread_exit [2] 11312 pthread_mutexattr_settype [2] pthread_setcanceltype [2] 11313 pthread_attr_setstackaddr [2] pthread_getconcurrency [2] 11314 pthread_once [2] pthread_setconcurrency [2] 11315 11316 Referenced Specification(s) 11317 11318 [1]. this specification 11319 11320 [2]. ISO POSIX (2003) 11321 11322 [3]. Large File Support 11323 _________________________________________________________ 11324 11325 1.10. Data Definitions for libpthread 11326 11327 This section defines global identifiers and their values that 11328 are associated with interfaces contained in libpthread. These 11329 definitions are organized into groups that correspond to 11330 system headers. This convention is used as a convenience for 11331 the reader, and does not imply the existence of these headers, 11332 or their content. 11333 11334 These definitions are intended to supplement those provided in 11335 the referenced underlying specifications. 11336 11337 This specification uses ISO/IEC 9899 C Language as the 11338 reference programming language, and data definitions are 11339 specified in ISO C format. The C language is used here as a 11340 convenient notation. Using a C language description of these 11341 data objects does not preclude their use by other programming 11342 languages. 11343 _________________________________________________________ 11344 11345 1.10.1. pthread.h 11346 11347 #define PTHREAD_SCOPE_SYSTEM 0 11348 #define PTHREAD_MUTEX_DEFAULT 1 11349 #define PTHREAD_MUTEX_NORMAL 1 11350 #define PTHREAD_SCOPE_PROCESS 1 11351 #define PTHREAD_MUTEX_RECURSIVE 2 11352 #define PTHREAD_RWLOCK_DEFAULT_NP 2 11353 #define PTHREAD_MUTEX_ERRORCHECK 3 11354 #define pthread_cleanup_pop(execute) _pthread_cleanup_pop(& _buffer, 11355 (execute));} 11356 #define __LOCK_INITIALIZER { 0, 0 } 11357 #define PTHREAD_RWLOCK_INITIALIZER { __LOCK_INITIALIZER, 0, NULL, 11358 NULL, NULL,PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE } 11359 #define PTHREAD_MUTEX_INITIALIZER {0,0,0,PTHREAD_MUTEX_NORMAL,__L 11360 OCK_INITIALIZER} 11361 #define pthread_cleanup_push(routine,arg) {struct _pthread_cleanu 11362 p_buffer _buffer;_pthread_cleanup_push(& _buffer,(routine),(arg)); 11363 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER,0} 11364 11365 struct _pthread_cleanup_buffer 11366 { 11367 void (*__routine) (void *); 11368 void *__arg; 11369 int __canceltype; 11370 struct _pthread_cleanup_buffer *__prev; 11371 } 11372 ; 11373 typedef unsigned int pthread_key_t; 11374 typedef int pthread_once_t; 11375 typedef long long int __pthread_cond_align_t; 11376 11377 typedef unsigned long int pthread_t; 11378 struct _pthread_fastlock 11379 { 11380 long int __status; 11381 int __spinlock; 11382 } 11383 ; 11384 11385 typedef struct _pthread_descr_struct *_pthread_descr; 11386 11387 typedef struct 11388 { 11389 int __m_reserved; 11390 int __m_count; 11391 _pthread_descr __m_owner; 11392 int __m_kind; 11393 struct _pthread_fastlock __m_lock; 11394 } 11395 pthread_mutex_t; 11396 typedef struct 11397 { 11398 int __mutexkind; 11399 } 11400 pthread_mutexattr_t; 11401 11402 typedef struct 11403 { 11404 int __detachstate; 11405 int __schedpolicy; 11406 struct sched_param __schedparam; 11407 int __inheritsched; 11408 int __scope; 11409 size_t __guardsize; 11410 int __stackaddr_set; 11411 void *__stackaddr; 11412 unsigned long int __stacksize; 11413 } 11414 pthread_attr_t; 11415 11416 typedef struct 11417 { 11418 struct _pthread_fastlock __c_lock; 11419 _pthread_descr __c_waiting; 11420 char __padding[48 - sizeof (struct _pthread_fastlock) - 11421 sizeof (_pthread_descr) - sizeof (__pthread_cond_align 11422 _t)]; 11423 __pthread_cond_align_t __align; 11424 } 11425 pthread_cond_t; 11426 typedef struct 11427 { 11428 int __dummy; 11429 } 11430 pthread_condattr_t; 11431 11432 typedef struct _pthread_rwlock_t 11433 { 11434 struct _pthread_fastlock __rw_lock; 11435 int __rw_readers; 11436 _pthread_descr __rw_writer; 11437 _pthread_descr __rw_read_waiting; 11438 _pthread_descr __rw_write_waiting; 11439 int __rw_kind; 11440 int __rw_pshared; 11441 } 11442 pthread_rwlock_t; 11443 typedef struct 11444 { 11445 int __lockkind; 11446 int __pshared; 11447 } 11448 pthread_rwlockattr_t; 11449 11450 #define PTHREAD_CREATE_JOINABLE 0 11451 #define PTHREAD_INHERIT_SCHED 0 11452 #define PTHREAD_ONCE_INIT 0 11453 #define PTHREAD_PROCESS_PRIVATE 0 11454 #define PTHREAD_CREATE_DETACHED 1 11455 #define PTHREAD_EXPLICIT_SCHED 1 11456 #define PTHREAD_PROCESS_SHARED 1 11457 11458 #define PTHREAD_CANCELED ((void*)-1) 11459 #define PTHREAD_CANCEL_DEFERRED 0 11460 #define PTHREAD_CANCEL_ENABLE 0 11461 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 11462 #define PTHREAD_CANCEL_DISABLE 1 11463 _________________________________________________________ 11464 11465 1.10.2. semaphore.h 11466 11467 typedef struct 11468 { 11469 struct _pthread_fastlock __sem_lock; 11470 int __sem_value; 11471 _pthread_descr __sem_waiting; 11472 } 11473 sem_t; 11474 #define SEM_FAILED ((sem_t*)0) 11475 11476 #define SEM_VALUE_MAX ((int)((~0u)>>1)) 11477 _________________________________________________________ 11478 11479 1.11. Interface Definitions for libpthread 11480 11481 Table of Contents 11482 _pthread_cleanup_pop -- establish cancellation handlers 11483 _pthread_cleanup_push -- establish cancellation handlers 11484 11485 The following interfaces are included in libpthread and are 11486 defined by this specification. Unless otherwise noted, these 11487 interfaces shall be included in the source standard. 11488 11489 Other interfaces listed above for libpthread shall behave as 11490 described in the referenced base document. 11491 11492 _pthread_cleanup_pop 11493 11494 Name 11495 11496 _pthread_cleanup_pop -- establish cancellation handlers 11497 11498 Synopsis 11499 11500 #include 11501 11502 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer *, 11503 int); 11504 11505 Description 11506 11507 The _pthread_cleanup_pop() function provides an implementation 11508 of the pthread_cleanup_pop() macro described in ISO POSIX 11509 (2003). 11510 11511 The _pthread_cleanup_pop() function is not in the source 11512 standard; it is only in the binary standard. 11513 11514 _pthread_cleanup_push 11515 11516 Name 11517 11518 _pthread_cleanup_push -- establish cancellation handlers 11519 11520 Synopsis 11521 11522 #include 11523 11524 void _pthread_cleanup_push(struct _pthread_cleanup_buffer *, 11525 void (*) (void *), void *); 11526 11527 Description 11528 11529 The _pthread_cleanup_push() function provides an 11530 implementation of the pthread_cleanup_push() macro described 11531 in ISO POSIX (2003). 11532 11533 The _pthread_cleanup_push() function is not in the source 11534 standard; it is only in the binary standard. 11535 _________________________________________________________ 11536 11537 1.12. Interfaces for libgcc_s 11538 11539 Table 1-30 defines the library name and shared object name for 11540 the libgcc_s library 11541 11542 Table 1-30. libgcc_s Definition 11543 Library: libgcc_s 11544 SONAME: libgcc_s.so.1 11545 _________________________________________________________ 11546 11547 1.12.1. Unwind Library 11548 _________________________________________________________ 11549 11550 1.12.1.1. Interfaces for Unwind Library 11551 11552 No external functions are defined for libgcc_s - Unwind 11553 Library 11554 _________________________________________________________ 11555 11556 1.13. Data Definitions for libgcc_s 11557 11558 This section defines global identifiers and their values that 11559 are associated with interfaces contained in libgcc_s. These 11560 definitions are organized into groups that correspond to 11561 system headers. This convention is used as a convenience for 11562 the reader, and does not imply the existence of these headers, 11563 or their content. 11564 11565 These definitions are intended to supplement those provided in 11566 the referenced underlying specifications. 11567 11568 This specification uses ISO/IEC 9899 C Language as the 11569 reference programming language, and data definitions are 11570 specified in ISO C format. The C language is used here as a 11571 convenient notation. Using a C language description of these 11572 data objects does not preclude their use by other programming 11573 languages. 11574 _________________________________________________________ 11575 11576 1.13.1. unwind.h 11577 11578 struct dwarf_eh_base 11579 { 11580 void *tbase; 11581 void *dbase; 11582 void *func; 11583 } 11584 ; 11585 struct _Unwind_Context; 11586 11587 typedef unsigned int _Unwind_Ptr; 11588 typedef unsigned int _Unwind_Word; 11589 11590 typedef enum 11591 { 11592 _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_FATAL_PHASE2_ 11593 ERROR = 11594 2, _URC_FATAL_PHASE1_ERROR = 3, _URC_NORMAL_STOP = 4, _URC_END_OF_S 11595 TACK = 11596 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 11597 7, _URC_CONTINUE_UNWIND = 8 11598 } 11599 _Unwind_Reason_Code; 11600 11601 struct _Unwind_Exception 11602 { 11603 _Unwind_Exception_Class; 11604 _Unwind_Exception_Cleanup_Fn; 11605 _Unwind_Word; 11606 _Unwind_Word; 11607 } 11608 ; 11609 #define _UA_SEARCH_PHASE 1 11610 #define _UA_END_OF_STACK 16 11611 #define _UA_CLEANUP_PHASE 2 11612 #define _UA_HANDLER_FRAME 4 11613 #define _UA_FORCE_UNWIND 8 11614 _________________________________________________________ 11615 11616 1.14. Interfaces for libdl 11617 11618 Table 1-31 defines the library name and shared object name for 11619 the libdl library 11620 11621 Table 1-31. libdl Definition 11622 Library: libdl 11623 SONAME: libdl.so.2 11624 11625 The behavior of the interfaces in this library is specified by 11626 the following specifications: 11627 11628 this specification 11629 ISO POSIX (2003) 11630 _________________________________________________________ 11631 11632 1.14.1. Dynamic Loader 11633 _________________________________________________________ 11634 11635 1.14.1.1. Interfaces for Dynamic Loader 11636 11637 An LSB conforming implementation shall provide the generic 11638 functions for Dynamic Loader specified in Table 1-32, with the 11639 full mandatory functionality as described in the referenced 11640 underlying specification. 11641 11642 Table 1-32. libdl - Dynamic Loader Function Interfaces 11643 dladdr [1] dlclose [2] dlerror [2] dlopen [1] dlsym [1] 11644 11645 Referenced Specification(s) 11646 11647 [1]. this specification 11648 11649 [2]. ISO POSIX (2003) 11650 _________________________________________________________ 11651 11652 1.15. Data Definitions for libdl 11653 11654 This section defines global identifiers and their values that 11655 are associated with interfaces contained in libdl. These 11656 definitions are organized into groups that correspond to 11657 system headers. This convention is used as a convenience for 11658 the reader, and does not imply the existence of these headers, 11659 or their content. 11660 11661 These definitions are intended to supplement those provided in 11662 the referenced underlying specifications. 11663 11664 This specification uses ISO/IEC 9899 C Language as the 11665 reference programming language, and data definitions are 11666 specified in ISO C format. The C language is used here as a 11667 convenient notation. Using a C language description of these 11668 data objects does not preclude their use by other programming 11669 languages. 11670 _________________________________________________________ 11671 11672 1.15.1. dlfcn.h 11673 11674 #define RTLD_NEXT ((void *) -1l) 11675 #define RTLD_LOCAL 0 11676 #define RTLD_LAZY 0x00001 11677 #define RTLD_NOW 0x00002 11678 #define RTLD_GLOBAL 0x00100 11679 11680 typedef struct 11681 { 11682 char *dli_fname; 11683 void *dli_fbase; 11684 char *dli_sname; 11685 void *dli_saddr; 11686 } 11687 Dl_info; 11688 _________________________________________________________ 11689 11690 1.16. Interface Definitions for libdl 11691 11692 Table of Contents 11693 dladdr -- find the shared object containing a given address 11694 dlopen -- open dynamic object 11695 dlsym -- obtain the address of a symbol from a dlopen object 11696 11697 The following interfaces are included in libdl and are defined 11698 by this specification. Unless otherwise noted, these 11699 interfaces shall be included in the source standard. 11700 11701 Other interfaces listed above for libdl shall behave as 11702 described in the referenced base document. 11703 11704 dladdr 11705 11706 Name 11707 11708 dladdr -- find the shared object containing a given address 11709 11710 Synopsis 11711 11712 #include 11713 11714 typedef struct { 11715 const char *dli_fname; 11716 void *dli_fbase; 11717 const char *dli_sname; 11718 void *dli_saddr; 11719 } Dl_info; 11720 11721 int dladdr(const void * addr, Dl_info * dlip); 11722 11723 Description 11724 11725 The dladdr() function shall query the dynamic linker for 11726 information about the shared object containing the address 11727 addr. The information shall be returned in the user supplied 11728 data structure referenced by dlip. 11729 11730 The structure shall contain at least the following members: 11731 11732 dli_fname 11733 The pathname of the shared object containing the 11734 address 11735 11736 dli_fbase 11737 The base address at which the shared object is mapped 11738 into the address space of the calling process. 11739 11740 dli_sname 11741 The name of the nearest runtime symbol with value less 11742 than or equal to addr. Where possible, the symbol name 11743 shall be returned as it would appear in C source code. 11744 11745 If no symbol with a suitable value is found, both this 11746 field and dli_saddr shall be set to NULL. 11747 11748 dli_saddr 11749 The address of the symbol returned in dli_sname. 11750 11751 The behavior of dladdr() is only specified in dynamically 11752 linked programs. 11753 11754 Return Value 11755 11756 On success, dladdr() shall return non-zero, and the structure 11757 referenced by dlip shall be filled in as described. Otherwise, 11758 dladdr() shall return zero, and the cause of the error can be 11759 fetched with dlerr(). 11760 11761 Errors 11762 11763 See dlerr(). 11764 11765 Environment 11766 11767 LD_LIBRARY_PATH 11768 directory search-path for object files 11769 11770 dlopen 11771 11772 Name 11773 11774 dlopen -- open dynamic object 11775 11776 Synopsis 11777 11778 #include 11779 11780 void * dlopen(const char * filename, int flag); 11781 11782 Description 11783 11784 dlopen shall behave as specified in ISO POSIX (2003), but with 11785 additional behaviors listed below. 11786 11787 If the file argument does not contain a slash character, then 11788 the system shall look for a library of that name in at least 11789 the following directories, and use the first one which is 11790 found: 11791 11792 * The directories specified by the DT_RPATH dynamic entry. 11793 * The directories specified in the LD_LIBRARY_PATH 11794 environment variable (which is a colon separated list of 11795 pathnames). This step shall be skipped for setuid and 11796 setgid executables. 11797 * A set of directories sufficient to contain the libraries 11798 specified in this standard. 11799 11800 Note: Traditionally, /lib and /usr/lib. This case would 11801 also cover cases in which the system used the mechanism of 11802 /etc/ld.so.conf and /etc/ld.so.cache to provide access. 11803 Example: An application which is not linked against libm 11804 may choose to dlopen libm. 11805 11806 dlsym 11807 11808 Name 11809 11810 dlsym -- obtain the address of a symbol from a dlopen object 11811 11812 Description 11813 11814 dlsym() is as specified in the ISO POSIX (2003), but with 11815 differences as listed below. 11816 11817 The special purpose value for handle RTLD_NEXT 11818 11819 The value RTLD_NEXT, which is reserved for future use shall be 11820 available, with the behavior as described in ISO POSIX (2003). 11821 _________________________________________________________ 11822 11823 1.17. Interfaces for libcrypt 11824 11825 Table 1-33 defines the library name and shared object name for 11826 the libcrypt library 11827 11828 Table 1-33. libcrypt Definition 11829 Library: libcrypt 11830 SONAME: libcrypt.so.1 11831 11832 The behavior of the interfaces in this library is specified by 11833 the following specifications: 11834 11835 ISO POSIX (2003) 11836 _________________________________________________________ 11837 11838 1.17.1. Encryption 11839 _________________________________________________________ 11840 11841 1.17.1.1. Interfaces for Encryption 11842 11843 An LSB conforming implementation shall provide the generic 11844 functions for Encryption specified in Table 1-34, with the 11845 full mandatory functionality as described in the referenced 11846 underlying specification. 11847 11848 Table 1-34. libcrypt - Encryption Function Interfaces 11849 crypt [1] encrypt [1] setkey [1] 11850 11851 Referenced Specification(s) 11852 11853 [1]. ISO POSIX (2003) 11854 _________________________________________________________ 11855 11856 1.18. Interfaces for libpam 11857 11858 Table 1-35 defines the library name and shared object name for 11859 the libpam library 11860 11861 Table 1-35. libpam Definition 11862 Library: libpam 11863 SONAME: libpam.so.0 11864 11865 A single service name, other, shall always be present. The 11866 behavior of this service shall be determined by the system 11867 administrator. Additional service names may also exist. [1] 11868 11869 The behavior of the interfaces in this library is specified by 11870 the following specifications: 11871 11872 this specification 11873 _________________________________________________________ 11874 11875 1.18.1. Pluggable Authentication API 11876 _________________________________________________________ 11877 11878 1.18.1.1. Interfaces for Pluggable Authentication API 11879 11880 An LSB conforming implementation shall provide the generic 11881 functions for Pluggable Authentication API specified in Table 11882 1-36, with the full mandatory functionality as described in 11883 the referenced underlying specification. 11884 11885 Table 1-36. libpam - Pluggable Authentication API Function 11886 Interfaces 11887 pam_acct_mgmt [1] pam_close_session [1] pam_get_item [1] 11888 pam_set_item [1] pam_strerror [1] 11889 pam_authenticate [1] pam_end [1] pam_getenvlist [1] 11890 pam_setcred [1] 11891 pam_chauthtok [1] pam_fail_delay [1] pam_open_session [1] 11892 pam_start [1] 11893 11894 Referenced Specification(s) 11895 11896 [1]. this specification 11897 _________________________________________________________ 11898 11899 1.19. Data Definitions for libpam 11900 11901 This section defines global identifiers and their values that 11902 are associated with interfaces contained in libpam. These 11903 definitions are organized into groups that correspond to 11904 system headers. This convention is used as a convenience for 11905 the reader, and does not imply the existence of these headers, 11906 or their content. 11907 11908 These definitions are intended to supplement those provided in 11909 the referenced underlying specifications. 11910 11911 This specification uses ISO/IEC 9899 C Language as the 11912 reference programming language, and data definitions are 11913 specified in ISO C format. The C language is used here as a 11914 convenient notation. Using a C language description of these 11915 data objects does not preclude their use by other programming 11916 languages. 11917 _________________________________________________________ 11918 11919 1.19.1. security/pam_appl.h 11920 11921 typedef struct pam_handle pam_handle_t; 11922 struct pam_message 11923 { 11924 int msg_style; 11925 const char *msg; 11926 } 11927 ; 11928 struct pam_response 11929 { 11930 char *resp; 11931 int resp_retcode; 11932 } 11933 ; 11934 11935 struct pam_conv 11936 { 11937 int (*conv) (int num_msg, const struct pam_message * *msg, 11938 struct pam_response * *resp, void *appdata_ptr); 11939 void *appdata_ptr; 11940 } 11941 ; 11942 #define PAM_PROMPT_ECHO_OFF 1 11943 #define PAM_PROMPT_ECHO_ON 2 11944 #define PAM_ERROR_MSG 3 11945 #define PAM_TEXT_INFO 4 11946 11947 #define PAM_SERVICE 1 11948 #define PAM_USER 2 11949 #define PAM_TTY 3 11950 #define PAM_RHOST 4 11951 #define PAM_CONV 5 11952 #define PAM_RUSER 8 11953 #define PAM_USER_PROMPT 9 11954 11955 #define PAM_SUCCESS 0 11956 #define PAM_OPEN_ERR 1 11957 #define PAM_USER_UNKNOWN 10 11958 #define PAM_MAXTRIES 11 11959 #define PAM_NEW_AUTHTOK_REQD 12 11960 #define PAM_ACCT_EXPIRED 13 11961 #define PAM_SESSION_ERR 14 11962 #define PAM_CRED_UNAVAIL 15 11963 #define PAM_CRED_EXPIRED 16 11964 #define PAM_CRED_ERR 17 11965 #define PAM_CONV_ERR 19 11966 #define PAM_SYMBOL_ERR 2 11967 #define PAM_AUTHTOK_ERR 20 11968 #define PAM_AUTHTOK_RECOVER_ERR 21 11969 #define PAM_AUTHTOK_LOCK_BUSY 22 11970 #define PAM_AUTHTOK_DISABLE_AGING 23 11971 #define PAM_TRY_AGAIN 24 11972 #define PAM_ABORT 26 11973 #define PAM_AUTHTOK_EXPIRED 27 11974 #define PAM_BAD_ITEM 29 11975 #define PAM_SERVICE_ERR 3 11976 #define PAM_SYSTEM_ERR 4 11977 #define PAM_BUF_ERR 5 11978 #define PAM_PERM_DENIED 6 11979 #define PAM_AUTH_ERR 7 11980 #define PAM_CRED_INSUFFICIENT 8 11981 #define PAM_AUTHINFO_UNAVAIL 9 11982 11983 #define PAM_DISALLOW_NULL_AUTHTOK 0x0001U 11984 #define PAM_ESTABLISH_CRED 0x0002U 11985 #define PAM_DELETE_CRED 0x0004U 11986 #define PAM_REINITIALIZE_CRED 0x0008U 11987 #define PAM_REFRESH_CRED 0x0010U 11988 #define PAM_CHANGE_EXPIRED_AUTHTOK 0x0020U 11989 #define PAM_SILENT 0x8000U 11990 _________________________________________________________ 11991 11992 1.20. Interface Definitions for libpam 11993 11994 Table of Contents 11995 pam_acct_mgmt -- establish the status of a user's account 11996 pam_authenticate -- authenticate the user 11997 pam_chauthtok -- change the authentication token for a given 11998 user 11999 12000 pam_close_session -- indicate that an authenticated session 12001 has ended 12002 12003 pam_end -- terminate the use of the PAM library 12004 pam_fail_delay -- specify delay time to use on authentication 12005 error 12006 12007 pam_get_item -- obtain the value of the indicated item. 12008 pam_getenvlist -- returns a pointer to the complete PAM 12009 environment. 12010 12011 pam_open_session -- used to indicate that an authenticated 12012 session has been initiated 12013 12014 pam_set_item -- (re)set the value of an item. 12015 pam_setcred -- set the module-specific credentials of the user 12016 pam_start -- initialize the PAM library 12017 pam_strerror -- returns a string describing the PAM error 12018 12019 The following interfaces are included in libpam and are 12020 defined by this specification. Unless otherwise noted, these 12021 interfaces shall be included in the source standard. 12022 12023 Other interfaces listed above for libpam shall behave as 12024 described in the referenced base document. 12025 12026 pam_acct_mgmt 12027 12028 Name 12029 12030 pam_acct_mgmt -- establish the status of a user's account 12031 12032 Synopsis 12033 12034 #include 12035 12036 int pam_acct_mgmt(pam_handle_t * pamh, int flags); 12037 12038 Description 12039 12040 pam_acct_mgmt() establishes the account's usability and the 12041 user's accessibility to the system. It is typically called 12042 after the user has been authenticated. 12043 12044 flags may be specified as any valid flag (namely, one of those 12045 applicable to the flags argument of pam_authenticate()). 12046 Additionally, the value of flags may be logically or'd with 12047 PAM_SILENT. 12048 12049 Return Value 12050 12051 PAM_SUCCESS 12052 Success. 12053 12054 PAM_NEW_AUTHTOK_REQD 12055 User is valid, but user's authentication token has 12056 expired. The correct response to this return-value is 12057 to require that the user satisfy the pam_chauthtok() 12058 function before obtaining service. It may not be 12059 possible for an application to do this. In such a case, 12060 the user should be denied access until the account 12061 password is updated. 12062 12063 PAM_ACCT_EXPIRED 12064 User is no longer permitted access to the system. 12065 12066 PAM_AUTH_ERR 12067 Authentication error. 12068 12069 PAM_PERM_DENIED 12070 User is not permitted to gain access at this time. 12071 12072 PAM_USER_UNKNOWN 12073 User is not known to a module's account management 12074 component. 12075 12076 Errors 12077 12078 May be translated to text with pam_strerror(). 12079 12080 pam_authenticate 12081 12082 Name 12083 12084 pam_authenticate -- authenticate the user 12085 12086 Synopsis 12087 12088 #include 12089 12090 int pam_authenticate(pam_handle_t * pamh, int flags); 12091 12092 Description 12093 12094 pam_authenticate() serves as an interface to the 12095 authentication mechanisms of the loaded modules. 12096 12097 flags is an optional parameter that may be specified by the 12098 following value: 12099 12100 PAM_DISALLOW_NULL_AUTHTOK 12101 Instruct the authentication modules to return 12102 PAM_AUTH_ERR if the user does not have a registered 12103 authorization token. 12104 12105 Additionally, the value of flags may be logically or'd with 12106 PAM_SILENT. 12107 12108 The process may need to be privileged in order to successfully 12109 call this function. 12110 12111 Return Value 12112 12113 PAM_SUCCESS 12114 Success. 12115 12116 PAM_AUTH_ERR 12117 User was not authenticated or process did not have 12118 sufficient privileges to perform authentication. 12119 12120 PAM_CRED_INSUFFICIENT 12121 Application does not have sufficient credentials to 12122 authenticate the user. 12123 12124 PAM_AUTHINFO_UNAVAIL 12125 Modules were not able to access the authentication 12126 information. This might be due to a network or hardware 12127 failure, etc. 12128 12129 PAM_USER_UNKNOWN 12130 Supplied username is not known to the authentication 12131 service. 12132 12133 PAM_MAXTRIES 12134 One or more authentication modules has reached its 12135 limit of tries authenticating the user. Do not try 12136 again. 12137 12138 PAM_ABORT 12139 One or more authentication modules failed to load. 12140 12141 Errors 12142 12143 May be translated to text with pam_strerror(). 12144 12145 pam_chauthtok 12146 12147 Name 12148 12149 pam_chauthtok -- change the authentication token for a given 12150 user 12151 12152 Synopsis 12153 12154 #include 12155 12156 int pam_chauthtok(pam_handle_t * pamh, const int flags); 12157 12158 Description 12159 12160 pam_chauthtok() is used to change the authentication token for 12161 a given user as indicated by the state associated with the 12162 handle pamh. 12163 12164 flags is an optional parameter that may be specified by the 12165 following value: 12166 12167 PAM_CHANGE_EXPIRED_AUTHTOK 12168 User's authentication token should only be changed if 12169 it has expired. 12170 12171 Additionally, the value of flags may be logically or'd with 12172 PAM_SILENT. 12173 12174 RETURN VALUE 12175 12176 PAM_SUCCESS 12177 Success. 12178 12179 PAM_AUTHTOK_ERR 12180 A module was unable to obtain the new authentication 12181 token. 12182 12183 PAM_AUTHTOK_RECOVER_ERR 12184 A module was unable to obtain the old authentication 12185 token. 12186 12187 PAM_AUTHTOK_LOCK_BUSY 12188 One or more modules were unable to change the 12189 authentication token since it is currently locked. 12190 12191 PAM_AUTHTOK_DISABLE_AGING 12192 Authentication token aging has been disabled for at 12193 least one of the modules. 12194 12195 PAM_PERM_DENIED 12196 Permission denied. 12197 12198 PAM_TRY_AGAIN 12199 Not all modules were in a position to update the 12200 authentication token(s). In such a case, none of the 12201 user's authentication tokens are updated. 12202 12203 PAM_USER_UNKNOWN 12204 User is not known to the authentication token changing 12205 service. 12206 12207 ERRORS 12208 12209 May be translated to text with pam_strerror(). 12210 12211 pam_close_session 12212 12213 Name 12214 12215 pam_close_session -- indicate that an authenticated session 12216 has ended 12217 12218 Synopsis 12219 12220 #include 12221 12222 int pam_close_session(pam_handle_t * pamh, int flags); 12223 12224 Description 12225 12226 pam_close_session() is used to indicate that an authenticated 12227 session has ended. It is used to inform the module that the 12228 user is exiting a session. It should be possible for the PAM 12229 library to open a session and close the same session from 12230 different applications. 12231 12232 flags may have the value PAM_SILENT to indicate that no output 12233 should be generated as a result of this function call. 12234 12235 Return Value 12236 12237 PAM_SUCCESS 12238 Success. 12239 12240 PAM_SESSION_ERR 12241 One of the required loaded modules was unable to close 12242 a session for the user. 12243 12244 Errors 12245 12246 May be translated to text with pam_strerror(). 12247 12248 pam_end 12249 12250 Name 12251 12252 pam_end -- terminate the use of the PAM library 12253 12254 Synopsis 12255 12256 #include 12257 12258 int pam_end(pam_handle_t * pamh, int pam_status); 12259 12260 Description 12261 12262 pam_end() terminates use of the PAM library. On success, the 12263 contents of *pamh are no longer valid, and all memory 12264 associated with it is invalid. 12265 12266 Normally, pam_status is passed the value PAM_SUCCESS, but in 12267 the event of an unsuccessful service application, the 12268 appropriate PAM error return value should be used. 12269 12270 Return Value 12271 12272 PAM_SUCCESS 12273 Success. 12274 12275 Errors 12276 12277 May be translated to text with pam_strerror(). 12278 12279 pam_fail_delay 12280 12281 Name 12282 12283 pam_fail_delay -- specify delay time to use on authentication 12284 error 12285 12286 Synopsis 12287 12288 #include 12289 12290 int pam_fail_delay(pam_handle_t * pamh, unsigned int 12291 micro_sec); 12292 12293 Description 12294 12295 pam_fail_delay() specifies the minimum delay for the PAM 12296 library to use when an authentication error occurs. The actual 12297 delay can vary by as much at 25%. If this function is called 12298 multiple times, the longest time specified by any of the call 12299 will be used. 12300 12301 The delay is invoked if an authentication error occurs during 12302 the pam_authenticate() or pam_chauthtok() function calls. 12303 12304 Independent of the success of pam_authenticate() or 12305 pam_chauthtok(), the delay time is reset to its default value 12306 of 0 when the PAM library returns control to the application 12307 from these two functions. 12308 12309 Return Value 12310 12311 PAM_SUCCESS 12312 Success. 12313 12314 Errors 12315 12316 May be translated to text with pam_strerror(). 12317 12318 pam_get_item 12319 12320 Name 12321 12322 pam_get_item -- obtain the value of the indicated item. 12323 12324 Synopsis 12325 12326 #include 12327 12328 int pam_get_item(const pam_handle_t * pamh, int item_type, 12329 const void * * item); 12330 12331 Description 12332 12333 pam_get_item() obtains the value of the indicated item_type. 12334 The possible values of item_type are the same as listed for 12335 pam_set_item(). 12336 12337 On success, item contains a pointer to the value of the 12338 corresponding item. Note that this is a pointer to the actual 12339 data and should not be free()'d or over-written. 12340 12341 Return Value 12342 12343 PAM_SUCCESS 12344 Success. 12345 12346 PAM_PERM_DENIED 12347 Application passed a NULL pointer for item. 12348 12349 PAM_BAD_ITEM 12350 Application attempted to get an undefined item. 12351 12352 Errors 12353 12354 May be translated to text with pam_strerror(). 12355 12356 pam_getenvlist 12357 12358 Name 12359 12360 pam_getenvlist -- returns a pointer to the complete PAM 12361 environment. 12362 12363 Synopsis 12364 12365 #include 12366 12367 char * const * pam_getenvlist(pam_handle_t * pamh); 12368 12369 Description 12370 12371 pam_getenvlist() returns a pointer to the complete PAM 12372 environment. This pointer points to an array of pointers to 12373 NUL-terminated strings and must be terminated by a NULL 12374 pointer. Each string has the form "name=value". 12375 12376 The PAM library module allocates memory for the returned value 12377 and the associated strings. The calling application is 12378 responsible for freeing this memory. 12379 12380 Return Value 12381 12382 pam_getenvlist() returns an array of string pointers 12383 containing the PAM environment. On error, NULL is returned. 12384 12385 pam_open_session 12386 12387 Name 12388 12389 pam_open_session -- used to indicate that an authenticated 12390 session has been initiated 12391 12392 Synopsis 12393 12394 #include 12395 12396 int pam_open_session(pam_handle_t * pamh, int flags); 12397 12398 Description 12399 12400 pam_handle_t() is used to indicate that an authenticated 12401 session has begun. It is used to inform the module that the 12402 user is currently in a session. It should be possible for the 12403 PAM library to open a session and close the same session from 12404 different applications. 12405 12406 flags may have the value PAM_SILENT to indicate that no output 12407 be generated as a rsult of this function call. 12408 12409 Return Value 12410 12411 PAM_SUCCESS 12412 Success. 12413 12414 PAM_SESSION_ERR 12415 One of the loaded modules was unable to open a session 12416 for the user. 12417 12418 ERRORS 12419 12420 May be translated to text with pam_strerror(). 12421 12422 pam_set_item 12423 12424 Name 12425 12426 pam_set_item -- (re)set the value of an item. 12427 12428 Synopsis 12429 12430 #include 12431 12432 int pam_set_item(pam_handle_t * pamh, int item_type, const 12433 void * item); 12434 12435 Description 12436 12437 pam_set_item() (re)sets the value of one of the following 12438 item_types: 12439 12440 PAM_SERVICE 12441 service name 12442 12443 PAM_USER 12444 user name 12445 12446 PAM_TTY 12447 terminal name 12448 12449 The value for a device file should include the /dev/ 12450 prefix. The value for graphical, X-based, applications 12451 should be the $DISPLAY variable. 12452 12453 PAM_RHOST 12454 remote host name 12455 12456 PAM_CONV 12457 conversation structure 12458 12459 PAM_RUSER 12460 remote user name 12461 12462 PAM_USER_PROMPT 12463 string to be used when prompting for a user's name 12464 12465 The default value for this string is Please enter 12466 username: . 12467 12468 For all item_types other than PAM_CONV, item is a pointer to a 12469 NULL-terminated character string. In the case of PAM_CONV, 12470 item points to an initialized pam_conv structure. 12471 12472 Return Value 12473 12474 PAM_SUCCESS 12475 Success. 12476 12477 PAM_PERM_DENIED 12478 An attempt was made to replace the conversation 12479 structure with a NULL value. 12480 12481 PAM_BUF_ERR 12482 Function ran out of memory making a copy of the item. 12483 12484 PAM_BAD_ITEM 12485 Application attempted to set an undefined item. 12486 12487 Errors 12488 12489 May be translated to text with pam_strerror(). 12490 12491 pam_setcred 12492 12493 Name 12494 12495 pam_setcred -- set the module-specific credentials of the user 12496 12497 Synopsis 12498 12499 #include 12500 12501 extern int pam_setcred(pam_handle_t * pamh, int flags); 12502 12503 Description 12504 12505 pam_setcred() sets the module-specific credentials of the 12506 user. It is usually called after the user has been 12507 authenticated, after the account management function has been 12508 called and after a session has been opened for the user. 12509 12510 flags maybe specified from among the following values: 12511 12512 PAM_ESTABLISH_CRED 12513 set credentials for the authentication service 12514 12515 PAM_DELETE_CRED 12516 delete credentials associated with the authentication 12517 service 12518 12519 PAM_REINITIALIZE_CRED 12520 reinitialize the user credentials 12521 12522 PAM_REFRESH_CRED 12523 extend lifetime of the user credentials 12524 12525 Additionally, the value of flags may be logically or'd with 12526 PAM_SILENT. 12527 12528 Return Value 12529 12530 PAM_SUCCESS 12531 Success. 12532 12533 PAM_CRED_UNAVAIL 12534 Module cannot retrieve the user's credentials. 12535 12536 PAM_CRED_EXPIRED 12537 User's credentials have expired. 12538 12539 PAM_USER_UNKNOWN 12540 User is not known to an authentication module. 12541 12542 PAM_CRED_ERR 12543 Module was unable to set the credentials of the user. 12544 12545 Errors 12546 12547 May be translated to text with pam_strerror(). 12548 12549 pam_start 12550 12551 Name 12552 12553 pam_start -- initialize the PAM library 12554 12555 Synopsis 12556 12557 #include 12558 12559 int pam_start(const char * service_name, const char * user, 12560 const struct pam_conv * pam_conversation, pam_handle_t * * 12561 pamh); 12562 12563 Description 12564 12565 pam_start() is used to initialize the PAM library. It must be 12566 called prior to any other usage of the PAM library. On 12567 success, *pamh becomes a handle that provides continuity for 12568 successive calls to the PAM library. pam_start() expects 12569 arguments as follows: the service_name of the program, the 12570 username of the individual to be authenticated, a pointer to 12571 an application-supplied pam_conv structure, and a pointer to a 12572 pam_handle_t pointer. 12573 12574 An application must provide the conversation function used for 12575 direct communication between a loaded module and the 12576 application. The application also typically provides a means 12577 for the module to prompt the user for a password, etc. 12578 12579 The structure, pam_conv, is defined to be, 12580 struct pam_conv { 12581 int (*conv) (int num_msg, 12582 const struct pam_message * *msg, 12583 struct pam_response * *resp, 12584 void *appdata_ptr); 12585 void *appdata_ptr; 12586 }; 12587 12588 It is initialized by the application before it is passed to 12589 the library. The contents of this structure are attached to 12590 the *pamh handle. The point of this argument is to provide a 12591 mechanism for any loaded module to interact directly with the 12592 application program; this is why it is called a conversation 12593 structure. 12594 12595 When a module calls the referenced conv() function, 12596 appdata_ptr is set to the second element of this structure. 12597 12598 The other arguments of a call to conv() concern the 12599 information exchanged by module and application. num_msg holds 12600 the length of the array of pointers passed via msg. On 12601 success, the pointer resp points to an array of num_msg 12602 pam_response structures, holding the application-supplied 12603 text. Note that resp is a struct pam_response array and not an 12604 array of pointers. 12605 12606 Return Value 12607 12608 PAM_SUCCESS 12609 Success. 12610 12611 PAM_BUF_ERR 12612 Memory allocation error. 12613 12614 PAM_ABORT 12615 Internal failure. 12616 12617 ERRORS 12618 12619 May be translated to text with pam_strerror(). 12620 12621 pam_strerror 12622 12623 Name 12624 12625 pam_strerror -- returns a string describing the PAM error 12626 12627 Synopsis 12628 12629 #include 12630 12631 const char * pam_strerror(pam_handle_t * pamh, int errnum); 12632 12633 Description 12634 12635 pam_strerror() returns a string describing the PAM error 12636 associated with errnum. 12637 12638 Return Value 12639 12640 On success, this function returns a description of the 12641 indicated error. The application should not free or modify 12642 this string. Otherwise, a string indicating that the error is 12643 unknown shall be returned. It is unspecified whether or not 12644 the string returned is translated according to the setting of 12645 LC_MESSAGES. 12646 12647 II. Utility Libraries 12648 12649 Table of Contents 12650 2. Utility Libraries 12651 _________________________________________________________ 12652 12653 Chapter 2. Utility Libraries 12654 12655 2.1. Introduction 12656 12657 An LSB-conforming implementation shall also support the 12658 following utility libraries which are built on top of the 12659 interfaces provided by the base libraries. These libraries 12660 implement common functionality, and hide additional system 12661 dependent information such as file formats and device names. 12662 12663 * libz 12664 * libcurses 12665 * libutil 12666 _________________________________________________________ 12667 12668 2.2. Interfaces for libz 12669 12670 Table 2-1 defines the library name and shared object name for 12671 the libz library 12672 12673 Table 2-1. libz Definition 12674 Library: libz 12675 SONAME: libz.so.1 12676 12677 The behavior of the interfaces in this library is specified by 12678 the following specifications: 12679 12680 this specification 12681 _________________________________________________________ 12682 12683 2.2.1. Compression Library 12684 _________________________________________________________ 12685 12686 2.2.1.1. Interfaces for Compression Library 12687 12688 An LSB conforming implementation shall provide the generic 12689 functions for Compression Library specified in Table 2-2, with 12690 the full mandatory functionality as described in the 12691 referenced underlying specification. 12692 12693 Table 2-2. libz - Compression Library Function Interfaces 12694 adler32 [1] deflateInit2_ [1] gzerror [1] gzrewind [1] 12695 inflateReset [1] 12696 compress [1] deflateInit_ [1] gzflush [1] gzseek [1] 12697 inflateSetDictionary [1] 12698 compress2 [1] deflateParams [1] gzgetc [1] gzsetparams [1] 12699 inflateSync [1] 12700 compressBound [1] deflateReset [1] gzgets [1] gztell [1] 12701 inflateSyncPoint [1] 12702 crc32 [1] deflateSetDictionary [1] gzopen [1] gzwrite [1] 12703 uncompress [1] 12704 deflate [1] get_crc_table [1] gzprintf [1] inflate [1] zError 12705 [1] 12706 deflateBound [1] gzclose [1] gzputc [1] inflateEnd [1] 12707 zlibVersion [1] 12708 deflateCopy [1] gzdopen [1] gzputs [1] inflateInit2_ [1] 12709 deflateEnd [1] gzeof [1] gzread [1] inflateInit_ [1] 12710 12711 Referenced Specification(s) 12712 12713 [1]. this specification 12714 _________________________________________________________ 12715 12716 2.3. Data Definitions for libz 12717 12718 This section defines global identifiers and their values that 12719 are associated with interfaces contained in libz. These 12720 definitions are organized into groups that correspond to 12721 system headers. This convention is used as a convenience for 12722 the reader, and does not imply the existence of these headers, 12723 or their content. 12724 12725 These definitions are intended to supplement those provided in 12726 the referenced underlying specifications. 12727 12728 This specification uses ISO/IEC 9899 C Language as the 12729 reference programming language, and data definitions are 12730 specified in ISO C format. The C language is used here as a 12731 convenient notation. Using a C language description of these 12732 data objects does not preclude their use by other programming 12733 languages. 12734 _________________________________________________________ 12735 12736 2.3.1. zlib.h 12737 12738 In addition to the values below, the zlib.h header shall 12739 define the ZLIB_VERSION macro. This macro may be used to check 12740 that the version of the library at run time matches that at 12741 compile time. 12742 12743 See also the zlibVersion() function, which returns the library 12744 version at run time. The first character of the version at 12745 compile time should always match the first character at run 12746 time. 12747 #define Z_NULL 0 12748 #define MAX_WBITS 15 12749 #define MAX_MEM_LEVEL 9 12750 #define deflateInit2(strm,level,method,windowBits,memLevel,strategy) 12751 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),(strategy 12752 ),ZLIB_VERSION,sizeof(z_stream)) 12753 #define deflateInit(strm,level) deflateInit_((strm), (level), ZLI 12754 B_VERSION, sizeof(z_stream)) 12755 #define inflateInit2(strm,windowBits) inflateInit2_((strm), (windowBi 12756 ts), ZLIB_VERSION, sizeof(z_stream)) 12757 #define inflateInit(strm) inflateInit_((strm), ZLI 12758 B_VERSION, sizeof(z_stream)) 12759 12760 typedef char charf; 12761 typedef int intf; 12762 12763 typedef void *voidpf; 12764 typedef unsigned int uInt; 12765 typedef unsigned long int uLong; 12766 typedef uLong uLongf; 12767 typedef void *voidp; 12768 typedef unsigned char Byte; 12769 typedef off_t z_off_t; 12770 typedef void *const voidpc; 12771 12772 typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size); 12773 typedef void (*free_func) (voidpf opaque, voidpf address); 12774 struct internal_state 12775 { 12776 int dummy; 12777 } 12778 ; 12779 typedef Byte Bytef; 12780 typedef uInt uIntf; 12781 12782 typedef struct z_stream_s 12783 { 12784 Bytef *next_in; 12785 uInt avail_in; 12786 uLong total_in; 12787 Bytef *next_out; 12788 uInt avail_out; 12789 uLong total_out; 12790 char *msg; 12791 struct internal_state *state; 12792 alloc_func zalloc; 12793 free_func zfree; 12794 voidpf opaque; 12795 int data_type; 12796 uLong adler; 12797 uLong reserved; 12798 } 12799 z_stream; 12800 12801 typedef z_stream *z_streamp; 12802 typedef voidp gzFile; 12803 #define Z_NO_FLUSH 0 12804 #define Z_PARTIAL_FLUSH 1 12805 #define Z_SYNC_FLUSH 2 12806 #define Z_FULL_FLUSH 3 12807 #define Z_FINISH 4 12808 12809 #define Z_ERRNO (-1) 12810 #define Z_STREAM_ERROR (-2) 12811 #define Z_DATA_ERROR (-3) 12812 #define Z_MEM_ERROR (-4) 12813 #define Z_BUF_ERROR (-5) 12814 #define Z_VERSION_ERROR (-6) 12815 #define Z_OK 0 12816 #define Z_STREAM_END 1 12817 #define Z_NEED_DICT 2 12818 12819 #define Z_DEFAULT_COMPRESSION (-1) 12820 #define Z_NO_COMPRESSION 0 12821 #define Z_BEST_SPEED 1 12822 #define Z_BEST_COMPRESSION 9 12823 12824 #define Z_DEFAULT_STRATEGY 0 12825 #define Z_FILTERED 1 12826 #define Z_HUFFMAN_ONLY 2 12827 12828 #define Z_BINARY 0 12829 #define Z_ASCII 1 12830 #define Z_UNKNOWN 2 12831 12832 #define Z_DEFLATED 8 12833 _________________________________________________________ 12834 12835 2.4. Interface Definitions for libz 12836 12837 Table of Contents 12838 adler32 -- Compute Adler 32 Checksum 12839 compress -- compress data 12840 compress2 -- compress data at a specified level 12841 compressBound -- compute compressed data size 12842 crc32 -- Compute CRC-32 Checksum 12843 deflate -- compress data 12844 deflateBound -- compute compressed data size 12845 deflateCopy -- copy compression stream 12846 deflateEnd -- free compression stream state 12847 deflateInit2_ -- initialize compression system 12848 deflateInit_ -- initialize compression system 12849 deflateParams -- set compression parameters 12850 deflateReset -- reset compression stream state 12851 deflateSetDictionary -- initialize compression dictionary 12852 get_crc_table -- generate a table for crc calculations 12853 gzclose -- close a compressed file stream 12854 gzdopen -- open a compressed file 12855 gzeof -- check for end-of-file on a compressed file stream 12856 gzerror -- decode an error on a compressed file stream 12857 gzflush -- flush a compressed file stream 12858 gzgetc -- read a character from a compressed file 12859 gzgets -- read a string from a compressed file 12860 gzopen -- open a compressed file 12861 gzprintf -- format data and compress 12862 gzputc -- write character to a compressed file 12863 gzputs -- string write to a compressed file 12864 gzread -- read from a compressed file 12865 gzrewind -- reset the file-position indicator on a compressed 12866 file stream 12867 12868 gzseek -- reposition a file-position indicator in a compressed 12869 file stream 12870 12871 gzsetparams -- dynamically set compression parameters 12872 gztell -- find position on a compressed file stream 12873 gzwrite -- write to a compressed file 12874 inflate -- decompress data 12875 inflateEnd -- free decompression stream state 12876 inflateInit2_ -- initialize decompression system 12877 inflateInit_ -- initialize decompression system 12878 inflateReset -- reset decompression stream state 12879 inflateSetDictionary -- initialize decompression dictionary 12880 inflateSync -- advance compression stream to next sync point 12881 inflateSyncPoint -- test for synchronization point 12882 uncompress -- uncompress data 12883 zError -- translate error number to string 12884 zlibVersion -- discover library version at run time 12885 12886 The following interfaces are included in libz and are defined 12887 by this specification. Unless otherwise noted, these 12888 interfaces shall be included in the source standard. 12889 12890 Other interfaces listed above for libz shall behave as 12891 described in the referenced base document. 12892 12893 adler32 12894 12895 Name 12896 12897 adler32 -- Compute Adler 32 Checksum 12898 12899 Synopsis 12900 12901 #include 12902 12903 uLong adler32(uLong adler, const Bytef * buf, uInt len); 12904 12905 Description 12906 12907 The adler32() function shall compute a running Adler-32 12908 checksum (as described in RFC 1950: ZLIB Compressed Data 12909 Format Specication). On entry, adler is the previous value for 12910 the checksum, and buf shall point to an array of len bytes of 12911 data to be added to this checksum. The adler32() function 12912 shall return the new checksum. 12913 12914 If buf is NULL (or Z_NULL), adler32() shall return the initial 12915 checksum. 12916 12917 Return Value 12918 12919 The adler32() function shall return the new checksum value. 12920 12921 Errors 12922 12923 None defined. 12924 12925 Application Usage (informative) 12926 12927 The following code fragment demonstrates typical usage of the 12928 adler32() function: 12929 uLong adler = adler32(0L, Z_NULL, 0); 12930 12931 while (read_buffer(buffer, length) != EOF) { 12932 adler = adler32(adler, buffer, length); 12933 } 12934 if (adler != original_adler) error(); 12935 12936 compress 12937 12938 Name 12939 12940 compress -- compress data 12941 12942 Synopsis 12943 12944 #include 12945 12946 int compress(Bytef * dest, uLongf * destLen, const Bytef * 12947 source, uLong sourceLen); 12948 12949 Description 12950 12951 The compress() function shall attempt to compress sourceLen 12952 bytes of data in the buffer source, placing the result in the 12953 buffer dest. 12954 12955 On entry, destLen should point to a value describing the size 12956 of the dest buffer. The application should ensure that this 12957 value be at least (sourceLen × 1.001) + 12. On successful 12958 exit, the variable referenced by destLen shall be updated to 12959 hold the length of compressed data in dest. 12960 12961 The compress() function is equivalent to compress2() with a 12962 level of Z_DEFAULT_LEVEL. 12963 12964 Return Value 12965 12966 On success, compress() shall return Z_OK. Otherwise, 12967 compress() shall return a value to indicate the error. 12968 12969 Errors 12970 12971 On error, compress() shall return a value as described below: 12972 12973 Z_BUF_ERROR 12974 The buffer dest was not large enough to hold the 12975 compressed data. 12976 12977 Z_MEM_ERROR 12978 Insufficient memory. 12979 12980 compress2 12981 12982 Name 12983 12984 compress2 -- compress data at a specified level 12985 12986 Synopsis 12987 12988 #include 12989 12990 int compress2(Bytef * dest, uLongf * destLen, const Bytef * 12991 source, uLong sourceLen, int level); 12992 12993 Description 12994 12995 The compress2() function shall attempt to compress sourceLen 12996 bytes of data in the buffer source, placing the result in the 12997 buffer dest, at the level described by level. The level 12998 supplied shall be a value between 0 and 9, or the value 12999 Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 13000 speed, while a level of 9 requests the highest compression. A 13001 level of 0 indicates that no compression should be used, and 13002 the output shall be the same as the input. 13003 13004 On entry, destLen should point to a value describing the size 13005 of the dest buffer. The application should ensure that this 13006 value be at least (sourceLen × 1.001) + 12. On successful 13007 exit, the variable referenced by destLen shall be updated to 13008 hold the length of compressed data in dest. 13009 13010 The compress() function is equivalent to compress2() with a 13011 level of Z_DEFAULT_LEVEL. 13012 13013 Return Value 13014 13015 On success, compress2() shall return Z_OK. Otherwise, 13016 compress2() shall return a value to indicate the error. 13017 13018 Errors 13019 13020 On error, compress2() shall return a value as described below: 13021 13022 Z_BUF_ERROR 13023 The buffer dest was not large enough to hold the 13024 compressed data. 13025 13026 Z_MEM_ERROR 13027 Insufficient memory. 13028 13029 Z_STREAM_ERROR 13030 The level was not Z_DEFAULT_LEVEL, or was not between 0 13031 and 9. 13032 13033 compressBound 13034 13035 Name 13036 13037 compressBound -- compute compressed data size 13038 13039 Synopsis 13040 13041 #include 13042 13043 int compressBound(uLong sourceLen); 13044 13045 Description 13046 13047 The compressBound() function shall estimate the size of buffer 13048 required to compress sourceLen bytes of data using the 13049 compress() or compress2() functions. If successful, the value 13050 returned shall be an upper bound for the size of buffer 13051 required to compress sourceLen bytes of data, using the 13052 parameters stored in stream, in a single call to compress() or 13053 compress2(). 13054 13055 Return Value 13056 13057 The compressBound() shall return a value representing the 13058 upper bound of an array to allocate to hold the compressed 13059 data in a single call to compress() or compress2(). This 13060 function may return a conservative value that may be larger 13061 than sourceLen. 13062 13063 Errors 13064 13065 None defined. 13066 13067 crc32 13068 13069 Name 13070 13071 crc32 -- Compute CRC-32 Checksum 13072 13073 Synopsis 13074 13075 #include 13076 13077 uLong crc32(uLong crc, const Bytef * buf, uInt len); 13078 13079 Description 13080 13081 The crc32() function shall compute a running Cyclic Redundancy 13082 Check checksum, as defined in ITU-T V.42. On entry, crc is the 13083 previous value for the checksum, and buf shall point to an 13084 array of len bytes of data to be added to this checksum. The 13085 crc32() function shall return the new checksum. 13086 13087 If buf is NULL (or Z_NULL), crc32() shall return the initial 13088 checksum. 13089 13090 Return Value 13091 13092 The crc32() function shall return the new checksum value. 13093 13094 Errors 13095 13096 None defined. 13097 13098 Application Usage (informative) 13099 13100 The following code fragment demonstrates typical usage of the 13101 crc32() function: 13102 uLong crc = crc32(0L, Z_NULL, 0); 13103 13104 while (read_buffer(buffer, length) != EOF) { 13105 crc = crc32(crc, buffer, length); 13106 } 13107 if (crc != original_crc) error(); 13108 13109 deflate 13110 13111 Name 13112 13113 deflate -- compress data 13114 13115 Synopsis 13116 13117 #include 13118 13119 int deflate(z_streamp stream, int flush); 13120 13121 Description 13122 13123 The deflate() function shall attempt to compress data until 13124 either the input buffer is empty or the output buffer is full. 13125 The stream references a z_stream structure. Before the first 13126 call to deflate(), this structure should have been initialized 13127 by a call to deflateInit2_(). 13128 13129 Note: deflateInit2_() is only in the binary standard; 13130 source level applications should initialize stream via a 13131 call to deflateInit() or deflateInit2(). 13132 13133 In addition, the stream input and output buffers should have 13134 been initialized as follows: 13135 13136 next_in 13137 should point to the data to be compressed. 13138 13139 avail_in 13140 should contain the number of bytes of data in the 13141 buffer referenced by next_in. 13142 13143 next_out 13144 should point to a buffer where compressed data may be 13145 placed. 13146 13147 avail_out 13148 should contain the size in bytes of the buffer 13149 referenced by next_out 13150 13151 The deflate() function shall perform one or both of the 13152 following actions: 13153 13154 1. Compress input data from next_in and update next_in, 13155 avail_in and total_in to reflect the data that has been 13156 compressed. 13157 2. Fill the output buffer referenced by next_out, and update 13158 next_out, avail_out and total_out to reflect the 13159 compressed data that has been placed there. If flush is 13160 not Z_NO_FLUSH, and avail_out indicates that there is 13161 still space in output buffer, this action shall always 13162 occur (see below for further details). 13163 13164 The deflate() function shall return when either avail_in 13165 reaches zero (indicating that all the input data has been 13166 compressed), or avail_out reaches zero (indicating that the 13167 output buffer is full). 13168 13169 On success, the deflate() function shall set the adler field 13170 of the stream to the adler32() checksum of all the input data 13171 compressed so far (represented by total_in). 13172 13173 If the deflate() function shall attempt to determine the type 13174 of input data, and set field data_type in stream to Z_ASCII if 13175 the majority of the data bytes fall within the ASCII (ISO 646) 13176 printable character range. Otherwise, it shall set data_type 13177 to Z_BINARY. This data type is informational only, and does 13178 not affect the compression algorithm. 13179 13180 Note: Future versions of the LSB may remove this 13181 requirement, since it is based on an outdated character set 13182 that does not support Internationalization, and does not 13183 affect the algorithm. It is included for information only 13184 at this release. Applications should not depend on this 13185 field. 13186 13187 Flush Operation 13188 13189 The parameter flush determines when compressed bits are added 13190 to the output buffer in next_out. If flush is Z_NO_FLUSH, 13191 deflate() may return with some data pending output, and not 13192 yet added to the output buffer. 13193 13194 If flush is Z_SYNC_FLUSH, deflate() shall flush all pending 13195 output to next_out and align the output to a byte boundary. A 13196 synchronization point is generated in the output. 13197 13198 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 13199 Z_SYNC_FLUSH, and the compression state shall be reset. A 13200 synchronization point is generated in the output. 13201 13202 Rationale: Z_SYNC_FLUSH is intended to ensure that the 13203 compressed data contains all the data compressed so far, 13204 and allows a decompressor to reconstruct all of the input 13205 data. Z_FULL_FLUSH allows decompression to restart from 13206 this point if the previous compressed data has been lost or 13207 damaged. Flushing is likely to degrade the performance of 13208 the compression system, and should only be used where 13209 necessary. 13210 13211 If flush is set to Z_FINISH, all pending input shall be 13212 processed and deflate() shall return with Z_STREAM_END if 13213 there is sufficient space in the output buffer at next_out, as 13214 indicated by avail_out. If deflate() is called with flush set 13215 to Z_FINISH and there is insufficient space to store the 13216 compressed data, and no other error has occurred during 13217 compression, deflate() shall return Z_OK, and the application 13218 should call deflate() again with flush unchanged, and having 13219 updated next_out and avail_out. 13220 13221 If all the compression is to be done in a single step, 13222 deflate() may be called with flush set to Z_FINISH immediately 13223 after the stream has been initialized if avail_out is set to 13224 at least the value returned by deflateBound(). 13225 13226 Return Value 13227 13228 On success, deflate() shall return Z_OK, unless flush was set 13229 to Z_FINISH and there was sufficient space in the output 13230 buffer to compress all of the input data. In this case, 13231 deflate() shall return Z_STREAM_END. On error, deflate() shall 13232 return a value to indicate the error. 13233 13234 Note: If deflate() returns Z_OK and has set avail_out to 13235 zero, the function should be called again with the same 13236 value for flush, and with updated next_out and avail_out 13237 until deflate() returns with Z_OK (or Z_STREAM_END if flush 13238 is set to Z_FINISH) and a non-zero avail_out. 13239 13240 Errors 13241 13242 On error, deflate() shall return a value as described below, 13243 and set the msg field of stream to point to a string 13244 describing the error: 13245 13246 Z_BUF_ERROR 13247 No progress is possible; either avail_in or avail_out 13248 was zero. 13249 13250 Z_MEM_ERROR 13251 Insufficient memory. 13252 13253 Z_STREAM_ERROR 13254 The state (as represented in stream) is inconsistent, 13255 or stream was NULL. 13256 13257 deflateBound 13258 13259 Name 13260 13261 deflateBound -- compute compressed data size 13262 13263 Synopsis 13264 13265 #include 13266 13267 int deflateBound(z_streamp stream, uLong sourceLen); 13268 13269 Description 13270 13271 The deflateBound() function shall estimate the size of buffer 13272 required to compress sourceLen bytes of data. If successful, 13273 the value returned shall be an upper bound for the size of 13274 buffer required to compress sourceLen bytes of data, using the 13275 parameters stored in stream, in a single call to deflate() 13276 with flush set to Z_FINISH. 13277 13278 On entry, stream should have been initialized via a call to 13279 deflateInit_() or deflateInit2_(). 13280 13281 Return Value 13282 13283 The deflateBound() shall return a value representing the upper 13284 bound of an array to allocate to hold the compressed data in a 13285 single call to deflate(). If the stream is not correctly 13286 initialized, or is NULL, then deflateBound() may return a 13287 conservative value that may be larger than sourceLen. 13288 13289 Errors 13290 13291 None defined. 13292 13293 deflateCopy 13294 13295 Name 13296 13297 deflateCopy -- copy compression stream 13298 13299 Synopsis 13300 13301 #include 13302 13303 int deflateCopy(z_streamp dest, z_streamp source); 13304 13305 Description 13306 13307 The deflateCopy() function shall copy the compression state 13308 information in source to the uninitialized z_stream structure 13309 referenced by dest. 13310 13311 On successful return, dest will be an exact copy of the stream 13312 referenced by source. The input and output buffer pointers in 13313 next_in and next_out will reference the same data. 13314 13315 Return Value 13316 13317 On success, deflateCopy() shall return Z_OK. Otherwise it 13318 shall return a value less than zero to indicate the error. 13319 13320 Errors 13321 13322 On error, deflateCopy() shall return a value as described 13323 below: 13324 13325 Z_STREAM_ERROR 13326 The state in source is inconsistent, or either source 13327 or dest was NULL. 13328 13329 Z_MEM_ERROR 13330 Insufficient memory available. 13331 13332 Application Usage (informative) 13333 13334 This function can be useful when several compression 13335 strategies will be tried, for example when there are several 13336 ways of pre-processing the input data with a filter. The 13337 streams that will be discarded should then be freed by calling 13338 deflateEnd(). Note that deflateCopy() duplicates the internal 13339 compression state which can be quite large, so this strategy 13340 may be slow and can consume lots of memory. 13341 13342 deflateEnd 13343 13344 Name 13345 13346 deflateEnd -- free compression stream state 13347 13348 Synopsis 13349 13350 #include 13351 13352 int deflateEnd(z_streamp stream); 13353 13354 Description 13355 13356 The deflateEnd() function shall free all allocated state 13357 information referenced by stream. All pending output is 13358 discarded, and unprocessed input is ignored. 13359 13360 Return Value 13361 13362 On success, deflateEnd() shall return Z_OK, or Z_DATA_ERROR if 13363 there was pending output discarded or input unprocessed. 13364 Otherwise it shall return Z_STREAM_ERROR to indicate the 13365 error. 13366 13367 Errors 13368 13369 On error, deflateEnd() shall return Z_STREAM_ERROR. The 13370 following conditions shall be treated as an error: 13371 13372 * The state in stream is inconsistent or inappropriate. 13373 * stream is NULL. 13374 13375 deflateInit2_ 13376 13377 Name 13378 13379 deflateInit2_ -- initialize compression system 13380 13381 Synopsis 13382 13383 #include 13384 13385 int deflateInit2_ (z_streamp strm, int level, int method, int 13386 windowBits, int memLevel, int strategy, char * version, int 13387 stream_size); 13388 13389 Description 13390 13391 The deflateInit2_() function shall initialize the compression 13392 system. On entry, strm shall refer to a user supplied z_stream 13393 object (a z_stream_s structure). The following fields shall be 13394 set on entry: 13395 13396 zalloc 13397 a pointer to an alloc_func function, used to allocate 13398 state information. If this is NULL, a default 13399 allocation function will be used. 13400 13401 zfree 13402 a pointer to a free_func function, used to free memory 13403 allocated by the zalloc function. If this is NULL a 13404 default free function will be used. 13405 13406 opaque 13407 If alloc_func is not NULL, opaque is a user supplied 13408 pointer to data that will be passed to the alloc_func 13409 and free_func functions. 13410 13411 If the version requested is not compatible with the version 13412 implemented, or if the size of the z_stream_s structure 13413 provided in stream_size does not match the size in the library 13414 implementation, deflateInit2_() shall fail, and return 13415 Z_VERSION_ERROR. 13416 13417 The level supplied shall be a value between 0 and 9, or the 13418 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 13419 speed, while a level of 9 requests the highest compression. A 13420 level of 0 indicates that no compression should be used, and 13421 the output shall be the same as the input. 13422 13423 The method selects the compression algorithm to use. LSB 13424 conforming implementation shall support the Z_DEFLATED method, 13425 and may support other implementation defined methods. 13426 13427 The windowBits parameter shall be a base 2 logarithm of the 13428 window size to use, and shall be a value between 8 and 15. A 13429 smaller value will use less memory, but will result in a 13430 poorer compression ratio, while a higher value will give 13431 better compression but utilize more memory. 13432 13433 The memLevel parameter specifies how much memory to use for 13434 the internal state. The value of memLevel shall be between 1 13435 and MAX_MEM_LEVEL. Smaller values use less memory but are 13436 slower, while higher values use more memory to gain 13437 compression speed. 13438 13439 The strategy parameter selects the compression strategy to 13440 use: 13441 13442 Z_DEFAULT_STRATEGY 13443 use the system default compression strategy. 13444 Z_DEFAULT_STRATEGY is particularly appropriate for text 13445 data. 13446 13447 Z_FILTERED 13448 use a compression strategy tuned for data consisting 13449 largely of small values with a fairly random 13450 distribution. Z_FILTERED uses more Huffman encoding and 13451 less string matching than Z_DEFAULT_STRATEGY. 13452 13453 Z_HUFFMAN_ONLY 13454 force Huffman encoding only, with no string match. 13455 13456 The deflateInit2_() function is not in the source standard; it 13457 is only in the binary standard. Source applications should use 13458 the deflateInit2() macro. 13459 13460 Return Value 13461 13462 On success, the deflateInit2_() function shall return Z_OK. 13463 Otherwise, deflateInit2_() shall return a value as described 13464 below to indicate the error. 13465 13466 Errors 13467 13468 On error, deflateInit2_() shall return one of the following 13469 error indicators: 13470 13471 Z_STREAM_ERROR 13472 Invalid parameter. 13473 13474 Z_MEM_ERROR 13475 Insufficient memory available. 13476 13477 Z_VERSION_ERROR 13478 The version requested is not compatible with the 13479 library version, or the z_stream size differs from that 13480 used by the library. 13481 13482 In addition, the msg field of the strm may be set to an error 13483 message. 13484 13485 deflateInit_ 13486 13487 Name 13488 13489 deflateInit_ -- initialize compression system 13490 13491 Synopsis 13492 13493 #include 13494 13495 int deflateInit_(z_streamp stream, int level, const char * 13496 version, int stream_size); 13497 13498 Description 13499 13500 The deflateInit_() function shall initialize the compression 13501 system. On entry, stream shall refer to a user supplied 13502 z_stream object (a z_stream_s structure). The following fields 13503 shall be set on entry: 13504 13505 zalloc 13506 a pointer to an alloc_func function, used to allocate 13507 state information. If this is NULL, a default 13508 allocation function will be used. 13509 13510 zfree 13511 a pointer to a free_func function, used to free memory 13512 allocated by the zalloc function. If this is NULL a 13513 default free function will be used. 13514 13515 opaque 13516 If alloc_func is not NULL, opaque is a user supplied 13517 pointer to data that will be passed to the alloc_func 13518 and free_func functions. 13519 13520 If the version requested is not compatible with the version 13521 implemented, or if the size of the z_stream_s structure 13522 provided in stream_size does not match the size in the library 13523 implementation, deflateInit_() shall fail, and return 13524 Z_VERSION_ERROR. 13525 13526 The level supplied shall be a value between 0 and 9, or the 13527 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 13528 speed, while a level of 9 requests the highest compression. A 13529 level of 0 indicates that no compression should be used, and 13530 the output shall be the same as the input. 13531 13532 The deflateInit_() function is not in the source standard; it 13533 is only in the binary standard. Source applications should use 13534 the deflateInit() macro. 13535 13536 The deflateInit_() function is equivalent to 13537 deflateInit2_(stream, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, 13538 Z_DEFAULT_STRATEGY, version, stream_size); 13539 13540 Return Value 13541 13542 On success, the deflateInit_() function shall return Z_OK. 13543 Otherwise, deflateInit_() shall return a value as described 13544 below to indicate the error. 13545 13546 Errors 13547 13548 On error, deflateInit_() shall return one of the following 13549 error indicators: 13550 13551 Z_STREAM_ERROR 13552 Invalid parameter. 13553 13554 Z_MEM_ERROR 13555 Insufficient memory available. 13556 13557 Z_VERSION_ERROR 13558 The version requested is not compatible with the 13559 library version, or the z_stream size differs from that 13560 used by the library. 13561 13562 In addition, the msg field of the stream may be set to an 13563 error message. 13564 13565 deflateParams 13566 13567 Name 13568 13569 deflateParams -- set compression parameters 13570 13571 Synopsis 13572 13573 #include 13574 13575 int deflateParams(z_streamp stream, int level, int strategy); 13576 13577 Description 13578 13579 The deflateParams() function shall dynamically alter the 13580 compression parameters for the compression stream object 13581 stream. On entry, stream shall refer to a user supplied 13582 z_stream object (a z_stream_s structure), already initialized 13583 via a call to deflateInit_() or deflateInit2_(). 13584 13585 The level supplied shall be a value between 0 and 9, or the 13586 value Z_DEFAULT_COMPRESSION. A level of 1 requests the highest 13587 speed, while a level of 9 requests the highest compression. A 13588 level of 0 indicates that no compression should be used, and 13589 the output shall be the same as the input. If the compression 13590 level is altered by deflateParams(), and some data has already 13591 been compressed with this stream (i.e. total_in is not zero), 13592 and the new level requires a different underlying compression 13593 method, then stream shall be flushed by a call to deflate(). 13594 13595 The strategy parameter selects the compression strategy to 13596 use: 13597 13598 Z_DEFAULT_STRATEGY 13599 use the system default compression strategy. 13600 Z_DEFAULT_STRATEGY is particularly appropriate for text 13601 data. 13602 13603 Z_FILTERED 13604 use a compression strategy tuned for data consisting 13605 largely of small values with a fairly random 13606 distribution. Z_FILTERED uses more Huffman encoding and 13607 less string matching than Z_DEFAULT_STRATEGY. 13608 13609 Z_HUFFMAN_ONLY 13610 force Huffman encoding only, with no string match. 13611 13612 Return Value 13613 13614 On success, the deflateParams() function shall return Z_OK. 13615 Otherwise, deflateParams() shall return a value as described 13616 below to indicate the error. 13617 13618 Errors 13619 13620 On error, deflateParams() shall return one of the following 13621 error indicators: 13622 13623 Z_STREAM_ERROR 13624 Invalid parameter. 13625 13626 Z_MEM_ERROR 13627 Insufficient memory available. 13628 13629 Z_BUF_ERROR 13630 Insufficient space in stream to flush the current 13631 output. 13632 13633 In addition, the msg field of the strm may be set to an error 13634 message. 13635 13636 Application Usage (Informative) 13637 13638 Applications should ensure that the stream is flushed, e.g. by 13639 a call to deflate(stream, Z_SYNC_FLUSH) before calling 13640 deflateParams(), or ensure that there is sufficient space in 13641 next_out (as identified by avail_out) to ensure that all 13642 pending output and all uncompressed input can be flushed in a 13643 single call to deflate(). 13644 13645 Rationale: Although the deflateParams() function should 13646 flush pending output and compress all pending input, the 13647 result is unspecified if there is insufficient space in the 13648 output buffer. Applications should only call 13649 deflateParams() when the stream is effectively empty 13650 (flushed). 13651 13652 The deflateParams() can be used to switch between 13653 compression and straight copy of the input data, or to 13654 switch to a different kind of input data requiring a 13655 different strategy. 13656 13657 deflateReset 13658 13659 Name 13660 13661 deflateReset -- reset compression stream state 13662 13663 Synopsis 13664 13665 #include 13666 13667 int deflateReset(z_streamp stream); 13668 13669 Description 13670 13671 The deflateReset() function shall reset all state associated 13672 with stream. All pending output shall be discarded, and the 13673 counts of processed bytes (total_in and total_out) shall be 13674 reset to zero. 13675 13676 Return Value 13677 13678 On success, deflateReset() shall return Z_OK. Otherwise it 13679 shall return Z_STREAM_ERROR to indicate the error. 13680 13681 Errors 13682 13683 On error, deflateReset() shall return Z_STREAM_ERROR. The 13684 following conditions shall be treated as an error: 13685 13686 * The state in stream is inconsistent or inappropriate. 13687 * stream is NULL. 13688 13689 deflateSetDictionary 13690 13691 Name 13692 13693 deflateSetDictionary -- initialize compression dictionary 13694 13695 Synopsis 13696 13697 #include 13698 13699 int deflateSetDictionary(z_streamp stream, const Bytef * 13700 dictionary, uInt dictlen); 13701 13702 Description 13703 13704 The deflateSetDictionary() function shall initialize the 13705 compression dictionary associated with stream using the 13706 dictlen bytes referenced by dictionary. 13707 13708 The implementation may silently use a subset of the provided 13709 dictionary if the dictionary cannot fit in the current window 13710 associated with stream (see deflateInit2_()). The application 13711 should ensure that the dictionary is sorted such that the most 13712 commonly used strings occur at the end of the dictionary. 13713 13714 If the dictionary is successfully set, the Adler32 checksum of 13715 the entire provided dictionary shall be stored in the adler 13716 member of stream. This value may be used by the decompression 13717 system to select the correct dictionary. The compression and 13718 decompression systems must use the same dictionary. 13719 13720 stream shall reference an initialized compression stream, with 13721 total_in zero (i.e. no data has been compressed since the 13722 stream was initialized). 13723 13724 Return Value 13725 13726 On success, deflateSetDictionary() shall return Z_OK. 13727 Otherwise it shall return Z_STREAM_ERROR to indicate an error. 13728 13729 Errors 13730 13731 On error, deflateSetDictionary() shall return a value as 13732 described below: 13733 13734 Z_STREAM_ERROR 13735 The state in stream is inconsistent, or stream was 13736 NULL. 13737 13738 Application Usage (informative) 13739 13740 The application should provide a dictionary consisting of 13741 strings {{{ed note: do we really mean "strings"? Null 13742 terminated?}}} that are likely to be encountered in the data 13743 to be compressed. The application should ensure that the 13744 dictionary is sorted such that the most commonly used strings 13745 occur at the end of the dictionary. 13746 13747 The use of a dictionary is optional; however if the data to be 13748 compressed is relatively short and has a predictable 13749 structure, the use of a dictionary can substantially improve 13750 the compression ratio. 13751 13752 get_crc_table 13753 13754 Name 13755 13756 get_crc_table -- generate a table for crc calculations 13757 13758 Synopsis 13759 13760 #include 13761 13762 const uLongf * get_crc_table(void); 13763 13764 Description 13765 13766 Generate tables for a byte-wise 32-bit CRC calculation based 13767 on the polynomial: 13768 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+ 13769 1 13770 13771 In a multi-threaded application, get_crc_table() should be 13772 called by one thread to initialize the tables before any other 13773 thread calls any libz function. 13774 13775 Return Value 13776 13777 The get_crc_table() function shall return a pointer to the 13778 first of a set of tables used internally to calculate CRC-32 13779 values (see crc32()). 13780 13781 Errors 13782 13783 None defined. 13784 13785 gzclose 13786 13787 Name 13788 13789 gzclose -- close a compressed file stream 13790 13791 Synopsis 13792 13793 #include 13794 13795 int gzclose (gzFile file ); 13796 13797 Description 13798 13799 The gzclose() function shall close the compressed file stream 13800 file. If file was open for writing, gzclose() shall first 13801 flush any pending output. Any state information allocated 13802 shall be freed. 13803 13804 Return Value 13805 13806 On success, gzclose() shall return Z_OK. Otherwise, gzclose() 13807 shall return an error value as described below. 13808 13809 Errors 13810 13811 On error, gzclose() may set the global variable errno to 13812 indicate the error. The gzclose() shall return a value other 13813 than Z_OK on error. 13814 13815 Z_STREAM_ERROR 13816 file was NULL (or Z_NULL), or did not refer to an open 13817 compressed file stream. 13818 13819 Z_ERRNO 13820 An error occurred in the underlying base libraries, and 13821 the application should check errno for further 13822 information. 13823 13824 Z_BUF_ERROR 13825 no compression progress is possible during buffer flush 13826 (see deflate()). 13827 13828 gzdopen 13829 13830 Name 13831 13832 gzdopen -- open a compressed file 13833 13834 Synopsis 13835 13836 #include 13837 13838 gzFile gzdopen ( int fd, const char *mode ); 13839 13840 Description 13841 13842 The gzdopen() function shall attempt to associate the open 13843 file referenced by fd with a gzFile object. The mode argument 13844 is based on that of fopen(), but the mode parameter may also 13845 contain the following characters: 13846 13847 digit 13848 set the compression level to digit. A low value (e.g. 13849 1) means high speed, while a high value (e.g. 9) means 13850 high compression. A compression level of 0 (zero) means 13851 no compression. See defaultInit2_() for further 13852 details. 13853 13854 [fhR] 13855 set the compression strategy to [fhR]. The letter f 13856 corresponds to filtered data, the letter h corresponds 13857 to Huffman only compression, and the letter R 13858 corresponds to Run Length Encoding. See defaultInit2_() 13859 for further details. 13860 13861 If fd refers to an uncompressed file, and mode refers to a 13862 read mode, gzdopen() shall attempt to open the file and return 13863 a gzFile object suitable for reading directly from the file 13864 without any decompression. 13865 13866 If mode is NULL, or if mode does not contain one of r, w, or 13867 a, gzdopen() shall return Z_NULL, and need not set any other 13868 error condition. 13869 13870 Example 13871 13872 gzdopen(fileno(stdin), "r"); 13873 13874 Attempt to associate the standard input with a gzFile object. 13875 13876 Return Value 13877 13878 On success, gzdopen() shall return a gzFile object. On 13879 failure, gzdopen() shall return Z_NULL and may set errno 13880 accordingly. 13881 13882 Note: At version 1.2.2, zlib does not set errno for several 13883 error conditions. Applications may not be able to determine 13884 the cause of an error. 13885 13886 Errors 13887 13888 On error, gzdopen() may set the global variable errno to 13889 indicate the error. 13890 13891 gzeof 13892 13893 Name 13894 13895 gzeof -- check for end-of-file on a compressed file stream 13896 13897 Synopsis 13898 13899 #include 13900 13901 int gzeof (gzFile file ); 13902 13903 Description 13904 13905 The gzeof() function shall test the compressed file stream 13906 file for end of file. 13907 13908 Return Value 13909 13910 If file was open for reading and end of file has been reached, 13911 gzeof() shall return 1. Otherwise, gzeof() shall return 0. 13912 13913 Errors 13914 13915 None defined. 13916 13917 gzerror 13918 13919 Name 13920 13921 gzerror -- decode an error on a compressed file stream 13922 13923 Synopsis 13924 13925 #include 13926 13927 const char * gzerror (gzFile file, int * errnum); 13928 13929 Description 13930 13931 The gzerror() function shall return a string describing the 13932 last error to have occurred associated with the open 13933 compressed file stream referred to by file. It shall also set 13934 the location referenced by errnum to an integer value that 13935 further identifies the error. 13936 13937 Return Value 13938 13939 The gzerror() function shall return a string that describes 13940 the last error associated with the given file compressed file 13941 stream. This string shall have the format "%s: %s", with the 13942 name of the file, followed by a colon, a space, and the 13943 description of the error. If the compressed file stream was 13944 opened by a call to gzdopen(), the format of the filename is 13945 unspecified. 13946 13947 Rationale: Although in all current implementations of libz 13948 file descriptors are named "", the code suggests 13949 that this is for debugging purposes only, and may change in 13950 a future release. 13951 13952 It is unspecified if the string returned is determined by the 13953 setting of the LC_MESSAGES category in the current locale. 13954 13955 Errors 13956 13957 None defined. 13958 13959 gzflush 13960 13961 Name 13962 13963 gzflush -- flush a compressed file stream 13964 13965 Synopsis 13966 13967 #include 13968 13969 int gzflush(gzFile file, int flush); 13970 13971 Description 13972 13973 The gzflush() function shall flush pending output to the 13974 compressed file stream identified by file, which must be open 13975 for writing. 13976 13977 Flush Operation 13978 13979 The parameter flush determines which compressed bits are added 13980 to the output file. If flush is Z_NO_FLUSH, gzflush() may 13981 return with some data pending output, and not yet written to 13982 the file. 13983 13984 If flush is Z_SYNC_FLUSH, gzflush() shall flush all pending 13985 output to file and align the output to a byte boundary. There 13986 may still be data pending compression that is not flushed. 13987 13988 If flush is Z_FULL_FLUSH, all output shall be flushed, as for 13989 Z_SYNC_FLUSH, and the compression state shall be reset. There 13990 may still be data pending compression that is not flushed. 13991 13992 Rationale: Z_SYNC_FLUSH is intended to ensure that the 13993 compressed data contains all the data compressed so far, 13994 and allows a decompressor to reconstruct all of the input 13995 data. Z_FULL_FLUSH allows decompression to restart from 13996 this point if the previous compressed data has been lost or 13997 damaged. Flushing is likely to degrade the performance of 13998 the compression system, and should only be used where 13999 necessary. 14000 14001 If flush is set to Z_FINISH, all pending uncompressed data 14002 shall be compressed and all output shall be flushed. 14003 14004 Return Value 14005 14006 On success, gzflush() shall return the value Z_OK. Otherwise 14007 gzflush() shall return a value to indicate the error, and may 14008 set the error number associated with the compressed file 14009 stream file. 14010 14011 Note: If flush is set to Z_FINISH and the flush operation 14012 is successful, gzflush() will return Z_OK, but the 14013 compressed file stream error value may be set to 14014 Z_STREAM_END. 14015 14016 Errors 14017 14018 On error, gzwrite() shall return an error value, and may set 14019 the error number associated with the stream identified by file 14020 to indicate the error. Applications may use gzerror() to 14021 access this error value. 14022 14023 Z_ERRNO 14024 An underlying base library function has indicated an 14025 error. The global variable errno may be examined for 14026 further information. 14027 14028 Z_STREAM_ERROR 14029 The stream is invalid, is not open for writing, or is 14030 in an invalid state. 14031 14032 Z_BUF_ERROR 14033 no compression progress is possible (see deflate()). 14034 14035 Z_MEM_ERROR 14036 Insufficient memory available to compress. 14037 14038 gzgetc 14039 14040 Name 14041 14042 gzgetc -- read a character from a compressed file 14043 14044 Synopsis 14045 14046 #include 14047 14048 int gzgetc (gzFile file); 14049 14050 Description 14051 14052 The gzgetc() function shall read the next single character 14053 from the compressed file stream referenced by file, which 14054 shall have been opened in a read mode (see gzopen() and 14055 gzdopen()). 14056 14057 Return Value 14058 14059 On success, gzgetc() shall return the uncompressed character 14060 read, otherwise, on end of file or error, gzgetc() shall 14061 return -1. 14062 14063 Errors 14064 14065 On end of file or error, gzgetc() shall return -1. Further 14066 information can be found by calling gzerror() with a pointer 14067 to the compressed file stream. 14068 14069 gzgets 14070 14071 Name 14072 14073 gzgets -- read a string from a compressed file 14074 14075 Synopsis 14076 14077 #include 14078 14079 char * gzgets (gzFile file, char * buf, int len); 14080 14081 Description 14082 14083 The gzgets() function shall attempt to read data from the 14084 compressed file stream file, uncompressing it into buf until 14085 either len-1 bytes have been inserted into buf, or until a 14086 newline character has been uncompressed into buf. A null byte 14087 shall be appended to the uncompressed data. The file shall 14088 have been opened in for reading (see gzopen() and gzdopen()). 14089 14090 Return Value 14091 14092 On success, gzgets() shall return a pointer to buf. Otherwise, 14093 gzgets() shall return Z_NULL. Applications may examine the 14094 cause using gzerror(). 14095 14096 Errors 14097 14098 On error, gzgets() shall return Z_NULL. The following 14099 conditions shall always be treated as an error: 14100 14101 file is NULL, or does not refer to a file open for reading; 14102 buf is NULL; 14103 len is less than or equal to zero. 14104 14105 gzopen 14106 14107 Name 14108 14109 gzopen -- open a compressed file 14110 14111 Synopsis 14112 14113 #include 14114 14115 gzFile gzopen (const char *path , const char *mode ); 14116 14117 Description 14118 14119 The gzopen() function shall open the compressed file named by 14120 path. The mode argument is based on that of fopen(), but the 14121 mode parameter may also contain the following characters: 14122 14123 digit 14124 set the compression level to digit. A low value (e.g. 14125 1) means high speed, while a high value (e.g. 9) means 14126 high compression. A compression level of 0 (zero) means 14127 no compression. See defaultInit2_() for further 14128 details. 14129 14130 [fhR] 14131 set the compression strategy to [fhR]. The letter f 14132 corresponds to filtered data, the letter h corresponds 14133 to Huffman only compression, and the letter R 14134 corresponds to Run Length Encoding. See defaultInit2_() 14135 for further details. 14136 14137 If path refers to an uncompressed file, and mode refers to a 14138 read mode, gzopen() shall attempt to open the file and return 14139 a gzFile object suitable for reading directly from the file 14140 without any decompression. 14141 14142 If path or mode is NULL, or if mode does not contain one of r, 14143 w, or a, gzopen() shall return Z_NULL, and need not set any 14144 other error condition. 14145 14146 The gzFile object is also referred to as a compressed file 14147 stream. 14148 14149 Example 14150 14151 gzopen("file.gz", "w6h"); 14152 14153 Attempt to create a new compressed file, file.gz, at 14154 compression level 6 using Huffman only compression. 14155 14156 Return Value 14157 14158 On success, gzopen() shall return a gzFile object (also known 14159 as a compressed file stream). On failure, gzopen() shall 14160 return Z_NULL and may set errno accordingly. 14161 14162 Note: At version 1.2.2, zlib does not set errno for several 14163 error conditions. Applications may not be able to determine 14164 the cause of an error. 14165 14166 Errors 14167 14168 On error, gzopen() may set the global variable errno to 14169 indicate the error. 14170 14171 gzprintf 14172 14173 Name 14174 14175 gzprintf -- format data and compress 14176 14177 Synopsis 14178 14179 #include 14180 14181 int gzprintf (gzFile file, const char * fmt, ...); 14182 14183 Description 14184 14185 The gzprintf() function shall format data as for fprintf(), 14186 and write the resulting string to the compressed file stream 14187 file. 14188 14189 Return Value 14190 14191 The gzprintf() function shall return the number of 14192 uncompressed bytes actually written, or a value less than or 14193 equal to 0 in the event of an error. 14194 14195 Errors 14196 14197 If file is NULL, or refers to a compressed file stream that 14198 has not been opened for writing, gzprintf() shall return 14199 Z_STREAM_ERROR. Otherwise, errors are as for gzwrite(). 14200 14201 gzputc 14202 14203 Name 14204 14205 gzputc -- write character to a compressed file 14206 14207 Synopsis 14208 14209 #include 14210 14211 int gzputc (gzFile file, int c); 14212 14213 Description 14214 14215 The gzputc() function shall write the single character c, 14216 converted from integer to unsigned character, to the 14217 compressed file referenced by file, which shall have been 14218 opened in a write mode (see gzopen() and gzdopen()). 14219 14220 Return Value 14221 14222 On success, gzputc() shall return the value written, otherwise 14223 gzputc() shall return -1. 14224 14225 Errors 14226 14227 On error, gzputc() shall return -1. 14228 14229 gzputs 14230 14231 Name 14232 14233 gzputs -- string write to a compressed file 14234 14235 Synopsis 14236 14237 #include 14238 14239 int gzputs (gzFile file, const char * s); 14240 14241 Description 14242 14243 The gzputs() function shall write the null terminated string s 14244 to the compressed file referenced by file, which shall have 14245 been opened in a write mode (see gzopen() and gzdopen()). The 14246 terminating null character shall not be written. The gzputs() 14247 function shall return the number of uncompressed bytes 14248 actually written. 14249 14250 Return Value 14251 14252 On success, gzputs() shall return the number of uncompressed 14253 bytes actually written to file. On error gzputs() shall return 14254 a value less than or equal to 0. Applications may examine the 14255 cause using gzerror(). 14256 14257 Errors 14258 14259 On error, gzputs() shall set the error number associated with 14260 the stream identified by file to indicate the error. 14261 Applications should use gzerror() to access this error value. 14262 If file is NULL, gzputs() shall return Z_STREAM_ERR. 14263 14264 Z_ERRNO 14265 An underlying base library function has indicated an 14266 error. The global variable errno may be examined for 14267 further information. 14268 14269 Z_STREAM_ERROR 14270 The stream is invalid, is not open for writing, or is 14271 in an invalid state. 14272 14273 Z_BUF_ERROR 14274 no compression progress is possible (see deflate()). 14275 14276 Z_MEM_ERROR 14277 Insufficient memory available to compress. 14278 14279 gzread 14280 14281 Name 14282 14283 gzread -- read from a compressed file 14284 14285 Synopsis 14286 14287 #include 14288 14289 int gzread (gzFile file, voidp buf, unsigned int len); 14290 14291 Description 14292 14293 The gzread() function shall read data from the compressed file 14294 referenced by file, which shall have been opened in a read 14295 mode (see gzopen() and gzdopen()). The gzread() function shall 14296 read data from file, and uncompress it into buf. At most, len 14297 bytes of uncompressed data shall be copied to buf. If the file 14298 is not compressed, gzread() shall simply copy data from file 14299 to buf without alteration. 14300 14301 Return Value 14302 14303 On success, gzread() shall return the number of bytes 14304 decompressed into buf. If gzread() returns 0, either the 14305 end-of-file has been reached or an underlying read error has 14306 occurred. Applications should use gzerror() or gzeof() to 14307 determine which occurred. On other errors, gzread() shall 14308 return a value less than 0 and and applications may examine 14309 the cause using gzerror(). 14310 14311 Errors 14312 14313 On error, gzread() shall set the error number associated with 14314 the stream identified by file to indicate the error. 14315 Applications should use gzerror() to access this error value. 14316 14317 Z_ERRNO 14318 An underlying base library function has indicated an 14319 error. The global variable errno may be examined for 14320 further information. 14321 14322 Z_STREAM_END 14323 End of file has been reached on input. 14324 14325 Z_DATA_ERROR 14326 A CRC error occurred when reading data; the file is 14327 corrupt. 14328 14329 Z_STREAM_ERROR 14330 The stream is invalid, or is in an invalid state. 14331 14332 Z_NEED_DICT 14333 A dictionary is needed (see inflateSetDictionary()). 14334 14335 Z_MEM_ERROR 14336 Insufficient memory available to decompress. 14337 14338 gzrewind 14339 14340 Name 14341 14342 gzrewind -- reset the file-position indicator on a compressed 14343 file stream 14344 14345 Synopsis 14346 14347 #include 14348 14349 int gzrewind(gzFile file); 14350 14351 Description 14352 14353 The gzrewind() function shall set the starting position for 14354 the next read on compressed file stream file to the beginning 14355 of file. file must be open for reading. 14356 14357 gzrewind() is equivalent to 14358 (int)gzseek(file, 0L, SEEK_SET) 14359 14360 . 14361 14362 Return Value 14363 14364 On success, gzrewind() shall return 0. On error, gzrewind() 14365 shall return -1, and may set the error value for file 14366 accordingly. 14367 14368 Errors 14369 14370 On error, gzrewind() shall return -1, indicating that file is 14371 NULL, or does not represent an open compressed file stream, or 14372 represents a compressed file stream that is open for writing 14373 and is not currently at the beginning of file. 14374 14375 gzseek 14376 14377 Name 14378 14379 gzseek -- reposition a file-position indicator in a compressed 14380 file stream 14381 14382 Synopsis 14383 14384 #include 14385 14386 z_off_t gzseek(gzFile file, z_off_t offset, int whence); 14387 14388 Description 14389 14390 The gzseek() function shall set the file-position indicator 14391 for the compressed file stream file. The file-position 14392 indicator controls where the next read or write operation on 14393 the compressed file stream shall take place. The offset 14394 indicates a byte offset in the uncompressed data. The whence 14395 parameter may be one of: 14396 14397 SEEK_SET 14398 the offset is relative to the start of the uncompressed 14399 data. 14400 14401 SEEK_CUR 14402 the offset is relative to the current positition in the 14403 uncompressed data. 14404 14405 Note: The value SEEK_END need not be supported. 14406 14407 If the file is open for writing, the new offset must be 14408 greater than or equal to the current offset. In this case, 14409 gzseek() shall compress a sequence of null bytes to fill the 14410 gap from the previous offset to the new offset. 14411 14412 Return Value 14413 14414 On success, gzseek() shall return the resulting offset in the 14415 file expressed as a byte position in the uncompressed data 14416 stream. On error, gzseek() shall return -1, and may set the 14417 error value for file accordingly. 14418 14419 Errors 14420 14421 On error, gzseek() shall return -1. The following conditions 14422 shall always result in an error: 14423 14424 * file is NULL 14425 * file does not represent an open compressed file stream. 14426 * file refers to a compressed file stream that is open for 14427 writing, and the newly computed offset is less than the 14428 current offset. 14429 * The newly computed offset is less than zero. 14430 * whence is not one of the supported values. 14431 14432 Application Usage (informative) 14433 14434 If file is open for reading, the implementation may still need 14435 to uncompress all of the data up to the new offset. As a 14436 result, gzseek() may be extremely slow in some circumstances. 14437 14438 gzsetparams 14439 14440 Name 14441 14442 gzsetparams -- dynamically set compression parameters 14443 14444 Synopsis 14445 14446 #include 14447 14448 int gzsetparams (gzFile file, int level, int strategy); 14449 14450 Description 14451 14452 The gzsetparams() function shall set the compression level and 14453 compression strategy on the compressed file stream referenced 14454 by file. The compressed file stream shall have been opened in 14455 a write mode. The level and strategy are as defined in 14456 deflateInit2_. If there is any data pending writing, it shall 14457 be flushed before the parameters are updated. 14458 14459 Return Value 14460 14461 On success, the gzsetparams() function shall return Z_OK. 14462 14463 Errors 14464 14465 On error, gzsetparams() shall return one of the following 14466 error indications: 14467 14468 Z_STREAM_ERROR 14469 Invalid parameter, or file not open for writing. 14470 14471 Z_BUF_ERROR 14472 An internal inconsistency was detected while flushing 14473 the previous buffer. 14474 14475 gztell 14476 14477 Name 14478 14479 gztell -- find position on a compressed file stream 14480 14481 Synopsis 14482 14483 #include 14484 14485 z_off_t gztell (gzFile file ); 14486 14487 Description 14488 14489 The gztell() function shall return the starting position for 14490 the next read or write operation on compressed file stream 14491 file. This position represents the number of bytes from the 14492 beginning of file in the uncompressed data. 14493 14494 gztell() is equivalent to 14495 gzseek(file, 0L, SEEK_SET) 14496 14497 . 14498 14499 Return Value 14500 14501 gztell() shall return the current offset in the file expressed 14502 as a byte position in the uncompressed data stream. On error, 14503 gztell() shall return -1, and may set the error value for file 14504 accordingly. 14505 14506 Errors 14507 14508 On error, gztell() shall return -1, indicating that file is 14509 NULL, or does not represent an open compressed file stream. 14510 14511 gzwrite 14512 14513 Name 14514 14515 gzwrite -- write to a compressed file 14516 14517 Synopsis 14518 14519 #include 14520 14521 int gzwrite (gzFile file, voidpc buf, unsigned int len); 14522 14523 Description 14524 14525 The gzwrite() function shall write data to the compressed file 14526 referenced by file, which shall have been opened in a write 14527 mode (see gzopen() and gzdopen()). On entry, buf shall point 14528 to a buffer containing lenbytes of uncompressed data. The 14529 gzwrite() function shall compress this data and write it to 14530 file. The gzwrite() function shall return the number of 14531 uncompressed bytes actually written. 14532 14533 Return Value 14534 14535 On success, gzwrite() shall return the number of uncompressed 14536 bytes actually written to file. On error gzwrite() shall 14537 return a value less than or equal to 0. Applications may 14538 examine the cause using gzerror(). 14539 14540 Errors 14541 14542 On error, gzwrite() shall set the error number associated with 14543 the stream identified by file to indicate the error. 14544 Applications should use gzerror() to access this error value. 14545 14546 Z_ERRNO 14547 An underlying base library function has indicated an 14548 error. The global variable errno may be examined for 14549 further information. 14550 14551 Z_STREAM_ERROR 14552 The stream is invalid, is not open for writing, or is 14553 in an invalid state. 14554 14555 Z_BUF_ERROR 14556 no compression progress is possible (see deflate()). 14557 14558 Z_MEM_ERROR 14559 Insufficient memory available to compress. 14560 14561 inflate 14562 14563 Name 14564 14565 inflate -- decompress data 14566 14567 Synopsis 14568 14569 #include 14570 14571 int inflate(z_streamp stream, int flush); 14572 14573 Description 14574 14575 The inflate() function shall attempt to decompress data until 14576 either the input buffer is empty or the output buffer is full. 14577 The stream references a z_stream structure. Before the first 14578 call to inflate(), this structure should have been initialized 14579 by a call to inflateInit2_(). 14580 14581 Note: inflateInit2_() is only in the binary standard; 14582 source level applications should initialize stream via a 14583 call to inflateInit() or inflateInit2(). 14584 14585 In addition, the stream input and output buffers should have 14586 been initialized as follows: 14587 14588 next_in 14589 should point to the data to be decompressed. 14590 14591 avail_in 14592 should contain the number of bytes of data in the 14593 buffer referenced by next_in. 14594 14595 next_out 14596 should point to a buffer where decompressed data may be 14597 placed. 14598 14599 avail_out 14600 should contain the size in bytes of the buffer 14601 referenced by next_out 14602 14603 The inflate() function shall perform one or both of the 14604 following actions: 14605 14606 1. Decompress input data from next_in and update next_in, 14607 avail_in and total_in to reflect the data that has been 14608 decompressed. 14609 2. Fill the output buffer referenced by next_out, and update 14610 next_out, avail_out, and total_out to reflect the 14611 decompressed data that has been placed there. If flush is 14612 not Z_NO_FLUSH, and avail_out indicates that there is 14613 still space in output buffer, this action shall always 14614 occur (see below for further details). 14615 14616 The inflate() function shall return when either avail_in 14617 reaches zero (indicating that all the input data has been 14618 compressed), or avail_out reaches zero (indicating that the 14619 output buffer is full). 14620 14621 On success, the inflate() function shall set the adler field 14622 of the stream to the Adler-32 checksum of all the input data 14623 compressed so far (represented by total_in). 14624 14625 Flush Operation 14626 14627 The parameter flush determines when uncompressed bytes are 14628 added to the output buffer in next_out. If flush is 14629 Z_NO_FLUSH, inflate() may return with some data pending 14630 output, and not yet added to the output buffer. 14631 14632 If flush is Z_SYNC_FLUSH, inflate() shall flush all pending 14633 output to next_out, and update next_out and avail_out 14634 accordingly. 14635 14636 If flush is set to Z_BLOCK, inflate() shall stop adding data 14637 to the output buffer if and when the next compressed block 14638 boundary is reached (see RFC 1951: DEFLATE Compressed Data 14639 Format Specification). 14640 14641 If flush is set to Z_FINISH, all of the compressed input shall 14642 be decompressed and added to the output. If there is 14643 insufficient output space (i.e. the compressed input data 14644 uncompresses to more than avail_out bytes), then inflate() 14645 shall fail and return Z_BUF_ERROR. 14646 14647 Return Value 14648 14649 On success, inflate() shall return Z_OK if decompression 14650 progress has been made, or Z_STREAM_END if all of the input 14651 data has been decompressed and there was sufficient space in 14652 the output buffer to store the uncompressed result. On error, 14653 inflate() shall return a value to indicate the error. 14654 14655 Note: If inflate() returns Z_OK and has set avail_out to 14656 zero, the function should be called again with the same 14657 value for flush, and with updated next_out and avail_out 14658 until inflate() returns with either Z_OK or Z_STREAM_END 14659 and a non-zero avail_out. 14660 14661 On success, inflate() shall set the adler to the Adler-32 14662 checksum of the output produced so far (i.e. total_out bytes). 14663 14664 Errors 14665 14666 On error, inflate() shall return a value as described below, 14667 and may set the msg field of stream to point to a string 14668 describing the error: 14669 14670 Z_BUF_ERROR 14671 No progress is possible; either avail_in or avail_out 14672 was zero. 14673 14674 Z_MEM_ERROR 14675 Insufficient memory. 14676 14677 Z_STREAM_ERROR 14678 The state (as represented in stream) is inconsistent, 14679 or stream was NULL. 14680 14681 Z_NEED_DICT 14682 A preset dictionary is required. The adler field shall 14683 be set to the Adler-32 checksum of the dictionary 14684 chosen by the compressor. 14685 14686 inflateEnd 14687 14688 Name 14689 14690 inflateEnd -- free decompression stream state 14691 14692 Synopsis 14693 14694 #include 14695 14696 int inflateEnd(z_streamp stream); 14697 14698 Description 14699 14700 The inflateEnd() function shall free all allocated state 14701 information referenced by stream. All pending output is 14702 discarded, and unprocessed input is ignored. 14703 14704 Return Value 14705 14706 On success, inflateEnd() shall return Z_OK. Otherwise it shall 14707 return Z_STREAM_ERROR to indicate the error. 14708 14709 Errors 14710 14711 On error, inflateEnd() shall return Z_STREAM_ERROR. The 14712 following conditions shall be treated as an error: 14713 14714 * The state in stream is inconsistent. 14715 * stream is NULL. 14716 * The zfree function pointer is NULL. 14717 14718 inflateInit2_ 14719 14720 Name 14721 14722 inflateInit2_ -- initialize decompression system 14723 14724 Synopsis 14725 14726 #include 14727 14728 int inflateInit2_ (z_streamp strm, int windowBits, char * 14729 version, int stream_size); 14730 14731 Description 14732 14733 The inflateInit2_() function shall initialize the 14734 decompression system. On entry, strm shall refer to a user 14735 supplied z_stream object (a z_stream_s structure). The 14736 following fields shall be set on entry: 14737 14738 zalloc 14739 a pointer to an alloc_func function, used to allocate 14740 state information. If this is NULL, a default 14741 allocation function will be used. 14742 14743 zfree 14744 a pointer to a free_func function, used to free memory 14745 allocated by the zalloc function. If this is NULL a 14746 default free function will be used. 14747 14748 opaque 14749 If alloc_func is not NULL, opaque is a user supplied 14750 pointer to data that will be passed to the alloc_func 14751 and free_func functions. 14752 14753 If the version requested is not compatible with the version 14754 implemented, or if the size of the z_stream_s structure 14755 provided in stream_size does not match the size in the library 14756 implementation, inflateInit2_() shall fail, and return 14757 Z_VERSION_ERROR. 14758 14759 The windowBits parameter shall be a base 2 logarithm of the 14760 maximum window size to use, and shall be a value between 8 and 14761 15. If the input data was compressed with a larger window 14762 size, subsequent attempts to decompress this data will fail 14763 with Z_DATA_ERROR, rather than try to allocate a larger 14764 window. 14765 14766 The inflateInit2_() function is not in the source standard; it 14767 is only in the binary standard. Source applications should use 14768 the inflateInit2() macro. 14769 14770 Return Value 14771 14772 On success, the inflateInit2_() function shall return Z_OK. 14773 Otherwise, inflateInit2_() shall return a value as described 14774 below to indicate the error. 14775 14776 Errors 14777 14778 On error, inflateInit2_() shall return one of the following 14779 error indicators: 14780 14781 Z_STREAM_ERROR 14782 Invalid parameter. 14783 14784 Z_MEM_ERROR 14785 Insufficient memory available. 14786 14787 Z_VERSION_ERROR 14788 The version requested is not compatible with the 14789 library version, or the z_stream size differs from that 14790 used by the library. 14791 14792 In addition, the msg field of the strm may be set to an error 14793 message. 14794 14795 inflateInit_ 14796 14797 Name 14798 14799 inflateInit_ -- initialize decompression system 14800 14801 Synopsis 14802 14803 #include 14804 14805 int inflateInit_(z_streamp stream, const char * version, int 14806 stream_size); 14807 14808 Description 14809 14810 The inflateInit_() function shall initialize the decompression 14811 system. On entry, stream shall refer to a user supplied 14812 z_stream object (a z_stream_s structure). The following fields 14813 shall be set on entry: 14814 14815 zalloc 14816 a pointer to an alloc_func function, used to allocate 14817 state information. If this is NULL, a default 14818 allocation function will be used. 14819 14820 zfree 14821 a pointer to a free_func function, used to free memory 14822 allocated by the zalloc function. If this is NULL a 14823 default free function will be used. 14824 14825 opaque 14826 If alloc_func is not NULL, opaque is a user supplied 14827 pointer to data that will be passed to the alloc_func 14828 and free_func functions. 14829 14830 If the version requested is not compatible with the version 14831 implemented, or if the size of the z_stream_s structure 14832 provided in stream_size does not match the size in the library 14833 implementation, inflateInit_() shall fail, and return 14834 Z_VERSION_ERROR. 14835 14836 The inflateInit_() function is not in the source standard; it 14837 is only in the binary standard. Source applications should use 14838 the inflateInit() macro. 14839 14840 The inflateInit_() shall be equivalent to 14841 inflateInit2_(strm, DEF_WBITS, version, stream_size); 14842 14843 Return Value 14844 14845 On success, the inflateInit_() function shall return Z_OK. 14846 Otherwise, inflateInit_() shall return a value as described 14847 below to indicate the error. 14848 14849 Errors 14850 14851 On error, inflateInit_() shall return one of the following 14852 error indicators: 14853 14854 Z_STREAM_ERROR 14855 Invalid parameter. 14856 14857 Z_MEM_ERROR 14858 Insufficient memory available. 14859 14860 Z_VERSION_ERROR 14861 The version requested is not compatible with the 14862 library version, or the z_stream size differs from that 14863 used by the library. 14864 14865 In addition, the msg field of the strm may be set to an error 14866 message. 14867 14868 inflateReset 14869 14870 Name 14871 14872 inflateReset -- reset decompression stream state 14873 14874 Synopsis 14875 14876 #include 14877 14878 int inflateReset(z_streamp stream); 14879 14880 Description 14881 14882 The inflateReset() function shall reset all state associated 14883 with stream. All pending output shall be discarded, and the 14884 counts of processed bytes (total_in and total_out) shall be 14885 reset to zero. 14886 14887 Return Value 14888 14889 On success, inflateReset() shall return Z_OK. Otherwise it 14890 shall return Z_STREAM_ERROR to indicate the error. 14891 14892 Errors 14893 14894 On error, inflateReset() shall return Z_STREAM_ERROR. The 14895 following conditions shall be treated as an error: 14896 14897 * The state in stream is inconsistent or inappropriate. 14898 * stream is NULL. 14899 14900 inflateSetDictionary 14901 14902 Name 14903 14904 inflateSetDictionary -- initialize decompression dictionary 14905 14906 Synopsis 14907 14908 #include 14909 14910 int inflateSetDictionary(z_streamp stream, const Bytef * 14911 dictionary, uInt dictlen); 14912 14913 Description 14914 14915 The inflateSetDictionary() function shall initialize the 14916 decompression dictionary associated with stream using the 14917 dictlen bytes referenced by dictionary. 14918 14919 The inflateSetDictionary() function should be called 14920 immediately after a call to inflate() has failed with return 14921 value Z_NEED_DICT. The dictionary must have the same Adler-32 14922 checksum as the dictionary used for the compression (see 14923 deflateSetDictionary()). 14924 14925 stream shall reference an initialized decompression stream, 14926 with total_in zero (i.e. no data has been decompressed since 14927 the stream was initialized). 14928 14929 Return Value 14930 14931 On success, inflateSetDictionary() shall return Z_OK. 14932 Otherwise it shall return a value as indicated below. 14933 14934 Errors 14935 14936 On error, inflateSetDictionary() shall return a value as 14937 described below: 14938 14939 Z_STREAM_ERROR 14940 The state in stream is inconsistent, or stream was 14941 NULL. 14942 14943 Z_DATA_ERROR 14944 The Adler-32 checksum of the supplied dictionary does 14945 not match that used for the compression. 14946 14947 Application Usage (informative) 14948 14949 The application should provide a dictionary consisting of 14950 strings {{{ed note: do we really mean "strings"? Null 14951 terminated?}}} that are likely to be encountered in the data 14952 to be compressed. The application should ensure that the 14953 dictionary is sorted such that the most commonly used strings 14954 occur at the end of the dictionary. 14955 14956 The use of a dictionary is optional; however if the data to be 14957 compressed is relatively short and has a predictable 14958 structure, the use of a dictionary can substantially improve 14959 the compression ratio. 14960 14961 inflateSync 14962 14963 Name 14964 14965 inflateSync -- advance compression stream to next sync point 14966 14967 Synopsis 14968 14969 #include 14970 14971 int inflateSync(z_streamp stream); 14972 14973 Description 14974 14975 The inflateSync() function shall advance through the 14976 compressed data in stream, skipping any invalid compressed 14977 data, until the next full flush point is reached, or all input 14978 is exhausted. See the description for deflate() with flush 14979 level Z_FULL_FLUSH. No output is placed in next_out. 14980 14981 Return Value 14982 14983 On success, inflateSync() shall return Z_OK, and update the 14984 next_in,, avail_in, and, total_in fields of stream to reflect 14985 the number of bytes of compressed data that have been skipped. 14986 Otherwise, inflateSync() shall return a value as described 14987 below to indicate the error. 14988 14989 Errors 14990 14991 On error, inflateSync() shall return a value as described 14992 below: 14993 14994 Z_STREAM_ERROR 14995 The state (as represented in stream) is inconsistent, 14996 or stream was NULL. 14997 14998 Z_BUF_ERROR 14999 There is no data available to skip over. 15000 15001 Z_DATA_ERROR 15002 No sync point was found. 15003 15004 inflateSyncPoint 15005 15006 Name 15007 15008 inflateSyncPoint -- test for synchronization point 15009 15010 Synopsis 15011 15012 #include 15013 15014 int inflateSyncPoint(z_streamp stream); 15015 15016 Description 15017 15018 The inflateSyncPoint() function shall return a non-zero calue 15019 if the compressed data stream referenced by stream is at a 15020 synchronization point. 15021 15022 Return Value 15023 15024 If the compressed data in stream is at a synchronization point 15025 (see deflate() with a flush level of Z_SYNC_FLUSH or 15026 Z_FULL_FLUSH), inflateSyncPoint() shall return a non-zero 15027 value, other than Z_STREAM_ERROR. Otherwise, if the stream is 15028 valid, inflateSyncPoint() shall return 0. If stream is 15029 invalid, or in an invalid state, inflateSyncPoint() shall 15030 return Z_STREAM_ERROR to indicate the error. 15031 15032 Errors 15033 15034 On error, inflateSyncPoint() shall return a value as described 15035 below: 15036 15037 Z_STREAM_ERROR 15038 The state (as represented in stream) is inconsistent, 15039 or stream was NULL. 15040 15041 uncompress 15042 15043 Name 15044 15045 uncompress -- uncompress data 15046 15047 Synopsis 15048 15049 #include 15050 15051 int uncompress(Bytef * dest, uLongf * destLen, const Bytef * 15052 source, uLong sourceLen); 15053 15054 Description 15055 15056 The uncompress() function shall attempt to uncompress 15057 sourceLen bytes of data in the buffer source, placing the 15058 result in the buffer dest. 15059 15060 On entry, destLen should point to a value describing the size 15061 of the dest buffer. The application should ensure that this 15062 value is large enough to hold the entire uncompressed data. 15063 15064 Note: The LSB does not describe any mechanism by which a 15065 compressor can communicate the size required to the 15066 uncompressor. 15067 15068 On successful exit, the variable referenced by destLen shall 15069 be updated to hold the length of uncompressed data in dest. 15070 15071 Return Value 15072 15073 On success, uncompress() shall return Z_OK. Otherwise, 15074 uncompress() shall return a value to indicate the error. 15075 15076 Errors 15077 15078 On error, uncompress() shall return a value as described 15079 below: 15080 15081 Z_BUF_ERROR 15082 The buffer dest was not large enough to hold the 15083 uncompressed data. 15084 15085 Z_MEM_ERROR 15086 Insufficient memory. 15087 15088 Z_DATA_ERROR 15089 The compressed data (referenced by source) was 15090 corrupted. 15091 15092 zError 15093 15094 Name 15095 15096 zError -- translate error number to string 15097 15098 Synopsis 15099 15100 #include 15101 15102 const char * zError(int err); 15103 15104 Description 15105 15106 The zError() function shall return the string identifying the 15107 error associated with err. This allows for conversion from 15108 error code to string for functions such as compress() and 15109 uncompress(), that do not always set the string version of an 15110 error. 15111 15112 Return Value 15113 15114 The zError() function shall return a the string identifying 15115 the error associated with err, or NULL if err is not a valid 15116 error code. 15117 15118 It is unspecified if the string returned is determined by the 15119 setting of the LC_MESSAGES category in the current locale. 15120 15121 Errors 15122 15123 None defined. 15124 15125 zlibVersion 15126 15127 Name 15128 15129 zlibVersion -- discover library version at run time 15130 15131 Synopsis 15132 15133 #include 15134 15135 const char * zlibVersion (void); 15136 15137 Description 15138 15139 The zlibVersion() function shall return the string identifying 15140 the interface version at the time the library was built. 15141 15142 Applications should compare the value returned from 15143 zlibVersion() with the macro constant ZLIB_VERSION for 15144 compatibility. 15145 15146 Return Value 15147 15148 The zlibVersion() function shall return a the string 15149 identifying the version of the library currently implemented. 15150 15151 Errors 15152 15153 None defined. 15154 _________________________________________________________ 15155 15156 2.5. Interfaces for libncurses 15157 15158 Table 2-3 defines the library name and shared object name for 15159 the libncurses library 15160 15161 Table 2-3. libncurses Definition 15162 Library: libncurses 15163 SONAME: libncurses.so.5 15164 15165 The behavior of the interfaces in this library is specified by 15166 the following specifications: 15167 15168 X/Open Curses 15169 _________________________________________________________ 15170 15171 2.5.1. Curses 15172 _________________________________________________________ 15173 15174 2.5.1.1. Interfaces for Curses 15175 15176 An LSB conforming implementation shall provide the generic 15177 functions for Curses specified in Table 2-4, with the full 15178 mandatory functionality as described in the referenced 15179 underlying specification. 15180 15181 Table 2-4. libncurses - Curses Function Interfaces 15182 addch [1] has_ic [1] mvwaddchnstr [1] scr_init [1] vwscanw [1] 15183 addchnstr [1] has_il [1] mvwaddchstr [1] scr_restore [1] 15184 waddch [1] 15185 addchstr [1] hline [1] mvwaddnstr [1] scr_set [1] waddchnstr 15186 [1] 15187 addnstr [1] idcok [1] mvwaddstr [1] scrl [1] waddchstr [1] 15188 addstr [1] idlok [1] mvwchgat [1] scroll [1] waddnstr [1] 15189 attr_get [1] immedok [1] mvwdelch [1] scrollok [1] waddstr [1] 15190 attr_off [1] inch [1] mvwgetch [1] set_curterm [1] wattr_get 15191 [1] 15192 attr_on [1] inchnstr [1] mvwgetnstr [1] set_term [1] wattr_off 15193 [1] 15194 attr_set [1] inchstr [1] mvwgetstr [1] setscrreg [1] wattr_on 15195 [1] 15196 attroff [1] init_color [1] mvwhline [1] setupterm [1] 15197 wattr_set [1] 15198 attron [1] init_pair [1] mvwin [1] slk_attr_set [1] wattroff 15199 [1] 15200 attrset [1] initscr [1] mvwinch [1] slk_attroff [1] wattron 15201 [1] 15202 baudrate [1] innstr [1] mvwinchnstr [1] slk_attron [1] 15203 wattrset [1] 15204 beep [1] insch [1] mvwinchstr [1] slk_attrset [1] wbkgd [1] 15205 bkgd [1] insdelln [1] mvwinnstr [1] slk_clear [1] wbkgdset [1] 15206 bkgdset [1] insertln [1] mvwinsch [1] slk_color [1] wborder 15207 [1] 15208 border [1] insnstr [1] mvwinsnstr [1] slk_init [1] wchgat [1] 15209 box [1] insstr [1] mvwinsstr [1] slk_label [1] wclear [1] 15210 can_change_color [1] instr [1] mvwinstr [1] slk_noutrefresh 15211 [1] wclrtobot [1] 15212 cbreak [1] intrflush [1] mvwprintw [1] slk_refresh [1] 15213 wclrtoeol [1] 15214 chgat [1] is_linetouched [1] mvwscanw [1] slk_restore [1] 15215 wcolor_set [1] 15216 clear [1] is_wintouched [1] mvwvline [1] slk_set [1] 15217 wcursyncup [1] 15218 clearok [1] isendwin [1] napms [1] slk_touch [1] wdelch [1] 15219 clrtobot [1] keyname [1] newpad [1] standend [1] wdeleteln [1] 15220 clrtoeol [1] keypad [1] newterm [1] standout [1] wechochar [1] 15221 color_content [1] killchar [1] newwin [1] start_color [1] 15222 werase [1] 15223 color_set [1] leaveok [1] nl [1] subpad [1] wgetch [1] 15224 copywin [1] longname [1] nocbreak [1] subwin [1] wgetnstr [1] 15225 curs_set [1] meta [1] nodelay [1] syncok [1] wgetstr [1] 15226 def_prog_mode [1] move [1] noecho [1] termattrs [1] whline [1] 15227 def_shell_mode [1] mvaddch [1] nonl [1] termname [1] winch [1] 15228 del_curterm [1] mvaddchnstr [1] noqiflush [1] tgetent [1] 15229 winchnstr [1] 15230 delay_output [1] mvaddchstr [1] noraw [1] tgetflag [1] 15231 winchstr [1] 15232 delch [1] mvaddnstr [1] notimeout [1] tgetnum [1] winnstr [1] 15233 deleteln [1] mvaddstr [1] overlay [1] tgetstr [1] winsch [1] 15234 delscreen [1] mvchgat [1] overwrite [1] tgoto [1] winsdelln 15235 [1] 15236 delwin [1] mvcur [1] pair_content [1] tigetflag [1] winsertln 15237 [1] 15238 derwin [1] mvdelch [1] pechochar [1] tigetnum [1] winsnstr [1] 15239 doupdate [1] mvderwin [1] pnoutrefresh [1] tigetstr [1] 15240 winsstr [1] 15241 dupwin [1] mvgetch [1] prefresh [1] timeout [1] winstr [1] 15242 echo [1] mvgetnstr [1] printw [1] touchline [1] wmove [1] 15243 echochar [1] mvgetstr [1] putp [1] touchwin [1] wnoutrefresh 15244 [1] 15245 endwin [1] mvhline [1] putwin [1] tparm [1] wprintw [1] 15246 erase [1] mvinch [1] qiflush [1] tputs [1] wredrawln [1] 15247 erasechar [1] mvinchnstr [1] raw [1] typeahead [1] wrefresh 15248 [1] 15249 filter [1] mvinchstr [1] redrawwin [1] unctrl [1] wscanw [1] 15250 flash [1] mvinnstr [1] refresh [1] ungetch [1] wscrl [1] 15251 flushinp [1] mvinsch [1] reset_prog_mode [1] untouchwin [1] 15252 wsetscrreg [1] 15253 getbkgd [1] mvinsnstr [1] reset_shell_mode [1] use_env [1] 15254 wstandend [1] 15255 getch [1] mvinsstr [1] resetty [1] vidattr [1] wstandout [1] 15256 getnstr [1] mvinstr [1] restartterm [1] vidputs [1] wsyncdown 15257 [1] 15258 getstr [1] mvprintw [1] ripoffline [1] vline [1] wsyncup [1] 15259 getwin [1] mvscanw [1] savetty [1] vw_printw [1] wtimeout [1] 15260 halfdelay [1] mvvline [1] scanw [1] vw_scanw [1] wtouchln [1] 15261 has_colors [1] mvwaddch [1] scr_dump [1] vwprintw [1] wvline 15262 [1] 15263 15264 Referenced Specification(s) 15265 15266 [1]. X/Open Curses 15267 15268 An LSB conforming implementation shall provide the generic 15269 data interfaces for Curses specified in Table 2-5, with the 15270 full mandatory functionality as described in the referenced 15271 underlying specification. 15272 15273 Table 2-5. libncurses - Curses Data Interfaces 15274 COLORS [1] COLS [1] acs_map [1] curscr [1] 15275 COLOR_PAIRS [1] LINES [1] cur_term [1] stdscr [1] 15276 15277 Referenced Specification(s) 15278 15279 [1]. X/Open Curses 15280 _________________________________________________________ 15281 15282 2.6. Data Definitions for libncurses 15283 15284 This section defines global identifiers and their values that 15285 are associated with interfaces contained in libncurses. These 15286 definitions are organized into groups that correspond to 15287 system headers. This convention is used as a convenience for 15288 the reader, and does not imply the existence of these headers, 15289 or their content. 15290 15291 These definitions are intended to supplement those provided in 15292 the referenced underlying specifications. 15293 15294 This specification uses ISO/IEC 9899 C Language as the 15295 reference programming language, and data definitions are 15296 specified in ISO C format. The C language is used here as a 15297 convenient notation. Using a C language description of these 15298 data objects does not preclude their use by other programming 15299 languages. 15300 _________________________________________________________ 15301 15302 2.6.1. curses.h 15303 15304 #define ERR (-1) 15305 #define OK (0) 15306 #define ACS_RARROW (acs_map['+']) 15307 #define ACS_LARROW (acs_map[',']) 15308 #define ACS_UARROW (acs_map['-']) 15309 #define ACS_DARROW (acs_map['.']) 15310 #define ACS_BLOCK (acs_map['0']) 15311 #define ACS_CKBOARD (acs_map['a']) 15312 #define ACS_DEGREE (acs_map['f']) 15313 #define ACS_PLMINUS (acs_map['g']) 15314 #define ACS_BOARD (acs_map['h']) 15315 #define ACS_LANTERN (acs_map['i']) 15316 #define ACS_LRCORNER (acs_map['j']) 15317 #define ACS_URCORNER (acs_map['k']) 15318 #define ACS_ULCORNER (acs_map['l']) 15319 #define ACS_LLCORNER (acs_map['m']) 15320 #define ACS_PLUS (acs_map['n']) 15321 #define ACS_S1 (acs_map['o']) 15322 #define ACS_HLINE (acs_map['q']) 15323 #define ACS_S9 (acs_map['s']) 15324 #define ACS_LTEE (acs_map['t']) 15325 #define ACS_RTEE (acs_map['u']) 15326 #define ACS_BTEE (acs_map['v']) 15327 #define ACS_TTEE (acs_map['w']) 15328 #define ACS_VLINE (acs_map['x']) 15329 #define ACS_DIAMOND (acs_map['`']) 15330 #define ACS_BULLET (acs_map['~']) 15331 #define getmaxyx(win,y,x) (y=(win)?((win)->_maxy+1):ERR,x=(win)?( 15332 (win)->_maxx+1):ERR) 15333 #define getbegyx(win,y,x) (y=(win)?(win)->_begy:ERR,x=(win)?(win) 15334 ->_begx:ERR) 15335 #define getyx(win,y,x) (y=(win)?(win)->_cury:ERR,x=(win)?(win)->_curx: 15336 ERR) 15337 #define getparyx(win,y,x) (y=(win)?(win)->_pary:ERR,x=(win)?(win) 15338 ->_parx:ERR) 15339 15340 #define WA_ALTCHARSET A_ALTCHARSET 15341 #define WA_ATTRIBUTES A_ATTRIBUTES 15342 #define WA_BLINK A_BLINK 15343 #define WA_BOLD A_BOLD 15344 #define WA_DIM A_DIM 15345 #define WA_HORIZONTAL A_HORIZONTAL 15346 #define WA_INVIS A_INVIS 15347 #define WA_LEFT A_LEFT 15348 #define WA_LOW A_LOW 15349 #define WA_NORMAL A_NORMAL 15350 #define WA_PROTECT A_PROTECT 15351 #define WA_REVERSE A_REVERSE 15352 #define WA_RIGHT A_RIGHT 15353 #define WA_STANDOUT A_STANDOUT 15354 #define WA_TOP A_TOP 15355 #define WA_UNDERLINE A_UNDERLINE 15356 #define WA_VERTICAL A_VERTICAL 15357 #define A_REVERSE NCURSES_BITS(1UL,10) 15358 15359 #define COLOR_BLACK 0 15360 #define COLOR_RED 1 15361 #define COLOR_GREEN 2 15362 #define COLOR_YELLOW 3 15363 #define COLOR_BLUE 4 15364 #define COLOR_MAGENTA 5 15365 #define COLOR_CYAN 6 15366 #define COLOR_WHITE 7 15367 15368 #define _SUBWIN 0x01 15369 #define _ENDLINE 0x02 15370 #define _FULLWIN 0x04 15371 #define _ISPAD 0x10 15372 #define _HASMOVED 0x20 15373 15374 typedef unsigned char bool; 15375 15376 typedef unsigned long int chtype; 15377 typedef struct screen SCREEN; 15378 typedef struct _win_st WINDOW; 15379 typedef chtype attr_t; 15380 typedef struct 15381 { 15382 attr_t attr; 15383 wchar_t chars[5]; 15384 } 15385 cchar_t; 15386 struct pdat 15387 { 15388 short _pad_y; 15389 short _pad_x; 15390 short _pad_top; 15391 short _pad_left; 15392 short _pad_bottom; 15393 short _pad_right; 15394 } 15395 ; 15396 15397 struct _win_st 15398 { 15399 short _cury; 15400 short _curx; 15401 short _maxy; 15402 short _maxx; 15403 short _begy; 15404 short _begx; 15405 short _flags; 15406 attr_t _attrs; 15407 chtype _bkgd; 15408 bool _notimeout; 15409 bool _clear; 15410 bool _leaveok; 15411 bool _scroll; 15412 bool _idlok; 15413 bool _idcok; 15414 bool _immed; 15415 bool _sync; 15416 bool _use_keypad; 15417 int _delay; 15418 struct ldat *_line; 15419 short _regtop; 15420 short _regbottom; 15421 int _parx; 15422 int _pary; 15423 WINDOW *_parent; 15424 struct pdat _pad; 15425 short _yoffset; 15426 cchar_t _bkgrnd; 15427 } 15428 ; 15429 #define KEY_CODE_YES 0400 15430 #define KEY_BREAK 0401 15431 #define KEY_MIN 0401 15432 #define KEY_DOWN 0402 15433 #define KEY_UP 0403 15434 #define KEY_LEFT 0404 15435 #define KEY_RIGHT 0405 15436 #define KEY_HOME 0406 15437 #define KEY_BACKSPACE 0407 15438 #define KEY_F0 0410 15439 #define KEY_DL 0510 15440 #define KEY_IL 0511 15441 #define KEY_DC 0512 15442 #define KEY_IC 0513 15443 #define KEY_EIC 0514 15444 #define KEY_CLEAR 0515 15445 #define KEY_EOS 0516 15446 #define KEY_EOL 0517 15447 #define KEY_SF 0520 15448 #define KEY_SR 0521 15449 #define KEY_NPAGE 0522 15450 #define KEY_PPAGE 0523 15451 #define KEY_STAB 0524 15452 #define KEY_CTAB 0525 15453 #define KEY_CATAB 0526 15454 #define KEY_ENTER 0527 15455 #define KEY_SRESET 0530 15456 #define KEY_RESET 0531 15457 #define KEY_PRINT 0532 15458 #define KEY_LL 0533 15459 #define KEY_A1 0534 15460 #define KEY_A3 0535 15461 #define KEY_B2 0536 15462 #define KEY_C1 0537 15463 #define KEY_C3 0540 15464 #define KEY_BTAB 0541 15465 #define KEY_BEG 0542 15466 #define KEY_CANCEL 0543 15467 #define KEY_CLOSE 0544 15468 #define KEY_COMMAND 0545 15469 #define KEY_COPY 0546 15470 #define KEY_CREATE 0547 15471 #define KEY_END 0550 15472 #define KEY_EXIT 0551 15473 #define KEY_FIND 0552 15474 #define KEY_HELP 0553 15475 #define KEY_MARK 0554 15476 #define KEY_MESSAGE 0555 15477 #define KEY_MOVE 0556 15478 #define KEY_NEXT 0557 15479 #define KEY_OPEN 0560 15480 #define KEY_OPTIONS 0561 15481 #define KEY_PREVIOUS 0562 15482 #define KEY_REDO 0563 15483 #define KEY_REFERENCE 0564 15484 #define KEY_REFRESH 0565 15485 #define KEY_REPLACE 0566 15486 #define KEY_RESTART 0567 15487 #define KEY_RESUME 0570 15488 #define KEY_SAVE 0571 15489 #define KEY_SBEG 0572 15490 #define KEY_SCANCEL 0573 15491 #define KEY_SCOMMAND 0574 15492 #define KEY_SCOPY 0575 15493 #define KEY_SCREATE 0576 15494 #define KEY_SDC 0577 15495 #define KEY_SDL 0600 15496 #define KEY_SELECT 0601 15497 #define KEY_SEND 0602 15498 #define KEY_SEOL 0603 15499 #define KEY_SEXIT 0604 15500 #define KEY_SFIND 0605 15501 #define KEY_SHELP 0606 15502 #define KEY_SHOME 0607 15503 #define KEY_SIC 0610 15504 #define KEY_SLEFT 0611 15505 #define KEY_SMESSAGE 0612 15506 #define KEY_SMOVE 0613 15507 #define KEY_SNEXT 0614 15508 #define KEY_SOPTIONS 0615 15509 #define KEY_SPREVIOUS 0616 15510 #define KEY_SPRINT 0617 15511 #define KEY_SREDO 0620 15512 #define KEY_SREPLACE 0621 15513 #define KEY_SRIGHT 0622 15514 #define KEY_SRSUME 0623 15515 #define KEY_SSAVE 0624 15516 #define KEY_SSUSPEND 0625 15517 #define KEY_SUNDO 0626 15518 #define KEY_SUSPEND 0627 15519 #define KEY_UNDO 0630 15520 #define KEY_MOUSE 0631 15521 #define KEY_RESIZE 0632 15522 #define KEY_MAX 0777 15523 15524 #define PAIR_NUMBER(a) (((a)& A_COLOR)>>8) 15525 #define NCURSES_BITS(mask,shift) ((mask)<<((shift)+8)) 15526 #define A_CHARTEXT (NCURSES_BITS(1UL,0)-1UL) 15527 #define A_NORMAL 0L 15528 #define NCURSES_ATTR_SHIFT 8 15529 #define A_COLOR NCURSES_BITS(((1UL)<<8)-1UL,0) 15530 #define A_BLINK NCURSES_BITS(1UL,11) 15531 #define A_DIM NCURSES_BITS(1UL,12) 15532 #define A_BOLD NCURSES_BITS(1UL,13) 15533 #define A_ALTCHARSET NCURSES_BITS(1UL,14) 15534 #define A_INVIS NCURSES_BITS(1UL,15) 15535 #define A_PROTECT NCURSES_BITS(1UL,16) 15536 #define A_HORIZONTAL NCURSES_BITS(1UL,17) 15537 #define A_LEFT NCURSES_BITS(1UL,18) 15538 #define A_LOW NCURSES_BITS(1UL,19) 15539 #define A_RIGHT NCURSES_BITS(1UL,20) 15540 #define A_TOP NCURSES_BITS(1UL,21) 15541 #define A_VERTICAL NCURSES_BITS(1UL,22) 15542 #define A_STANDOUT NCURSES_BITS(1UL,8) 15543 #define A_UNDERLINE NCURSES_BITS(1UL,9) 15544 #define COLOR_PAIR(n) NCURSES_BITS(n,0) 15545 #define A_ATTRIBUTES NCURSES_BITS(~(1UL-1UL),0) 15546 _________________________________________________________ 15547 15548 2.7. Interfaces for libutil 15549 15550 Table 2-6 defines the library name and shared object name for 15551 the libutil library 15552 15553 Table 2-6. libutil Definition 15554 Library: libutil 15555 SONAME: libutil.so.1 15556 15557 The behavior of the interfaces in this library is specified by 15558 the following specifications: 15559 15560 this specification 15561 _________________________________________________________ 15562 15563 2.7.1. Utility Functions 15564 _________________________________________________________ 15565 15566 2.7.1.1. Interfaces for Utility Functions 15567 15568 An LSB conforming implementation shall provide the generic 15569 functions for Utility Functions specified in Table 2-7, with 15570 the full mandatory functionality as described in the 15571 referenced underlying specification. 15572 15573 Table 2-7. libutil - Utility Functions Function Interfaces 15574 forkpty [1] login_tty [1] logwtmp [1] 15575 login [1] logout [1] openpty [1] 15576 15577 Referenced Specification(s) 15578 15579 [1]. this specification 15580 _________________________________________________________ 15581 15582 2.8. Interface Definitions for libutil 15583 15584 Table of Contents 15585 forkpty -- Create a new process attached to an available 15586 pseudo-terminal 15587 15588 login -- login utility function 15589 login_tty -- Prepare a terminal for login 15590 logout -- logout utility function 15591 logwtmp -- append an entry to the wtmp file 15592 openpty -- find and open an available pseudo-terminal 15593 15594 The following interfaces are included in libutil and are 15595 defined by this specification. Unless otherwise noted, these 15596 interfaces shall be included in the source standard. 15597 15598 Other interfaces listed above for libutil shall behave as 15599 described in the referenced base document. 15600 15601 forkpty 15602 15603 Name 15604 15605 forkpty -- Create a new process attached to an available 15606 pseudo-terminal 15607 15608 Synopsis 15609 15610 #include 15611 15612 int forkpty(int * amaster, char * name, struct termios * 15613 termp, struct winsize * winp); 15614 15615 Description 15616 15617 The forkpty() function shall find and open a pseudo-terminal 15618 device pair in the same manner as the openpty() function. If a 15619 pseudo-terminal is available, forkpty() shall create a new 15620 process in the same manner as the fork() function, and 15621 prepares the new process for login in the same manner as 15622 login_tty(). 15623 15624 If termp is not null, it shall refer to a termios structure 15625 that shall be used to initialize the characteristics of the 15626 slave device. If winp is not null, it shall refer to a winsize 15627 structure used to initialize the window size of the slave 15628 device. 15629 15630 Return Value 15631 15632 On success, the parent process shall return the process id of 15633 the child, and the child shall return 0. On error, no new 15634 process shall be created, -1 shall be returned, and errno 15635 shall be set appropriately. On success, the parent process 15636 shall receive the file descriptor of the master side of the 15637 pseudo-terminal in the location referenced by amaster, and, if 15638 name is not NULL, the filename of the slave device in name. 15639 15640 Errors 15641 15642 EAGAIN 15643 Unable to create a new process. 15644 15645 ENOENT 15646 There are no available pseudo-terminals. 15647 15648 ENOMEM 15649 Insufficient memory was available. 15650 15651 login 15652 15653 Name 15654 15655 login -- login utility function 15656 15657 Synopsis 15658 15659 #include 15660 15661 void login (struct utmp * ut ); 15662 15663 Description 15664 15665 The login() function shall update the user accounting 15666 databases. The ut parameter shall reference a utmp structure 15667 for all fields except the following: 15668 15669 1. The ut_type field shall be set to USER_PROCESS. 15670 2. The ut_pid field shall be set to the process identifier 15671 for the current process. 15672 3. The ut_line field shall be set to the name of the 15673 controlling terminal device. The name shall be found by 15674 examining the device associated with the standard input, 15675 output and error streams in sequence, until one associated 15676 with a terminal device is found. If none of these streams 15677 refers to a terminal device, the ut_line field shall be 15678 set to "???". If the terminal device is in the /dev 15679 directory hierarchy, the ut_line field shall not contain 15680 the leading "/dev/", otherwise it shall be set to the 15681 final component of the pathname of the device. If the user 15682 accounting database imposes a limit on the size of the 15683 ut_line field, it shall truncate the name, but any such 15684 limit shall not be smaller than UT_LINESIZE (including a 15685 terminating null character). 15686 15687 Return Value 15688 15689 None 15690 15691 Errors 15692 15693 None 15694 15695 login_tty 15696 15697 Name 15698 15699 login_tty -- Prepare a terminal for login 15700 15701 Synopsis 15702 15703 #include 15704 15705 int login_tty (int fdr); 15706 15707 Description 15708 15709 The login_tty() function shall prepare the terminal device 15710 referenced by the file descriptor fdr. This function shall 15711 create a new session, make the terminal the controlling 15712 terminal for the current process, and set the standard input, 15713 output, and error streams of the current process to the 15714 terminal. If fdr is not the standard input, output or error 15715 stream, then login_tty() shall close fdr. 15716 15717 Return Value 15718 15719 On success, login_tty() shall return zero; otherwise -1 is 15720 returned, and errno shall be set appropriately. 15721 15722 Errors 15723 15724 ENOTTY 15725 fdr does not refer to a terminal device. 15726 15727 logout 15728 15729 Name 15730 15731 logout -- logout utility function 15732 15733 Synopsis 15734 15735 #include 15736 15737 int logout (const char * line ); 15738 15739 Description 15740 15741 Given the device line, the logout() function shall search the 15742 user accounting database which is read by getutent() for an 15743 entry with the corresponding line, and with the type of 15744 USER_PROCESS. If a corresponding entry is located, it shall be 15745 updated as follows: 15746 15747 1. The ut_name field shall be set to zeroes (UT_NAMESIZE NUL 15748 bytes). 15749 2. The ut_host field shall be set to zeroes (UT_HOSTSIZE NUL 15750 bytes). 15751 3. The ut_tv shall be set to the current time of day. 15752 4. The ut_type field shall be set to DEAD_PROCESS. 15753 15754 Return Value 15755 15756 On success, the logout() function shall return non-zero. Zero 15757 is returned if there was no entry to remove, or if the utmp 15758 file could not be opened or updated. 15759 15760 logwtmp 15761 15762 Name 15763 15764 logwtmp -- append an entry to the wtmp file 15765 15766 Synopsis 15767 15768 #include 15769 15770 void logwtmp (const char * line , const char * name , const 15771 char * host ); 15772 15773 Description 15774 15775 If the process has permission to update the user accounting 15776 databases, the logwtmp() function shall append a record to the 15777 user accounting database that records all logins and logouts. 15778 The record to be appended shall be constructed as follows: 15779 15780 1. The ut_line field shall be initialized from line. If the 15781 user accounting database imposes a limit on the size of 15782 the ut_line field, it shall truncate the value, but any 15783 such limit shall not be smaller than UT_LINESIZE 15784 (including a terminating null character). 15785 2. The ut_name field shall be initialized from name. If the 15786 user accounting database imposes a limit on the size of 15787 the ut_name field, it shall truncate the value, but any 15788 such limit shall not be smaller than UT_NAMESIZE 15789 (including a terminating null character). 15790 3. The ut_host field shall be initialized from host. If the 15791 user accounting database imposes a limit on the size of 15792 the ut_host field, it shall truncate the value, but any 15793 such limit shall not be smaller than UT_HOSTSIZE 15794 (including a terminating null character). 15795 4. If the name parameter does not refer to an empty string 15796 (i.e. ""), the ut_type field shall be set to USER_PROCESS; 15797 otherwise the ut_type field shall be set to DEAD_PROCESS. 15798 5. The ut_id field shall be set to the process identifier for 15799 the current process. 15800 6. The ut_tv field shall be set to the current time of day. 15801 15802 Note: If a process does not have write access to the the 15803 user accounting database, the logwtmp() function will not 15804 update it. Since the function does not return any value, an 15805 application has no way of knowing whether it succeeded or 15806 failed. 15807 15808 Return Value 15809 15810 None. 15811 15812 openpty 15813 15814 Name 15815 15816 openpty -- find and open an available pseudo-terminal 15817 15818 Synopsis 15819 15820 #include 15821 15822 int openpty(int *amaster, int *aslave, char *name, struct 15823 termios *termp, struct winsize *winp); 15824 15825 Description 15826 15827 The openpty() function shall find an available pseudo-terminal 15828 and return file descriptors for the master and slave devices 15829 in the locations referenced by amaster and aslave 15830 respectively. If name is not NULL, the filename of the slave 15831 shall be placed in the user supplied buffer referenced by 15832 name. If termp is not NULL, it shall point to a termios 15833 structure used to initialize the terminal parameters of the 15834 slave pseudo-terminal device. If winp is not NULL, it shall 15835 point to a winsize structure used to initialize the window 15836 size parameters of the slave pseudo-terminal device. 15837 15838 Return Value 15839 15840 On success, zero is returned. On error, -1 is returned, and 15841 errno is set appropriately. 15842 15843 Errors 15844 15845 ENOENT 15846 There are no available pseudo-terminals. 15847 15848 III. Commands and Utilities 15849 15850 Table of Contents 15851 3. Commands and Utilities 15852 _________________________________________________________ 15853 15854 Chapter 3. Commands and Utilities 15855 15856 3.1. Commands and Utilities 15857 15858 An LSB conforming implementation shall provide the commands 15859 and utilities as described in Table 3-1, with at least the 15860 behavior described as mandatory in the referenced underlying 15861 specification, with the following execptions: 15862 15863 1. If any operand (except one which follows --) starts with a 15864 hyphen, the behavior is unspecified. 15865 15866 Rationale (Informative): Applications should place options 15867 before operands, or use --, as needed. This text is needed 15868 because, by default, GNU option parsing differs from POSIX, 15869 unless the environment variable POSIXLY_CORRECT is set. For 15870 example, ls . -a in GNU ls means to list the current 15871 directory, showing all files (that is, "." is an operand 15872 and -a is an option). In POSIX, "." and -a are both 15873 operands, and the command means to list the current 15874 directory, and also the file named -a. Suggesting that 15875 applications rely on the setting of the POSIXLY_CORRECT 15876 environment variable, or try to set it, seems worse than 15877 just asking the applictions to invoke commands in ways 15878 which work with either the POSIX or GNU behaviors. 15879 15880 Table 3-1. Commands And Utilities 15881 [ [1] dmesg [2] id [1] more [2] sleep [1] 15882 ar [2] du [2] install [2] mount [2] sort [1] 15883 at [2] echo [2] install_initd [2] msgfmt [2] split [1] 15884 awk [2] ed [1] ipcrm [2] mv [1] strip [1] 15885 basename [1] egrep [2] ipcs [2] newgrp [2] stty [1] 15886 batch [2] env [1] join [1] nice [1] su [2] 15887 bc [2] expand [1] kill [1] nl [1] sync [2] 15888 cat [1] expr [1] killall [2] nohup [1] tail [1] 15889 chfn [2] false [1] ln [1] od [2] tar [2] 15890 chgrp [2] fgrep [2] locale [1] passwd [2] tee [1] 15891 chmod [1] file [2] localedef [1] paste [1] test [1] 15892 chown [2] find [2] logger [1] patch [2] time [1] 15893 chsh [2] fold [1] logname [1] pathchk [1] touch [1] 15894 cksum [1] fuser [2] lp [1] pax [1] tr [1] 15895 cmp [1] gencat [1] lpr [2] pidof [2] true [1] 15896 col [2] getconf [1] ls [2] pr [1] tsort [1] 15897 comm [1] gettext [2] lsb_release [2] printf [1] tty [1] 15898 cp [1] grep [2] lsbinstall [2] ps [1] umount [2] 15899 cpio [2] groupadd [2] m4 [2] pwd [1] uname [1] 15900 crontab [2] groupdel [2] mailx [1] remove_initd [2] unexpand 15901 [1] 15902 csplit [1] groupmod [2] make [1] renice [2] uniq [1] 15903 cut [2] groups [2] man [1] rm [1] useradd [2] 15904 date [1] gunzip [2] md5sum [2] rmdir [1] userdel [2] 15905 dd [1] gzip [2] mkdir [1] sed [2] usermod [2] 15906 df [2] head [1] mkfifo [1] sendmail [2] wc [1] 15907 diff [1] hostname [2] mknod [2] sh [1] xargs [2] 15908 dirname [1] iconv [1] mktemp [2] shutdown [2] 15909 15910 Referenced Specification(s) 15911 15912 [1]. ISO POSIX (2003) 15913 15914 [2]. this specification 15915 15916 An LSB conforming implementation shall provide the shell built 15917 in utilities as described in Table 3-2, with at least the 15918 behavior described as mandatory in the referenced underlying 15919 specification, with the following execptions: 15920 15921 1. The built in commands and utilities shall be provided by 15922 the sh utility itself, and need not be implemented in a 15923 manner so that they can be accessed via the exec family of 15924 functions as defined in ISO POSIX (2003) and should not be 15925 invoked directly by those standard utilities that execute 15926 other utilities ( env, find, nice, nohup, time, xargs). 15927 15928 Rationale (Informative): Since the built in utilities must 15929 affect the environment of the calling process, they have no 15930 effect when executed as a file. 15931 15932 Table 3-2. Built In Utilities 15933 cd [1] getopts [1] read [1] umask [1] wait [1] 15934 15935 Referenced Specification(s) 15936 15937 [1]. ISO POSIX (2003) 15938 _________________________________________________________ 15939 15940 3.2. Command Behavior 15941 15942 Table of Contents 15943 ar -- create and maintain library archives (DEPRECATED) 15944 at -- examine or delete jobs for later execution 15945 awk -- pattern scanning and processing language 15946 batch -- schedule commands to be executed in a batch queue 15947 bc -- An arbitrary precision calculator language 15948 chfn -- change user name and information 15949 chgrp -- change file group 15950 chown -- change file owner and group 15951 chsh -- change login shell 15952 col -- filter reverse line feeds from input 15953 cpio -- copy file archives in and out 15954 crontab -- maintain crontab files for individual users 15955 cut -- split a file into sections determined by context lines 15956 df -- report filesystem disk space usage 15957 dmesg -- print or control the system message buffer 15958 du -- estimate file space usage 15959 echo -- Write arguments to standard output 15960 egrep -- search a file with an ERE pattern 15961 fgrep -- search a file with a fixed pattern 15962 file -- determine file type 15963 find -- search for files in a directory hierarchy 15964 fuser -- identify processes using files or sockets 15965 gettext -- retrieve text string from message catalog 15966 grep -- print lines matching a pattern 15967 groupadd -- create a new group 15968 groupdel -- delete a group 15969 groupmod -- modify a group 15970 groups -- display a group 15971 gunzip -- uncompress files 15972 gzip -- compress or expand files 15973 hostname -- show or set the system's host name 15974 install -- copy files and set attributes 15975 install_initd -- install an init.d file 15976 ipcrm -- Remove IPC Resources 15977 ipcs -- provide information on ipc facilities 15978 killall -- kill processes by name 15979 lpr -- off line print 15980 ls -- list directory contents 15981 lsb_release -- print distribution specific information 15982 lsbinstall -- installation tool for various types of data 15983 m4 -- macro processor 15984 md5sum -- generate or check MD5 message digests 15985 mknod -- make special files 15986 mktemp -- make temporary file name (unique) 15987 more -- display files on a page-by-page basis 15988 mount -- mount a file system 15989 msgfmt -- create a message object from a message file 15990 newgrp -- change group ID 15991 od -- dump files in octal and other formats 15992 passwd -- change user password 15993 patch -- apply a diff file to an original 15994 pidof -- find the process ID of a running program 15995 remove_initd -- clean up boot script system modifications 15996 introduced by install_initd 15997 15998 renice -- alter priority of running processes 15999 sed -- stream editor 16000 sendmail -- an electronic mail transport agent 16001 shutdown -- shut the system down 16002 su -- change user ID or become super-user 16003 sync -- flush filesystem buffers 16004 tar -- file archiver 16005 umount -- unmount file systems 16006 useradd -- create a new user or update default new user 16007 information 16008 16009 userdel -- delete a user account and related files 16010 usermod -- modify a user account 16011 xargs -- build and execute command lines from standard input 16012 16013 This section contains descriptions for commands and utilities 16014 whose specified behavior in the LSB contradicts or extends the 16015 standards referenced. It also contains commands and utilities 16016 only required by the LSB and not specified by other standards. 16017 16018 ar 16019 16020 Name 16021 16022 ar -- create and maintain library archives (DEPRECATED) 16023 16024 Description 16025 16026 ar is deprecated from the LSB and is expected to disappear 16027 from a future version of the LSB. 16028 16029 Rationale: The LSB generally does not include software 16030 development utilities nor does it specify .o and .a file 16031 formats. 16032 16033 ar is as specified in ISO POSIX (2003) but with differences as 16034 listed below. 16035 16036 Differences 16037 16038 -T, -C 16039 need not be accepted. 16040 16041 -l 16042 has unspecified behavior. 16043 16044 -q 16045 has unspecified behavior; using -r is suggested. 16046 16047 at 16048 16049 Name 16050 16051 at -- examine or delete jobs for later execution 16052 16053 Description 16054 16055 at is as specified in ISO POSIX (2003) but with differences as 16056 listed below. 16057 16058 Differences 16059 16060 Options 16061 16062 -d 16063 is functionally equivalent to the -r option specified 16064 in ISO POSIX (2003). 16065 16066 -r 16067 need not be supported, but the '-d' option is 16068 equivalent. 16069 16070 -t time 16071 need not be supported. 16072 16073 Optional Control Files 16074 16075 The implementation shall support the XSI optional behavior for 16076 access control; however the files at.allow and at.deny may 16077 reside in /etc rather than /usr/lib/cron. 16078 16079 awk 16080 16081 Name 16082 16083 awk -- pattern scanning and processing language 16084 16085 Description 16086 16087 awk is as specified in ISO POSIX (2003) but with differences 16088 as listed below. 16089 16090 Differences 16091 16092 Certain aspects of internationalized regular expressions are 16093 optional; see Internationalization and Regular Expressions. 16094 16095 batch 16096 16097 Name 16098 16099 batch -- schedule commands to be executed in a batch queue 16100 16101 Description 16102 16103 The specification for batch is as specified in ISO POSIX 16104 (2003), but with differences as listed below. 16105 16106 Optional Control Files 16107 16108 The implementation shall support the XSI optional behavior for 16109 access control; however the files at.allow and at.deny may 16110 reside in /etc rather than /usr/lib/cron. 16111 16112 bc 16113 16114 Name 16115 16116 bc -- An arbitrary precision calculator language 16117 16118 Description 16119 16120 bc is as specified in ISO POSIX (2003) but with extensions as 16121 listed below. 16122 16123 Extensions 16124 16125 The bc language may be extended in an implementation defined 16126 manner. If an implementation supports extensions, it shall 16127 also support the additional options: 16128 16129 -s|--standard 16130 processes exactly the POSIX bc language. 16131 16132 -w|--warn 16133 gives warnings for extensions to POSIX bc. 16134 16135 chfn 16136 16137 Name 16138 16139 chfn -- change user name and information 16140 16141 Synopsis 16142 16143 chfn [-f full_name] [-h home_phone] [user] 16144 16145 Description 16146 16147 chfn shall update the user database. An unprivileged user may 16148 only change the fields for their own account, a user with 16149 appropriate privileges may change the fields for any account. 16150 16151 The fields full_name and home_phone may contain any character 16152 except: 16153 16154 any control character 16155 comma 16156 colon 16157 equal sign 16158 16159 If none of the options are selected, chfn operates in an 16160 interactive fashion. The prompts and expected input in 16161 interactive mode are unspecified and should not be relied 16162 upon. 16163 16164 As it is possible for the system to be configured to restrict 16165 which fields a non-privileged user is permitted to change, 16166 applications should be written to gracefully handle these 16167 situations. 16168 16169 Standard Options 16170 16171 -f full_name 16172 sets the user's full name. 16173 16174 -h home_phone 16175 sets the user's home phone number. 16176 16177 Future Directions 16178 16179 The following two options are expected to be added in a future 16180 version of the LSB: 16181 16182 -o office 16183 sets the user's office room number. 16184 16185 -p office_phone 16186 sets the user's office phone number. 16187 16188 Note that some implementations contain a "-o other" option 16189 which specifies an additional field called "other". 16190 Traditionally, this field is not subject to the constraints 16191 about legitimate characters in fields. Also, one traditionally 16192 shall have appropriate privileges to change the other field. 16193 At this point there is no consensus about whether it is 16194 desirable to specify the other field; applications may wish to 16195 avoid using it. 16196 16197 The "-w work_phone" field found in some implementations should 16198 be replaced by the "-p office_phone" field. The "-r 16199 room_number" field found in some implementations is the 16200 equivalent of the "-o office" option mentioned above; which 16201 one of these two options to specify will depend on 16202 implementation experience and the decision regarding the other 16203 field. 16204 16205 chgrp 16206 16207 Name 16208 16209 chgrp -- change file group 16210 16211 Description 16212 16213 chgrp is as specified in ISO POSIX (2003) but with differences 16214 as listed below. 16215 16216 Differences 16217 16218 The -L, -H, and -P options need not be supported. 16219 16220 chown 16221 16222 Name 16223 16224 chown -- change file owner and group 16225 16226 Description 16227 16228 chown is as specified in ISO POSIX (2003) but with differences 16229 as listed below. 16230 16231 Differences 16232 16233 The -L, -H, and -P options need not be supported. 16234 16235 chsh 16236 16237 Name 16238 16239 chsh -- change login shell 16240 16241 Synopsis 16242 16243 chsh [-s login_shell] [user] 16244 16245 Description 16246 16247 chsh changes the user login shell. This determines the name of 16248 the user's initial login command. An unprivileged user may 16249 only change the login shell for their own account, a user with 16250 appropriate privilege may change the login shell for any 16251 account specified by user. 16252 16253 Unless the user has appropriate privilege, the initial login 16254 command name shall be one of those listed in /etc/shells. The 16255 login_shell shall be the absolute path (i.e. it must start 16256 with '/') to an executable file. Accounts which are restricted 16257 (in an implementation-defined manner) may not change their 16258 login shell. 16259 16260 If the -s option is not selected, chsh operates in an 16261 interactive mode. The prompts and expected input in this mode 16262 are unspecified. 16263 16264 Standard Options 16265 16266 -s login_shell 16267 sets the login shell. 16268 16269 col 16270 16271 Name 16272 16273 col -- filter reverse line feeds from input 16274 16275 Description 16276 16277 col is as specified in SUSv2 but with differences as listed 16278 below. 16279 16280 Differences 16281 16282 The -p option has unspecified behavior. 16283 16284 Note: Although col is shown as legacy in SUSv2, it is not 16285 (yet) deprecated in the LSB. 16286 16287 cpio 16288 16289 Name 16290 16291 cpio -- copy file archives in and out 16292 16293 Description 16294 16295 cpio is as specified in ISO POSIX (2003), but with differences 16296 as listed below. 16297 16298 Differences 16299 16300 Some elements of the Pattern Matching Notation are optional; 16301 see Internationalization and Pattern Matching Notation. 16302 16303 crontab 16304 16305 Name 16306 16307 crontab -- maintain crontab files for individual users 16308 16309 Synopsis 16310 16311 crontab [-u user] file 16312 crontab [-u user] {-l | -r | -e} 16313 16314 Description 16315 16316 crontab is as specified in ISO POSIX (2003), but with 16317 differences as listed below. 16318 16319 Optional Control Files 16320 16321 The implementation shall support the XSI optional behavior for 16322 access control; however the files cron.allow and cron.deny may 16323 reside in /etc rather than /usr/lib/cron. 16324 16325 cut 16326 16327 Name 16328 16329 cut -- split a file into sections determined by context lines 16330 16331 Description 16332 16333 cut is as specified in ISO POSIX (2003), but with differences 16334 as listed below. 16335 16336 Differences 16337 16338 -n 16339 has unspecified behavior. 16340 16341 df 16342 16343 Name 16344 16345 df -- report filesystem disk space usage 16346 16347 Description 16348 16349 The df command shall behave as specified in ISO POSIX (2003), 16350 but with differences as listed below. 16351 16352 Differences 16353 16354 Options 16355 16356 If the -k option is not specified, disk space is shown in 16357 unspecified units. If the -P option is specified, the size of 16358 the unit shall be printed on the header line in the format 16359 "%4s-blocks". Applications should specify -k. 16360 16361 The XSI option -t has unspecified behavior. Applications 16362 should not specify -t. 16363 16364 Rationale: The most common implementation of df uses the -t 16365 option for a different purpose (restricting output to a 16366 particular filesystem type), and use of -t is therefore 16367 non-portable. 16368 16369 Operand May Identify Special File 16370 16371 If an argument is the absolute file name of a special file 16372 containing a mounted filesystem, df shall show the space 16373 available on that filesystem rather than on the filesystem 16374 containing the special file (which is typically the root 16375 filesystem). 16376 16377 Note: In ISO POSIX (2003) the XSI optional behavior permits 16378 an operand to name a special file, but appears to require 16379 the operation be performed on the filesystem containing the 16380 special file. A defect report has been submitted for this 16381 case. 16382 16383 dmesg 16384 16385 Name 16386 16387 dmesg -- print or control the system message buffer 16388 16389 Synopsis 16390 16391 dmesg [-c | -n level | -s bufsize] 16392 16393 Description 16394 16395 dmesg examines or controls the system message buffer. Only a 16396 user with appropriate privileges may modify the system message 16397 buffer parameters or contents. 16398 16399 Standard Options 16400 16401 -c 16402 If the user has appropriate privilege, clears the 16403 system message buffer contents after printing. 16404 16405 -n level 16406 If the user has appropriate privilege, sets the level 16407 at which logging of messages is done to the console. 16408 16409 -s bufsize 16410 uses a buffer of bufsize to query the system message 16411 buffer. This is 16392 by default (this matches the 16412 default kernel syslog buffer size since 2.1.113). If 16413 you have set the kernel buffer to larger than the 16414 default then this option can be used to view the entire 16415 buffer. 16416 16417 du 16418 16419 Name 16420 16421 du -- estimate file space usage 16422 16423 Description 16424 16425 du is as specified in ISO POSIX (2003), but with differences 16426 as listed below. 16427 16428 Differences 16429 16430 If the -k option is not specified, disk space is shown in 16431 unspecified units. Applications should specify -k. 16432 16433 echo 16434 16435 Name 16436 16437 echo -- Write arguments to standard output 16438 16439 Synopsis 16440 16441 echo [string...] 16442 16443 Description 16444 16445 The echo command is as specified in ISO POSIX (2003), but with 16446 the following differences. 16447 16448 Implementations may support implementation-defined options to 16449 echo. The behavior of echo if any arguments contain 16450 backslashes is also implementation defined. 16451 16452 Conforming applications shall not run echo with a first 16453 argument starting with a hyphen, or with any arguments 16454 containing backslashes; they should use printf in those cases. 16455 16456 Note: The behavior specified here is similar to that 16457 specified by ISO POSIX (2003) without the XSI option. 16458 However, the LSB forbids a conforming application from 16459 using any options (even if the implementation provides 16460 them) while ISO POSIX (2003) specifies behavior if the 16461 first operand is the string -n. 16462 16463 egrep 16464 16465 Name 16466 16467 egrep -- search a file with an ERE pattern 16468 16469 Description 16470 16471 egrep is equivalent to grep -E. For further details, see the 16472 specification for grep. 16473 16474 fgrep 16475 16476 Name 16477 16478 fgrep -- search a file with a fixed pattern 16479 16480 Description 16481 16482 fgrep is equivalent to grep -F. For further details, see the 16483 specification for grep. 16484 16485 file 16486 16487 Name 16488 16489 file -- determine file type 16490 16491 Description 16492 16493 file is as specified in ISO POSIX (2003), but with differences 16494 as listed below. 16495 16496 Differences 16497 16498 The -M, -h, -d, and -i options need not be supported. 16499 16500 find 16501 16502 Name 16503 16504 find -- search for files in a directory hierarchy 16505 16506 Description 16507 16508 find shall behave as specified in ISO POSIX (2003), but with 16509 differences as listed below. 16510 16511 Differences 16512 16513 Pattern Matching 16514 16515 Some elements of the Pattern Matching Notation are optional; 16516 see Internationalization and Pattern Matching Notation. 16517 16518 Option and Operand Handling 16519 16520 Options and operands to find shall behave as described in ISO 16521 POSIX (2003), except as follows: 16522 16523 -H 16524 need not be supported 16525 16526 -L 16527 need not be supported 16528 16529 -exec ... + 16530 argument aggregation need not be supported 16531 16532 Rationale: The -H and -L options are only supported in the 16533 most recent versions of find, as is argument aggregation. 16534 When this verion of find becomes widely adopted, these 16535 limitations will be removed. 16536 16537 fuser 16538 16539 Name 16540 16541 fuser -- identify processes using files or sockets 16542 16543 Description 16544 16545 fuser is as specified in ISO POSIX (2003), but with 16546 differences as listed below. 16547 16548 Differences 16549 16550 The fuser command is a system administration utility, see Path 16551 For System Administration Utilities. 16552 16553 Option Differences 16554 16555 -c 16556 has unspecified behavior. 16557 16558 -f 16559 has unspecified behavior. 16560 16561 gettext 16562 16563 Name 16564 16565 gettext -- retrieve text string from message catalog 16566 16567 Synopsis 16568 16569 gettext [options] [textdomain] msgid 16570 gettext -s [options] msgid... 16571 16572 Description 16573 16574 The gettext utility retrieves a translated text string 16575 corresponding to string msgid from a message object generated 16576 with msgfmt utility. 16577 16578 The message object name is derived from the optional argument 16579 textdomain if present, otherwise from the TEXTDOMAIN 16580 environment variable. If no domain is specified, or if a 16581 corresponding string cannot be found, gettext prints msgid. 16582 16583 Ordinarily gettext looks for its message object in 16584 dirname/lang/LC_MESSAGES where dirname is the 16585 implementation-defined default directory and lang is the 16586 locale name. If present, the TEXTDOMAINDIR environment 16587 variable replaces the dirname. 16588 16589 This utility interprets C escape sequences such as \t for tab. 16590 Use \\ to print a backslash. To produce a message on a line of 16591 its own, either put a \n at the end of msgid, or use this 16592 command in conjunction with the printf utility. 16593 16594 When used with the -s option the gettext utility behaves like 16595 the echo utility, except that the message corresponding to 16596 msgid in the selected catalog provides the arguments. 16597 16598 Options 16599 16600 -d domainname, --domain=domainname 16601 PARAMETER translated messages from domainname. 16602 16603 -e 16604 Enable expansion of some escape sequences. 16605 16606 -n 16607 Suppress trailing newline. 16608 16609 Operands 16610 16611 The following operands are supported: 16612 16613 textdomain 16614 A domain name used to retrieve the messages. 16615 16616 msgid 16617 A key to retrieve the localized message. 16618 16619 Environment Variables 16620 16621 LANGUAGE 16622 Specifies one or more locale names. 16623 16624 LANG 16625 Specifies locale name. 16626 16627 LC_MESSAGES 16628 Specifies messaging locale, and if present overrides 16629 LANG for messages. 16630 16631 TEXTDOMAIN 16632 Specifies the text domain name, which is identical to 16633 the message object filename without .mo suffix. 16634 16635 TEXTDOMAINDIR 16636 Specifies the pathname to the message catalog, and if 16637 present replaces the implementation-defined default 16638 directory. 16639 16640 Exit Status 16641 16642 The following exit values are returned: 16643 16644 0 16645 Successful completion. 16646 16647 >0 16648 An error occurred. 16649 16650 grep 16651 16652 Name 16653 16654 grep -- print lines matching a pattern 16655 16656 Description 16657 16658 grep is as specified in ISO POSIX (2003), but with differences 16659 as listed below. 16660 16661 LSB Differences 16662 16663 Certain aspects of regular expression matching are optional; 16664 see Internationalization and Regular Expressions. 16665 16666 groupadd 16667 16668 Name 16669 16670 groupadd -- create a new group 16671 16672 Synopsis 16673 16674 groupadd [-g gid [-o]] group 16675 16676 Description 16677 16678 If the caller has appropriate privilege, the groupadd command 16679 shall create a new group named group. The group name shall be 16680 unique in the group database. If no gid is specified, groupadd 16681 shall create the new group with a unique group ID. 16682 16683 The groupadd command is a system administration utility, see 16684 Path For System Administration Utilities. 16685 16686 Options 16687 16688 -g gid [-o] 16689 The new group shall have group ID gid. If the -o option 16690 is not used, no other group shall have this group ID. 16691 The value of gidshall be non-negative. 16692 16693 groupdel 16694 16695 Name 16696 16697 groupdel -- delete a group 16698 16699 Synopsis 16700 16701 groupdel group 16702 16703 Description 16704 16705 If the caller has sufficient privilege, the groupdel command 16706 shall modify the system group database, deleting the group 16707 named group. If the group named group does not exist, groupdel 16708 shall issue a diagnostic message and exit with a non-zero exit 16709 status. 16710 16711 The groupdel command is a system administration utility, see 16712 Path For System Administration Utilities. 16713 16714 groupmod 16715 16716 Name 16717 16718 groupmod -- modify a group 16719 16720 Synopsis 16721 16722 groupmod [-g gid [-o]] [-n group_name] group 16723 16724 Description 16725 16726 If the caller has appropriate privilege, the groupmod command 16727 shall modify the entry in the system group database 16728 corresponding to a group named group. 16729 16730 The groupmod command is a system administration utility, see 16731 Path For System Administration Utilities. 16732 16733 Options 16734 16735 -g gid [-o] 16736 Modify the group's group ID, setting it to gid. If the 16737 -o option is not used, no other group shall have this 16738 group ID. The value of gidshall be non-negative. 16739 16740 Note: Only the group ID in the database is altered; any 16741 files with group ownership set to the original group ID are 16742 unchanged by this modification. 16743 16744 -n group_name 16745 changes the name of the group from group to group_name. 16746 16747 groups 16748 16749 Name 16750 16751 groups -- display a group 16752 16753 Synopsis 16754 16755 groups [user] 16756 16757 Description 16758 16759 The groups command shall behave as id -Gn [user], as specified 16760 in ISO POSIX (2003). The optional user parameter will display 16761 the groups for the named user. 16762 16763 gunzip 16764 16765 Name 16766 16767 gunzip -- uncompress files 16768 16769 Description 16770 16771 gunzip is equivalent to gzip -d. See the specification for 16772 gzip for further details. 16773 16774 gzip 16775 16776 Name 16777 16778 gzip -- compress or expand files 16779 16780 Synopsis 16781 16782 gzip [-cdfhlLnNrtvV19] [-S suffix] [name...] 16783 16784 Description 16785 16786 The gzip command shall attempt to reduce the size of the named 16787 files. Whenever possible, each file is replaced by one with 16788 the extension .gz, while keeping the same ownership modes, 16789 access and modification times. If no files are specified, or 16790 if a file name is -, the standard input is compressed to the 16791 standard output. gzip shall only attempt to compress regular 16792 files. In particular, it will ignore symbolic links. 16793 16794 When compressing, gzip uses the deflate algorithm specified in 16795 RFC 1951: DEFLATE Compressed Data Format Specification and 16796 stores the result in a file using the gzip file format 16797 specified in RFC 1952: GZIP File Format Specification. 16798 16799 Options 16800 16801 -c, --stdout, --to-stdout 16802 writes output on standard output, leaving the original 16803 files unchanged. If there are several input files, the 16804 output consists of a sequence of independently 16805 compressed members. To obtain better compression, 16806 concatenate all input files before compressing them. 16807 16808 -d, --decompress, --uncompress 16809 the name operands are compressed files, and gzip shall 16810 decompress them. 16811 16812 -f, --force 16813 forces compression or decompression even if the file 16814 has multiple links or the corresponding file already 16815 exists, or if the compressed data is read from or 16816 written to a terminal. If the input data is not in a 16817 format recognized by gzip, and if the option --stdout 16818 is also given, copy the input data without change to 16819 the standard ouput: let gzip behave as cat. If -f is 16820 not given, and when not running in the background, gzip 16821 prompts to verify whether an existing file should be 16822 overwritten. 16823 16824 -l, --list 16825 lists the compressed size, uncompressed size, ration 16826 and uncompressed name for each compressed file. Gives 16827 the uncompressed size as -1 for files not in gzip 16828 format. Additionally displays method, crc and timestamp 16829 for the uncompress file when used in combination with 16830 --verbose. 16831 16832 For decompression, gzip shall support at least the 16833 following compression methods: 16834 16835 + deflate (RFC 1951: DEFLATE Compressed Data Format 16836 Specification) 16837 + compress (ISO POSIX (2003)) 16838 16839 The crc shall be given as ffffffff for a file not in 16840 gzip format. 16841 16842 With --name, the uncompressed name, date and time are 16843 those stored within the compress file, if present. 16844 16845 With --verbose, the size totals and compression ratio 16846 for all files is also displayed, unless some sizes are 16847 unknown. With --quiet, the title and totals lines are 16848 not displayed. 16849 16850 -L, --license 16851 displays the gzip license and quit. 16852 16853 -n, --no-name 16854 does not save the original file name and time stamp by 16855 default when compressing. (The original name is always 16856 saved if the name had to be truncated.) When 16857 decompressing, do not restore the original file name if 16858 present (remove only the gzip suffix from the 16859 compressed file name) and do not restore the original 16860 time stamp if present (copy it from the compressed 16861 file). This option is the default when decompressing. 16862 16863 -N, --name 16864 always saves the original file name and time stamp when 16865 compressing; this is the default. When decompressing, 16866 restore the original file name and time stamp if 16867 present. This option is useful on systems which have a 16868 limit on file name length or when the time stamp has 16869 been lost after a file transfer. 16870 16871 -q, --quiet 16872 suppresses all warnings. 16873 16874 -r, --recursive 16875 travels the directory structure recursively. If any of 16876 the file names specified on the command line are 16877 directories, gzip will descend into the directory and 16878 compress all the files it finds there (or decompress 16879 them in the case of gunzip). 16880 16881 -S .suf, --sufix .suf 16882 uses suffix .suf instead of .gz. 16883 16884 -t, --test 16885 checks the compressed file integrity. 16886 16887 -v, --verbose 16888 displays the name and percentage reduction for each 16889 file compressed or decompressed. 16890 16891 -#, --fast, --best 16892 regulates the speed of compression using the specified 16893 digit #, where -1 or --fast indicates the fastest 16894 compression method (less compression) and -9 or --best 16895 indicates the slowest compression method (best 16896 compression). The default compression level is -6 (that 16897 is, biased towards high compression at expense of 16898 speed). 16899 16900 LSB Deprecated Options 16901 16902 The behaviors specified in this section are expected to 16903 disappear from a future version of the LSB; applications 16904 should only use the non-LSB-deprecated behaviors. 16905 16906 -V, --version 16907 displays the version number and compilation options, 16908 then quits. 16909 16910 hostname 16911 16912 Name 16913 16914 hostname -- show or set the system's host name 16915 16916 Synopsis 16917 16918 hostname [name] 16919 16920 Description 16921 16922 hostname is used to either display or, with appropriate 16923 privileges, set the current host name of the system. The host 16924 name is used by many applications to identify the machine. 16925 16926 When called without any arguments, the program displays the 16927 name of the system as returned by the gethostname() function. 16928 16929 When called with a name argument, and the user has appropriate 16930 privilege, the command sets the host name. 16931 16932 Note: It is not specified if the hostname displayed will be 16933 a fully qualified domain name. Applications requiring a 16934 particular format of hostname should check the output and 16935 take appropriate action. 16936 16937 install 16938 16939 Name 16940 16941 install -- copy files and set attributes 16942 16943 Synopsis 16944 16945 install [option...] SOURCE DEST 16946 install [option...] SOURCE... DEST 16947 install [-d | --directory] [option...] DIRECTORY... 16948 16949 Description 16950 16951 In the first two formats, copy SOURCE to DEST or multiple 16952 SOURCE(s) to the existing DIRECTORY, optionally setting 16953 permission modes and file ownership. In the third format, each 16954 DIRECTORY and any missing parent directories shall be created. 16955 16956 Standard Options 16957 16958 --backup[=METHOD] 16959 makes a backup of each existing destination file. 16960 METHOD may be one of the following: 16961 16962 + none or off never make backups. 16963 + numbered or t make numbered backups. A numbered 16964 backup has the form "%s.~%d~", target_name, 16965 version_number. Each backup shall increment the 16966 version number by 1. 16967 + existing or nil numbered if numbered backups exist, 16968 or simple otherwise. 16969 + simple or never append a suffix to the name. The 16970 default suffix is '~', but can be overriden by 16971 setting SIMPLE_BACKUP_SUFFIX in the environment, or 16972 via the -S or --suffix option. 16973 16974 If no METHOD is specified, the environment variable 16975 VERSION_CONTROL shall be examined for one of the above. 16976 Unambiguous abbreviations of METHOD shall be accepted. 16977 If no METHOD is specified, or if METHOD is empty, the 16978 backup method shall default to existing. 16979 16980 If METHOD is invalid or ambiguous, install shall fail 16981 and issue a diagnostic message. 16982 16983 -b 16984 is equivalent to --backup=existing. 16985 16986 -d, --directory 16987 treats all arguments as directory names; creates all 16988 components of the specified directories. 16989 16990 -D 16991 creates all leading components of DEST except the last, 16992 then copies SOURCE to DEST; useful in the 1st format. 16993 16994 -g GROUP, --group=GROUP 16995 if the user has appropriate privilege, sets group 16996 ownership, instead of process' current group. GROUP is 16997 either a name in the user group database, or a positive 16998 integer, which shall be used as a group-id. 16999 17000 -m MODE, --mode=MODE 17001 sets permission mode (specified as in chmod), instead 17002 of the default rwxr-xr-x. 17003 17004 -o OWNER, --owner=OWNER 17005 if the user has appropriate privilege, sets ownership. 17006 OWNER is either a name in the user login database, or a 17007 positive integer, which shall be used as a user-id. 17008 17009 -p, --preserve-timestamps 17010 copies the access and modification times of SOURCE 17011 files to corresponding destination files. 17012 17013 -s, --strip 17014 strips symbol tables, only for 1st and 2nd formats. 17015 17016 -S SUFFIX, --suffix=SUFFIX 17017 equivalent to --backup=existing, except if a simple 17018 suffix is required, use SUFFIX. 17019 17020 --verbose 17021 prints the name of each directory as it is created. 17022 17023 -v, --verbose 17024 print the name of each file before copying it to 17025 stdout. 17026 17027 install_initd 17028 17029 Name 17030 17031 install_initd -- install an init.d file 17032 17033 Synopsis 17034 17035 /usr/lib/lsb/install_initd initd_file 17036 17037 Description 17038 17039 install_initd shall install a system initialization file that 17040 has been copied to the /etc/init.d location such that this 17041 file shall be run at the appropriate point during system 17042 initialization. The install_initrd command is typically called 17043 in the postinstall script of a package. See also Section 8.4. 17044 17045 ipcrm 17046 17047 Name 17048 17049 ipcrm -- Remove IPC Resources 17050 17051 Synopsis 17052 17053 ipcrm [-q msgid | -Q msgkey | -s semid | -S semkey | -m shmid 17054 | -M shmkey]... 17055 ipcrm [shm | msg | msg] id... 17056 17057 Description 17058 17059 If any of the -q, -Q, -s, -S, -m, or -M arguments are given, 17060 the ipcrm shall behave as described in ISO POSIX (2003). 17061 17062 Otherwise, ipcrm shall remove the resource of the specified 17063 type identified by id. 17064 17065 Future Directions 17066 17067 A future revision of this specification may deprecate the 17068 second synopsis form. 17069 17070 Rationale: In its first Linux implementation, ipcrm used 17071 the second syntax shown in the SYNOPSIS. Functionality 17072 present in other implementations of ipcrm has since been 17073 added, namely the ability to delete resources by key (not 17074 just identifier), and to respect the same command line 17075 syntax. The previous syntax is still supported for 17076 backwards compatibility only. 17077 17078 ipcs 17079 17080 Name 17081 17082 ipcs -- provide information on ipc facilities 17083 17084 Synopsis 17085 17086 ipcs [-smq] [-tcp] 17087 17088 Description 17089 17090 ipcs provides information on the ipc facilities for which the 17091 calling process has read access. 17092 17093 Note: Although this command has many similarities with the 17094 optional ipcs utility described in ISO POSIX (2003), it has 17095 substantial differences and is therefore described 17096 separately. The options specified here have similar meaning 17097 to those in ISO POSIX (2003); other options specified there 17098 have unspecified behavior on an LSB conforming 17099 implementation. See Application Usage below. The output 17100 format is not specified. 17101 17102 Resource display options 17103 17104 -m 17105 shared memory segments. 17106 17107 -q 17108 message queues. 17109 17110 -s 17111 semaphore arrays. 17112 17113 Output format options 17114 17115 -t 17116 time. 17117 17118 -p 17119 pid. 17120 17121 -c 17122 creator. 17123 17124 Application Usage 17125 17126 In some implementations of ipcs the -a option will print all 17127 information available. In other implementations the -a option 17128 will print all resource types. Therefore, applications shall 17129 not use the -a option. 17130 17131 Some implementations of ipcs provide more output formats than 17132 are specified here. These options are not consistent between 17133 differing implementations of ipcs. Therefore, only the -t, -c 17134 and -p option formatting flags may be used. At least one of 17135 the -t, -c and -p options, and at least one of -m, -q and -s 17136 options, shall be specified. 17137 17138 killall 17139 17140 Name 17141 17142 killall -- kill processes by name 17143 17144 Synopsis 17145 17146 killall [-egiqvw] [-signal] name... 17147 killall -l 17148 killall -V 17149 17150 Description 17151 17152 killall sends a signal to all processes running any of the 17153 specified commands. If no signal name is specified, SIGTERM is 17154 sent. 17155 17156 Signals can be specified either by name (e.g. -HUP) or by 17157 number (e.g. -1). Signal 0 (check if a process exists) can 17158 only be specified by number. 17159 17160 If the command name contains a slash (/), processes executing 17161 that particular file will be selected for killing, independent 17162 of their name. 17163 17164 killall returns a non-zero return code if no process has been 17165 killed for any of the listed commands. If at least one process 17166 has been killed for each command, killall returns zero. 17167 17168 A killall process never kills itself (but may kill other 17169 killall processes). 17170 17171 Standard Options 17172 17173 -e 17174 requires an exact match for very long names. If a 17175 command name is longer than 15 characters, the full 17176 name may be unavailable (i.e. it is swapped out). In 17177 this case, killall will kill everything that matches 17178 within the first 15 characters. With -e, such entries 17179 are skipped. killall prints a message for each skipped 17180 entry if -v is specified in addition to -e. 17181 17182 -g 17183 kills the process group to which the process belongs. 17184 The kill signal is only sent once per group, even if 17185 multiple processes belonging to the same process group 17186 were found. 17187 17188 -i 17189 asks interactively for confirmation before killing. 17190 17191 -l 17192 lists all known signal names. 17193 17194 -q 17195 does not complain if no processes were killed. 17196 17197 -v 17198 reports if the signal was successfully sent. 17199 17200 LSB Deprecated Options 17201 17202 The behaviors specified in this section are expected to 17203 disappear from a future version of the LSB; applications 17204 should only use the non-LSB-deprecated behaviors. 17205 17206 -V 17207 displays version information. 17208 17209 lpr 17210 17211 Name 17212 17213 lpr -- off line print 17214 17215 Synopsis 17216 17217 lpr [-l] [-p] [-Pprinter] [-h] [-s] [-#copies] [-J name] [-T 17218 title] [name ......] 17219 17220 Description 17221 17222 lpr uses a spooling daemon to print the named files when 17223 facilities become available. If no names appear, the standard 17224 input is assumed. 17225 17226 Standard Options 17227 17228 -l 17229 identifies binary data that is not to be filtered but 17230 sent as raw input to printer. 17231 17232 -p 17233 formats with "pr" before sending to printer. 17234 17235 -Pprinter 17236 sends output to the printer named printer instead of 17237 the default printer. 17238 17239 -h 17240 suppresses header page. 17241 17242 -s 17243 uses symbolic links. 17244 17245 -#copies 17246 specifies copies as the number of copies to print. 17247 17248 -J name 17249 specifies name as the job name for the header page. 17250 17251 -T title 17252 specifies title as the title used for "pr". 17253 17254 ls 17255 17256 Name 17257 17258 ls -- list directory contents 17259 17260 Description 17261 17262 ls shall behave as specified in ISO POSIX (2003), but with 17263 extensions listed below. 17264 17265 Extensions 17266 17267 -l 17268 If the file is a character special or block special 17269 file, the size of the file shall be replaced with two 17270 unsigned numbers in the format "%u, %u", representing 17271 the major and minor device numbers associated with the 17272 special file. 17273 17274 Note: The LSB does not specify the meaning of the major and 17275 minor devices numbers. 17276 17277 -p 17278 in addition to ISO POSIX (2003) XSI optional behavior 17279 of printing a slash for a directory, ls -p may display 17280 other characters for other file types. 17281 17282 lsb_release 17283 17284 Name 17285 17286 lsb_release -- print distribution specific information 17287 17288 Synopsis 17289 17290 lsb_release [OPTION...] 17291 17292 Description 17293 17294 The lsb_release command prints certain LSB (Linux Standard 17295 Base) and Distribution information. 17296 17297 If no options are given, the -v option is assumed. 17298 17299 Options 17300 17301 -v, --version 17302 displays version of LSB against which distribution is 17303 compliant. The version is expressed as a colon 17304 seperated list of LSB module descriptions. LSB module 17305 descriptions are dash seperated tuples containing the 17306 module name, version, and architecture name. The output 17307 is a single line of text of the following format: 17308 17309 LSB Version:\t 17310 17311 -i, --id 17312 displays string id of distributor. The output is a 17313 single line of text of the following format: 17314 17315 Distributor ID:\t 17316 17317 -d, --description 17318 displays single line text description of distribution. 17319 The output is of the following format: 17320 17321 Description:\t 17322 17323 -r, --release 17324 displays release number of distribution. The output is 17325 a single line of text of the following format: 17326 17327 Release:\t 17328 17329 -c, --codename 17330 displays codename according to distribution release. 17331 The output is a single line of text of the following 17332 format. 17333 17334 Codename:\t 17335 17336 -a, --all 17337 displays all of the above information. 17338 17339 -s, --short 17340 displays all of the above information in short output 17341 format. 17342 17343 -h, --help 17344 displays a human-readable help message. 17345 17346 Examples 17347 17348 The following command will list the LSB Profiles which are 17349 currently supported on this platform. 17350 example% lsb_release -v 17351 LSB Version: core-2.0-ia32:core-2.0-noarch:graphics-2.0-ia32:graphics-2 17352 .0-noarch 17353 17354 lsbinstall 17355 17356 Name 17357 17358 lsbinstall -- installation tool for various types of data 17359 17360 Synopsis 17361 17362 /usr/lib/lsb/lsbinstall [OPTION...] 17363 17364 Description 17365 17366 The lsbinstall command may be used to install certain types of 17367 files into system specific locations. This command may be used 17368 during a package post installation script to add package 17369 specific data to system wide repositories. A user may need 17370 appropriate privilege to invoke lsbinstall. 17371 17372 Options 17373 17374 -f, --font 17375 install a font file into the systemwide font 17376 repository. There shall be one operand, that names a 17377 font file. 17378 17379 -i, --init 17380 install an init script into the system specific 17381 location. There shall be one operand, that names an 17382 init script file. 17383 17384 -p, --profile 17385 install a profile script into the system specific 17386 location. There shall be one operand, that names a 17387 profile shell script. The behavior is unspecified if 17388 this name does not have the suffix .sh. 17389 17390 -s, --service 17391 ensure a service name and number pair is know to the 17392 system service database. There must be at least two 17393 operands. The first operand shall have the format %d/%s 17394 with the port number and protocol values (e.g. 22/tcp), 17395 and the second operand shall be the name of the 17396 service. Any subsequent operands provide aliases for 17397 this service. 17398 17399 -I, --inet 17400 add an entry to the systems inet super daemon 17401 configuration. There shall be one operand, that names a 17402 file with the following format: 17403 17404 service 17405 { 17406 17407 } 17408 17409 Add a list here of supported attributes. Explain that 17410 assign-opt must be at least =, but others may be 17411 supported. 17412 17413 -c, --crontab 17414 Install a crontab into the system specific location. 17415 There shall be one operand, that names a crontab file. 17416 See Cron Jobs. 17417 17418 -m, --menu 17419 install a desktop menu entry into the system menu 17420 database. There shall be one operand, that names a menu 17421 file. 17422 17423 -l, --ldconfig 17424 Register a directory that contains shared libraries 17425 with the system. There shall be one operand, that names 17426 a directory. 17427 17428 Examples 17429 17430 add something here! 17431 17432 m4 17433 17434 Name 17435 17436 m4 -- macro processor 17437 17438 Description 17439 17440 m4 is as specified in ISO POSIX (2003), but with extensions as 17441 listed below. 17442 17443 Extensions 17444 17445 -P 17446 forces all builtins to be prefixed with m4_. For 17447 example, define becomes m4_define. 17448 17449 -I directory 17450 Add directory to the end of the search path for 17451 includes. 17452 17453 md5sum 17454 17455 Name 17456 17457 md5sum -- generate or check MD5 message digests 17458 17459 Synopsis 17460 17461 md5sum [-c [file] | file...] 17462 17463 Description 17464 17465 For each file, write to standard output a line containing the 17466 MD5 message digest of that file, followed by one or more blank 17467 characters, followed by the name of the file. The MD5 message 17468 digest shall be calculated according to RFC 1321: The MD5 17469 Message-Digest Algorithm and output as 32 hexadecimal digits. 17470 17471 If no file names are specified as operands, read from standard 17472 input and use "-" as the file name in the output. 17473 17474 Options 17475 17476 -c [file] 17477 checks the MD5 message digest of all files named in 17478 file against the message digest listed in the same 17479 file. The actual format of file is the same as the 17480 output of md5sum. That is, each line in the file 17481 describes a file. If file is not specified, read 17482 message digests from stdin. 17483 17484 Exit Status 17485 17486 md5sum shall exit with status 0 if the sum was generated 17487 successfully, or, in check mode, if the check matched. 17488 Otherwise, md5sum shall exit with a non-zero status. 17489 17490 mknod 17491 17492 Name 17493 17494 mknod -- make special files 17495 17496 Synopsis 17497 17498 mknod [-m mode | --mode=mode] name type [major minor] 17499 mknod [--version] 17500 17501 Description 17502 17503 The mknod command shall create a special file named name of 17504 the given type. 17505 17506 The type shall be one of the following: 17507 17508 b 17509 creates a block (buffered) special file with the 17510 specified major and minor device numbers. 17511 17512 c, u 17513 creates a character (unbuffered) special file with the 17514 specified major and minor device numbers. 17515 17516 p 17517 creates a FIFO. 17518 17519 Options 17520 17521 -m mode, --mode=mode 17522 create the special file with file access permissions 17523 set as described in mode. The permissions may be any 17524 absolute value (i.e. one not containing '+' or '-') 17525 acceptable to the chmod command. 17526 17527 --version 17528 output version information and exit. 17529 17530 Note: This option may be deprecated in a future release of 17531 this specification. 17532 17533 If type is pparameter, major and minor shall not be specified. 17534 Otherwise, these parameters are mandatory. 17535 17536 Future Directions 17537 17538 This command may be deprecated in a future version of this 17539 specification. The major and minor operands are insufficently 17540 portable to be specified usefully here. Only a FIFO can be 17541 portably created by this command, and the mkfifo command is a 17542 simpler interface for that purpose. 17543 17544 mktemp 17545 17546 Name 17547 17548 mktemp -- make temporary file name (unique) 17549 17550 Synopsis 17551 17552 mktemp [-q] [-u] template 17553 17554 Description 17555 17556 The mktemp command takes the given file name template and 17557 overwrites a portion of it to create a file name. This file 17558 name shall be unique and suitable for use by the application. 17559 17560 The template should have at least six trailing 'X' characters. 17561 These characters are replaced with characters from the 17562 portable filename character set in order to generate a unique 17563 name. 17564 17565 If mktemp can successfully generate a unique file name, and 17566 the -u option is not present, the file shall be created with 17567 read and write permission only for the current user. The 17568 mktemp command shall write the filename generated to the 17569 standard output. 17570 17571 Options 17572 17573 -q 17574 fail silently if an error occurs. Diagnostic messages 17575 to stderr are suppressed, but the command shall still 17576 exit with a non-zero exit status if an error occurs. 17577 17578 -u 17579 operates in `unsafe' mode. A unique name is generated, 17580 but the temporary file shall be unlinked before mktemp 17581 exits. Use of this option is not encouraged. 17582 17583 more 17584 17585 Name 17586 17587 more -- display files on a page-by-page basis 17588 17589 Description 17590 17591 more is as specified in ISO POSIX (2003), but with differences 17592 as listed below. 17593 17594 Differences 17595 17596 The more command need not respect the LINES and COLUMNS 17597 environment variables. 17598 17599 The following additional options may be supported: 17600 17601 -num 17602 specifies an integer which is the screen size (in 17603 lines). 17604 17605 +num 17606 starts at line number num. 17607 17608 +/pattern 17609 Start at the first line matching the pattern, 17610 equivalent to executing the search forward (/) command 17611 with the given pattern immediately after opening each 17612 file. 17613 17614 The following options from ISO POSIX (2003) may behave 17615 differently: 17616 17617 -e 17618 has unspecified behavior. 17619 17620 -i 17621 has unspecified behavior. 17622 17623 -n 17624 has unspecified behavior. 17625 17626 -p 17627 Either clear the whole screen before displaying any 17628 text (instead of the usual scrolling behavior), or 17629 provide the behavior specified by ISO POSIX (2003). In 17630 the latter case, the syntax is "-p command". 17631 17632 -t 17633 has unspecified behavior. 17634 17635 The more command need not support the following interactive 17636 commands: 17637 17638 g 17639 G 17640 u 17641 control u 17642 control f 17643 newline 17644 j 17645 k 17646 r 17647 R 17648 m 17649 ' (return to mark) 17650 /! 17651 ? 17652 N 17653 :e 17654 :t 17655 control g 17656 ZZ 17657 17658 Rationale 17659 17660 The +num and +/string options are deprecated in SUSv2, and 17661 have been removed in ISO POSIX (2003); however this 17662 specification continues to specify them because the publicly 17663 available util-linux package does not support the replacement 17664 (-p command). The +command option as found in SUSv2 is more 17665 general than is specified here, but the util-linux package 17666 appears to only support the more specific +num and +/string 17667 forms. 17668 17669 mount 17670 17671 Name 17672 17673 mount -- mount a file system 17674 17675 Synopsis 17676 17677 mount [-hV] 17678 mount [-a] [-fFnrsvw] [-t vfstype] 17679 mount [-fnrsvw] [-o options [,...]] [device | dir] 17680 mount [-fnrsvw] [-t vfstype] [-o options] device dir 17681 17682 Description 17683 17684 As described in ISO POSIX (2003), all files in the system are 17685 organized in a directed graph, known as the file hierarchy, 17686 rooted at /. These files can be spread out over several 17687 underlying devices. The mount command shall attach the file 17688 system found on some underlying device to the file hierarchy. 17689 17690 Options 17691 17692 -v 17693 invoke verbose mode. The mount command shall provide 17694 diagnostic messages on stdout. 17695 17696 -a 17697 mount all filesystems (of the given types) mentioned in 17698 /etc/fstab. 17699 17700 -F 17701 If the -a option is also present, fork a new 17702 incarnation of mount for each device to be mounted. 17703 This will do the mounts on different devices or 17704 different NFS servers in parallel. 17705 17706 -f 17707 cause everything to be done except for the actual 17708 system call; if it's not obvious, this `fakes' mounting 17709 the file system. 17710 17711 -n 17712 mount without writing in /etc/mtab. This is necessary 17713 for example when /etc is on a read-only file system. 17714 17715 -s 17716 ignore mount options not supported by a filesystem 17717 type. Not all filesystems support this option. 17718 17719 -r 17720 mount the file system read-only. A synonym is -o ro. 17721 17722 -w 17723 mount the file system read/write. (default) A synonym 17724 is -o rw. 17725 17726 -L label 17727 If the file /proc/partitions is supported, mount the 17728 partition that has the specified label. 17729 17730 -U uuid 17731 If the file /proc/partitions is supported, mount the 17732 partition that has the specified uuid. 17733 17734 -t vfstype 17735 indicate a file system type of vfstype. 17736 17737 More than one type may be specified in a comma 17738 separated list. The list of file system types can be 17739 prefixed with no to specify the file system types on 17740 which no action should be taken. 17741 17742 -o 17743 options are specified with a -o flag followed by a 17744 comma-separated string of options. Some of these 17745 options are only useful when they appear in the 17746 /etc/fstab file. The following options apply to any 17747 file system that is being mounted: 17748 17749 async 17750 perform all I/O to the file system 17751 asynchronously. 17752 17753 atime 17754 update inode access time for each access. 17755 (default) 17756 17757 auto 17758 in /etc/fstab, indicate the device is mountable 17759 with -a. 17760 17761 defaults 17762 use default options: rw, suid, dev, exec, auto, 17763 nouser, async. 17764 17765 dev 17766 interpret character or block special devices on 17767 the file system. 17768 17769 exec 17770 permit execution of binaries. 17771 17772 noatime 17773 do not update file access times on this file 17774 system. 17775 17776 noauto 17777 in /etc/fstab, indicates the device is only 17778 explicitly mountable. 17779 17780 nodev 17781 do not interpret character or block special 17782 devices on the file system. 17783 17784 noexec 17785 do not allow execution of any binaries on the 17786 mounted file system. 17787 17788 nosuid 17789 do not allow set-user-identifier or 17790 set-group-identifier bits to take effect. 17791 17792 nouser 17793 forbid an unprivileged user to mount the file 17794 system. (default) 17795 17796 remount 17797 remount an already-mounted file system. This is 17798 commonly used to change the mount options for a 17799 file system, especially to make a read-only file 17800 system writable. 17801 17802 ro 17803 mount the file system read-only. 17804 17805 rw 17806 mount the file system read-write. 17807 17808 suid 17809 allow set-user-identifier or set-group-identifier 17810 bits to take effect. 17811 17812 sync 17813 do all I/O to the file system synchronously. 17814 17815 user 17816 allow an unprivilieged user to mount the file 17817 system. This option implies the options noexec, 17818 nosuid, nodev unless overridden by subsequent 17819 options. 17820 17821 LSB Deprecated Options 17822 17823 The behaviors specified in this section are expected to 17824 disappear from a future version of the LSB; applications 17825 should only use the non-LSB-deprecated behaviors. 17826 17827 -V 17828 output version and exit. 17829 17830 msgfmt 17831 17832 Name 17833 17834 msgfmt -- create a message object from a message file 17835 17836 Synopsis 17837 17838 msgfmt [options...] filename... 17839 17840 Description 17841 17842 The msgfmt command generates a binary message catalog from a 17843 textual translation description. Message catalogs, or message 17844 object files, are stored in files with a .mo extension. 17845 17846 Note: The format of message object files is not guaranteed 17847 to be portable. Message catalogs should always be generated 17848 on the target architecture using the msgfmt command. 17849 17850 The source message files, otherwise known as portable object 17851 files, have a .po extension. 17852 17853 The filename operands shall be portable object files. The .po 17854 file contains messages to be displayed to users by system 17855 utilities or by application programs. The portable object 17856 files are text files, and the messages in them can be 17857 rewritten in any language supported by the system. 17858 17859 If any filename is -, a portable object file shall be read 17860 from the standard input. 17861 17862 The msgfmt command interprets data as characters according to 17863 the current setting of the LC_CTYPE locale category. 17864 17865 Options 17866 17867 -c, --check 17868 Detect and diagnose input file anomalies which might 17869 represent translation errors. The msgid and msgstr 17870 strings are studied and compared. It is considered 17871 abnormal that one string starts or ends with a newline 17872 while the other does not. 17873 17874 If the message is flagged as c-format (see Comment 17875 Handling), check that the msgid string and the msgstr 17876 translation have the same number of % format 17877 specifiers, with matching types. 17878 17879 -D directory, --directory=directory 17880 Add directory to list for input files search. If 17881 filename is not an absolute pathname and filename 17882 cannot be opened, search for it in directory. This 17883 option may be repeated. Directories shall be searched 17884 in order, with the leftmost directory searched first. 17885 17886 -f, --use-fuzzy 17887 Use entries marked as fuzzy in output. If this option 17888 is not specified, such entries are not included into 17889 the output. See Comment Handling below. 17890 17891 -o output-file, --output-file=output-file 17892 Specify the output file name as output-file. If 17893 multiple domains or duplicate msgids in the .po file 17894 are present, the behavior is unspecified. If 17895 output-file is -, output is written to standard output. 17896 17897 --strict 17898 Ensure that all output files have a .mo extension. 17899 Output files are named either by the -o (or 17900 --output-file) option, or by domains found in the input 17901 files. 17902 17903 -v, --verbose 17904 Print additional information to the standard error, 17905 including the number of translated strings processed. 17906 17907 Operands 17908 17909 The filename operands are treated as portable object files. 17910 The format of portable object files is defined in EXTENDED 17911 DESCRIPTION. 17912 17913 Standard Input 17914 17915 The standard input is not used unless a filename operand is 17916 specified as "-". 17917 17918 Environment Variables 17919 17920 LANGUAGE 17921 Specifies one or more locale names. 17922 17923 LANG 17924 Specifies locale name. 17925 17926 LC_ALL 17927 Specifies locale name for all categories. If defined, 17928 overrides LANG, LC_CTYPE and LC_MESSAGES. 17929 17930 LC_CTYPE 17931 Determine the locale for the interpretation of 17932 sequences of bytes of text data as characters (for 17933 example, single-byte as opposed to multi-byte 17934 characters in arguments and input files). 17935 17936 LC_MESSAGES 17937 Specifies messaging locale, and if present overrides 17938 LANG for messages. 17939 17940 Standard Output 17941 17942 The standard output is not used unless the option-argument of 17943 the -o option is specified as -. 17944 17945 Extended Description 17946 17947 The format of portable object files (.po files) is defined as 17948 follows. Each .po file contains one or more lines, with each 17949 line containing either a comment or a statement. Comments 17950 start the line with a hash mark (#) and end with the newline 17951 character. Empty lines, or lines containing only white-space, 17952 shall be ignored. Comments can in certain circumstances alter 17953 the behavior of msgfmt. See Comment Handling below for details 17954 on comment processing. The format of a statement is: 17955 17956 directive value 17957 17958 Each directive starts at the beginning of the line and is 17959 separated from value by white space (such as one or more space 17960 or tab characters). The value consists of one or more quoted 17961 strings separated by white space. If two or more strings are 17962 specified as value, they are normalized into single string 17963 using the string normalization syntax specified in ISO C 17964 (1999). The following directives are supported: 17965 17966 domain domainname 17967 17968 msgid message_identifier 17969 17970 msgid_plural untranslated_string_plural 17971 17972 msgstr message_string 17973 17974 msgstr[n] message_string 17975 17976 The behavior of the domain directive is affected by the 17977 options used. See OPTIONS for the behavior when the -o option 17978 is specified. If the -o option is not specified, the behavior 17979 of the domain directive is as follows: 17980 17981 1. All msgids from the beginning of each .po file to the 17982 first domain directive are put into a default message 17983 object file, messages (or messages.mo if the --strict 17984 option is specified). 17985 2. When msgfmt encounters a domain domainname directive in 17986 the .po file, all following msgids until the next domain 17987 directive are put into the message object file domainname 17988 (or domainname.mo if --strict option is specified). 17989 3. Duplicate msgids are defined in the scope of each domain. 17990 That is, a msgid is considered a duplicate only if the 17991 identical msgid exists in the same domain. 17992 4. All duplicate msgids are ignored. 17993 17994 The msgid directive specifies the value of a message 17995 identifier associated with the directive that follows it. The 17996 msgid_plural directive specifies the plural form message 17997 specified to the plural message handling functions ngettext(), 17998 dngettext() or dcngettext(). The message_identifier string 17999 identifies a target string to be used at retrieval time. Each 18000 statement containing a msgid directive shall be followed by a 18001 statement containing a msgstr directive or msgstr[n] 18002 directives. 18003 18004 The msgstr directive specifies the target string associated 18005 with the message_identifier string declared in the immediately 18006 preceding msgid directive. 18007 18008 The msgstr[n] (where n = 0, 1, 2, ...) directive specifies the 18009 target string to be used with plural form handling functions 18010 ngettext(), dngettext() and dcngettext(). 18011 18012 Message strings can contain the following escape sequences: 18013 18014 Table 3-1. Escape Sequences 18015 \n newline 18016 \t tab 18017 \v vertical tab 18018 \b backspace 18019 \r carriage return 18020 \f formfeed 18021 \\ backslash 18022 \" double quote 18023 \ddd octal bit pattern 18024 \xHH hexadecimal bit pattern 18025 18026 Comment Handling 18027 18028 Comments are introduced by a #, and continue to the end of the 18029 line. The second character (i.e. the character following the 18030 #) has special meaning. Regular comments should follow a space 18031 character. Other comment types include: 18032 18033 # normal-comments 18034 18035 #. automatic-comments 18036 18037 #: reference... 18038 18039 #, flag 18040 18041 Automatic and reference comments are typically generated by 18042 external utilities, and are not specified by the LSB. The 18043 msgfmt command shall ignore such comments. 18044 18045 Note: Portable object files may be produced by unspecified 18046 tools. Some of the comment types described here may arise 18047 from the use of such tools. It is beyond the scope of this 18048 specification to describe these tools. 18049 18050 The #, comments require one or more flags separated by the 18051 comma (,) character. The following flags can be specified: 18052 18053 fuzzy 18054 This flag shows that the following msgstr string might 18055 not be a correct translation. Only the translator (i.e. 18056 the individual undertaking the translation) can judge 18057 if the translation requires further modification, or is 18058 acceptable as is. Once satisfied with the translation, 18059 the translator then removes this fuzzy flag. 18060 18061 If this flag is specified, the msgfmt utility will not 18062 generate the entry for the immediately following msgid 18063 in the output message catalog, unless the --use-fuzzy 18064 is specified. 18065 18066 c-format, no-c-format 18067 The c-format flag indicates that the msgid string is 18068 used as format string by printf()-like functions. If 18069 the c-format flag is given for a string the msgfmt 18070 utility may perform additional tests to check to 18071 validity of the translation. 18072 18073 Plurals 18074 18075 The msgid entry with empty string ("") is called the header 18076 entry and is treated specially. If the message string for the 18077 header entry contains nplurals=value, the value indicates the 18078 number of plural forms. For example, if nplurals=4, there are 18079 4 plural forms. If nplurals is defined, there should be a 18080 plural=expression on the same line, separated by a semicolon 18081 (;) character. The expression is a C language expression to 18082 determine which version of msgstr[n] to be used based on the 18083 value of n, the last argument of ngettext(), dngettext() or 18084 dcngettext(). For example: 18085 nplurals=2; plural=n == 1 ? 0 : 1 18086 18087 indicates that there are 2 plural forms in the language; 18088 msgstr[0] is used if n == 1, otherwise msgstr[1] is used. 18089 Another example: 18090 nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2 18091 18092 indicates that there are 3 plural forms in the language; 18093 msgstr[0] is used if n == 1, msgstr[1] is used if n == 2, 18094 otherwise msgstr[2] is used. 18095 18096 If the header entry contains charset=codeset string, the 18097 codeset is used to indicate the codeset to be used to encode 18098 the message strings. If the output string's codeset is 18099 different from the message string's codeset, codeset 18100 conversion from the message strings's codeset to the output 18101 string's codeset will be performed upon the call of gettext(), 18102 dgettext(), dcgettext(), ngettext(), dngettext(), and 18103 dcngettext(). The output string's codeset is determined by the 18104 current locale's codeset (the return value of 18105 nl_langinfo(CODESET)) by default, and can be changed by the 18106 call of bind_textdomain_codeset(). 18107 18108 Exit Status 18109 18110 The following exit values are returned: 18111 18112 0 18113 Successful completion. 18114 18115 >0 18116 An error occurred. 18117 18118 Application Usage 18119 18120 Neither msgfmt nor any gettext() function imposes a limit on 18121 the total length of a message. Installing message catalogs 18122 under the C locale is pointless, since they are ignored for 18123 the sake of efficiency. 18124 18125 Examples 18126 18127 Example 1: Examples of creating message objects from message 18128 files. 18129 18130 In this example module1.po, module2.po and module3.po are 18131 portable message object files. 18132 example% cat module1.po 18133 18134 # default domain "messages" 18135 18136 msgid "message one" 18137 18138 msgstr "mensaje nśmero uno" 18139 18140 # 18141 18142 domain "help_domain" 18143 18144 msgid "help two" 18145 18146 msgstr "ayuda nśmero dos" 18147 18148 # 18149 18150 domain "error_domain" 18151 18152 msgid "error three" 18153 18154 msgstr "error nśmero tres" 18155 18156 example% cat module2.po 18157 18158 # default domain "messages" 18159 18160 msgid "message four" 18161 18162 msgstr "mensaje nśmero cuatro" 18163 18164 # 18165 18166 domain "error_domain" 18167 18168 msgid "error five" 18169 18170 msgstr "error nśmero cinco" 18171 18172 # 18173 18174 domain "window_domain" 18175 18176 msgid "window six" 18177 18178 msgstr "ventana nśmero seises" 18179 18180 example% cat module3.po 18181 18182 # default domain "messages" 18183 18184 msgid "message seven" 18185 18186 msgstr "mensaje nśmero siete" 18187 18188 The following command will produce the output files messages, 18189 help_domain, and error_domain. 18190 example% msgfmt module1.po 18191 18192 The following command will produce the output files 18193 messages.mo, help_domain.mo, error_domain.mo, and 18194 window_domain.mo. 18195 example% msgfmt module1.po module2.po 18196 18197 The following example will produce the output file hello.mo. 18198 example% msgfmt -o hello.mo module3.po 18199 18200 newgrp 18201 18202 Name 18203 18204 newgrp -- change group ID 18205 18206 Synopsis 18207 18208 newgrp [group] 18209 18210 Description 18211 18212 The newgrp command is as specified in ISO POSIX (2003), but 18213 with differences as listed below. 18214 18215 Differences 18216 18217 The -l option specified in ISO POSIX (2003) need not be 18218 supported. 18219 18220 od 18221 18222 Name 18223 18224 od -- dump files in octal and other formats 18225 18226 Synopsis 18227 18228 od [-abcdfilox] [-w width | --width-width] [-v] [-A 18229 address_base] [-j skip] [-n count] [-t type_string] [file...] 18230 od --traditional [options] [file] [[+]offset [.] [b]] 18231 [[+]label [.] [b]] 18232 18233 Description 18234 18235 The od command shall provide all of the madatory functionality 18236 specified in ISO POSIX (2003), but with extensions and 18237 differences to the XSI optional behavior as listed below. 18238 18239 Extensions and Differences 18240 18241 -s 18242 unspecified behavior. 18243 18244 Note: Applications wishing to achieve the ISO POSIX (2003) 18245 behavior for -s should instead use -t d2. 18246 18247 -wwidth, --width[=width] 18248 each output line is limited to width bytes from the 18249 input. 18250 18251 --traditional 18252 accepts arguments in traditional form, see Traditional 18253 Usage below. 18254 18255 Note: The XSI optional behavior for offset handling 18256 described in ISO POSIX (2003) is not supported unless the 18257 --traditional option is also specified. 18258 18259 Pre-POSIX and XSI Specifications 18260 18261 The LSB supports mixing options between the mandatory and XSI 18262 optional synopsis forms in ISO POSIX (2003). The LSB shall 18263 support the following options: 18264 18265 -a 18266 is equivalent to -t a, selects named characters. 18267 18268 -b 18269 is equivalent to -t o1, selects octal bytes. 18270 18271 -c 18272 is equivalent to -t c, selects characters. 18273 18274 -d 18275 is equivalent to -t u2, selects unsigned decimal two 18276 byte units. 18277 18278 -f 18279 is equivalent to -t fF, selects floats. 18280 18281 -i 18282 is equivalent to -t d2, selects decimal two byte units. 18283 18284 Note: This usage may change in future releases; portable 18285 applications should use -t d2. 18286 18287 -l 18288 is equivalent to -t d4, selects decimal longs. 18289 18290 -o 18291 is equivalent to -t o2, selects octal two byte units. 18292 18293 -x 18294 is equivalent to -t x2, selects hexadecimal two byte 18295 units. 18296 18297 Note that the XSI option -s need not be supported. 18298 18299 Traditional Usage 18300 18301 If the --traditional option is specified, there may be between 18302 zero and three operands specified. 18303 18304 If no operands are specified, then od shall read the standard 18305 input. 18306 18307 If there is exactly one operand, and it is an offset of the 18308 form [+]offset[.][b], then it shall be interpreted as 18309 specified in ISO POSIX (2003). The file to be dumped shall be 18310 the standard input. 18311 18312 If there are exactly two operands, and they are both of the 18313 form [+]offset[.][b], then the first shall be an treated as an 18314 offset (as above), and the second shall be a label, in the 18315 same format as the offset. If a label is specified, then the 18316 first output line produced for each input block shall be 18317 preceded by the input offset, cumulative across input files, 18318 of the next byte to be written, followed by the label, in 18319 parentheses. The label shall increment in the same manner as 18320 the offset. 18321 18322 If there are three operands, then the first shall be the file 18323 to dump, the second the offset, and the third the label. 18324 18325 Note: Recent versions of coreutils contain an od utility 18326 that conforms to ISO POSIX (2003). However, in April 2005, 18327 this version was not in widespread use. A future version of 18328 this specification may remove the differences. 18329 18330 passwd 18331 18332 Name 18333 18334 passwd -- change user password 18335 18336 Synopsis 18337 18338 passwd [-x max] [-n min] [-w warn] [-i inact] name 18339 passwd {-l | -u} name 18340 18341 Description 18342 18343 passwd changes passwords for user and group accounts. A normal 18344 user may only change the password for their own account, the 18345 super user may change the password for any account. passwd 18346 also changes password expiry dates and intervals. Applications 18347 may not assume the format of prompts and anticipated input for 18348 user interaction, because they are unspecified. 18349 18350 Options 18351 18352 -x max 18353 sets the maximum number of days a password remains 18354 valid. 18355 18356 -n min 18357 sets the minimum number of days before a password may 18358 be changed. 18359 18360 -w warn 18361 sets the number of days warning the user will receive 18362 before their password will expire. 18363 18364 -i inactive 18365 disables an account after the password has been expired 18366 for the given number of days. 18367 18368 -l 18369 disables an account by changing the password to a value 18370 which matches no possible encrypted value. 18371 18372 -u 18373 re-enables an account by changing the password back to 18374 its previous value. 18375 18376 patch 18377 18378 Name 18379 18380 patch -- apply a diff file to an original 18381 18382 Description 18383 18384 patch is as specified in ISO POSIX (2003), but with extensions 18385 as listed below. 18386 18387 Extensions 18388 18389 --binary 18390 reads and write all files in binary mode, except for 18391 standard output and /dev/tty. This option has no effect 18392 on POSIX-compliant systems. 18393 18394 -u, --unified 18395 interprets the patch file as a unified context diff. 18396 18397 pidof 18398 18399 Name 18400 18401 pidof -- find the process ID of a running program 18402 18403 Synopsis 18404 18405 pidof [-s] [-x] [-o omitpid...] program... 18406 18407 Description 18408 18409 Return the process ID of a process which is running the 18410 program named on the command line. 18411 18412 The pidof command is a system administration utility, see Path 18413 For System Administration Utilities. 18414 18415 Options 18416 18417 -s 18418 instructs the program to only return one pid. 18419 18420 -x 18421 causes the program to also return process id's of 18422 shells running the named scripts. 18423 18424 -o 18425 omits processes with specified process id. 18426 18427 remove_initd 18428 18429 Name 18430 18431 remove_initd -- clean up boot script system modifications 18432 introduced by install_initd 18433 18434 Synopsis 18435 18436 /usr/lib/lsb/remove_initd initd_file 18437 18438 Description 18439 18440 remove_initd processes the removal of the modifications made 18441 to a distribution's boot script system by the install_initd 18442 program. This cleanup is performed in the preuninstall script 18443 of a package; however, the package manager is still 18444 responsible for removing the /etc/init.d file. See also 18445 Section 8.4. 18446 18447 renice 18448 18449 Name 18450 18451 renice -- alter priority of running processes 18452 18453 Description 18454 18455 renice is as specified in ISO POSIX (2003), but with 18456 differences as listed below. 18457 18458 Differences 18459 18460 -n increment 18461 has unspecified behavior. 18462 18463 sed 18464 18465 Name 18466 18467 sed -- stream editor 18468 18469 Description 18470 18471 sed is as specified in ISO POSIX (2003), but with differences 18472 as listed below. 18473 18474 LSB Differences 18475 18476 Certain aspects of internationalized regular expressions are 18477 optional; see Internationalization and Regular Expressions. 18478 18479 sendmail 18480 18481 Name 18482 18483 sendmail -- an electronic mail transport agent 18484 18485 Synopsis 18486 18487 /usr/sbin/sendmail [options] [address...] 18488 18489 Description 18490 18491 To deliver electronic mail (email), applications shall support 18492 the interface provided by sendmail (described here). This 18493 interface shall be the default delivery method for 18494 applications. 18495 18496 This program sends an email message to one or more recipients, 18497 routing the message as necessary. This program is not intended 18498 as a user interface routine. 18499 18500 With no options, sendmail reads its standard input up to an 18501 end-of-file or a line consisting only of a single dot and 18502 sends a copy of the message found there to all of the 18503 addresses listed. It determines the network(s) to use based on 18504 the syntax and contents of the addresses. 18505 18506 If an address is preceded by a backslash, '\', it is 18507 unspecified if the address is subject to local alias 18508 expansion. 18509 18510 The format of messages shall be as defined in RFC 18511 2822:Internet Message Format. 18512 18513 Options 18514 18515 -bm 18516 read mail from standard input and deliver it to the 18517 recipient addresses. This is the default mode of 18518 operation. 18519 18520 -bp 18521 If the user has sufficient privilege, list information 18522 about messages currently in the mail queue. 18523 18524 -bs 18525 use the SMTP protocol as described in RFC 2821:Simple 18526 Mail Transfer Protocol; read SMTP commands on standard 18527 input and write SMTP responses on standard output. 18528 18529 In this mode, sendmail shall accept \r\n (CR-LF), as 18530 required by RFC 2821:Simple Mail Transfer Protocol, and 18531 \n (LF) line terminators. 18532 18533 -F fullname 18534 explicitly set the full name of the sender for incoming 18535 mail unless the message already contains a From: 18536 message header. 18537 18538 If the user running sendmail is not sufficiently 18539 trusted, then the actual sender may be indicated in the 18540 message, depending on the configuration of the agent. 18541 18542 -f name 18543 explicitly set the envelope sender address for incoming 18544 mail. If there is no From: header, the address 18545 specified in the From: header will also be set. 18546 18547 If the user running sendmail is not sufficiently 18548 trusted, then the actual sender shall be indicated in 18549 the message. 18550 18551 -i 18552 ignore dots alone on lines by themselves in incoming 18553 messages. If this options is not specified, a line 18554 consisting of a single dot shall terminate the input. 18555 If -bs is also used, the behavior is unspecified. 18556 18557 -odb 18558 deliver any mail in background, if supported; otherwise 18559 ignored. 18560 18561 -odf 18562 deliver any mail in foreground, if supported; otherwise 18563 ignored. 18564 18565 -oem or -em 18566 mail errors back to the sender. (default) 18567 18568 -oep or -ep 18569 write errors to the standard error output. 18570 18571 -oeq or -eq 18572 do not send notification of errors to the sender. This 18573 only works for mail delivered locally. 18574 18575 -oi 18576 is equivalent to -i. 18577 18578 -om 18579 indicate that the sender of a message should receive a 18580 copy of the message if the sender appears in an alias 18581 expansion. Ignored if aliases are not supported. 18582 18583 -t 18584 read the message to obtain recipients from the To:, 18585 Cc:, and Bcc: headers in the message instead of from 18586 the command arguments. If a Bcc: header is present, it 18587 is removed from the message unless there is no To: or 18588 Cc: header, in which case a Bcc: header with no data is 18589 created, in accordance with RFC 2822:Internet Message 18590 Format. 18591 18592 If there are any operands, the recipients list is 18593 unspecified. 18594 18595 This option may be ignored when not in -bm mode (the 18596 default). 18597 18598 Note: It is recommended that applications use as few 18599 options as necessary, none if possible. 18600 18601 Exit status 18602 18603 0 18604 successful completion on all addresses. This does not 18605 indicate successful delivery. 18606 18607 >0 18608 there was an error. 18609 18610 Notes/Rationale 18611 18612 This page is intended to reflect functionality provided by 18613 smail, exim and other implementations, not just the sendmail 18614 implementation. 18615 18616 shutdown 18617 18618 Name 18619 18620 shutdown -- shut the system down 18621 18622 Synopsis 18623 18624 /sbin/shutdown [-t sec] [-h | -r] [-akfF] time 18625 [warning-message] 18626 /sbin/shutdown -c [warning-message] 18627 18628 Description 18629 18630 The shutdown command shall shut the system down in a secure 18631 way (first synopsis), or cancel a pending shutdown (second 18632 synopsis). When the shutdown is initiated, all logged-in users 18633 shall be notified immediately that the system is going down, 18634 and users shall be prevented from logging in to the system. 18635 The time specifies when the actual shutdown shall commence. 18636 See below for details. At the specified time all processes are 18637 first notified that the system is going down by the signal 18638 SIGTERM. After an interval (see -t) all processes shall be 18639 sent the signal SIGKILL. If neither the -h or the -r argument 18640 is specified, then the default behavior shall be to take the 18641 system to a runlevel where administrative tasks can be run. 18642 See also Run Levels. 18643 18644 Note: This is sometimes referred to as "single user mode". 18645 18646 The -h and -r options are mutually exclusive. If either the -h 18647 or -r options are specified, the system shall be halted or 18648 rebooted respectively. 18649 18650 Standard Options 18651 18652 -a 18653 use access control. See below. 18654 18655 -t sec 18656 tell the system to wait sec seconds between sending 18657 processes the warning and the kill signal, before 18658 changing to another runlevel. The default period is 18659 three seconds. 18660 18661 -k 18662 do not really shutdown; only send the warning messages 18663 to everybody. 18664 18665 -r 18666 reboot after shutdown. 18667 18668 -h 18669 halt after shutdown. Actions after halting are 18670 unspecified (e.g. power off). 18671 18672 -f 18673 advise the system to skip file system consistency 18674 checks on reboot. 18675 18676 -F 18677 advise the system to force file system consistency 18678 checks on reboot. 18679 18680 -c 18681 cancel an already running shutdown. 18682 18683 time 18684 specify when to shut down. 18685 18686 The time argument shall have the following format: [now 18687 | [+]mins | hh:mm] If the format is hh:mm, hh shall 18688 specify the hour (1 or 2 digits) and mm is the minute 18689 of the hour (exactly two digits), and the shutdown 18690 shall commence at the next occurence of the specified 18691 time. If the format is mins (or +mins), where mins is a 18692 decimal number, shutdown shall commence in the 18693 specified number of minutes. The word now is an alias 18694 for +0. 18695 18696 warning-message 18697 specify a message to send to all users. 18698 18699 su 18700 18701 Name 18702 18703 su -- change user ID or become super-user 18704 18705 Synopsis 18706 18707 su [options] [-] [username [ARGS]] 18708 18709 Description 18710 18711 su is used to become another user during a login session. 18712 Invoked without a username, su defaults to becoming the super 18713 user. The optional argument - may be used to provide an 18714 environment similar to what the user would expect had the user 18715 logged in directly. 18716 18717 The user will be prompted for a password, if appropriate. 18718 Invalid passwords will produce an error message. All attempts, 18719 both valid and invalid, are logged to detect abuses of the 18720 system. Applications may not assume the format of prompts and 18721 anticipated input for user interaction, because they are 18722 unspecified. 18723 18724 An optional command can be executed. This is done by the shell 18725 specified in /etc/passwd for the target user unless the -s or 18726 -m options are used. Any arguments supplied after the username 18727 will be passed to the invoked shell (shell shall support the 18728 -c command line option in order for a command to be passed to 18729 it). 18730 18731 The current environment is passed to the new shell. The value 18732 of $PATH is reset to /bin:/usr/bin for normal users, or 18733 /sbin:/bin:/usr/sbin:/usr/bin for the super user. This may be 18734 changed with the ENV_PATH and ENV_SUPATH definitions in 18735 /etc/login.defs. When using the -m or -p options, the user's 18736 environment is not changed. 18737 18738 A subsystem login is indicated by the presense of a "*" as the 18739 first character of the login shell. The given home directory 18740 will be used as the root of a new filesystem which the user is 18741 actually logged into. 18742 18743 Standard Options 18744 18745 - 18746 makes this a login shell. 18747 18748 -c, --comand=command 18749 passes command to the invoked shell. It is passed 18750 directly to the invoked shell (using the shell's -c 18751 option), so its syntax is whatever that shell can 18752 accept. 18753 18754 -m, -p, --preserve-environment 18755 does not reset environment variables, and keeps the 18756 same shell if it is present in /etc/shells. 18757 18758 -s, --shell=shell 18759 uses shell instead of the default in /etc/passwd. The 18760 shell specified shall be present in /etc/shells. 18761 18762 sync 18763 18764 Name 18765 18766 sync -- flush filesystem buffers 18767 18768 Synopsis 18769 18770 sync 18771 18772 Description 18773 18774 Force changed blocks to disk, update the super block. 18775 18776 tar 18777 18778 Name 18779 18780 tar -- file archiver 18781 18782 Description 18783 18784 tar is as specified in SUSv2, but with differences as listed 18785 below. 18786 18787 Differences 18788 18789 Some elements of the Pattern Matching Notation are optional; 18790 see Internationalization and Pattern Matching Notation. 18791 18792 -h 18793 doesn't dump symlinks; dumps the files they point to. 18794 18795 -z 18796 filters the archive through gzip. 18797 18798 umount 18799 18800 Name 18801 18802 umount -- unmount file systems 18803 18804 Synopsis 18805 18806 umount [-hV] 18807 umount -a [-nrv] [-t vfstype] 18808 umount [-nrv] device | dir... 18809 18810 Description 18811 18812 umount detaches the file system(s) mentioned from the file 18813 hierarchy. A file system is specified by giving the directory 18814 where it has been mounted. 18815 18816 Standard Options 18817 18818 -v 18819 invokes verbose mode. 18820 18821 -n 18822 unmounts without writing in /etc/mtab. 18823 18824 -r 18825 tries to remount read-only if unmounting fails. 18826 18827 -a 18828 unmounts all of the file systems described in /etc/mtab 18829 except for the proc filesystem. 18830 18831 -t vfstype 18832 indicates that the actions should only be taken on file 18833 systems of the specified type. More than one type may 18834 be specified in a comma separated list. The list of 18835 file system types can be prefixed with no to specify 18836 the file system types on which no action should be 18837 taken. 18838 18839 -f 18840 forces unmount (in case of an unreachable NFS system). 18841 18842 LSB Deprecated Options 18843 18844 The behaviors specified in this section are expected to 18845 disappear from a future version of the LSB; applications 18846 should only use the non-LSB-deprecated behaviors. 18847 18848 -V 18849 print version and exits. 18850 18851 useradd 18852 18853 Name 18854 18855 useradd -- create a new user or update default new user 18856 information 18857 18858 Synopsis 18859 18860 useradd [-c comment] [-d home_dir] [-g initial_group] [-G 18861 group...] [-m [-k skeleton_dir]] [-p passwd] [-r] [-s shell] 18862 [-u uid [-o]] login 18863 useradd -D [-g default_group] [-b default_home] [-s 18864 default_shell] 18865 18866 Description 18867 18868 When invoked without the -D option, and with appropriate 18869 privilege, useradd creates a new user account using the values 18870 specified on the command line and the default values from the 18871 system. The new user account will be entered into the system 18872 files as needed, the home directory will be created, and 18873 initial files copied, depending on the command line options. 18874 18875 When invoked with the -D option, useradd will either display 18876 the current default values, or, with appropriate privilege, 18877 update the default values from the command line. If no options 18878 are specified, useradd displays the current default values. 18879 18880 The useradd command is a system administration utility, see 18881 Path For System Administration Utilities. 18882 18883 Standard Options 18884 18885 -c comment 18886 specifies the new user's password file comment field 18887 value. 18888 18889 -d home_dir 18890 creates the new user using home_dir as the value for 18891 the user's login directory. The default is to append 18892 the login name to default_home and use that as the 18893 login directory name. 18894 18895 -g initial_group 18896 specifies the group name or number of the user's 18897 initial login group. The group name shall exist. A 18898 group number shall refer to an already existing group. 18899 If -g is not specified, the implementation will follow 18900 the normal user default for that system. This may 18901 create a new group or choose a default group that 18902 normal users are placed in. Applications which require 18903 control of the groups into which a user is placed 18904 should specify -g. 18905 18906 -G group[,...] 18907 specifies a list of supplementary groups which the user 18908 is also a member of. Each group is separated from the 18909 next by a comma, with no intervening whitespace. The 18910 groups are subject to the same restrictions as the 18911 group given with the -g option. The default is for the 18912 user to belong only to the initial group. 18913 18914 -m [-k skeleton_dir] 18915 specifies the user's home directory will be created if 18916 it does not exist. The files contained in skeleton_dir 18917 will be copied to the home directory if the -k option 18918 is used, otherwise the files contained in /etc/skel 18919 will be used instead. Any directories contained in 18920 skeleton_dir or /etc/skel will be created in the user's 18921 home directory as well. The -k option is only valid in 18922 conjunction with the -m option. The default is to not 18923 create the directory and to not copy any files. 18924 18925 -p passwd 18926 is the encrypted password, as returned by crypt(). The 18927 default is to disable the account. 18928 18929 -r 18930 creates a system account, that is, a user with a UID in 18931 the range reserved for system account users. If there 18932 is not a UID free in the reserved range the command 18933 will fail. 18934 18935 -s shell 18936 specifies the name of the user's login shell. The 18937 default is to leave this field blank, which causes the 18938 system to select the default login shell. 18939 18940 -u uid [-o] 18941 specifies the numerical value of the user's ID. This 18942 value shall be unique, unless the -o option is used. 18943 The value shall be non-negative. The default is the 18944 smallest ID value greater than 499 which is not yet 18945 used. 18946 18947 Change Default Options 18948 18949 -b default_home 18950 specifies the initial path prefix for a new user's home 18951 directory. The user's name will be affixed to the end 18952 of default_home to create the new directory name if the 18953 -d option is not used when creating a new account. 18954 18955 -g default_group 18956 specifies the group name or ID for a new user's initial 18957 group. The named group shall exist, and a numerical 18958 group ID shall have an existing entry. 18959 18960 -s default_shell 18961 specifies the name of the new user's login shell. The 18962 named program will be used for all future new user 18963 accounts. 18964 18965 -c comment 18966 specifies the new user's password file comment field 18967 value. 18968 18969 Application Usage 18970 18971 The -D option will typically be used by system administration 18972 packages. Most applications should not change defaults which 18973 will affect other applications and users. 18974 18975 userdel 18976 18977 Name 18978 18979 userdel -- delete a user account and related files 18980 18981 Synopsis 18982 18983 userdel [-r] login 18984 18985 Description 18986 18987 Delete the user account named login. If there is also a group 18988 named login, this command may delete the group as well, or may 18989 leave it alone. 18990 18991 The userdel command is a system administration utility, see 18992 Path For System Administration Utilities. 18993 18994 Options 18995 18996 -r 18997 removes files in the user's home directory along with 18998 the home directory itself. Files located in other file 18999 system will have to be searched for and deleted 19000 manually. 19001 19002 usermod 19003 19004 Name 19005 19006 usermod -- modify a user account 19007 19008 Synopsis 19009 19010 usermod [-c comment] [-d home_dir [ -m]] [-g initial_group] 19011 [-G group [,...]] [-l login_name] [-p passwd] [-s shell] [-u 19012 uid [ -o]] login 19013 19014 Description 19015 19016 The usermod command shall modify an entry in the user account 19017 database. 19018 19019 The usermod command is a system administration utility, see 19020 Path For System Administration Utilities. 19021 19022 Options 19023 19024 -c comment 19025 specifies the new value of the user's password file 19026 comment field. 19027 19028 -d home_dir 19029 specifies the user's new login directory. If the -m 19030 option is given the contents of the current home 19031 directory will be moved to the new home directory, 19032 which is created if it does not already exist. 19033 19034 -g initial_group 19035 specifies the group name or number of the user's new 19036 initial login group. The group name shall exist. A 19037 group number shall refer to an already existing group. 19038 19039 -G group,[...] 19040 specifies a list of supplementary groups which the user 19041 is also a member of. Each group is separated from the 19042 next by a comma, with no intervening whitespace. The 19043 groups are subject to the same restrictions as the 19044 group given with the -g option. If the user is 19045 currently a member of a group which is not listed, the 19046 user will be removed from the group. 19047 19048 -l login_name 19049 changes the name of the user from login to login_name. 19050 Nothing else is changed. In particular, the user's home 19051 directory name should probably be changed to reflect 19052 the new login name. 19053 19054 -p passwd 19055 is the encrypted password, as returned by crypt(3). 19056 19057 -s shell 19058 specifies the name of the user's new login shell. 19059 Setting this field to blank causes the system to select 19060 the default login shell. 19061 19062 -u uid [-o] 19063 specifies the numerical value of the user's ID. This 19064 value shall be unique, unless the -o option is used. 19065 The value shall be non-negative. Any files which the 19066 user owns and which are located in the directory tree 19067 rooted at the user's home directory will have the file 19068 user ID changed automatically. Files outside of the 19069 user's home directory shall be altered manually. 19070 19071 xargs 19072 19073 Name 19074 19075 xargs -- build and execute command lines from standard input 19076 19077 Description 19078 19079 xargs is as specified in ISO POSIX (2003), but with 19080 differences as listed below. 19081 19082 Differences 19083 19084 -E 19085 has unspecified behavior. 19086 19087 -I 19088 has unspecified behavior. 19089 19090 -L 19091 has unspecified behavior. 19092 19093 Note: These options have been implemented in 19094 findutils-4.2.9, but this version of the utilities is not 19095 in widespread use as of April 2005. However, future 19096 versions of this specification will require support for 19097 these arguments. 19098 19099 IV. Execution Environment 19100 19101 Table of Contents 19102 4. File System Hierarchy 19103 5. Additional Recommendations 19104 6. Additional Behaviors 19105 7. Localization 19106 _________________________________________________________ 19107 19108 Chapter 4. File System Hierarchy 19109 19110 An LSB conforming implementation shall provide the mandatory 19111 portions of the filesystem hierarchy specified in the 19112 Filesystem Hierarchy Standard (FHS), together with any 19113 additional requirements made in this specification. 19114 19115 An LSB conforming application shall conform to the Filesystem 19116 Hierarchy Standard. 19117 19118 The FHS allows many components or subsystems to be optional. 19119 An application shall check for the existence of an optional 19120 component before using it, and should behave in a reasonable 19121 manner if the optional component is not present. 19122 19123 The FHS requirement to locate the operating system kernel in 19124 either / or /boot does not apply if the operating system 19125 kernel does not exist as a file in the filesystem. 19126 19127 The FHS specifies certain behaviors for a variety of commands 19128 if they are present (for example, ping or python). However, 19129 LSB applications shall not rely on any commands beyond those 19130 specified by the LSB. The mere existence of a command may not 19131 be used as an indication that the command behaves in any 19132 particular way. 19133 19134 The following directories or links need not be present: 19135 /etc/X11 /usr/bin/X11 /usr/lib/X11 /proc 19136 _________________________________________________________ 19137 19138 4.1. /dev 19139 19140 The following shall exist under /dev. Other devices may also 19141 exist in /dev. Device names may exist as symbolic links to 19142 other device nodes located in /dev or subdirectories of /dev. 19143 There is no requirement concerning major/minor number values. 19144 19145 /dev/null 19146 An infinite data source and data sink. Data written to 19147 this device shall be discarded. Reads from this device 19148 shall always return end-of-file (EOF). 19149 19150 /dev/zero 19151 This device is a source of zeroed out data. All data 19152 written to this device shall be discarded. A read from 19153 this device shall always return the requested number of 19154 bytes, each initialized to the value '\0'. 19155 19156 /dev/tty 19157 In each process, a synonym for the controlling terminal 19158 associated with the process group of that process, if 19159 any. All reads and writes to this device shall behave 19160 as if the actual controlling terminal device had been 19161 opened. 19162 _________________________________________________________ 19163 19164 4.2. User Accounting Databases 19165 19166 The Filesystem Hierarchy Standard specifies two optional 19167 locations for user accounting databases used by the 19168 getutent(), getutent_r(), getutxent(), getutxid(), 19169 getutxline(), and pututxline() functions. These are 19170 /var/run/utmp and /var/run/wtmp. 19171 19172 The LSB does not specify the format or structure of these 19173 files, or even if they are files at all. They should be used 19174 only as "magic cookies" to the utmpname() function. 19175 _________________________________________________________ 19176 19177 4.3. Path For System Administration Utilities 19178 19179 Certain utilities used for system administration (and other 19180 privilieged commands) may be stored in /sbin, /usr/sbin, and 19181 /usr/local/sbin. Applications requiring to use commands 19182 identified as system administration utilities should add these 19183 directories to their PATH. By default, as described in ISO 19184 POSIX (2003), standard utilities shall be found on the PATH 19185 returned by getconf CS_PATH. 19186 _________________________________________________________ 19187 19188 Chapter 5. Additional Recommendations 19189 19190 5.1. Minimal granted Directory and File permissions 19191 19192 In this Chapter "System" means an "LSB conforming 19193 implementation" and "application" means an "LSB conforming 19194 (third party vendor) application". 19195 19196 The system shall grant to the application read and execute 19197 permissions on files needed to use all system interfaces 19198 (ABIs) required by the LSB specification. 19199 _________________________________________________________ 19200 19201 5.2. Recommendations for applications on ownership and permissions 19202 19203 5.2.1. Directory Write Permissions 19204 19205 The application should not depend on having directory write 19206 permission outside /tmp, /var/tmp, invoking user's home 19207 directory and /var/opt/package, (where package is the name of 19208 the application package). 19209 19210 The application should not depend on owning these directories. 19211 19212 For these directories the application should be able to work 19213 with directory write permissions restricted by the S_ISVTXT 19214 bit (otherwise known as the "sticky bit"). 19215 _________________________________________________________ 19216 19217 5.2.2. File Write Permissions 19218 19219 The application should not depend on file write permission on 19220 files not owned by the user it runs under with the exception 19221 of its personal inbox /var/mail/username. 19222 _________________________________________________________ 19223 19224 5.2.3. File Read and execute Permissions 19225 19226 The application should not depend on having read permission to 19227 every file and directory. 19228 _________________________________________________________ 19229 19230 5.2.4. Suid and Sgid Permissions 19231 19232 The application should not depend on the set user ID or set 19233 group ID (the S_ISUID or S_ISGID permissions of a file not 19234 packaged with the application. Instead, the distribution is 19235 responsible for assuming that all system commands have the 19236 required permissions and work correctly. 19237 19238 Rationale: In order to implement common security policies 19239 it is strongly advisable for applications to use the 19240 minimum set of security attributes necessary for correct 19241 operation. Applications that require substantial 19242 appropriate privilege are likely to cause problems with 19243 such security policies. 19244 _________________________________________________________ 19245 19246 5.2.5. Privileged users 19247 19248 In general, applications should not depend on running as a 19249 privileged user. This specification uses the term "appropriate 19250 privilege" throughout to identify operations that cannot be 19251 achieved without some special granting of additional 19252 privilege. 19253 19254 Applications that have a reason to run with appropriate 19255 privilege should outline this reason clearly in their 19256 documentation. Users of the application should be informed, 19257 that "this application demands security privileges, which 19258 could interfere with system security". 19259 19260 The application should not contain binary-only software that 19261 requires being run with appropriate privilege, as this makes 19262 security auditing harder or even impossible. 19263 _________________________________________________________ 19264 19265 5.2.6. Changing permissions 19266 19267 The application shall not change permissions of files and 19268 directories that do not belong to its own package. Should an 19269 application require that certain files and directories not 19270 directly belonging to the package have a particular ownership, 19271 the application shall document this requirement, and may fail 19272 during installation if the permissions on these files is 19273 inappropriate. 19274 _________________________________________________________ 19275 19276 5.2.7. Removable Media (Cdrom, Floppy, etc.) 19277 19278 Applications that expect to be runnable from removable media 19279 should not depend on logging in as a privileged user, and 19280 should be prepared to deal with a restrictive environment. 19281 Examples of such restrictions could be default mount options 19282 that disable set-user/group-ID attributes, disabling block or 19283 character-special files on the medium, or remapping the user 19284 and group IDs of files away from any privileged value. 19285 19286 Rationale: System vendors and local system administrators 19287 want to run applications from removable media, but want the 19288 possibility to control what the application can do. 19289 _________________________________________________________ 19290 19291 5.2.8. Installable applications 19292 19293 Where the installation of an application needs additional 19294 privileges, it must clearly document all files and system 19295 databases that are modified outside of those in /opt/pkg-name 19296 and /var/opt/pkg-name, other than those that may be updated by 19297 system logging or auditing activities. 19298 19299 Without this, the local system administrator would have to 19300 blindly trust a piece of software, particularly with respect 19301 to its security. 19302 _________________________________________________________ 19303 19304 Chapter 6. Additional Behaviors 19305 19306 6.1. Mandatory Optional Behaviors 19307 19308 This section specifies behaviors in which there is optional 19309 behavior in one of the standards on which the LSB relies, and 19310 where the LSB requires a specific behavior. 19311 19312 Note: The LSB does not require the kernel to be Linux; the 19313 set of mandated options reflects current existing practice, 19314 but may be modified in future releases. 19315 19316 LSB conforming implementations shall support the following 19317 options defined within the ISO POSIX (2003): 19318 19319 _POSIX_FSYNC 19320 _POSIX_MAPPED_FILES 19321 _POSIX_MEMLOCK 19322 _POSIX_MEMLOCK_RANGE 19323 _POSIX_MEMORY_PROTECTION 19324 _POSIX_PRIORITY_SCHEDULING 19325 _POSIX_REALTIME_SIGNALS 19326 _POSIX_THREAD_ATTR_STACKADDR 19327 _POSIX_THREAD_ATTR_STACKSIZE 19328 _POSIX_THREAD_PROCESS_SHARED 19329 _POSIX_THREAD_SAFE_FUNCTIONS 19330 _POSIX_THREADS 19331 19332 The opendir() function shall consume a file descriptor in the 19333 same fashion as open(), and therefore may fail with EMFILE or 19334 ENFILE. 19335 19336 The START and STOP termios characters shall be changeable, as 19337 described as optional behavior in the "General Terminal 19338 Interface" section of the ISO POSIX (2003). 19339 19340 The access() function function shall fail with errno set to 19341 EINVAL if the amode argument contains bits other than those 19342 set by the bitwise inclusive OR of R_OK, W_OK, X_OK and F_OK. 19343 19344 The link() function shall require access to the existing file 19345 in order to succeed, as described as optional behavior in the 19346 ISO POSIX (2003). 19347 19348 Calling unlink() on a directory shall fail. Calling link() 19349 specifying a directory as the first argument shall fail. See 19350 also unlink. 19351 19352 Note: Linux allows rename() on a directory without having 19353 write access, but the LSB does not require this. 19354 _________________________________________________________ 19355 19356 6.1.1. Special Requirements 19357 19358 LSB conforming systems shall enforce certain special 19359 additional restrictions above and beyond those required by ISO 19360 POSIX (2003). 19361 19362 Note: These additional restrictions are required in order 19363 to support the testing and certification programs 19364 associated with the LSB. In each case, these are values 19365 that defined macros must not have; conforming applications 19366 that use these values shall trigger a failure in the 19367 interface that is otherwise described as a "may fail". 19368 19369 The fcntl() function shall treat the "cmd" value -1 as 19370 invalid. 19371 19372 The whence value -1 shall be an invalid value for the lseek(), 19373 fseek() and fcntl() functions. 19374 19375 The value -5 shall be an invalid signal number. 19376 19377 If the sigaddset() or sigdelset() functions are passed an 19378 invalid signal number, they shall return with EINVAL. 19379 Implementations are only required to enforce this requirement 19380 for signal numbers which are specified to be invalid by this 19381 specification (such as the -5 mentioned above). 19382 19383 The mode value -1 to the access() function shall be treated as 19384 invalid. 19385 19386 A value of -1 shall be an invalid "_PC_..." value for 19387 pathconf(). 19388 19389 A value of -1 shall be an invalid "_SC..." value for 19390 sysconf(). 19391 19392 The nl_item value -1 shall be invalid for nl_langinfo(). 19393 19394 The value -1 shall be an invalid "_CS_..." value for 19395 confstr(). 19396 19397 The value "a" shall be an invalid mode argument to popen(). 19398 _________________________________________________________ 19399 19400 Chapter 7. Localization 19401 19402 7.1. Introduction 19403 19404 In order to install a message catalog, the installation 19405 procedure shall supply the message catalog in a format 19406 readable by the msgfmt utility, which shall be invoked to 19407 compile the message catalog into an appropriate binary format 19408 on the target system. 19409 19410 Rationale: The original intent was to allow an application 19411 to contain the binary GNU MO format files. However, the 19412 format of these files is not officially stable, hence it is 19413 necessary to compile these catalogs on the target system. 19414 These binary catalogs may differ from architecture to 19415 architecture as well. 19416 19417 The resulting binary message catalog shall be located in the 19418 package's private area under /opt, and the application may use 19419 bindtextdomain() to specify this location. 19420 19421 Implementations shall support the POSIX and C locales as 19422 specified in ISO POSIX (2003). Implementations may define 19423 additional locale categories not defined by that standard. 19424 19425 Note: Implementations choosing additional locale categories 19426 should be aware of ISO/IEC TR14652 and are advised not to 19427 choose names that conflict with that specification. If 19428 implementations provide locale categories whose names are 19429 part of the FDCC set of ISO/IEC TR14652, they should behave 19430 as defined by that specification. 19431 _________________________________________________________ 19432 19433 7.2. Regular Expressions 19434 19435 Utilities that process regular expressions shall support Basic 19436 Regular Expressions and Extended Regular Expressions as 19437 specified in ISO POSIX (2003), with the following exceptions: 19438 19439 Range expression (such as [a-z]) can be based on code point 19440 order instead of collating element order. 19441 19442 Equivalence class expression (such as [=a=]) and 19443 multi-character collating element expression (such as [.ch.]) 19444 are optional. 19445 19446 Handling of a multi-character collating element is optional. 19447 19448 This affects at least the following utilities: 19449 19450 * awk (see awk) 19451 * grep (see grep) (including egrep, see egrep) 19452 * sed (see sed) 19453 19454 It also affects the behavior of interfaces in the base 19455 libraries, including at least 19456 19457 * regexec() (see regexec) 19458 _________________________________________________________ 19459 19460 7.3. Pattern Matching Notation 19461 19462 Utilities that perform filename pattern matching (also known 19463 as Filename Globbing) shall do it as specified in ISO POSIX 19464 (2003), Pattern Matching Notation, with the following 19465 exceptions: 19466 19467 Pattern bracket expressions (such as [a-z]) can be based on 19468 code point order instead of collating element order. 19469 19470 Equivalence class expression (such as [=a=]) and 19471 multi-character collating element expression (such as [.ch.]) 19472 are optional. 19473 19474 Handling of a multi-character collating element is optional. 19475 19476 This affects at least the following utilities: cpio (cpio), 19477 find (find) and tar (tar). 19478 19479 V. System Initialization 19480 19481 Table of Contents 19482 8. System Initialization 19483 _________________________________________________________ 19484 19485 Chapter 8. System Initialization 19486 19487 8.1. Cron Jobs 19488 19489 In addition to the individual user crontab files specified by 19490 ISO POSIX (2003) stored under /var/spool/cron, the process 19491 that executes scheduled commands shall also process the 19492 following additional crontab files: /etc/crontab, 19493 /etc/cron.d/*. The installation of a package shall not modify 19494 the configuration file /etc/crontab. 19495 19496 If a package wishes to install a job that has to be executed 19497 periodically, it shall place an executable file in one of the 19498 following directories: 19499 19500 /etc/cron.daily 19501 /etc/cron.weekly 19502 /etc/cron.monthly 19503 19504 As these directory names suggest, the files within them are 19505 executed on a daily, weekly, or monthly basis, respectively, 19506 under the control of an entry in one of the system crontab 19507 files, at an unspecified time of day. See below for the rules 19508 concerning the names of files in these directories. 19509 19510 Note: It is recommended that files installed in any of 19511 these directories be scripts (e.g. shell scripts, Perl 19512 scripts, etc.) so that they may be modified by the local 19513 system administrator. 19514 19515 The scripts in these directories should check if all 19516 necessary programs are installed before they try to execute 19517 them. Otherwise, problems will arise if a package is 19518 removed (but not purged), since the configuration files are 19519 kept on the system in this situation. 19520 19521 If a certain task has to be executed at a different frequency 19522 (e.g. more frequently than daily), the package shall install a 19523 file /etc/cron.d/cron-name. The file shall have the same 19524 format as that described for the crontab command in ISO POSIX 19525 (2003), except that there shall be an additional field, 19526 username, before the name of the command to execute. For 19527 completeness, the seven fields shall be: 19528 19529 1. Minute [0,59] 19530 2. Hour [0,23] 19531 3. Day of the month [1,31] 19532 4. Month of the year [1,12] 19533 5. Day of the week [0,6] (with 0=Sunday) 19534 6. Username 19535 7. command [args ...] 19536 19537 This file shall be processed by the system automatically, with 19538 the named command being run at the specified time, as the 19539 specified username. 19540 19541 To avoid namespace conflicts in the /etc/cron.* directories, 19542 the filenames used by LSB-compliant packages in 19543 /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly, or 19544 /etc/cron.d shall come from a managed namespace. These 19545 filenames may be assigned using one of the following methods: 19546 19547 * Assigned names. Such names must be chosen from the 19548 character set [a-z0-9]. In order to avoid conflicts these 19549 names shall be reserved through the Linux Assigned Names 19550 and Numbers Authority (LANANA). Information about the 19551 LANANA may be found at www.lanana.org. 19552 19553 Note: Commonly used names should be reserved in advance; 19554 developers for projects should be encouraged reserve names 19555 from LANANA, so that each distribution can use the same 19556 name, and to avoid conflicts with other projects. 19557 * Hierarchical names. Script names in this category take the 19558 form: --...-, where name is taken from 19559 the character set [a-z0-9], and where there may be one or 19560 more components. may either be an LSB 19561 provider name assigned by the LANANA, or it may be owners' 19562 DNS name in lower case, with at least one '.'. e.g. 19563 "debian.org", "staroffice.sun.com", etc. The LSB provider 19564 name assigned by LANANA shall only consist of the ASCII 19565 characters [a-z0-9]. 19566 * Reserved names. Names that begin with the character '_' 19567 are reserved for distribution use only. These names should 19568 be used for essential system packages only. 19569 _________________________________________________________ 19570 19571 8.2. Init Script Actions 19572 19573 Init files provided by LSB applications shall accept one 19574 argument, saying what to do: 19575 19576 start start the service 19577 stop stop the service 19578 restart stop and restart the service if the service is already 19579 running, otherwise start the service 19580 try-restart restart the service if the service is already 19581 running 19582 reload cause the configuration of the service to be reloaded 19583 without actually stopping and restarting the service 19584 force-reload cause the configuration to be reloaded if the 19585 service supports this, otherwise restart the service if it is 19586 running 19587 status print the current status of the service 19588 19589 The start, stop, restart, force-reload, and status commands 19590 shall be supported by all init files; the reload and the 19591 try-restart options are optional. Other init script actions 19592 may be defined by the init script. 19593 19594 Init files shall ensure that they will behave sensibly if 19595 invoked with start when the service is already running, or 19596 with stop when it isn't, and that they don't kill 19597 unfortunately-named user processes. The best way to achieve 19598 this is to use the init-script functions provided by 19599 /lib/lsb/init-functions. 19600 19601 If a service reloads its configuration automatically (as in 19602 the case of cron, for example), the reload option of the init 19603 file shall behave as if the configuration has been reloaded 19604 successfully. The restart, try-restart, reload and 19605 force-reload action may be atomic; i.e. if a service is known 19606 not be operational after a restart or reload, the script may 19607 return an error without any further action. 19608 19609 These executable files shall not fail obscurely when the 19610 configuration files remain but the package has been removed, 19611 as the default in [the packaging system] is to leave 19612 configuration files on the system after the package has been 19613 removed. Only when it is executed with the [purge] option will 19614 [the packaging system] remove configuration files. Therefore, 19615 you should include a test statement at the top of the file, 19616 like this: 19617 test -f program-executed-later-in-file || exit 5 19618 19619 or take the equivalent action if the init file is not a shell 19620 script. 19621 19622 If the status command is given, the init script will return 19623 the following exit status codes. 19624 19625 0 program is running or service is OK 19626 1 program is dead and /var/run pid file exists 19627 2 program is dead and /var/lock lock file exists 19628 3 program is not running 19629 4 program or service status is unknown 19630 5-99 reserved for future LSB use 19631 100-149 reserved for distribution use 19632 150-199 reserved for application use 19633 200-254 reserved 19634 19635 In the case of init script commands other than "status" (i.e., 19636 "start", "stop", "restart", "try-restart", "reload", and 19637 "force-reload"), the init script shall return an exit status 19638 of zero if the action described by the argument has been 19639 successful. Otherwise, the exit status shall be non-zero, as 19640 defined below. In addition to straightforward success, the 19641 following situations are also to be considered successful: 19642 19643 * restarting a service (instead of reloading it) with the 19644 "force-reload" argument 19645 * running "start" on a service already running 19646 * running "stop" on a service already stopped or not running 19647 * running "restart" on a service already stopped or not 19648 running 19649 * running "try-restart" on a service already stopped or not 19650 running 19651 19652 In case of an error, while processing any init script action 19653 except for "status", the init script shall print an error 19654 message and return one of the following non-zero exit status 19655 codes. 19656 19657 1 generic or unspecified error (current practice) 19658 2 invalid or excess argument(s) 19659 3 unimplemented feature (for example, "reload") 19660 4 user had insufficient privilege 19661 5 program is not installed 19662 6 program is not configured 19663 7 program is not running 19664 8-99 reserved for future LSB use 19665 100-149 reserved for distribution use 19666 150-199 reserved for application use 19667 200-254 reserved 19668 19669 Error and status messages should be printed with the logging 19670 functions such as log_failure_msg and so on. Scripts may write 19671 to standard error or standard output, but implementations need 19672 not present text written to standard error/output to the user 19673 or do anything else with it. 19674 19675 Since init files may be run manually by a system administrator 19676 with non-standard environment variable values for PATH, USER, 19677 LOGNAME, etc. init files shall not depend on the values of 19678 these environment variables. They should set them to some 19679 known/default values if they are needed. 19680 _________________________________________________________ 19681 19682 8.3. Comment Conventions for Init Scripts 19683 19684 LSB applications which need to execute script(s) at bootup 19685 and/or shutdown may provide one or more init.d files. These 19686 files are installed by the install_initd program described 19687 below, which copies it into a standard directory and makes 19688 whatever other adjustments (creation of symlinks, creation of 19689 entries in a database, etc.) are necessary so that the script 19690 can be run at boot-time. 19691 19692 Note: This specification does not require, but is designed 19693 to allow, the development of a system which runs boot 19694 scripts in parallel. Hence, enforced-serialization of 19695 scripts is avoided unless it is explicitly necessary. 19696 19697 In the init.d file, information about the shell script shall 19698 be delimited by the lines "### BEGIN INIT INFO" and "### END 19699 INIT INFO". These delimiter lines may containg trailing 19700 whitespace, which shall be ignored. Inside this block there 19701 shall be lines of the form "# {keyword}: [arg1] [arg2] ...". 19702 (All lines inside this block start with a hash ('#') character 19703 in the first column, so that shell treats them as comments.) 19704 There shall be exactly one space character between "#" and the 19705 keyword. 19706 19707 Note: More than one space, or a tab character, indicates 19708 the continuation line. 19709 19710 The following keywords, with their arguments are defined in 19711 this specification: 19712 # Provides: boot_facility_1 [ boot_facility_2 ...] 19713 # Required-Start: boot_facility_1 [ boot_facility_2 ...] 19714 # Required-Stop: boot_facility_1 [ boot_facility_2 ...] 19715 # Should-Start: boot_facility_1 [ boot_facility_2 ...] 19716 # Should-Stop: boot_facility_1 [ boot_facility_2 ...] 19717 # Default-Start: run_level_1 [ run_level_2 ...] 19718 # Default-Stop: run_level_1 [ run_level_2 ...] 19719 # Short-Description: short_description 19720 # Description: multiline_description 19721 19722 Additional keywords may be defined in future LSB 19723 specifications. Distributions may define local extensions by 19724 using the prefix "X-[distribution name]" --- for example, 19725 "X-RedHat-foobardecl", or "X-Debian-xyzzydecl". 19726 19727 An init.d shell script may declare using the "Required-Start: 19728 " header that it shall not be run until certain boot 19729 facilities are provided. This information is used by the 19730 installation tool or the boot-time boot-script execution 19731 facility to assure that init scripts are run in the correct 19732 order. When an init script is run with a "start" argument, the 19733 boot facility or facilities specified in the "Provides" header 19734 shall be considered present, and hence init scripts which 19735 require those boot facilities would then be eligble to be run. 19736 When an init script is run with a "stop" argument, the boot 19737 facilities specified in the "Provides" header are considered 19738 no longer present. There are naming conventions for boot 19739 facilities and system facilities, as described in a following 19740 section. 19741 19742 Similarly, the "Required-Stop:" header defines which 19743 facilities shall still be available during the shutdown of 19744 that service. Hence, the init script system should avoid 19745 stopping shell scripts which provide those facilities until 19746 this shell script is stopped. 19747 19748 The "Should-Start:" header defines which facilities if present 19749 should be started before this service. This allows for weak 19750 dependencies which do not cause the service to fail if a 19751 facility is not available. But may cause reduced functionality 19752 of the service. Compliant applications should not rely on the 19753 existence of this feature. 19754 19755 The "Should-Stop:" header defines which facilities should be 19756 still available during the shutdown of that service. 19757 19758 The "Default-Start" and "Default-Stop" headers define which 19759 run levels should by default run the script with a start or 19760 stop argument, respectively, to start or stop the services 19761 controlled by the init script. 19762 19763 Note: For example, if you want a service to run in 19764 runlevels 3, 4, and 5 (only), specify "Default-Start: 3 4 19765 5" and "Default-Stop: 0 1 2 6". 19766 19767 The "Short-Description" and "Description" header fields are 19768 used to provide text which describes the actions of the init 19769 script. The "short_description" shall be a relatively short, 19770 pithy description of the init script, where as the 19771 "multiline_description" can be a much longer piece of text 19772 that may span mulitple lines. In a multiline description, each 19773 continuation line shall begin with a '#' followed by tab 19774 character or a '#' followed by at least two space characters. 19775 The multiline description is terminated by the first line that 19776 does not match this criteria. 19777 19778 The comment conventions described in this session are only 19779 required for use by LSB-compliant applications; system init 19780 scripts as provided by LSB-compliant run-time environments are 19781 not required to use the scheme outlined here. 19782 _________________________________________________________ 19783 19784 8.4. Installation and Removal of init.d Files 19785 19786 An init.d file is installed in /etc/init.d (which may be a 19787 symlink to another location). This can be done by the package 19788 installer. See Script Names. During the package's postinstall 19789 script, the program /usr/lib/lsb/install_initd configures the 19790 distribution's boot script system to call the package's init.d 19791 file at the appropriate time. 19792 19793 Note: For example, install_initd might create symbolic 19794 links in /etc/rc2.d and other such directories which point 19795 to the files in /etc/init.d (or it might update a database, 19796 or some other mechanism). The init.d files themselves 19797 should already be in /etc/init.d before running 19798 install_initd. 19799 19800 The install_initd program takes a single argument, the 19801 pathname to the /etc/init.d file. For example: 19802 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed 19803 19804 The install_initd program shall return an exit status of zero 19805 if the init.d file has been successfully installed or if the 19806 the init.d file was already installed. If the required boot 19807 facilities cannot be fulfilled an exit status of one shall be 19808 returned and the init.d file shall not be installed. 19809 19810 When a software package is removed, the package's preuninstall 19811 script shall call /usr/lib/lsb/remove_initd and pass the 19812 pathname to the /etc/init.d file. The package manager is still 19813 responsible for removing the /etc/init.d file; the 19814 remove_initd program is provided in case the distribution 19815 needs to clean up any other modifications in the 19816 distribution's boot script system that might have been made by 19817 the install_initd program. For example: 19818 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed 19819 19820 The remove_initd program shall return an exit status of zero 19821 if the init.d file has been successfully removed or if the the 19822 init.d file is not installed. If another init.d file which 19823 depends on a boot facility provided by this init.d file is 19824 installed, an exit status of one shall be returned and the 19825 init.d file shall remained installed. 19826 19827 Note: There should be a tool available to the user (e.g., 19828 RedHat's chkconfig) which can be used by the system 19829 administrator to easily manipulate at which init levels a 19830 particular init.d script is started or stopped. This 19831 specification currently does not specify such an interface, 19832 however. 19833 _________________________________________________________ 19834 19835 8.5. Run Levels 19836 19837 The following run levels are specified for use by the 19838 "Default-Start:" and "Default-Stop:" specifiers as defined by 19839 the section Comment Conventions for Init Scripts. Many LSB 19840 run-time environments commonly use these run level 19841 definitions, and in the absence of other considerations, 19842 providers of run-time environments are strongly encouraged to 19843 follow this convention to provide consistency for system 19844 administrators who need to work with multiple distributions. 19845 However, it is not required that LSB-compliant run-time 19846 environments use these run levels; the distribution-provided 19847 install_initd script may map the run levels specified below to 19848 whatever distribution-specified run levels are most 19849 appropriate. 19850 19851 0 halt 19852 1 single user mode 19853 2 multiuser with no network services exported 19854 3 normal/full multiuser 19855 4 reserved for local use, default is normal/full multiuser 19856 5 multiuser with xdm or equivalent 19857 6 reboot 19858 _________________________________________________________ 19859 19860 8.6. Facility Names 19861 19862 Boot facilities are used to indicate dependencies in init 19863 scripts, as defined in a previous section. Facility names that 19864 begin with a dollar sign ('$') are system facility names, 19865 defined by the LSB, and SHALL be provided by distributions. 19866 19867 Note: The dollar sign does not indicate variable expansion 19868 as in many Linux utilities. Starting a facility name with a 19869 dollar sign is merely a way of dividing the namespace 19870 between the system and applications. 19871 19872 LSB applications shall not provide facilities that begin with 19873 a dollar sign. This document defines the following facility 19874 names: 19875 19876 $local_fs all local filesystems are mounted 19877 $network low level networking (ethernet card; may imply PCMCIA 19878 running) 19879 $named daemons which may provide hostname resolution (if 19880 present) are running. For example, daemons to query DNS, NIS+, 19881 or LDAP. 19882 $portmap daemons providing SunRPC/ONCRPC portmapping service 19883 as defined in RFC 1833 (if present) are running 19884 $remote_fs all remote filesystems are mounted. In some LSB 19885 run-time environments, filesystems such as /usr may be remote. 19886 Many applications that require $local_fs will probably require 19887 also require $remote_fs. 19888 $syslog system logger is operational 19889 $time the system time has been set, for example by using a 19890 network-based time program such as ntp or rdate, or via the 19891 hardware Real Time Clock. 19892 19893 Other (non-system) facilities may be defined by other LSB 19894 applications. These facilities shall be named using the same 19895 conventions defined for naming init.d script names. Commonly, 19896 the facility provided by an LSB application init.d script will 19897 have the same name as the name assigned to the init.d script. 19898 _________________________________________________________ 19899 19900 8.7. Script Names 19901 19902 Since init scripts live in a single directory, they must share 19903 a single namespace. To avoid conflicts, three means of 19904 assigning names from this namespace are provided: 19905 19906 * Assigned names. Such names must be chosen from characters 19907 in the set [a-z0-9]. This category is desirable for 19908 scripts which system administrators may need to run 19909 manually: e.g., /etc/init.d/named restart. In order to 19910 avoid conflicts these names shall be reserved through the 19911 Linux Assigned Names and Numbers Authority (LANANA). 19912 Information about the LANANA may be found at 19913 www.lanana.org. 19914 19915 Note: Commonly used names should be reserved in advance; 19916 developers for projects are encouraged to reserve names 19917 from LANANA, so that each distribution can use the same 19918 name for the project's init script and avoid conflicts with 19919 other projects. 19920 * Hierarchical names. Script names in this category take the 19921 form --...-, where name is chosen from 19922 characters in the set [a-z0-9], and where there may be one 19923 or more components. may either be an LSB 19924 provider name assigned by the LANANA, or it may be the 19925 owners' DNS name in lower case, with at least one '.' 19926 (e.g., "debian.org", or "staroffice.sun.com"). The LSB 19927 provider name assigned by LANANA shall consist only of 19928 characters chosen from the set [a-z0-9]. 19929 * Reserved names. Names in this category begin with the 19930 character '_', and are reserved for distribution use only. 19931 These names should be used for essential system packages 19932 only, and in general use of this part of the namespace is 19933 highly discouraged. 19934 19935 Note: In general, if a package or some system function is 19936 likely to be used on multiple systems, the package 19937 developers or the distribution should get a registered name 19938 through LANANA, and distributions should strive to use the 19939 same name whenever possible. For applications which may not 19940 be essential or may not be commonly installed, the 19941 hierarchical namespace may be more appropriate. An 19942 advantage to the hierarchical namespace is that there is no 19943 need to consult with the LANANA before obtaining an 19944 assigned name. 19945 19946 Short names are highly desirable, since system 19947 administrators may need to manually start and stop 19948 services. Given this, they should be standardized on a 19949 per-package basis. This is the rationale behind having the 19950 LANANA organization assign these names. The LANANA may be 19951 called upon to handle other namespace issues, such as 19952 package/prerequisites naming. 19953 _________________________________________________________ 19954 19955 8.8. Init Script Functions 19956 19957 Each LSB-compliant init.d script shall source the file 19958 /lib/lsb/init-functions. This file shall cause the following 19959 shell script commands to be defined in an unspecified manner. 19960 19961 Note: This can be done either by adding a directory to the 19962 PATH variable which defines these commands, or by defining 19963 shell aliases. 19964 19965 Although the commands made available via this mechanism 19966 need not be LSB conforming applications in their own right, 19967 applications that use them should only depend on features 19968 described in the LSB. 19969 19970 Conforming scripts shall not specify the "exit on error" 19971 option (i.e. set -e) when sourcing this file, or calling any 19972 of the commands thus made available. 19973 19974 The start_daemon, killproc and pidofproc functions shall use 19975 the following algorithm for determining the status and the 19976 process identifiers of the specified program. 19977 19978 1. If the -p pidfile option is specified, and the named 19979 pidfile exists, a single line at the start of the pidfile 19980 shall be read. If this line contains one or more numeric 19981 values, separated by spaces, these values shall be used. 19982 2. Otherwise, /var/run/basename.pid shall be read in a 19983 similar fashion. If this contains one or more numeric 19984 values on the first line, these values shall be used. 19985 3. Optionally, if neither of the above methods has determined 19986 the process identifiers required, implementations may use 19987 unspecified additional methods to locate the process 19988 identifiers required. 19989 19990 The method used to determine the status is implementation 19991 defined, but should allow for non-binary programs. 19992 19993 Note: Commonly used methods check either for the existence 19994 of the /proc/pid directory or use /proc/pid/exe and 19995 /proc/pid/cmdline. Relying only on /proc/pid/exe is 19996 discouraged since the LSB does not specify the existence 19997 of, or semantics for, /proc. Additionally, using 19998 /proc/pid/exe may result in a not-running status for 19999 daemons that are written in a script language. 20000 20001 Conforming implementations may use other mechanisms besides 20002 those based on pidfiles, unless the -p pidfile option has been 20003 used. Conforming applications should not rely on such 20004 mechanisms and should always use a pidfile. When a program is 20005 stopped, it should delete its pidfile. Multiple process 20006 identifiers shall be separated by a single space in the 20007 pidfile and in the output of pidofproc. 20008 20009 start_daemon [-f] [-n nicelevel] [-p pidfile] pathname 20010 [args...] 20011 This runs the specified program as a daemon. The 20012 start_daemon function shall check if the program is 20013 already running using the algorithm given above. If so, 20014 it shall not start another copy of the daemon unless 20015 the -f option is given. The -n option specifies a nice 20016 level. See nice. start_daemon shall return the LSB 20017 defined exit status codes. It shall return 0 if the 20018 program has been successfully started or is running and 20019 not 0 otherwise. 20020 20021 killproc [-p pidfile] pathname [signal] 20022 The killproc function shall stop the specified program. 20023 The program is found using the algorithm given above. 20024 If a signal is specified, using the -signal_name or 20025 -signal_number syntaxes as specified by the kill 20026 command, the program is sent that signal. Otherwise, a 20027 SIGTERM followed by a SIGKILL after an unspecified 20028 number of seconds shall be sent. If a program has been 20029 terminated, the pidfile should be removed if the 20030 terminated process has not already done so. The 20031 killproc function shall return the LSB defined exit 20032 status codes. If called without a signal, it shall 20033 return 0 if the program has been stopped or is not 20034 running and not 0 otherwise. If a signal is given, it 20035 shall return 0 only if the program is running. 20036 20037 pidofproc [-p pidfile] pathname 20038 The pidofproc function shall return one or more process 20039 identifiers for a particular daemon using the algorithm 20040 given above. Only process identifiers of running 20041 processes should be returned. Multiple process 20042 identifiers shall be separated by a single space. 20043 20044 Note: A process may exit between pidofproc discovering its 20045 identity and the caller of pidofproc being able to act on 20046 that identity. As a result, no test assertion can be made 20047 that the process identifiers returned by pidofproc shall be 20048 running processes. 20049 20050 The pidofproc function shall return the LSB defined 20051 exit status codes for "status". It shall return 0 if 20052 the program is running and not 0 otherwise. 20053 20054 log_success_msg message 20055 The log_success_msg function shall cause the system to 20056 print a success message. 20057 20058 Note: The message should be relatively short; no more than 20059 60 characters is highly desirable. 20060 20061 log_failure_msg message 20062 The log_failure_msg function shall cause the system to 20063 print a failure message. 20064 20065 Note: The message should be relatively short; no more than 20066 60 characters is highly desirable. 20067 20068 log_warning_msg message 20069 The log_warning_msg function shall cause the system to 20070 print a warning message. 20071 20072 Note: The message should be relatively short; no more than 20073 60 characters is highly desirable. 20074 20075 VI. Users & Groups 20076 20077 Table of Contents 20078 9. Users & Groups 20079 _________________________________________________________ 20080 20081 Chapter 9. Users & Groups 20082 20083 9.1. User and Group Database 20084 20085 The format of the User and Group databases is not specified. 20086 Programs may only read these databases using the provided API. 20087 Changes to these databases should be made using the provided 20088 commands. 20089 _________________________________________________________ 20090 20091 9.2. User & Group Names 20092 20093 Below is a table of required mnemonic user and group names. 20094 This specification makes no attempt to numerically assign uid 20095 or gid numbers. The exception is the uid and gid for "root" 20096 which are equal to 0. 20097 20098 Table 9-1. Required User & Group Names 20099 User Group Comments 20100 root root Administrative user with all appropriate privileges 20101 bin bin Legacy UID/GID[a] 20102 daemon daemon Legacy UID/GID[b] 20103 Notes: 20104 a. The 'bin' UID/GID is included for compatibility with legacy 20105 applications. New applications should no longer use the 'bin' 20106 UID/GID. 20107 b. The 'daemon' UID/GID was used as an unprivileged UID/GID 20108 for daemons to execute under in order to limit their access to 20109 the system. Generally daemons should now run under individual 20110 UID/GIDs in order to further partition daemons from one 20111 another. 20112 20113 Below is a table of optional mnemonic user and group names. 20114 This specification makes no attempt to numerically assign uid 20115 or gid numbers. If the username exists on a system, then they 20116 should be in the suggested corresponding group. These user and 20117 group names are for use by distributions, not by applications. 20118 20119 Table 9-2. Optional User & Group Names 20120 User Group Comments 20121 adm adm Administrative special privileges 20122 lp lp Printer special privileges 20123 sync sync Login to sync the system 20124 shutdown shutdown Login to shutdown the system 20125 halt halt Login to halt the system 20126 mail mail Mail special privileges 20127 news news News special privileges 20128 uucp uucp UUCP special privileges 20129 operator root Operator special privileges 20130 man man Man special privileges 20131 nobody nobody Used by NFS 20132 20133 The differences in numeric values of the uids and gids between 20134 systems on a network can be reconciled via NIS, rdist(1), 20135 rsync(1), or ugidd(8). Only a minimum working set of "user 20136 names" and their corresponding "user groups" are required. 20137 Applications cannot assume non system user or group names will 20138 be defined. 20139 20140 Applications cannot assume any policy for the default umask or 20141 the default directory permissions a user may have. 20142 Applications should enforce user only file permissions on 20143 private files such as mailboxes. The location of the users 20144 home directory is also not defined by policy other than the 20145 recommendations of the FHS and shall be obtained by the 20146 *pwnam(3) calls. 20147 _________________________________________________________ 20148 20149 9.3. UID Ranges 20150 20151 The system UIDs from 0 to 99 should be statically allocated by 20152 the system, and shall not be created by applications. 20153 20154 The system UIDs from 100 to 499 should be reserved for dynamic 20155 allocation by system administrators and post install scripts 20156 using useradd(1). 20157 _________________________________________________________ 20158 20159 9.4. Rationale 20160 20161 The purpose of specifying optional users and groups is to 20162 reduce the potential for name conflicts between applications 20163 and distributions. 20164 _________________________________________________________ 20165 20166 Appendix A. Alphabetical Listing of Interfaces 20167 _________________________________________________________ 20168 20169 A.1. libc 20170 20171 The behaviour of the interfaces in this library is specified 20172 by the following Standards. 20173 20174 Large File Support 20175 this specification 20176 SUSv2 20177 ISO POSIX (2003) 20178 SVID Issue 3 20179 SVID Issue 4 20180 20181 Table A-1. libc Function Interfaces 20182 _Exit(GLIBC_2.1.1)[1] getrlimit(GLIBC_2.1.1)[1] 20183 sigaction(GLIBC_2.1.1)[1] 20184 _IO_feof(GLIBC_2.0)[1] getrlimit64(GLIBC_2.0)[1] 20185 sigaddset(GLIBC_2.0)[1] 20186 _IO_getc(GLIBC_2.0)[1] getrusage(GLIBC_2.0)[1] 20187 sigaltstack(GLIBC_2.0)[1] 20188 _IO_putc(GLIBC_2.0)[1] getservbyname(GLIBC_2.0)[1] 20189 sigandset(GLIBC_2.0)[1] 20190 _IO_puts(GLIBC_2.0)[1] getservbyport(GLIBC_2.0)[1] 20191 sigdelset(GLIBC_2.0)[1] 20192 __assert_fail(GLIBC_2.0)[1] getservent(GLIBC_2.0)[1] 20193 sigemptyset(GLIBC_2.0)[1] 20194 __ctype_b_loc[1] getsid()[1] sigfillset()[1] 20195 __ctype_get_mb_cur_max(GLIBC_2.0)[1] getsockname(GLIBC_2.0)[1] 20196 sighold(GLIBC_2.0)[1] 20197 __ctype_tolower_loc[1] getsockopt()[1] sigignore()[1] 20198 __ctype_toupper_loc[1] getsubopt()[1] siginterrupt()[1] 20199 __cxa_atexit(GLIBC_2.1.3)[1] gettext(GLIBC_2.1.3)[1] 20200 sigisemptyset(GLIBC_2.1.3)[1] 20201 __errno_location(GLIBC_2.0)[1] gettimeofday(GLIBC_2.0)[1] 20202 sigismember(GLIBC_2.0)[1] 20203 __fpending(GLIBC_2.2)[1] getuid(GLIBC_2.2)[1] 20204 siglongjmp(GLIBC_2.2)[1] 20205 __fxstat(GLIBC_2.0)[1] getutent(GLIBC_2.0)[1] 20206 signal(GLIBC_2.0)[1] 20207 __fxstat64(GLIBC_2.2)[1] getutent_r(GLIBC_2.2)[1] 20208 sigorset(GLIBC_2.2)[1] 20209 __getpagesize(GLIBC_2.0)[1] getutxent(GLIBC_2.0)[1] 20210 sigpause(GLIBC_2.0)[1] 20211 __getpgid(GLIBC_2.0)[1] getutxid(GLIBC_2.0)[1] 20212 sigpending(GLIBC_2.0)[1] 20213 __h_errno_location[1] getutxline()[1] sigprocmask()[1] 20214 __isinf[1] getw()[1] sigqueue()[1] 20215 __isinff[1] getwc()[1] sigrelse()[1] 20216 __isinfl[1] getwchar()[1] sigreturn()[1] 20217 __isnan[1] getwd()[1] sigset()[1] 20218 __isnanf[1] glob()[1] sigsuspend()[1] 20219 __isnanl[1] glob64()[1] sigtimedwait()[1] 20220 __libc_current_sigrtmax(GLIBC_2.1)[1] globfree(GLIBC_2.1)[1] 20221 sigwait(GLIBC_2.1)[1] 20222 __libc_current_sigrtmin(GLIBC_2.1)[1] globfree64(GLIBC_2.1)[1] 20223 sigwaitinfo(GLIBC_2.1)[1] 20224 __libc_start_main(GLIBC_2.0)[1] gmtime(GLIBC_2.0)[1] 20225 sleep(GLIBC_2.0)[1] 20226 __lxstat(GLIBC_2.0)[1] gmtime_r(GLIBC_2.0)[1] 20227 snprintf(GLIBC_2.0)[1] 20228 __lxstat64(GLIBC_2.2)[1] grantpt(GLIBC_2.2)[1] sockatmark[1] 20229 __mempcpy(GLIBC_2.0)[1] hcreate(GLIBC_2.0)[1] 20230 socket(GLIBC_2.0)[1] 20231 __rawmemchr(GLIBC_2.1)[1] hdestroy(GLIBC_2.1)[1] 20232 socketpair(GLIBC_2.1)[1] 20233 __register_atfork[1] hsearch()[1] sprintf()[1] 20234 __sigsetjmp(GLIBC_2.0)[1] htonl(GLIBC_2.0)[1] 20235 srand(GLIBC_2.0)[1] 20236 __stpcpy(GLIBC_2.0)[1] htons(GLIBC_2.0)[1] 20237 srand48(GLIBC_2.0)[1] 20238 __strdup(GLIBC_2.0)[1] iconv(GLIBC_2.0)[1] 20239 srandom(GLIBC_2.0)[1] 20240 __strtod_internal(GLIBC_2.0)[1] iconv_close(GLIBC_2.0)[1] 20241 sscanf(GLIBC_2.0)[1] 20242 __strtof_internal(GLIBC_2.0)[1] iconv_open(GLIBC_2.0)[1] 20243 statvfs(GLIBC_2.0)[1] 20244 __strtok_r(GLIBC_2.0)[1] if_freenameindex[1] statvfs64[1] 20245 __strtol_internal(GLIBC_2.0)[1] if_indextoname[1] 20246 stime(GLIBC_2.0)[1] 20247 __strtold_internal(GLIBC_2.0)[1] if_nameindex[1] 20248 stpcpy(GLIBC_2.0)[1] 20249 __strtoll_internal(GLIBC_2.0)[1] if_nametoindex[1] 20250 stpncpy(GLIBC_2.0)[1] 20251 __strtoul_internal(GLIBC_2.0)[1] imaxabs(GLIBC_2.0)[1] 20252 strcasecmp(GLIBC_2.0)[1] 20253 __strtoull_internal(GLIBC_2.0)[1] imaxdiv(GLIBC_2.0)[1] 20254 strcasestr(GLIBC_2.0)[1] 20255 __sysconf(GLIBC_2.2)[1] index(GLIBC_2.2)[1] 20256 strcat(GLIBC_2.2)[1] 20257 __sysv_signal(GLIBC_2.0)[1] inet_addr(GLIBC_2.0)[1] 20258 strchr(GLIBC_2.0)[1] 20259 __wcstod_internal(GLIBC_2.0)[1] inet_ntoa(GLIBC_2.0)[1] 20260 strcmp(GLIBC_2.0)[1] 20261 __wcstof_internal(GLIBC_2.0)[1] inet_ntop[1] 20262 strcoll(GLIBC_2.0)[1] 20263 __wcstol_internal(GLIBC_2.0)[1] inet_pton[1] 20264 strcpy(GLIBC_2.0)[1] 20265 __wcstold_internal(GLIBC_2.0)[1] initgroups(GLIBC_2.0)[1] 20266 strcspn(GLIBC_2.0)[1] 20267 __wcstoul_internal(GLIBC_2.0)[1] initstate(GLIBC_2.0)[1] 20268 strdup(GLIBC_2.0)[1] 20269 __xmknod(GLIBC_2.0)[1] insque(GLIBC_2.0)[1] 20270 strerror(GLIBC_2.0)[1] 20271 __xstat(GLIBC_2.0)[1] ioctl(GLIBC_2.0)[1] 20272 strerror_r(GLIBC_2.0)[1] 20273 __xstat64(GLIBC_2.2)[1] isalnum(GLIBC_2.2)[1] 20274 strfmon(GLIBC_2.2)[1] 20275 _exit(GLIBC_2.0)[1] isalpha(GLIBC_2.0)[1] 20276 strftime(GLIBC_2.0)[1] 20277 _longjmp(GLIBC_2.0)[1] isascii(GLIBC_2.0)[1] 20278 strlen(GLIBC_2.0)[1] 20279 _setjmp(GLIBC_2.0)[1] isatty(GLIBC_2.0)[1] 20280 strncasecmp(GLIBC_2.0)[1] 20281 _tolower(GLIBC_2.0)[1] isblank(GLIBC_2.0)[1] 20282 strncat(GLIBC_2.0)[1] 20283 _toupper(GLIBC_2.0)[1] iscntrl(GLIBC_2.0)[1] 20284 strncmp(GLIBC_2.0)[1] 20285 a64l(GLIBC_2.0)[1] isdigit(GLIBC_2.0)[1] strncpy(GLIBC_2.0)[1] 20286 abort(GLIBC_2.0)[1] isgraph(GLIBC_2.0)[1] 20287 strndup(GLIBC_2.0)[1] 20288 abs(GLIBC_2.0)[1] islower(GLIBC_2.0)[1] strnlen(GLIBC_2.0)[1] 20289 accept(GLIBC_2.0)[1] isprint(GLIBC_2.0)[1] 20290 strpbrk(GLIBC_2.0)[1] 20291 access(GLIBC_2.0)[1] ispunct(GLIBC_2.0)[1] 20292 strptime(GLIBC_2.0)[1] 20293 acct(GLIBC_2.0)[1] isspace(GLIBC_2.0)[1] strrchr(GLIBC_2.0)[1] 20294 adjtime(GLIBC_2.0)[1] isupper(GLIBC_2.0)[1] 20295 strsep(GLIBC_2.0)[1] 20296 alarm(GLIBC_2.0)[1] iswalnum(GLIBC_2.0)[1] 20297 strsignal(GLIBC_2.0)[1] 20298 asctime(GLIBC_2.0)[1] iswalpha(GLIBC_2.0)[1] 20299 strspn(GLIBC_2.0)[1] 20300 asctime_r(GLIBC_2.0)[1] iswblank(GLIBC_2.0)[1] 20301 strstr(GLIBC_2.0)[1] 20302 asprintf(GLIBC_2.0)[1] iswcntrl(GLIBC_2.0)[1] 20303 strtod(GLIBC_2.0)[1] 20304 atof(GLIBC_2.0)[1] iswctype(GLIBC_2.0)[1] strtof(GLIBC_2.0)[1] 20305 atoi(GLIBC_2.0)[1] iswdigit(GLIBC_2.0)[1] 20306 strtoimax(GLIBC_2.0)[1] 20307 atol(GLIBC_2.0)[1] iswgraph(GLIBC_2.0)[1] strtok(GLIBC_2.0)[1] 20308 atoll[1] iswlower()[1] strtok_r()[1] 20309 authnone_create(GLIBC_2.0)[1] iswprint(GLIBC_2.0)[1] 20310 strtol(GLIBC_2.0)[1] 20311 basename(GLIBC_2.0)[1] iswpunct(GLIBC_2.0)[1] 20312 strtold(GLIBC_2.0)[1] 20313 bcmp(GLIBC_2.0)[1] iswspace(GLIBC_2.0)[1] 20314 strtoll(GLIBC_2.0)[1] 20315 bcopy(GLIBC_2.0)[1] iswupper(GLIBC_2.0)[1] 20316 strtoq(GLIBC_2.0)[1] 20317 bind(GLIBC_2.0)[1] iswxdigit(GLIBC_2.0)[1] 20318 strtoul(GLIBC_2.0)[1] 20319 bind_textdomain_codeset[1] isxdigit()[1] strtoull()[1] 20320 bindresvport(GLIBC_2.0)[1] jrand48(GLIBC_2.0)[1] 20321 strtoumax(GLIBC_2.0)[1] 20322 bindtextdomain(GLIBC_2.0)[1] key_decryptsession(GLIBC_2.0)[1] 20323 strtouq(GLIBC_2.0)[1] 20324 brk(GLIBC_2.0)[1] kill(GLIBC_2.0)[1] strxfrm(GLIBC_2.0)[1] 20325 bsd_signal(GLIBC_2.0)[1] killpg(GLIBC_2.0)[1] 20326 svc_getreqset(GLIBC_2.0)[1] 20327 bsearch(GLIBC_2.0)[1] l64a(GLIBC_2.0)[1] 20328 svc_register(GLIBC_2.0)[1] 20329 btowc(GLIBC_2.0)[1] labs(GLIBC_2.0)[1] svc_run(GLIBC_2.0)[1] 20330 bzero(GLIBC_2.0)[1] lchown(GLIBC_2.0)[1] 20331 svc_sendreply(GLIBC_2.0)[1] 20332 calloc(GLIBC_2.0)[1] lcong48(GLIBC_2.0)[1] 20333 svcerr_auth(GLIBC_2.0)[1] 20334 catclose(GLIBC_2.0)[1] ldiv(GLIBC_2.0)[1] 20335 svcerr_decode(GLIBC_2.0)[1] 20336 catgets(GLIBC_2.0)[1] lfind(GLIBC_2.0)[1] 20337 svcerr_noproc(GLIBC_2.0)[1] 20338 catopen(GLIBC_2.0)[1] link(GLIBC_2.0)[1] 20339 svcerr_noprog(GLIBC_2.0)[1] 20340 cfgetispeed(GLIBC_2.0)[1] listen(GLIBC_2.0)[1] 20341 svcerr_progvers(GLIBC_2.0)[1] 20342 cfgetospeed(GLIBC_2.0)[1] llabs(GLIBC_2.0)[1] 20343 svcerr_systemerr(GLIBC_2.0)[1] 20344 cfmakeraw(GLIBC_2.0)[1] lldiv(GLIBC_2.0)[1] 20345 svcerr_weakauth(GLIBC_2.0)[1] 20346 cfsetispeed(GLIBC_2.0)[1] localeconv(GLIBC_2.0)[1] 20347 svctcp_create(GLIBC_2.0)[1] 20348 cfsetospeed(GLIBC_2.0)[1] localtime(GLIBC_2.0)[1] 20349 svcudp_create(GLIBC_2.0)[1] 20350 cfsetspeed(GLIBC_2.0)[1] localtime_r(GLIBC_2.0)[1] 20351 swab(GLIBC_2.0)[1] 20352 chdir(GLIBC_2.0)[1] lockf(GLIBC_2.0)[1] 20353 swapcontext(GLIBC_2.0)[1] 20354 chmod(GLIBC_2.0)[1] lockf64(GLIBC_2.0)[1] 20355 swprintf(GLIBC_2.0)[1] 20356 chown(GLIBC_2.1)[1] longjmp(GLIBC_2.1)[1] 20357 swscanf(GLIBC_2.1)[1] 20358 chroot(GLIBC_2.0)[1] lrand48(GLIBC_2.0)[1] 20359 symlink(GLIBC_2.0)[1] 20360 clearerr(GLIBC_2.0)[1] lsearch(GLIBC_2.0)[1] 20361 sync(GLIBC_2.0)[1] 20362 clnt_create(GLIBC_2.0)[1] lseek(GLIBC_2.0)[1] 20363 sysconf(GLIBC_2.0)[1] 20364 clnt_pcreateerror(GLIBC_2.0)[1] lseek64(GLIBC_2.0)[1] 20365 syslog(GLIBC_2.0)[1] 20366 clnt_perrno(GLIBC_2.0)[1] makecontext(GLIBC_2.0)[1] 20367 system(GLIBC_2.0)[1] 20368 clnt_perror(GLIBC_2.0)[1] malloc(GLIBC_2.0)[1] 20369 tcdrain(GLIBC_2.0)[1] 20370 clnt_spcreateerror(GLIBC_2.0)[1] mblen(GLIBC_2.0)[1] 20371 tcflow(GLIBC_2.0)[1] 20372 clnt_sperrno(GLIBC_2.0)[1] mbrlen(GLIBC_2.0)[1] 20373 tcflush(GLIBC_2.0)[1] 20374 clnt_sperror(GLIBC_2.0)[1] mbrtowc(GLIBC_2.0)[1] 20375 tcgetattr(GLIBC_2.0)[1] 20376 clock(GLIBC_2.0)[1] mbsinit(GLIBC_2.0)[1] 20377 tcgetpgrp(GLIBC_2.0)[1] 20378 close(GLIBC_2.0)[1] mbsnrtowcs(GLIBC_2.0)[1] 20379 tcgetsid(GLIBC_2.0)[1] 20380 closedir(GLIBC_2.0)[1] mbsrtowcs(GLIBC_2.0)[1] 20381 tcsendbreak(GLIBC_2.0)[1] 20382 closelog(GLIBC_2.0)[1] mbstowcs(GLIBC_2.0)[1] 20383 tcsetattr(GLIBC_2.0)[1] 20384 confstr(GLIBC_2.0)[1] mbtowc(GLIBC_2.0)[1] 20385 tcsetpgrp(GLIBC_2.0)[1] 20386 connect(GLIBC_2.0)[1] memccpy(GLIBC_2.0)[1] tdelete[1] 20387 creat(GLIBC_2.0)[1] memchr(GLIBC_2.0)[1] telldir(GLIBC_2.0)[1] 20388 creat64(GLIBC_2.1)[1] memcmp(GLIBC_2.1)[1] 20389 tempnam(GLIBC_2.1)[1] 20390 ctermid(GLIBC_2.0)[1] memcpy(GLIBC_2.0)[1] 20391 textdomain(GLIBC_2.0)[1] 20392 ctime(GLIBC_2.0)[1] memmem(GLIBC_2.0)[1] tfind(GLIBC_2.0)[1] 20393 ctime_r(GLIBC_2.0)[1] memmove(GLIBC_2.0)[1] time(GLIBC_2.0)[1] 20394 cuserid(GLIBC_2.0)[1] memrchr(GLIBC_2.0)[1] 20395 times(GLIBC_2.0)[1] 20396 daemon(GLIBC_2.0)[1] memset(GLIBC_2.0)[1] 20397 tmpfile(GLIBC_2.0)[1] 20398 dcgettext(GLIBC_2.0)[1] mkdir(GLIBC_2.0)[1] 20399 tmpfile64(GLIBC_2.0)[1] 20400 dcngettext[1] mkfifo()[1] tmpnam()[1] 20401 dgettext[1] mkstemp()[1] toascii()[1] 20402 difftime(GLIBC_2.0)[1] mkstemp64(GLIBC_2.0)[1] 20403 tolower(GLIBC_2.0)[1] 20404 dirname(GLIBC_2.0)[1] mktemp(GLIBC_2.0)[1] 20405 toupper(GLIBC_2.0)[1] 20406 div(GLIBC_2.0)[1] mktime(GLIBC_2.0)[1] towctrans(GLIBC_2.0)[1] 20407 dngettext[1] mlock()[1] towlower()[1] 20408 drand48(GLIBC_2.0)[1] mlockall(GLIBC_2.0)[1] 20409 towupper(GLIBC_2.0)[1] 20410 dup(GLIBC_2.0)[1] mmap(GLIBC_2.0)[1] truncate(GLIBC_2.0)[1] 20411 dup2(GLIBC_2.0)[1] mmap64(GLIBC_2.0)[1] 20412 truncate64(GLIBC_2.0)[1] 20413 duplocale[1] mprotect()[1] tsearch()[1] 20414 ecvt(GLIBC_2.0)[1] mrand48(GLIBC_2.0)[1] ttyname(GLIBC_2.0)[1] 20415 endgrent(GLIBC_2.0)[1] msgctl(GLIBC_2.0)[1] 20416 ttyname_r(GLIBC_2.0)[1] 20417 endprotoent(GLIBC_2.0)[1] msgget(GLIBC_2.0)[1] 20418 twalk(GLIBC_2.0)[1] 20419 endpwent(GLIBC_2.0)[1] msgrcv(GLIBC_2.0)[1] 20420 tzset(GLIBC_2.0)[1] 20421 endservent(GLIBC_2.0)[1] msgsnd(GLIBC_2.0)[1] 20422 ualarm(GLIBC_2.0)[1] 20423 endutent(GLIBC_2.0)[1] msync(GLIBC_2.0)[1] 20424 ulimit(GLIBC_2.0)[1] 20425 endutxent(GLIBC_2.1)[1] munlock(GLIBC_2.1)[1] 20426 umask(GLIBC_2.1)[1] 20427 erand48(GLIBC_2.0)[1] munlockall(GLIBC_2.0)[1] 20428 uname(GLIBC_2.0)[1] 20429 err(GLIBC_2.0)[1] munmap(GLIBC_2.0)[1] ungetc(GLIBC_2.0)[1] 20430 error(GLIBC_2.0)[1] nanosleep(GLIBC_2.0)[1] 20431 ungetwc(GLIBC_2.0)[1] 20432 errx(GLIBC_2.0)[1] newlocale[1] unlink(GLIBC_2.0)[1] 20433 execl(GLIBC_2.0)[1] nftw(GLIBC_2.0)[1] unlockpt(GLIBC_2.0)[1] 20434 execle(GLIBC_2.0)[1] nftw64(GLIBC_2.0)[1] unsetenv[1] 20435 execlp(GLIBC_2.0)[1] ngettext[1] uselocale[1] 20436 execv(GLIBC_2.0)[1] nice(GLIBC_2.0)[1] usleep(GLIBC_2.0)[1] 20437 execve(GLIBC_2.0)[1] nl_langinfo(GLIBC_2.0)[1] 20438 utime(GLIBC_2.0)[1] 20439 execvp(GLIBC_2.0)[1] nrand48(GLIBC_2.0)[1] 20440 utimes(GLIBC_2.0)[1] 20441 exit(GLIBC_2.0)[1] ntohl(GLIBC_2.0)[1] utmpname[1] 20442 fchdir(GLIBC_2.0)[1] ntohs(GLIBC_2.0)[1] 20443 vasprintf(GLIBC_2.0)[1] 20444 fchmod(GLIBC_2.0)[1] open(GLIBC_2.0)[1] vdprintf(GLIBC_2.0)[1] 20445 fchown(GLIBC_2.0)[1] open64(GLIBC_2.0)[1] verrx(GLIBC_2.0)[1] 20446 fclose(GLIBC_2.1)[1] opendir(GLIBC_2.1)[1] vfork(GLIBC_2.1)[1] 20447 fcntl(GLIBC_2.0)[1] openlog(GLIBC_2.0)[1] 20448 vfprintf(GLIBC_2.0)[1] 20449 fcvt(GLIBC_2.0)[1] pathconf(GLIBC_2.0)[1] vfscanf[1] 20450 fdatasync(GLIBC_2.0)[1] pause(GLIBC_2.0)[1] 20451 vfwprintf(GLIBC_2.0)[1] 20452 fdopen(GLIBC_2.1)[1] pclose(GLIBC_2.1)[1] 20453 vfwscanf(GLIBC_2.1)[1] 20454 feof(GLIBC_2.0)[1] perror(GLIBC_2.0)[1] vprintf(GLIBC_2.0)[1] 20455 ferror(GLIBC_2.0)[1] pipe(GLIBC_2.0)[1] vscanf[1] 20456 fflush(GLIBC_2.0)[1] pmap_getport(GLIBC_2.0)[1] 20457 vsnprintf(GLIBC_2.0)[1] 20458 fflush_unlocked(GLIBC_2.0)[1] pmap_set(GLIBC_2.0)[1] 20459 vsprintf(GLIBC_2.0)[1] 20460 ffs(GLIBC_2.0)[1] pmap_unset(GLIBC_2.0)[1] vsscanf[1] 20461 fgetc(GLIBC_2.0)[1] poll(GLIBC_2.0)[1] vswprintf(GLIBC_2.0)[1] 20462 fgetpos(GLIBC_2.0)[1] popen(GLIBC_2.0)[1] 20463 vswscanf(GLIBC_2.0)[1] 20464 fgetpos64(GLIBC_2.1)[1] posix_memalign(GLIBC_2.1)[1] 20465 vsyslog[1] 20466 fgets(GLIBC_2.0)[1] posix_openpt[1] vwprintf(GLIBC_2.0)[1] 20467 fgetwc(GLIBC_2.2)[1] printf(GLIBC_2.2)[1] 20468 vwscanf(GLIBC_2.2)[1] 20469 fgetwc_unlocked(GLIBC_2.2)[1] psignal(GLIBC_2.2)[1] 20470 wait(GLIBC_2.2)[1] 20471 fgetws(GLIBC_2.2)[1] ptsname(GLIBC_2.2)[1] wait4(GLIBC_2.2)[1] 20472 fileno(GLIBC_2.0)[1] putc(GLIBC_2.0)[1] waitpid(GLIBC_2.0)[1] 20473 flock(GLIBC_2.0)[1] putc_unlocked(GLIBC_2.0)[1] 20474 warn(GLIBC_2.0)[1] 20475 flockfile(GLIBC_2.0)[1] putchar(GLIBC_2.0)[1] 20476 warnx(GLIBC_2.0)[1] 20477 fmtmsg(GLIBC_2.1)[1] putchar_unlocked(GLIBC_2.1)[1] 20478 wcpcpy(GLIBC_2.1)[1] 20479 fnmatch(GLIBC_2.2.3)[1] putenv(GLIBC_2.2.3)[1] 20480 wcpncpy(GLIBC_2.2.3)[1] 20481 fopen(GLIBC_2.1)[1] puts(GLIBC_2.1)[1] wcrtomb(GLIBC_2.1)[1] 20482 fopen64(GLIBC_2.1)[1] pututxline(GLIBC_2.1)[1] 20483 wcscasecmp(GLIBC_2.1)[1] 20484 fork(GLIBC_2.0)[1] putw(GLIBC_2.0)[1] wcscat(GLIBC_2.0)[1] 20485 fpathconf(GLIBC_2.0)[1] putwc(GLIBC_2.0)[1] 20486 wcschr(GLIBC_2.0)[1] 20487 fprintf(GLIBC_2.0)[1] putwchar(GLIBC_2.0)[1] 20488 wcscmp(GLIBC_2.0)[1] 20489 fputc(GLIBC_2.0)[1] qsort(GLIBC_2.0)[1] wcscoll(GLIBC_2.0)[1] 20490 fputs(GLIBC_2.0)[1] raise(GLIBC_2.0)[1] wcscpy(GLIBC_2.0)[1] 20491 fputwc(GLIBC_2.2)[1] rand(GLIBC_2.2)[1] wcscspn(GLIBC_2.2)[1] 20492 fputws(GLIBC_2.2)[1] rand_r(GLIBC_2.2)[1] wcsdup(GLIBC_2.2)[1] 20493 fread(GLIBC_2.0)[1] random(GLIBC_2.0)[1] 20494 wcsftime(GLIBC_2.0)[1] 20495 free(GLIBC_2.0)[1] read(GLIBC_2.0)[1] wcslen(GLIBC_2.0)[1] 20496 freeaddrinfo[1] readdir()[1] wcsncasecmp()[1] 20497 freelocale[1] readdir64()[1] wcsncat()[1] 20498 freopen(GLIBC_2.0)[1] readdir_r[1] wcsncmp(GLIBC_2.0)[1] 20499 freopen64(GLIBC_2.1)[1] readlink(GLIBC_2.1)[1] 20500 wcsncpy(GLIBC_2.1)[1] 20501 fscanf(GLIBC_2.0)[1] readv(GLIBC_2.0)[1] wcsnlen(GLIBC_2.0)[1] 20502 fseek(GLIBC_2.0)[1] realloc(GLIBC_2.0)[1] 20503 wcsnrtombs(GLIBC_2.0)[1] 20504 fseeko(GLIBC_2.1)[1] realpath(GLIBC_2.1)[1] 20505 wcspbrk(GLIBC_2.1)[1] 20506 fseeko64(GLIBC_2.1)[1] recv(GLIBC_2.1)[1] 20507 wcsrchr(GLIBC_2.1)[1] 20508 fsetpos(GLIBC_2.0)[1] recvfrom(GLIBC_2.0)[1] 20509 wcsrtombs(GLIBC_2.0)[1] 20510 fsetpos64(GLIBC_2.1)[1] recvmsg(GLIBC_2.1)[1] 20511 wcsspn(GLIBC_2.1)[1] 20512 fstatvfs(GLIBC_2.1)[1] regcomp(GLIBC_2.1)[1] 20513 wcsstr(GLIBC_2.1)[1] 20514 fstatvfs64(GLIBC_2.1)[1] regerror(GLIBC_2.1)[1] 20515 wcstod(GLIBC_2.1)[1] 20516 fsync(GLIBC_2.0)[1] regexec(GLIBC_2.0)[1] wcstof(GLIBC_2.0)[1] 20517 ftell(GLIBC_2.0)[1] regfree(GLIBC_2.0)[1] 20518 wcstoimax(GLIBC_2.0)[1] 20519 ftello(GLIBC_2.1)[1] remove(GLIBC_2.1)[1] wcstok(GLIBC_2.1)[1] 20520 ftello64(GLIBC_2.1)[1] remque(GLIBC_2.1)[1] 20521 wcstol(GLIBC_2.1)[1] 20522 ftime(GLIBC_2.0)[1] rename(GLIBC_2.0)[1] wcstold(GLIBC_2.0)[1] 20523 ftok(GLIBC_2.0)[1] rewind(GLIBC_2.0)[1] wcstoll(GLIBC_2.0)[1] 20524 ftruncate(GLIBC_2.0)[1] rewinddir(GLIBC_2.0)[1] 20525 wcstombs(GLIBC_2.0)[1] 20526 ftruncate64(GLIBC_2.1)[1] rindex(GLIBC_2.1)[1] 20527 wcstoq(GLIBC_2.1)[1] 20528 ftrylockfile(GLIBC_2.0)[1] rmdir(GLIBC_2.0)[1] 20529 wcstoul(GLIBC_2.0)[1] 20530 ftw(GLIBC_2.0)[1] sbrk(GLIBC_2.0)[1] wcstoull(GLIBC_2.0)[1] 20531 ftw64(GLIBC_2.1)[1] scanf(GLIBC_2.1)[1] 20532 wcstoumax(GLIBC_2.1)[1] 20533 funlockfile(GLIBC_2.0)[1] sched_get_priority_max(GLIBC_2.0)[1] 20534 wcstouq(GLIBC_2.0)[1] 20535 fwide(GLIBC_2.2)[1] sched_get_priority_min(GLIBC_2.2)[1] 20536 wcswcs(GLIBC_2.2)[1] 20537 fwprintf(GLIBC_2.2)[1] sched_getparam(GLIBC_2.2)[1] 20538 wcswidth(GLIBC_2.2)[1] 20539 fwrite(GLIBC_2.0)[1] sched_getscheduler(GLIBC_2.0)[1] 20540 wcsxfrm(GLIBC_2.0)[1] 20541 fwscanf(GLIBC_2.2)[1] sched_rr_get_interval(GLIBC_2.2)[1] 20542 wctob(GLIBC_2.2)[1] 20543 gai_strerror[1] sched_setparam()[1] wctomb()[1] 20544 gcvt(GLIBC_2.0)[1] sched_setscheduler(GLIBC_2.0)[1] 20545 wctrans(GLIBC_2.0)[1] 20546 getaddrinfo[1] sched_yield()[1] wctype()[1] 20547 getc(GLIBC_2.0)[1] seed48(GLIBC_2.0)[1] wcwidth(GLIBC_2.0)[1] 20548 getc_unlocked(GLIBC_2.0)[1] seekdir(GLIBC_2.0)[1] 20549 wmemchr(GLIBC_2.0)[1] 20550 getchar(GLIBC_2.0)[1] select(GLIBC_2.0)[1] 20551 wmemcmp(GLIBC_2.0)[1] 20552 getchar_unlocked(GLIBC_2.0)[1] semctl(GLIBC_2.0)[1] 20553 wmemcpy(GLIBC_2.0)[1] 20554 getcontext(GLIBC_2.1)[1] semget(GLIBC_2.1)[1] 20555 wmemmove(GLIBC_2.1)[1] 20556 getcwd(GLIBC_2.0)[1] semop(GLIBC_2.0)[1] wmemset(GLIBC_2.0)[1] 20557 getdate(GLIBC_2.1)[1] send(GLIBC_2.1)[1] wordexp(GLIBC_2.1)[1] 20558 getegid(GLIBC_2.0)[1] sendmsg(GLIBC_2.0)[1] 20559 wordfree(GLIBC_2.0)[1] 20560 getenv(GLIBC_2.0)[1] sendto(GLIBC_2.0)[1] 20561 wprintf(GLIBC_2.0)[1] 20562 geteuid(GLIBC_2.0)[1] setbuf(GLIBC_2.0)[1] write(GLIBC_2.0)[1] 20563 getgid(GLIBC_2.0)[1] setbuffer(GLIBC_2.0)[1] 20564 writev(GLIBC_2.0)[1] 20565 getgrent(GLIBC_2.0)[1] setcontext(GLIBC_2.0)[1] 20566 wscanf(GLIBC_2.0)[1] 20567 getgrgid(GLIBC_2.0)[1] setegid(GLIBC_2.0)[1] 20568 xdr_accepted_reply(GLIBC_2.0)[1] 20569 getgrgid_r(GLIBC_2.0)[1] setenv[1] xdr_array(GLIBC_2.0)[1] 20570 getgrnam(GLIBC_2.0)[1] seteuid(GLIBC_2.0)[1] 20571 xdr_bool(GLIBC_2.0)[1] 20572 getgrnam_r(GLIBC_2.0)[1] setgid(GLIBC_2.0)[1] 20573 xdr_bytes(GLIBC_2.0)[1] 20574 getgrouplist[1] setgrent()[1] xdr_callhdr()[1] 20575 getgroups(GLIBC_2.0)[1] setgroups(GLIBC_2.0)[1] 20576 xdr_callmsg(GLIBC_2.0)[1] 20577 gethostbyaddr(GLIBC_2.0)[1] sethostname(GLIBC_2.0)[1] 20578 xdr_char(GLIBC_2.0)[1] 20579 gethostbyname(GLIBC_2.0)[1] setitimer(GLIBC_2.0)[1] 20580 xdr_double(GLIBC_2.0)[1] 20581 gethostid(GLIBC_2.0)[1] setlocale(GLIBC_2.0)[1] 20582 xdr_enum(GLIBC_2.0)[1] 20583 gethostname(GLIBC_2.0)[1] setlogmask(GLIBC_2.0)[1] 20584 xdr_float(GLIBC_2.0)[1] 20585 getitimer(GLIBC_2.0)[1] setpgid(GLIBC_2.0)[1] 20586 xdr_free(GLIBC_2.0)[1] 20587 getloadavg(GLIBC_2.2)[1] setpgrp(GLIBC_2.2)[1] 20588 xdr_int(GLIBC_2.2)[1] 20589 getlogin(GLIBC_2.0)[1] setpriority(GLIBC_2.0)[1] 20590 xdr_long(GLIBC_2.0)[1] 20591 getnameinfo[1] setprotoent()[1] xdr_opaque()[1] 20592 getopt(GLIBC_2.0)[1] setpwent(GLIBC_2.0)[1] 20593 xdr_opaque_auth(GLIBC_2.0)[1] 20594 getopt_long(GLIBC_2.0)[1] setregid(GLIBC_2.0)[1] 20595 xdr_pointer(GLIBC_2.0)[1] 20596 getopt_long_only(GLIBC_2.0)[1] setreuid(GLIBC_2.0)[1] 20597 xdr_reference(GLIBC_2.0)[1] 20598 getpagesize(GLIBC_2.0)[1] setrlimit(GLIBC_2.0)[1] 20599 xdr_rejected_reply(GLIBC_2.0)[1] 20600 getpeername(GLIBC_2.0)[1] setrlimit64[1] 20601 xdr_replymsg(GLIBC_2.0)[1] 20602 getpgid(GLIBC_2.0)[1] setservent(GLIBC_2.0)[1] 20603 xdr_short(GLIBC_2.0)[1] 20604 getpgrp(GLIBC_2.0)[1] setsid(GLIBC_2.0)[1] 20605 xdr_string(GLIBC_2.0)[1] 20606 getpid(GLIBC_2.0)[1] setsockopt(GLIBC_2.0)[1] 20607 xdr_u_char(GLIBC_2.0)[1] 20608 getppid(GLIBC_2.0)[1] setstate(GLIBC_2.0)[1] 20609 xdr_u_int(GLIBC_2.0)[1] 20610 getpriority(GLIBC_2.0)[1] setuid(GLIBC_2.0)[1] 20611 xdr_u_long(GLIBC_2.0)[1] 20612 getprotobyname(GLIBC_2.0)[1] setutent(GLIBC_2.0)[1] 20613 xdr_u_short(GLIBC_2.0)[1] 20614 getprotobynumber(GLIBC_2.0)[1] setutxent(GLIBC_2.0)[1] 20615 xdr_union(GLIBC_2.0)[1] 20616 getprotoent(GLIBC_2.0)[1] setvbuf(GLIBC_2.0)[1] 20617 xdr_vector(GLIBC_2.0)[1] 20618 getpwent(GLIBC_2.0)[1] shmat(GLIBC_2.0)[1] 20619 xdr_void(GLIBC_2.0)[1] 20620 getpwnam(GLIBC_2.0)[1] shmctl(GLIBC_2.0)[1] 20621 xdr_wrapstring(GLIBC_2.0)[1] 20622 getpwnam_r(GLIBC_2.0)[1] shmdt(GLIBC_2.0)[1] 20623 xdrmem_create(GLIBC_2.0)[1] 20624 getpwuid(GLIBC_2.0)[1] shmget(GLIBC_2.0)[1] 20625 xdrrec_create(GLIBC_2.0)[1] 20626 getpwuid_r(GLIBC_2.0)[1] shutdown(GLIBC_2.0)[1] 20627 xdrrec_eof(GLIBC_2.0)[1] 20628 20629 Table A-2. libc Data Interfaces 20630 __daylight __timezone _sys_errlist 20631 __environ __tzname 20632 _________________________________________________________ 20633 20634 A.2. libcrypt 20635 20636 The behaviour of the interfaces in this library is specified 20637 by the following Standards. 20638 20639 ISO POSIX (2003) 20640 20641 Table A-3. libcrypt Function Interfaces 20642 crypt(GLIBC_2.0)[1] encrypt(GLIBC_2.0)[1] setkey(GLIBC_2.0)[1] 20643 _________________________________________________________ 20644 20645 A.3. libdl 20646 20647 The behaviour of the interfaces in this library is specified 20648 by the following Standards. 20649 20650 this specification 20651 ISO POSIX (2003) 20652 20653 Table A-4. libdl Function Interfaces 20654 dladdr(GLIBC_2.0)[1] dlerror(GLIBC_2.0)[1] dlsym(GLIBC_2.0)[1] 20655 dlclose(GLIBC_2.0)[1] dlopen(GLIBC_2.0)[1] 20656 _________________________________________________________ 20657 20658 A.4. libm 20659 20660 The behaviour of the interfaces in this library is specified 20661 by the following Standards. 20662 20663 ISO C (1999) 20664 this specification 20665 SUSv2 20666 ISO POSIX (2003) 20667 20668 Table A-5. libm Function Interfaces 20669 __finite[1] csinhf()[1] log10()[1] 20670 __finitef[1] csinhl()[1] log10f[1] 20671 __finitel[1] csinl()[1] log10l[1] 20672 __fpclassify[1] csqrt()[1] log1p()[1] 20673 __fpclassifyf[1] csqrtf()[1] log1pf[1] 20674 __signbit[1] csqrtl()[1] log1pl[1] 20675 __signbitf[1] ctan()[1] log2[1] 20676 acos(GLIBC_2.0)[1] ctanf(GLIBC_2.0)[1] log2f[1] 20677 acosf(GLIBC_2.0)[1] ctanh(GLIBC_2.0)[1] log2l[1] 20678 acosh(GLIBC_2.0)[1] ctanhf(GLIBC_2.0)[1] logb(GLIBC_2.0)[1] 20679 acoshf(GLIBC_2.0)[1] ctanhl(GLIBC_2.0)[1] logbf[1] 20680 acoshl(GLIBC_2.0)[1] ctanl(GLIBC_2.0)[1] logbl[1] 20681 acosl(GLIBC_2.0)[1] dremf(GLIBC_2.0)[1] logf[1] 20682 asin(GLIBC_2.0)[1] dreml(GLIBC_2.0)[1] logl[1] 20683 asinf(GLIBC_2.0)[1] erf(GLIBC_2.0)[1] lrint(GLIBC_2.0)[1] 20684 asinh(GLIBC_2.0)[1] erfc(GLIBC_2.0)[1] lrintf(GLIBC_2.0)[1] 20685 asinhf(GLIBC_2.0)[1] erfcf(GLIBC_2.0)[1] lrintl(GLIBC_2.0)[1] 20686 asinhl(GLIBC_2.0)[1] erfcl(GLIBC_2.0)[1] lround(GLIBC_2.0)[1] 20687 asinl(GLIBC_2.0)[1] erff(GLIBC_2.0)[1] lroundf(GLIBC_2.0)[1] 20688 atan(GLIBC_2.0)[1] erfl(GLIBC_2.0)[1] lroundl(GLIBC_2.0)[1] 20689 atan2(GLIBC_2.0)[1] exp(GLIBC_2.0)[1] matherr(GLIBC_2.0)[1] 20690 atan2f(GLIBC_2.0)[1] exp2[1] modf(GLIBC_2.0)[1] 20691 atan2l(GLIBC_2.0)[1] exp2f[1] modff(GLIBC_2.0)[1] 20692 atanf(GLIBC_2.0)[1] expf[1] modfl(GLIBC_2.0)[1] 20693 atanh(GLIBC_2.0)[1] expl[1] nan(GLIBC_2.0)[1] 20694 atanhf(GLIBC_2.0)[1] expm1(GLIBC_2.0)[1] nanf(GLIBC_2.0)[1] 20695 atanhl(GLIBC_2.0)[1] expm1f[1] nanl(GLIBC_2.0)[1] 20696 atanl(GLIBC_2.0)[1] expm1l[1] nearbyint(GLIBC_2.0)[1] 20697 cabs(GLIBC_2.1)[1] fabs(GLIBC_2.1)[1] nearbyintf(GLIBC_2.1)[1] 20698 cabsf(GLIBC_2.1)[1] fabsf(GLIBC_2.1)[1] 20699 nearbyintl(GLIBC_2.1)[1] 20700 cabsl(GLIBC_2.1)[1] fabsl(GLIBC_2.1)[1] 20701 nextafter(GLIBC_2.1)[1] 20702 cacos(GLIBC_2.1)[1] fdim(GLIBC_2.1)[1] 20703 nextafterf(GLIBC_2.1)[1] 20704 cacosf(GLIBC_2.1)[1] fdimf(GLIBC_2.1)[1] 20705 nextafterl(GLIBC_2.1)[1] 20706 cacosh(GLIBC_2.1)[1] fdiml(GLIBC_2.1)[1] 20707 nexttoward(GLIBC_2.1)[1] 20708 cacoshf(GLIBC_2.1)[1] feclearexcept(GLIBC_2.1)[1] 20709 nexttowardf(GLIBC_2.1)[1] 20710 cacoshl(GLIBC_2.1)[1] fegetenv(GLIBC_2.1)[1] 20711 nexttowardl(GLIBC_2.1)[1] 20712 cacosl(GLIBC_2.1)[1] fegetexceptflag(GLIBC_2.1)[1] 20713 pow(GLIBC_2.1)[1] 20714 carg(GLIBC_2.1)[1] fegetround(GLIBC_2.1)[1] 20715 pow10(GLIBC_2.1)[1] 20716 cargf(GLIBC_2.1)[1] feholdexcept(GLIBC_2.1)[1] 20717 pow10f(GLIBC_2.1)[1] 20718 cargl(GLIBC_2.1)[1] feraiseexcept(GLIBC_2.1)[1] 20719 pow10l(GLIBC_2.1)[1] 20720 casin(GLIBC_2.1)[1] fesetenv(GLIBC_2.1)[1] powf(GLIBC_2.1)[1] 20721 casinf(GLIBC_2.1)[1] fesetexceptflag(GLIBC_2.1)[1] 20722 powl(GLIBC_2.1)[1] 20723 casinh(GLIBC_2.1)[1] fesetround(GLIBC_2.1)[1] 20724 remainder(GLIBC_2.1)[1] 20725 casinhf(GLIBC_2.1)[1] fetestexcept(GLIBC_2.1)[1] 20726 remainderf(GLIBC_2.1)[1] 20727 casinhl(GLIBC_2.1)[1] feupdateenv(GLIBC_2.1)[1] 20728 remainderl(GLIBC_2.1)[1] 20729 casinl(GLIBC_2.1)[1] finite(GLIBC_2.1)[1] remquo(GLIBC_2.1)[1] 20730 catan(GLIBC_2.1)[1] finitef(GLIBC_2.1)[1] 20731 remquof(GLIBC_2.1)[1] 20732 catanf(GLIBC_2.1)[1] finitel(GLIBC_2.1)[1] 20733 remquol(GLIBC_2.1)[1] 20734 catanh(GLIBC_2.1)[1] floor(GLIBC_2.1)[1] rint(GLIBC_2.1)[1] 20735 catanhf(GLIBC_2.1)[1] floorf(GLIBC_2.1)[1] rintf(GLIBC_2.1)[1] 20736 catanhl(GLIBC_2.1)[1] floorl(GLIBC_2.1)[1] rintl(GLIBC_2.1)[1] 20737 catanl(GLIBC_2.1)[1] fma(GLIBC_2.1)[1] round(GLIBC_2.1)[1] 20738 cbrt(GLIBC_2.0)[1] fmaf(GLIBC_2.0)[1] roundf(GLIBC_2.0)[1] 20739 cbrtf(GLIBC_2.0)[1] fmal(GLIBC_2.0)[1] roundl(GLIBC_2.0)[1] 20740 cbrtl(GLIBC_2.0)[1] fmax(GLIBC_2.0)[1] scalb(GLIBC_2.0)[1] 20741 ccos(GLIBC_2.1)[1] fmaxf(GLIBC_2.1)[1] scalbf(GLIBC_2.1)[1] 20742 ccosf(GLIBC_2.1)[1] fmaxl(GLIBC_2.1)[1] scalbl(GLIBC_2.1)[1] 20743 ccosh(GLIBC_2.1)[1] fmin(GLIBC_2.1)[1] scalbln(GLIBC_2.1)[1] 20744 ccoshf(GLIBC_2.1)[1] fminf(GLIBC_2.1)[1] 20745 scalblnf(GLIBC_2.1)[1] 20746 ccoshl(GLIBC_2.1)[1] fminl(GLIBC_2.1)[1] 20747 scalblnl(GLIBC_2.1)[1] 20748 ccosl(GLIBC_2.1)[1] fmod(GLIBC_2.1)[1] scalbn(GLIBC_2.1)[1] 20749 ceil(GLIBC_2.0)[1] fmodf(GLIBC_2.0)[1] scalbnf(GLIBC_2.0)[1] 20750 ceilf(GLIBC_2.0)[1] fmodl(GLIBC_2.0)[1] scalbnl(GLIBC_2.0)[1] 20751 ceill(GLIBC_2.0)[1] frexp(GLIBC_2.0)[1] 20752 significand(GLIBC_2.0)[1] 20753 cexp(GLIBC_2.1)[1] frexpf(GLIBC_2.1)[1] 20754 significandf(GLIBC_2.1)[1] 20755 cexpf(GLIBC_2.1)[1] frexpl(GLIBC_2.1)[1] 20756 significandl(GLIBC_2.1)[1] 20757 cexpl(GLIBC_2.1)[1] gamma(GLIBC_2.1)[1] sin(GLIBC_2.1)[1] 20758 cimag(GLIBC_2.1)[1] gammaf(GLIBC_2.1)[1] sincos(GLIBC_2.1)[1] 20759 cimagf(GLIBC_2.1)[1] gammal(GLIBC_2.1)[1] 20760 sincosf(GLIBC_2.1)[1] 20761 cimagl(GLIBC_2.1)[1] hypot(GLIBC_2.1)[1] sincosl(GLIBC_2.1)[1] 20762 clog(GLIBC_2.1)[1] hypotf(GLIBC_2.1)[1] sinf(GLIBC_2.1)[1] 20763 clog10(GLIBC_2.1)[1] hypotl(GLIBC_2.1)[1] sinh(GLIBC_2.1)[1] 20764 clog10f(GLIBC_2.1)[1] ilogb(GLIBC_2.1)[1] sinhf(GLIBC_2.1)[1] 20765 clog10l(GLIBC_2.1)[1] ilogbf(GLIBC_2.1)[1] sinhl(GLIBC_2.1)[1] 20766 clogf(GLIBC_2.1)[1] ilogbl(GLIBC_2.1)[1] sinl(GLIBC_2.1)[1] 20767 clogl(GLIBC_2.1)[1] j0(GLIBC_2.1)[1] sqrt(GLIBC_2.1)[1] 20768 conj(GLIBC_2.1)[1] j0f(GLIBC_2.1)[1] sqrtf(GLIBC_2.1)[1] 20769 conjf(GLIBC_2.1)[1] j0l(GLIBC_2.1)[1] sqrtl(GLIBC_2.1)[1] 20770 conjl(GLIBC_2.1)[1] j1(GLIBC_2.1)[1] tan(GLIBC_2.1)[1] 20771 copysign(GLIBC_2.0)[1] j1f(GLIBC_2.0)[1] tanf(GLIBC_2.0)[1] 20772 copysignf(GLIBC_2.0)[1] j1l(GLIBC_2.0)[1] tanh(GLIBC_2.0)[1] 20773 copysignl(GLIBC_2.0)[1] jn(GLIBC_2.0)[1] tanhf(GLIBC_2.0)[1] 20774 cos(GLIBC_2.0)[1] jnf(GLIBC_2.0)[1] tanhl(GLIBC_2.0)[1] 20775 cosf(GLIBC_2.0)[1] jnl(GLIBC_2.0)[1] tanl(GLIBC_2.0)[1] 20776 cosh(GLIBC_2.0)[1] ldexp(GLIBC_2.0)[1] tgamma(GLIBC_2.0)[1] 20777 coshf(GLIBC_2.0)[1] ldexpf(GLIBC_2.0)[1] tgammaf(GLIBC_2.0)[1] 20778 coshl(GLIBC_2.0)[1] ldexpl(GLIBC_2.0)[1] tgammal(GLIBC_2.0)[1] 20779 cosl(GLIBC_2.0)[1] lgamma(GLIBC_2.0)[1] trunc(GLIBC_2.0)[1] 20780 cpow(GLIBC_2.1)[1] lgamma_r(GLIBC_2.1)[1] truncf(GLIBC_2.1)[1] 20781 cpowf(GLIBC_2.1)[1] lgammaf(GLIBC_2.1)[1] truncl(GLIBC_2.1)[1] 20782 cpowl(GLIBC_2.1)[1] lgammaf_r(GLIBC_2.1)[1] y0(GLIBC_2.1)[1] 20783 cproj(GLIBC_2.1)[1] lgammal(GLIBC_2.1)[1] y0f(GLIBC_2.1)[1] 20784 cprojf(GLIBC_2.1)[1] lgammal_r(GLIBC_2.1)[1] y0l(GLIBC_2.1)[1] 20785 cprojl(GLIBC_2.1)[1] llrint(GLIBC_2.1)[1] y1(GLIBC_2.1)[1] 20786 creal(GLIBC_2.1)[1] llrintf(GLIBC_2.1)[1] y1f(GLIBC_2.1)[1] 20787 crealf(GLIBC_2.1)[1] llrintl(GLIBC_2.1)[1] y1l(GLIBC_2.1)[1] 20788 creall(GLIBC_2.1)[1] llround(GLIBC_2.1)[1] yn(GLIBC_2.1)[1] 20789 csin(GLIBC_2.1)[1] llroundf(GLIBC_2.1)[1] ynf(GLIBC_2.1)[1] 20790 csinf(GLIBC_2.1)[1] llroundl(GLIBC_2.1)[1] ynl(GLIBC_2.1)[1] 20791 csinh(GLIBC_2.1)[1] log(GLIBC_2.1)[1] 20792 20793 Table A-6. libm Data Interfaces 20794 signgam 20795 _________________________________________________________ 20796 20797 A.5. libncurses 20798 20799 The behaviour of the interfaces in this library is specified 20800 by the following Standards. 20801 20802 X/Open Curses 20803 20804 Table A-7. libncurses Function Interfaces 20805 addch[1] mvdelch[1] slk_refresh[1] 20806 addchnstr[1] mvderwin[1] slk_restore[1] 20807 addchstr[1] mvgetch[1] slk_set[1] 20808 addnstr[1] mvgetnstr[1] slk_touch[1] 20809 addstr[1] mvgetstr[1] standend[1] 20810 attr_get[1] mvhline[1] standout[1] 20811 attr_off[1] mvinch[1] start_color[1] 20812 attr_on[1] mvinchnstr[1] subpad[1] 20813 attr_set[1] mvinchstr[1] subwin[1] 20814 attroff[1] mvinnstr[1] syncok[1] 20815 attron[1] mvinsch[1] termattrs[1] 20816 attrset[1] mvinsnstr[1] termname[1] 20817 baudrate[1] mvinsstr[1] tgetent[1] 20818 beep[1] mvinstr[1] tgetflag[1] 20819 bkgd[1] mvprintw[1] tgetnum[1] 20820 bkgdset[1] mvscanw[1] tgetstr[1] 20821 border[1] mvvline[1] tgoto[1] 20822 box[1] mvwaddch[1] tigetflag[1] 20823 can_change_color[1] mvwaddchnstr[1] tigetnum[1] 20824 cbreak[1] mvwaddchstr[1] tigetstr[1] 20825 chgat[1] mvwaddnstr[1] timeout[1] 20826 clear[1] mvwaddstr[1] touchline[1] 20827 clearok[1] mvwchgat[1] touchwin[1] 20828 clrtobot[1] mvwdelch[1] tparm[1] 20829 clrtoeol[1] mvwgetch[1] tputs[1] 20830 color_content[1] mvwgetnstr[1] typeahead[1] 20831 color_set[1] mvwgetstr[1] unctrl[1] 20832 copywin[1] mvwhline[1] ungetch[1] 20833 curs_set[1] mvwin[1] untouchwin[1] 20834 def_prog_mode[1] mvwinch[1] use_env[1] 20835 def_shell_mode[1] mvwinchnstr[1] vidattr[1] 20836 del_curterm[1] mvwinchstr[1] vidputs[1] 20837 delay_output[1] mvwinnstr[1] vline[1] 20838 delch[1] mvwinsch[1] vw_printw[1] 20839 deleteln[1] mvwinsnstr[1] vw_scanw[1] 20840 delscreen[1] mvwinsstr[1] vwprintw[1] 20841 delwin[1] mvwinstr[1] vwscanw[1] 20842 derwin[1] mvwprintw[1] waddch[1] 20843 doupdate[1] mvwscanw[1] waddchnstr[1] 20844 dupwin[1] mvwvline[1] waddchstr[1] 20845 echo[1] napms[1] waddnstr[1] 20846 echochar[1] newpad[1] waddstr[1] 20847 endwin[1] newterm[1] wattr_get[1] 20848 erase[1] newwin[1] wattr_off[1] 20849 erasechar[1] nl[1] wattr_on[1] 20850 filter[1] nocbreak[1] wattr_set[1] 20851 flash[1] nodelay[1] wattroff[1] 20852 flushinp[1] noecho[1] wattron[1] 20853 getbkgd[1] nonl[1] wattrset[1] 20854 getch[1] noqiflush[1] wbkgd[1] 20855 getnstr[1] noraw[1] wbkgdset[1] 20856 getstr[1] notimeout[1] wborder[1] 20857 getwin[1] overlay[1] wchgat[1] 20858 halfdelay[1] overwrite[1] wclear[1] 20859 has_colors[1] pair_content[1] wclrtobot[1] 20860 has_ic[1] pechochar[1] wclrtoeol[1] 20861 has_il[1] pnoutrefresh[1] wcolor_set[1] 20862 hline[1] prefresh[1] wcursyncup[1] 20863 idcok[1] printw[1] wdelch[1] 20864 idlok[1] putp[1] wdeleteln[1] 20865 immedok[1] putwin[1] wechochar[1] 20866 inch[1] qiflush[1] werase[1] 20867 inchnstr[1] raw[1] wgetch[1] 20868 inchstr[1] redrawwin[1] wgetnstr[1] 20869 init_color[1] refresh[1] wgetstr[1] 20870 init_pair[1] reset_prog_mode[1] whline[1] 20871 initscr[1] reset_shell_mode[1] winch[1] 20872 innstr[1] resetty[1] winchnstr[1] 20873 insch[1] restartterm[1] winchstr[1] 20874 insdelln[1] ripoffline[1] winnstr[1] 20875 insertln[1] savetty[1] winsch[1] 20876 insnstr[1] scanw[1] winsdelln[1] 20877 insstr[1] scr_dump[1] winsertln[1] 20878 instr[1] scr_init[1] winsnstr[1] 20879 intrflush[1] scr_restore[1] winsstr[1] 20880 is_linetouched[1] scr_set[1] winstr[1] 20881 is_wintouched[1] scrl[1] wmove[1] 20882 isendwin[1] scroll[1] wnoutrefresh[1] 20883 keyname[1] scrollok[1] wprintw[1] 20884 keypad[1] set_curterm[1] wredrawln[1] 20885 killchar[1] set_term[1] wrefresh[1] 20886 leaveok[1] setscrreg[1] wscanw[1] 20887 longname[1] setupterm[1] wscrl[1] 20888 meta[1] slk_attr_set[1] wsetscrreg[1] 20889 move[1] slk_attroff[1] wstandend[1] 20890 mvaddch[1] slk_attron[1] wstandout[1] 20891 mvaddchnstr[1] slk_attrset[1] wsyncdown[1] 20892 mvaddchstr[1] slk_clear[1] wsyncup[1] 20893 mvaddnstr[1] slk_color[1] wtimeout[1] 20894 mvaddstr[1] slk_init[1] wtouchln[1] 20895 mvchgat[1] slk_label[1] wvline[1] 20896 mvcur[1] slk_noutrefresh[1] 20897 20898 Table A-8. libncurses Data Interfaces 20899 COLORS LINES curscr 20900 COLOR_PAIRS acs_map stdscr 20901 COLS cur_term 20902 _________________________________________________________ 20903 20904 A.6. libpam 20905 20906 The behaviour of the interfaces in this library is specified 20907 by the following Standards. 20908 20909 this specification 20910 20911 Table A-9. libpam Function Interfaces 20912 pam_acct_mgmt[1] pam_fail_delay[1] pam_setcred[1] 20913 pam_authenticate[1] pam_get_item[1] pam_start[1] 20914 pam_chauthtok[1] pam_getenvlist[1] pam_strerror[1] 20915 pam_close_session[1] pam_open_session[1] 20916 pam_end[1] pam_set_item[1] 20917 _________________________________________________________ 20918 20919 A.7. libpthread 20920 20921 The behaviour of the interfaces in this library is specified 20922 by the following Standards. 20923 20924 Large File Support 20925 this specification 20926 ISO POSIX (2003) 20927 20928 Table A-10. libpthread Function Interfaces 20929 _pthread_cleanup_pop[1] pthread_condattr_destroy()[1] 20930 pthread_rwlock_timedwrlock[1] 20931 _pthread_cleanup_push[1] pthread_condattr_getpshared[1] 20932 pthread_rwlock_tryrdlock()[1] 20933 pread(GLIBC_2.1)[1] pthread_condattr_init(GLIBC_2.1)[1] 20934 pthread_rwlock_trywrlock(GLIBC_2.1)[1] 20935 pread64(GLIBC_2.1)[1] pthread_condattr_setpshared[1] 20936 pthread_rwlock_unlock(GLIBC_2.1)[1] 20937 pthread_attr_destroy(GLIBC_2.0)[1] 20938 pthread_create(GLIBC_2.0)[1] 20939 pthread_rwlock_wrlock(GLIBC_2.0)[1] 20940 pthread_attr_getdetachstate(GLIBC_2.0)[1] 20941 pthread_detach(GLIBC_2.0)[1] 20942 pthread_rwlockattr_destroy(GLIBC_2.0)[1] 20943 pthread_attr_getguardsize(GLIBC_2.1)[1] 20944 pthread_equal(GLIBC_2.1)[1] 20945 pthread_rwlockattr_getpshared(GLIBC_2.1)[1] 20946 pthread_attr_getinheritsched(GLIBC_2.0)[1] 20947 pthread_exit(GLIBC_2.0)[1] 20948 pthread_rwlockattr_init(GLIBC_2.0)[1] 20949 pthread_attr_getschedparam(GLIBC_2.0)[1] 20950 pthread_getconcurrency[1] 20951 pthread_rwlockattr_setpshared(GLIBC_2.0)[1] 20952 pthread_attr_getschedpolicy(GLIBC_2.0)[1] 20953 pthread_getschedparam(GLIBC_2.0)[1] pthread_self(GLIBC_2.0)[1] 20954 pthread_attr_getscope(GLIBC_2.0)[1] 20955 pthread_getspecific(GLIBC_2.0)[1] 20956 pthread_setcancelstate(GLIBC_2.0)[1] 20957 pthread_attr_getstack[1] pthread_join()[1] 20958 pthread_setcanceltype()[1] 20959 pthread_attr_getstackaddr(GLIBC_2.1)[1] 20960 pthread_key_create(GLIBC_2.1)[1] pthread_setconcurrency[1] 20961 pthread_attr_getstacksize(GLIBC_2.1)[1] 20962 pthread_key_delete(GLIBC_2.1)[1] 20963 pthread_setschedparam(GLIBC_2.1)[1] 20964 pthread_attr_init(GLIBC_2.1)[1] pthread_kill(GLIBC_2.1)[1] 20965 pthread_setschedprio[1] 20966 pthread_attr_setdetachstate(GLIBC_2.0)[1] 20967 pthread_mutex_destroy(GLIBC_2.0)[1] 20968 pthread_setspecific(GLIBC_2.0)[1] 20969 pthread_attr_setguardsize(GLIBC_2.1)[1] 20970 pthread_mutex_init(GLIBC_2.1)[1] pthread_sigmask(GLIBC_2.1)[1] 20971 pthread_attr_setinheritsched(GLIBC_2.0)[1] 20972 pthread_mutex_lock(GLIBC_2.0)[1] 20973 pthread_testcancel(GLIBC_2.0)[1] 20974 pthread_attr_setschedparam(GLIBC_2.0)[1] 20975 pthread_mutex_trylock(GLIBC_2.0)[1] pwrite(GLIBC_2.0)[1] 20976 pthread_attr_setschedpolicy(GLIBC_2.0)[1] 20977 pthread_mutex_unlock(GLIBC_2.0)[1] pwrite64(GLIBC_2.0)[1] 20978 pthread_attr_setscope(GLIBC_2.0)[1] 20979 pthread_mutexattr_destroy(GLIBC_2.0)[1] 20980 sem_close(GLIBC_2.0)[1] 20981 pthread_attr_setstack[1] pthread_mutexattr_getpshared()[1] 20982 sem_destroy()[1] 20983 pthread_attr_setstackaddr(GLIBC_2.1)[1] 20984 pthread_mutexattr_gettype(GLIBC_2.1)[1] 20985 sem_getvalue(GLIBC_2.1)[1] 20986 pthread_attr_setstacksize(GLIBC_2.1)[1] 20987 pthread_mutexattr_init(GLIBC_2.1)[1] sem_init(GLIBC_2.1)[1] 20988 pthread_cancel(GLIBC_2.0)[1] 20989 pthread_mutexattr_setpshared(GLIBC_2.0)[1] 20990 sem_open(GLIBC_2.0)[1] 20991 pthread_cond_broadcast(GLIBC_2.0)[1] 20992 pthread_mutexattr_settype(GLIBC_2.0)[1] sem_post(GLIBC_2.0)[1] 20993 pthread_cond_destroy(GLIBC_2.0)[1] pthread_once(GLIBC_2.0)[1] 20994 sem_timedwait(GLIBC_2.0)[1] 20995 pthread_cond_init(GLIBC_2.0)[1] 20996 pthread_rwlock_destroy(GLIBC_2.0)[1] sem_trywait(GLIBC_2.0)[1] 20997 pthread_cond_signal(GLIBC_2.0)[1] 20998 pthread_rwlock_init(GLIBC_2.0)[1] sem_unlink(GLIBC_2.0)[1] 20999 pthread_cond_timedwait(GLIBC_2.0)[1] 21000 pthread_rwlock_rdlock(GLIBC_2.0)[1] sem_wait(GLIBC_2.0)[1] 21001 pthread_cond_wait(GLIBC_2.0)[1] pthread_rwlock_timedrdlock[1] 21002 _________________________________________________________ 21003 21004 A.8. libutil 21005 21006 The behaviour of the interfaces in this library is specified 21007 by the following Standards. 21008 21009 this specification 21010 21011 Table A-11. libutil Function Interfaces 21012 forkpty(GLIBC_2.0)[1] login_tty(GLIBC_2.0)[1] 21013 logwtmp(GLIBC_2.0)[1] 21014 login(GLIBC_2.0)[1] logout(GLIBC_2.0)[1] openpty(GLIBC_2.0)[1] 21015 _________________________________________________________ 21016 21017 A.9. libz 21018 21019 The behaviour of the interfaces in this library is specified 21020 by the following Standards. 21021 21022 this specification 21023 21024 Table A-12. libz Function Interfaces 21025 adler32[1] gzclose[1] gztell[1] 21026 compress[1] gzdopen[1] gzwrite[1] 21027 compress2[1] gzeof[1] inflate[1] 21028 compressBound[1] gzerror[1] inflateEnd[1] 21029 crc32[1] gzflush[1] inflateInit2_[1] 21030 deflate[1] gzgetc[1] inflateInit_[1] 21031 deflateBound[1] gzgets[1] inflateReset[1] 21032 deflateCopy[1] gzopen[1] inflateSetDictionary[1] 21033 deflateEnd[1] gzprintf[1] inflateSync[1] 21034 deflateInit2_[1] gzputc[1] inflateSyncPoint[1] 21035 deflateInit_[1] gzputs[1] uncompress[1] 21036 deflateParams[1] gzread[1] zError[1] 21037 deflateReset[1] gzrewind[1] zlibVersion[1] 21038 deflateSetDictionary[1] gzseek[1] 21039 get_crc_table[1] gzsetparams[1] 21040 21041 Linux Packaging Specification 21042 _________________________________________________________ 21043 21044 Table of Contents 21045 I. Package Format and Installation 21046 21047 1. Software Installation 21048 21049 1.1. Package File Format 21050 1.2. Package Script Restrictions 21051 1.3. Package Tools 21052 1.4. Package Naming 21053 1.5. Package Dependencies 21054 1.6. Package Architecture Considerations 21055 21056 List of Tables 21057 1-1. RPM File Format 21058 1-2. Signature Format 21059 1-3. Index Type values 21060 1-4. Header Private Tag Values 21061 1-5. Signature Tag Values 21062 1-6. Signature Digest Tag Values 21063 1-7. Signature Signing Tag Values 21064 1-8. Package Info Tag Values 21065 1-9. Installation Tag Values 21066 1-10. File Info Tag Values 21067 1-11. Package Dependency Tag Values 21068 1-12. Index Type values 21069 1-13. Package Dependency Attributes 21070 1-14. Other Tag Values 21071 1-15. CPIO File Format 21072 21073 I. Package Format and Installation 21074 21075 Table of Contents 21076 1. Software Installation 21077 _________________________________________________________ 21078 21079 Chapter 1. Software Installation 21080 21081 Applications shall either be packaged in the RPM packaging 21082 format as defined in this specification, or supply an 21083 installer which is LSB conforming (for example, calls LSB 21084 commands and utilities). [2] 21085 21086 Distributions shall provide a mechanism for installing 21087 applications in this packaging format with some restrictions 21088 listed below. [3] 21089 _________________________________________________________ 21090 21091 1.1. Package File Format 21092 21093 An RPM format file consists of 4 sections, the Lead, 21094 Signature, Header, and the Payload. All values are stored in 21095 network byte order. 21096 21097 Table 1-1. RPM File Format 21098 Lead 21099 Signature 21100 Header 21101 Payload 21102 21103 These 4 sections shall exist in the order specified. 21104 21105 The lead section is used to identify the package file. 21106 21107 The signature section is used to verify the integrity, and 21108 optionally, the authenticity of the majority of the package 21109 file. 21110 21111 The header section contains all available information about 21112 the package. Entries such as the package's name, version, and 21113 file list, are contained in the header. 21114 21115 The payload section holds the files to be install. 21116 _________________________________________________________ 21117 21118 1.1.1. Lead Section 21119 21120 struct rpmlead { 21121 unsigned char magic[4]; 21122 unsigned char major, minor; 21123 short type; 21124 short archnum; 21125 char name[66]; 21126 short osnum; 21127 short signature_type; 21128 char reserved[16]; 21129 } ; 21130 21131 magic 21132 Value identifying this file as an RPM format file. This 21133 value shall be "\355\253\356\333". 21134 21135 major 21136 Value indicating the major version number of the file 21137 format version. This value shall be 3. 21138 21139 minor 21140 Value indicating the minor revision number of file 21141 format version. This value shall be 0. 21142 21143 type 21144 Value indicating whether this is a source or binary 21145 package. This value shall be 0 to indicate a binary 21146 package. 21147 21148 archnum 21149 Value indicating the architecture for which this 21150 package is valid. This value is specified in the 21151 architecture-specific LSB specification. 21152 21153 name 21154 A NUL terminated string that provides the package name. 21155 This name shall conform with the Package Naming section 21156 of this specification. 21157 21158 osnum 21159 Value indicating the Operating System for which this 21160 package is valid. This value shall be 1. 21161 21162 signature_type 21163 Value indicating the type of the signature used in the 21164 Signature part of the file. This value shall be 5. 21165 21166 reserved 21167 Reserved space. The value is undefined. 21168 _________________________________________________________ 21169 21170 1.1.2. Header Structure 21171 21172 The Header structure is used for both the Signature and Header 21173 Sections. A Header Structure consists of 3 parts, a Header 21174 record, followed by 1 or more Index records, followed by 0 or 21175 more bytes of data associated with the Index records. A Header 21176 structure shall be aligned to an 8 byte boundary. 21177 21178 Table 1-2. Signature Format 21179 Header Record 21180 Array of Index Records 21181 Store of Index Values 21182 _________________________________________________________ 21183 21184 1.1.2.1. Header Record 21185 21186 struct rpmheader { 21187 unsigned char magic[4]; 21188 unsigned char reserved[4]; 21189 int nindex; 21190 int hsize; 21191 } ; 21192 21193 magic 21194 Value identifying this record as an RPM header record. 21195 This value shall be "\216\255\350\001". 21196 21197 reserved 21198 Reserved space. This value shall be "\000\000\000\000". 21199 21200 nindex 21201 The number of Index Records that follow this Header 21202 Record. There should be at least 1 Index Record. 21203 21204 hsize 21205 The size in bytes of the storage area for the data 21206 pointed to by the Index Records. 21207 _________________________________________________________ 21208 21209 1.1.2.2. Index Record 21210 21211 struct rpmhdrindex { 21212 int tag; 21213 int type; 21214 int offset; 21215 int count; 21216 } ; 21217 21218 tag 21219 Value identifying the purpose of the data associated 21220 with this Index Record. This value of this field is 21221 dependent on the context in which the Index Record is 21222 used, and is defined below and in later sections. 21223 21224 type 21225 Value identifying the type of the data associated with 21226 this Index Record. The possible type values are defined 21227 below. 21228 21229 offset 21230 Location in the Store of the data associated with this 21231 Index Record. This value should between 0 and the value 21232 contained in the hsize of the Header Structure. 21233 21234 count 21235 Size of the data associated with this Index Record. The 21236 count is the number of elements whose size is defined 21237 by the type of this Record. 21238 _________________________________________________________ 21239 21240 1.1.2.2.1. Index Type Values 21241 21242 The possible values for the type field are defined in this 21243 table. 21244 21245 Table 1-3. Index Type values 21246 Type Value Size (in bytes) Alignment 21247 RPM_NULL_TYPE 0 Not Implemented. 21248 RPM_CHAR_TYPE 1 1 1 21249 RPM_INT8_TYPE 2 1 1 21250 RPM_INT16_TYPE 3 2 2 21251 RPM_INT32_TYPE 4 4 4 21252 RPM_INT64_TYPE 5 Reserved. 21253 RPM_STRING_TYPE 6 variable, NUL terminated 1 21254 RPM_BIN_TYPE 7 1 1 21255 RPM_STRING_ARRAY_TYPE 8 Variable, sequence of NUL terminated 21256 strings 1 21257 RPM_I18NSTRING_TYPE 9 variable, sequence of NUL terminated 21258 strings 1 21259 21260 The string arrays specified for enties of type 21261 RPM_STRING_ARRAY_TYPE and RPM_I18NSTRING_TYPE are vectors of 21262 strings in a contiguous block of memory, each element 21263 separated from its neighbors by a NUL character. 21264 21265 Index records with type RPM_I18NSTRING_TYPE shall always have 21266 a count of 1. The array entries in an index of type 21267 RPM_I18NSTRING_TYPE correspond to the locale names contained 21268 in the RPMTAG_HDRI18NTABLE index. 21269 _________________________________________________________ 21270 21271 1.1.2.2.2. Index Tag Values 21272 21273 Some values are designated as header private, and may appear 21274 in any header structure. These are defined here. Additional 21275 values are defined in later sections. 21276 21277 Table 1-4. Header Private Tag Values 21278 Name Tag Value Type Count Status 21279 RPMTAG_HEADERSIGNATURES 62 BIN 16 Optional 21280 RPMTAG_HEADERIMMUTABLE 63 BIN 16 Optional 21281 RPMTAG_HEADERI18NTABLE 100 STRING_ARRAY Required 21282 21283 RPMTAG_HEADERSIGNATURES 21284 The signature tag differentiates a signature header 21285 from a metadata header, and identifies the original 21286 contents of the signature header. 21287 21288 RPMTAG_HEADERIMMUTABLE 21289 This tag contains an index record which specifies the 21290 portion of the Header Record which was used for the 21291 calculation of a signature. This data shall be 21292 preserved or any header-only signature will be 21293 invalidated. 21294 21295 RPMTAG_HEADERI18NTABLE 21296 Contains a list of locales for which strings are 21297 provided in other parts of the package. 21298 21299 Not all Index records defined here will be present in all 21300 packages. Each tag value has a status which is defined here. 21301 21302 Required 21303 This Index Record shall be present. 21304 21305 Optional 21306 This Index Record may be present. 21307 21308 Informational 21309 This Index Record may be present, but does not 21310 contribute to the processing of the package. 21311 21312 Deprecated 21313 This Index Record should not be present. 21314 21315 Obsolete 21316 This Index Record shall not be present. 21317 21318 Reserved 21319 This Index Record shall not be present. 21320 _________________________________________________________ 21321 21322 1.1.2.3. Header Store 21323 21324 The header store contains the values specified by the Index 21325 structures. These values are aligned according to their type 21326 and padding is used if needed. The store is located 21327 immediately following the Index structures. 21328 _________________________________________________________ 21329 21330 1.1.3. Signature Section 21331 21332 The Signature section is implemented using the Header 21333 structure. The signature section defines the following 21334 additional tag values which may be used in the Index 21335 structures. 21336 21337 These values exist to provide additional information about the 21338 rest of the package. 21339 21340 Table 1-5. Signature Tag Values 21341 Name Tag Value Type Count Status 21342 SIGTAG_SIGSIZE 1000 INT32 1 Required 21343 SIGTAG_PAYLOADSIZE 1007 INT32 1 Optional 21344 21345 SIGTAG_SIGSIZE 21346 This tag specifies the combined size of the Header and 21347 Payload sections. 21348 21349 SIGTAG_PAYLOADSIZE 21350 This tag specifies the uncompressed size of the Payload 21351 archive, including the cpio headers. 21352 21353 These values exist to ensure the integrity of the rest of the 21354 package. 21355 21356 Table 1-6. Signature Digest Tag Values 21357 Name Tag Value Type Count Status 21358 SIGTAG_MD5 1004 BIN 16 Required 21359 SIGTAG_SHA1HEADER 1010 STRING 1 Optional 21360 21361 SIGTAG_MD5 21362 This tag specifies the 128-bit MD5 checksum of the 21363 combined Header and Archive sections. 21364 21365 SIGTAG_SHA1HEADER 21366 This index contains the SHA1 checksum of the entire 21367 Header Section, including the Header Record, Index 21368 Records and Header store. 21369 21370 These values exist to provide authentication of the package. 21371 21372 Table 1-7. Signature Signing Tag Values 21373 Name Tag Value Type Count Status 21374 SIGTAG_PGP 1002 BIN 1 Optional 21375 SIGTAG_GPG 1005 BIN 65 Optional 21376 SIGTAG_DSAHEADER 1011 BIN 1 Optional 21377 SIGTAG_RSAHEADER 1012 BIN 1 Optional 21378 21379 SIGTAG_PGP 21380 This tag specifies the RSA signature of the combined 21381 Header and Payload sections. The data is formatted as a 21382 Version 3 Signature Packet as specified in RFC 2440: 21383 OpenPGP Message Format. 21384 21385 SIGTAG_GPG 21386 The tag contains the DSA signature of the combined 21387 Header and Payload sections. The data is formatted as a 21388 Version 3 Signature Packet as specified in RFC 2440: 21389 OpenPGP Message Format. 21390 21391 SIGTAG_DSAHEADER 21392 The tag contains the DSA signature of the Header 21393 section. The data is formatted as a Version 3 Signature 21394 Packet as specified in RFC 2440: OpenPGP Message 21395 Format. If this tag is present,then the SIGTAG_GPG tag 21396 shall also be present. 21397 21398 SIGTAG_RSAHEADER 21399 The tag contains the RSA signature of the Header 21400 section.The data is formatted as a Version 3 Signature 21401 Packet as specified in RFC 2440: OpenPGP Message 21402 Format. If this tag is present, then the SIGTAG_PGP 21403 shall also be present. 21404 _________________________________________________________ 21405 21406 1.1.4. Header Section 21407 21408 The Header section is implemented using the Header structure. 21409 The Header section defines the following additional tag values 21410 which may be used in the Index structures. 21411 _________________________________________________________ 21412 21413 1.1.4.1. Package Information 21414 21415 The following tag values are used to indicate information that 21416 describes the package as a whole. 21417 21418 Table 1-8. Package Info Tag Values 21419 Name Tag Value Type Count Status 21420 RPMTAG_NAME 1000 STRING 1 Required 21421 RPMTAG_VERSION 1001 STRING 1 Required 21422 RPMTAG_RELEASE 1002 STRING 1 Required 21423 RPMTAG_SUMMARY 1004 I18NSTRING 1 Required 21424 RPMTAG_DESCRIPTION 1005 I18NSTRING 1 Required 21425 RPMTAG_SIZE 1009 INT32 1 Required 21426 RPMTAG_DISTRIBUTION 1010 STRING 1 Informational 21427 RPMTAG_VENDOR 1011 STRING 1 Informational 21428 RPMTAG_LICENSE 1014 STRING 1 Required 21429 RPMTAG_GROUP 1016 I18NSTRING 1 Required 21430 RPMTAG_URL 1020 STRING 1 Informational 21431 RPMTAG_OS 1021 STRING 1 Required 21432 RPMTAG_ARCH 1022 STRING 1 Required 21433 RPMTAG_SOURCERPM 1044 STRING 1 Informational 21434 RPMTAG_ARCHIVESIZE 1046 INT32 1 Optional 21435 RPMTAG_RPMVERSION 1064 STRING 1 Informational 21436 RPMTAG_COOKIE 1094 STRING 1 Optional 21437 RPMTAG_DISTURL 1123 STRING 1 Informational 21438 RPMTAG_PAYLOADFORMAT 1124 STRING 1 Required 21439 RPMTAG_PAYLOADCOMPRESSOR 1125 STRING 1 Required 21440 RPMTAG_PAYLOADFLAGS 1126 STRING 1 Required 21441 21442 RPMTAG_NAME 21443 This tag specifies the name of the package. 21444 21445 RPMTAG_VERSION 21446 This tag specifies the version of the package. 21447 21448 RPMTAG_RELEASE 21449 This tag specifies the release of the package. 21450 21451 RPMTAG_SUMMARY 21452 This tag specifies the summary description of the 21453 package. The summary value pointed to by this index 21454 record contains a one line description of the package. 21455 21456 RPMTAG_DESCRIPTION 21457 This tag specifies the description of the package. The 21458 description value pointed to by this index record 21459 contains a full desription of the package. 21460 21461 RPMTAG_SIZE 21462 This tag specifies the sum of the sizes of the regular 21463 files in the archive. 21464 21465 RPMTAG_DISTRIBUTION 21466 A string containing the name of the distribution on 21467 which the package was built. 21468 21469 RPMTAG_VENDOR 21470 A string containing the name of the organization that 21471 produced the package. 21472 21473 RPMTAG_LICENSE 21474 This tag specifies the license which applies to this 21475 package. 21476 21477 RPMTAG_GROUP 21478 This tag specifies the administrative group to which 21479 this package belongs. 21480 21481 RPMTAG_URL 21482 URL for what?? 21483 21484 RPMTAG_OS 21485 This tag specifies the OS of the package. The OS value 21486 pointed to by this index record shall be "linux". 21487 21488 RPMTAG_ARCH 21489 This tag specifies the architecture of the package. The 21490 architecture value pointed to by this index record is 21491 defined in architecture specific LSB specification. 21492 21493 RPMTAG_SOURCERPM 21494 This tag specifies the name of the source RPM 21495 21496 RPMTAG_ARCHIVESIZE 21497 This tag specifies the uncompressed size of the Payload 21498 archive, including the cpio headers. 21499 21500 RPMTAG_RPMVERSION 21501 This tag indicates the version of RPM tool used to 21502 build this package. The value is unused. 21503 21504 RPMTAG_COOKIE 21505 This tag contains an opaque string whose contents are 21506 undefined. 21507 21508 RPMTAG_DISTURL 21509 URL of the distribution? 21510 21511 RPMTAG_PAYLOADFORMAT 21512 This tag specifies the format of the Archive section. 21513 The format value pointed to by this index record shall 21514 be 'cpio'. 21515 21516 RPMTAG_PAYLOADCOMPRESSOR 21517 This tag specifies the compression used on the Archive 21518 section. The compression value pointed to by this index 21519 record shall be 'gzip' 21520 21521 RPMTAG_PAYLOADFLAGS 21522 This tag indicates the compression level used for the 21523 Payload. This value shall always be '9'. 21524 _________________________________________________________ 21525 21526 1.1.4.2. Installation Information 21527 21528 The following tag values are used to provide information 21529 needed during the installation of the package. 21530 21531 Table 1-9. Installation Tag Values 21532 Name Tag Value Type Count Status 21533 RPMTAG_PREIN 1023 STRING 1 Optional 21534 RPMTAG_POSTIN 1024 STRING 1 Optional 21535 RPMTAG_PREUN 1025 STRING 1 Optional 21536 RPMTAG_POSTUN 1026 STRING 1 Optional 21537 RPMTAG_PREINPROG 1085 STRING 1 Optional 21538 RPMTAG_POSTINPROG 1086 STRING 1 Optional 21539 RPMTAG_PREUNPROG 1087 STRING 1 Optional 21540 RPMTAG_POSTUNPROG 1088 STRING 1 Optional 21541 21542 RPMTAG_PREIN 21543 This tag specifies the preinstall scriptlet. If 21544 present, then RPMTAG_PREINPROG shall also be present. 21545 21546 RPMTAG_POSTIN 21547 This tag specifies the postinstall scriptlet. If 21548 present, then RPMTAG_POSTINPROG shall also be present. 21549 21550 RPMTAG_PREUN 21551 his tag specifies the preuninstall scriptlet. If 21552 present, then RPMTAG_PREUNPROG shall also be present. 21553 21554 RPMTAG_POSTUN 21555 This tag specified the postuninstall scriptlet. If 21556 present, then RPMTAG_POSTUNPROG shall also be present. 21557 21558 RPMTAG_PREINPROG 21559 This tag specifies the name of the intepreter to which 21560 the preinstall scriptlet will be passed. The intepreter 21561 pointed to by this index record shall be '/bin/sh'. 21562 21563 RPMTAG_POSTINPROG 21564 This tag specifies the name of the intepreter to which 21565 the postinstall scriptlet will be passed. The 21566 intepreter pointed to by this index record shall be 21567 '/bin/sh'. 21568 21569 RPMTAG_PREUNPROG 21570 This tag specifies the name of the intepreter to which 21571 the preuninstall scriptlet will be passed. The 21572 intepreter pointed to by this index record shall be 21573 '/bin/sh'. 21574 21575 RPMTAG_POSTUNPROG 21576 This program specifies the name of the intepreter to 21577 which the postuninstall scriptlet will be passed. The 21578 intepreter pointed to by this index record shall be 21579 '/bin/sh'. 21580 _________________________________________________________ 21581 21582 1.1.4.3. File Information 21583 21584 The following tag values are used to provide information about 21585 the files in the payload. This information is provided in the 21586 header to allow more efficient access of the information. 21587 21588 Table 1-10. File Info Tag Values 21589 Name Tag Value Type Count Status 21590 RPMTAG_OLDFILENAMES 1027 STRING_ARRAY Optional 21591 RPMTAG_FILESIZES 1028 INT32 Required 21592 RPMTAG_FILEMODES 1030 INT16 Required 21593 RPMTAG_FILERDEVS 1033 INT16 Required 21594 RPMTAG_FILEMTIMES 1034 INT32 Required 21595 RPMTAG_FILEMD5S 1035 STRING_ARRAY Required 21596 RPMTAG_FILELINKTOS 1036 STRING_ARRAY Required 21597 RPMTAG_FILEFLAGS 1037 INT32 Required 21598 RPMTAG_FILEUSERNAME 1039 STRING_ARRAY Required 21599 RPMTAG_FILEGROUPNAME 1040 STRING_ARRAY Required 21600 RPMTAG_FILEDEVICES 1095 INT32 Required 21601 RPMTAG_FILEINODES 1096 INT32 Required 21602 RPMTAG_FILELANGS 1097 STRING_ARRAY Required 21603 RPMTAG_DIRINDEXES 1116 INT32 Optional 21604 RPMTAG_BASENAMES 1117 STRING_ARRAY Optional 21605 RPMTAG_DIRNAMES 1118 STRING_ARRAY Optional 21606 21607 RPMTAG_OLDFILENAMES 21608 This tag specifies the filenames when not in a 21609 compressed format as determined by the absense of 21610 rpmlib(CompressedFileNames) in the RPMTAG_REQUIRENAME 21611 index. 21612 21613 RPMTAG_FILESIZES 21614 This tag specifies the size of each file in the 21615 archive. 21616 21617 RPMTAG_FILEMODES 21618 This tag specifies the mode of each file in the 21619 archive. 21620 21621 RPMTAG_FILERDEVS 21622 This tag specifies the device number from which the 21623 file was copied. 21624 21625 RPMTAG_FILEMTIMES 21626 This tag specifies the modification time in seconds 21627 since the epoch of each file in the archive. 21628 21629 RPMTAG_FILEMD5S 21630 This tag specifies the ASCII representation of the MD5 21631 sum of the corresponding file contents. This value is 21632 empty if the corresponding archive entry is not a 21633 regular file. 21634 21635 RPMTAG_FILELINKTOS 21636 The target for a symlink, otherwise NULL. 21637 21638 RPMTAG_FILEFLAGS 21639 This tag specifies the bit(s) to classify and control 21640 how files are to be installed. 21641 21642 RPMTAG_FILEUSERNAME 21643 This tag specifies the owner of the corresponding file. 21644 21645 RPMTAG_FILEGROUPNAME 21646 This tag specifies the of the corresponding file. 21647 21648 RPMTAG_FILEDEVICES 21649 This tag specifies the 16 bit device number from which 21650 the file was copied. 21651 21652 RPMTAG_FILEINODES 21653 This tag specifies the inode value from the original 21654 file on the build host. 21655 21656 RPMTAG_FILELANGS 21657 This tag specifies a per-file locale marker used to 21658 install only locale specific subsets of files when the 21659 package is installed. 21660 21661 RPMTAG_DIRINDEXES 21662 This tag specifies the index into the array provided by 21663 the RPMTAG_DIRNAMES Index which contains the directory 21664 name for the corresponding filename. 21665 21666 RPMTAG_BASENAMES 21667 This tag specifies the base portion of the 21668 corresponding filename. 21669 21670 RPMTAG_DIRNAMES 21671 This tag specifies the directory portion of the 21672 corresponding filename. Each directory name shall 21673 contain a trailing '/'. 21674 21675 One of RPMTAG_OLDFILENAMES or the tuple 21676 RPMTAG_DIRINDEXES,RPMTAG_BASENAMES,RPMTAG_DIRNAMES shall be 21677 present, but not both. 21678 _________________________________________________________ 21679 21680 1.1.4.4. Dependency Information 21681 21682 The following tag values are used to provide information about 21683 interdependencies between packages. 21684 21685 Table 1-11. Package Dependency Tag Values 21686 Name Tag Value Type Count Status 21687 RPMTAG_PROVIDENAME 1047 STRING_ARRAY 1 Required 21688 RPMTAG_REQUIREFLAGS 1048 INT32 Required 21689 RPMTAG_REQUIRENAME 1049 STRING_ARRAY Required 21690 RPMTAG_REQUIREVERSION 1050 STRING_ARRAY Required 21691 RPMTAG_CONFLICTFLAGS 1053 INT32 Optional 21692 RPMTAG_CONFLICTNAME 1054 STRING_ARRAY Optional 21693 RPMTAG_CONFLICTVERSION 1055 STRING_ARRAY Optional 21694 RPMTAG_OBSOLETENAME 1090 STRING_ARRAY Optional 21695 RPMTAG_PROVIDEFLAGS 1112 INT32 Required 21696 RPMTAG_PROVIDEVERSION 1113 STRING_ARRAY Required 21697 RPMTAG_OBSOLETEFLAGS 1114 INT32 1 Optional 21698 RPMTAG_OBSOLETEVERSION 1115 STRING_ARRAY Optional 21699 21700 RPMTAG_PROVIDENAME 21701 This tag indicates the name of the dependency provided 21702 by this package. 21703 21704 RPMTAG_REQUIREFLAGS 21705 Bits(s) to specify the dependency range and context. 21706 21707 RPMTAG_REQUIRENAME 21708 This tag indicates the dependencies for this package. 21709 21710 RPMTAG_REQUIREVERSION 21711 This tag indicates the versions associated with the 21712 values found in the RPMTAG_REQUIRENAME Index. 21713 21714 RPMTAG_CONFLICTFLAGS 21715 Bits(s) to specify the conflict range and context. 21716 21717 RPMTAG_CONFLICTNAME 21718 This tag indicates the conflictind dependencies for 21719 this package. 21720 21721 RPMTAG_CONFLICTVERSION 21722 This tag indicates the versions associated with the 21723 values found in the RPMTAG_CONFLICTNAME Index. 21724 21725 RPMTAG_OBSOLETENAME 21726 This tag indicates the obsoleted dependencies for this 21727 package. 21728 21729 RPMTAG_PROVIDEFLAGS 21730 Bits(s) to specify the conflict range and context. 21731 21732 RPMTAG_PROVIDEVERSION 21733 This tag indicates the versions associated with the 21734 values found in the RPMTAG_PROVIDENAME Index. 21735 21736 RPMTAG_OBSOLETEFLAGS 21737 Bits(s) to specify the conflict range and context. 21738 21739 RPMTAG_OBSOLETEVERSION 21740 This tag indicates the versions associated with the 21741 values found in the RPMTAG_OBSOLETENAME Index. 21742 _________________________________________________________ 21743 21744 1.1.4.4.1. Package Dependency Values 21745 21746 The package dependencies are stored in the RPMTAG_REQUIRENAME 21747 and RPMTAG_REQUIREVERSION index records. The following values 21748 may be used. 21749 21750 Table 1-12. Index Type values 21751 Name Version Meaning Status 21752 rpmlib(VersionedDependencies) 3.0.3-1 Indicates that the 21753 package contains RPMTAG_PROVIDENAME, RPMTAG_OBSOLETENAME or 21754 RPMTAG_PREREQ records that have a version associated with 21755 them. Optional 21756 rpmlib(PayloadFilesHavePrefix) 4.0-1 Indicates the filenames 21757 in the Archive have had "." prepended to them. Optional 21758 rpmlib(CompressedFileNames) 3.0.4-1 Indicates that the 21759 filenames in the Payload are represented in the 21760 RPMTAG_DIRINDEXES, RPMTAG_DIRNAME and RPMTAG_BASENAMES 21761 indexes. Optional 21762 /bin/sh Interpreter usually required for installation 21763 scripts. Optional 21764 21765 Additional dependencies are specified in the Package 21766 Dependencies section of this document, and the architecture 21767 specific documents. 21768 _________________________________________________________ 21769 21770 1.1.4.4.2. Package Dependencies Attributes 21771 21772 The package dependency attributes are stored in the 21773 RPMTAG_REQUIREFLAGS, RPMTAG_PROVIDEFLAGS and 21774 RPMTAG_OBSOLETEFLAGS index records. The following values may 21775 be used. 21776 21777 Table 1-13. Package Dependency Attributes 21778 Name Value Meaning 21779 RPMSENSE_LESS 0x02 21780 RPMSENSE_GREATER 0x04 21781 RPMSENSE_EQUAL 0x08 21782 RPMSENSE_PREREQ 0x40 21783 RPMSENSE_INTERP 0x100 21784 RPMSENSE_SCRIPT_PRE 0x200 21785 RPMSENSE_SCRIPT_POST 0x400 21786 RPMSENSE_SCRIPT_PREUN 0x800 21787 RPMSENSE_SCRIPT_POSTUN 0x1000 21788 RPMSENSE_RPMLIB 0x1000000 21789 _________________________________________________________ 21790 21791 1.1.4.5. Other Information 21792 21793 The following tag values are also found in the Header section. 21794 21795 Table 1-14. Other Tag Values 21796 Name Tag Value Type Count Status 21797 RPMTAG_BUILDTIME 1006 INT32 1 Informational 21798 RPMTAG_BUILDHOST 1007 STRING 1 Informational 21799 RPMTAG_FILEVERIFYFLAGS 1045 INT32 Optional 21800 RPMTAG_CHANGELOGTIME 1080 INT32 Optional 21801 RPMTAG_CHANGELOGNAME 1081 STRING_ARRAY Optional 21802 RPMTAG_CHANGELOGTEXT 1082 STRING_ARRAY Optional 21803 RPMTAG_OPTFLAGS 1122 STRING 1 Informational 21804 RPMTAG_RHNPLATFORM 1131 STRING 1 Deprecated 21805 RPMTAG_PLATFORM 1132 STRING 1 Informational 21806 21807 RPMTAG_BUILDTIME 21808 This tag specifies the time as seconds since the epoch 21809 at which the package was built. 21810 21811 RPMTAG_BUILDHOST 21812 This tag specifies the hostname of the system on which 21813 which the package was built. 21814 21815 RPMTAG_FILEVERIFYFLAGS 21816 This tag specifies the bit(s) to control how files are 21817 to be verified after install, specifying which checks 21818 should be performed. 21819 21820 RPMTAG_CHANGELOGTIME 21821 This tag specifies the Unix time in seconds since the 21822 epoch associated with each entry in the Changelog file. 21823 21824 RPMTAG_CHANGELOGNAME 21825 This tag specifies the name of who made a change to 21826 this package 21827 21828 RPMTAG_CHANGELOGTEXT 21829 This tag specifies the changes asssociated with a 21830 changelog entry. 21831 21832 RPMTAG_OPTFLAGS 21833 This tag indicates additional flags which may have been 21834 passed to the compiler when building this package. 21835 21836 RPMTAG_RHNPLATFORM 21837 This tag contains an opaque string whose contents are 21838 undefined. 21839 21840 RPMTAG_PLATFORM 21841 This tag contains an opaque string whose contents are 21842 undefined. 21843 _________________________________________________________ 21844 21845 1.1.5. Payload Section 21846 21847 The Payload section contains a compressed cpio archive. The 21848 format of this section is defined by RFC 1952: GZIP File 21849 Format Specification. 21850 21851 When uncompressed, the cpio archive contains a sequence of 21852 records for each file. Each record contains a CPIO Header, 21853 Filename, Padding, and File Data. 21854 21855 Table 1-15. CPIO File Format 21856 CPIO Header Header structure as defined below. 21857 Filename NUL terminated ASCII string containing the name of 21858 the file. 21859 Padding 0-3 bytes as needed to align the file stream to a 4 21860 byte boundary. 21861 File data The contents of the file. 21862 Padding 0-3 bytes as needed to align the file stream to a 4 21863 byte boundary. 21864 21865 The CPIO Header uses the following header structure (sometimes 21866 referred to as "new ASCII" or "SVR4 cpio"). All numbers are 21867 stored as ASCII representations of their hexadecimal value 21868 with leading zeros as needed to fill the field. With the 21869 exception of c_namesize and the corresponding name string, and 21870 c_checksum, all information contained in the CPIO Header is 21871 also represented in the Header Section. The values in in the 21872 CPIO Header shall match the values contained in the Header 21873 Section. 21874 struct { 21875 char c_magic[6]; 21876 char c_ino[8]; 21877 char c_mode[8]; 21878 char c_uid[8]; 21879 char c_gid[8]; 21880 char c_nlink[8]; 21881 char c_mtime[8]; 21882 char c_filesize[8]; 21883 char c_devmajor[8]; 21884 char c_devminor[8]; 21885 char c_rdevmajor[8]; 21886 char c_rdevminor[8]; 21887 char c_namesize[8]; 21888 char c_checksum[8]; 21889 }; 21890 21891 c_magic 21892 Value identifying this cpio format. This value shall be 21893 "070701". 21894 21895 c_ino 21896 This field contains the inode number from the 21897 filesystem from which the file was read. This field is 21898 ignored when installing a package. This field shall 21899 match the corresponding value in the RPMTAG_FILEINODES 21900 index in the Header section. 21901 21902 c_mode 21903 Permission bits of the file. This is an ascii 21904 representation of the hexadecimal number representing 21905 the bit as defined for the st_mode field of the stat 21906 structure defined for the stat function. This field 21907 shall match the corresponding value in the 21908 RPMTAG_FILEMODES index in the Header section. 21909 21910 c_uid 21911 Value identifying this owner of this file. This value 21912 matches the uid value of the corresponding user in the 21913 RPMTAG_FILEUSERNAME as found on the system where this 21914 package was built. The username specified in 21915 RPMTAG_FILEUSERNAME should take precedence when 21916 installing the package. 21917 21918 c_gid 21919 Value identifying this group of this file. This value 21920 matches the gid value of the corresponding user in the 21921 RPMTAG_FILEGROUPNAME as found on the system where this 21922 package was built. The groupname specified in 21923 RPMTAG_FILEGROUPNAME should take precedence when 21924 installing the package. 21925 21926 c_nlink 21927 Value identifying the number of links associated with 21928 this file. If the value is greater than 1, then this 21929 filename will be linked to 1 or more files in this 21930 archive that has a matching value for the c_ino, 21931 c_devmajor and c_devminor fields. 21932 21933 c_mtime 21934 Value identifying the modification time of the file 21935 when it was read. This field shall match the 21936 corresponding value in the RPMTAG_FILEMTIMES index in 21937 the Header section. 21938 21939 c_filesize 21940 Value identifying the size of the file. This field 21941 shall match the corresponding value in the 21942 RPMTAG_FILESIZES index in the Header section. 21943 21944 c_devmajor 21945 The major number of the device containing the file 21946 system from which the file was read. With the exception 21947 of processing files with c_nlink >1, this field is 21948 ignored when installing a package. This field shall 21949 match the corresponding value in the RPMTAG_FILEDEVICES 21950 index in the Header section. 21951 21952 c_devminor 21953 The minor number of the device containing the file 21954 system from which the file was read. With the exception 21955 of processing files with c_nlink >1, this field is 21956 ignored when installing a package. This field shall 21957 match the corresponding value in the RPMTAG_FILEDEVICES 21958 index in the Header section. 21959 21960 c_rdevmajor 21961 The major number of the raw device containing the file 21962 system from which the file was read. This field is 21963 ignored when installing a package. This field shall 21964 match the corresponding value in the RPMTAG_RDEVS index 21965 in the Header section. 21966 21967 c_rdevminor 21968 The minor number of the raw device containing the file 21969 system from which the file was read. This field is 21970 ignored when installing a package. This field shall 21971 match the corresponding value in the RPMTAG_RDEVS index 21972 in the Header section. 21973 21974 c_namesize 21975 Value identifying the length of the filename, which is 21976 located immediately following the CPIO Header 21977 structure. 21978 21979 c_checksum 21980 Value containing the CRC checksum of the file data. 21981 This field is not used, and shall contain the value 21982 "00000000". This field is ignored when installing a 21983 package. 21984 21985 A record with the filename "TRAILER!!!" indicates the last 21986 record in the archive. 21987 _________________________________________________________ 21988 21989 1.2. Package Script Restrictions 21990 21991 Scripts used as part of the package install and uninstall 21992 shall only use commands and interfaces that are specified by 21993 the LSB. All other commands are not guaranteed to be present, 21994 or to behave in expected ways. 21995 21996 Packages shall not use RPM triggers. 21997 21998 Packages shall not depend on the order in which scripts are 21999 executed (pre-install, pre-uninstall, &c), when doing an 22000 upgrade. 22001 _________________________________________________________ 22002 22003 1.3. Package Tools 22004 22005 The LSB does not specify the interface to the tools used to 22006 manipulate LSB-conformant packages. Each conforming 22007 distribution shall provide documentation for installing LSB 22008 packages. 22009 _________________________________________________________ 22010 22011 1.4. Package Naming 22012 22013 Packages supplied by distributions and applications must 22014 follow the following rules for the name field within the 22015 package. These rules are not required for the filename of the 22016 package file itself.[4] 22017 22018 The following rules apply to the name field alone, not 22019 including any release or version.[5] 22020 22021 * If the name begins with "lsb-" and contains no other 22022 hyphens, the name shall be assigned by the Linux Assigned 22023 Names and Numbers Authority (LANANA), which shall maintain 22024 a registry of LSB names. The name may be registered by 22025 either a distribution or an application. 22026 * If the package name begins with "lsb-" and contains more 22027 than one hyphen (for example 22028 "lsb-distro.example.com-database" or 22029 "lsb-gnome-gnumeric"), then the portion of the package 22030 name between first and second hyphens shall either be an 22031 LSB provider name assigned by the LANANA, or it may be one 22032 of the owners' fully-qualified domain names in lower case 22033 (e.g., "debian.org", "staroffice.sun.com"). The LSB 22034 provider name assigned by LANANA shall only consist of the 22035 ASCII characters [a-z0-9]. The provider name or domain 22036 name may be either that of a distribution or an 22037 application. 22038 * Package names containing no hyphens are reserved for use 22039 by distributions. Applications must not use such names.[6] 22040 * Package names which do not start with "lsb-" and which 22041 contain a hyphen are open to both distributions and 22042 applications. Distributions may name packages in any part 22043 of this namespace. They are encouraged to use names from 22044 one of the other namespaces available to them, but this is 22045 not required due to the large amount of current practice 22046 to the contrary.[7] Applications may name their packages 22047 this way, but only if the portion of the name before the 22048 first hyphen is a provider name or registered domain name 22049 as described above.[8]Note that package names in this 22050 namespace are available to both the distribution and an 22051 application. Distributions and applications will need to 22052 consider this potential for conflicts when deciding to use 22053 these names rather than the alternatives (such as names 22054 starting with "lsb-"). 22055 _________________________________________________________ 22056 22057 1.5. Package Dependencies 22058 22059 Packages shall have a dependency that indicates which LSB 22060 modules are required. LSB module descriptions are dash 22061 seperated tuples containing the name 'lsb', the module name, 22062 and the architecture name. The following dependencies may be 22063 used. 22064 22065 lsb-core-arch 22066 This dependency is used to indicate that the 22067 application is dependent on features contained in the 22068 LSB-Core specification. 22069 22070 lsb-core-noarch 22071 This dependency is used to indicate that the 22072 application is dependent on features contained in the 22073 LSB-Core specification and that the package does not 22074 contain any architecture specific files. 22075 22076 These dependencies shall have a version of 3.0. 22077 22078 Packages shall not depend on other system-provided 22079 dependencies. They shall not depend on non-system-provided 22080 dependencies unless those dependencies are fulfilled by 22081 packages which are part of the same application. A package may 22082 only provide a virtual package name which is registered to 22083 that application. 22084 22085 Other modules in the LSB may supplement this list. The 22086 architecture specific dependencies are described in the 22087 relevant architecture specific LSB. 22088 _________________________________________________________ 22089 22090 1.6. Package Architecture Considerations 22091 22092 Packages which do not contain any architecture specific files 22093 must specify an architecture of noarch. A LSB runtime 22094 environment must accept values noarch, or the value specified 22095 in the architecture specific supplement. 22096 22097 Additional specifications or restrictions may be found in the 22098 architecture specific LSB specification. 22099 22100 Free Documentation License 22101 _________________________________________________________ 22102 22103 Table of Contents 22104 A. GNU Free Documentation License 22105 22106 A.1. PREAMBLE 22107 A.2. APPLICABILITY AND DEFINITIONS 22108 A.3. VERBATIM COPYING 22109 A.4. COPYING IN QUANTITY 22110 A.5. MODIFICATIONS 22111 A.6. COMBINING DOCUMENTS 22112 A.7. COLLECTIONS OF DOCUMENTS 22113 A.8. AGGREGATION WITH INDEPENDENT WORKS 22114 A.9. TRANSLATION 22115 A.10. TERMINATION 22116 A.11. FUTURE REVISIONS OF THIS LICENSE 22117 A.12. How to use this License for your documents 22118 _________________________________________________________ 22119 22120 Appendix A. GNU Free Documentation License 22121 22122 Version 1.1, March 2000 22123 22124 Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple 22125 Place, Suite 330, Boston, MA 02111-1307 USA Everyone is 22126 permitted to copy and distribute verbatim copies of this 22127 license document, but changing it is not allowed. 22128 _________________________________________________________ 22129 22130 A.1. PREAMBLE 22131 22132 The purpose of this License is to make a manual, textbook, or 22133 other written document "free" in the sense of freedom: to 22134 assure everyone the effective freedom to copy and redistribute 22135 it, with or without modifying it, either commercially or 22136 noncommercially. Secondarily, this License preserves for the 22137 author and publisher a way to get credit for their work, while 22138 not being considered responsible for modifications made by 22139 others. 22140 22141 This License is a kind of "copyleft", which means that 22142 derivative works of the document must themselves be free in 22143 the same sense. It complements the GNU General Public License, 22144 which is a copyleft license designed for free software. 22145 22146 We have designed this License in order to use it for manuals 22147 for free software, because free software needs free 22148 documentation: a free program should come with manuals 22149 providing the same freedoms that the software does. But this 22150 License is not limited to software manuals; it can be used for 22151 any textual work, regardless of subject matter or whether it 22152 is published as a printed book. We recommend this License 22153 principally for works whose purpose is instruction or 22154 reference. 22155 _________________________________________________________ 22156 22157 A.2. APPLICABILITY AND DEFINITIONS 22158 22159 This License applies to any manual or other work that contains 22160 a notice placed by the copyright holder saying it can be 22161 distributed under the terms of this License. The "Document", 22162 below, refers to any such manual or work. Any member of the 22163 public is a licensee, and is addressed as "you". 22164 22165 A "Modified Version" of the Document means any work containing 22166 the Document or a portion of it, either copied verbatim, or 22167 with modifications and/or translated into another language. 22168 22169 A "Secondary Section" is a named appendix or a front-matter 22170 section of the Document that deals exclusively with the 22171 relationship of the publishers or authors of the Document to 22172 the Document's overall subject (or to related matters) and 22173 contains nothing that could fall directly within that overall 22174 subject. (For example, if the Document is in part a textbook 22175 of mathematics, a Secondary Section may not explain any 22176 mathematics.) The relationship could be a matter of historical 22177 connection with the subject or with related matters, or of 22178 legal, commercial, philosophical, ethical or political 22179 position regarding them. 22180 22181 The "Invariant Sections" are certain Secondary Sections whose 22182 titles are designated, as being those of Invariant Sections, 22183 in the notice that says that the Document is released under 22184 this License. 22185 22186 The "Cover Texts" are certain short passages of text that are 22187 listed, as Front-Cover Texts or Back-Cover Texts, in the 22188 notice that says that the Document is released under this 22189 License. 22190 22191 A "Transparent" copy of the Document means a machine-readable 22192 copy, represented in a format whose specification is available 22193 to the general public, whose contents can be viewed and edited 22194 directly and straightforwardly with generic text editors or 22195 (for images composed of pixels) generic paint programs or (for 22196 drawings) some widely available drawing editor, and that is 22197 suitable for input to text formatters or for automatic 22198 translation to a variety of formats suitable for input to text 22199 formatters. A copy made in an otherwise Transparent file 22200 format whose markup has been designed to thwart or discourage 22201 subsequent modification by readers is not Transparent. A copy 22202 that is not "Transparent" is called "Opaque". 22203 22204 Examples of suitable formats for Transparent copies include 22205 plain ASCII without markup, Texinfo input format, LaTeX input 22206 format, SGML or XML using a publicly available DTD, and 22207 standard-conforming simple HTML designed for human 22208 modification. Opaque formats include PostScript, PDF, 22209 proprietary formats that can be read and edited only by 22210 proprietary word processors, SGML or XML for which the DTD 22211 and/or processing tools are not generally available, and the 22212 machine-generated HTML produced by some word processors for 22213 output purposes only. 22214 22215 The "Title Page" means, for a printed book, the title page 22216 itself, plus such following pages as are needed to hold, 22217 legibly, the material this License requires to appear in the 22218 title page. For works in formats which do not have any title 22219 page as such, "Title Page" means the text near the most 22220 prominent appearance of the work's title, preceding the 22221 beginning of the body of the text. 22222 _________________________________________________________ 22223 22224 A.3. VERBATIM COPYING 22225 22226 You may copy and distribute the Document in any medium, either 22227 commercially or noncommercially, provided that this License, 22228 the copyright notices, and the license notice saying this 22229 License applies to the Document are reproduced in all copies, 22230 and that you add no other conditions whatsoever to those of 22231 this License. You may not use technical measures to obstruct 22232 or control the reading or further copying of the copies you 22233 make or distribute. However, you may accept compensation in 22234 exchange for copies. If you distribute a large enough number 22235 of copies you must also follow the conditions in section 3. 22236 22237 You may also lend copies, under the same conditions stated 22238 above, and you may publicly display copies. 22239 _________________________________________________________ 22240 22241 A.4. COPYING IN QUANTITY 22242 22243 If you publish printed copies of the Document numbering more 22244 than 100, and the Document's license notice requires Cover 22245 Texts, you must enclose the copies in covers that carry, 22246 clearly and legibly, all these Cover Texts: Front-Cover Texts 22247 on the front cover, and Back-Cover Texts on the back cover. 22248 Both covers must also clearly and legibly identify you as the 22249 publisher of these copies. The front cover must present the 22250 full title with all words of the title equally prominent and 22251 visible. You may add other material on the covers in addition. 22252 Copying with changes limited to the covers, as long as they 22253 preserve the title of the Document and satisfy these 22254 conditions, can be treated as verbatim copying in other 22255 respects. 22256 22257 If the required texts for either cover are too voluminous to 22258 fit legibly, you should put the first ones listed (as many as 22259 fit reasonably) on the actual cover, and continue the rest 22260 onto adjacent pages. 22261 22262 If you publish or distribute Opaque copies of the Document 22263 numbering more than 100, you must either include a 22264 machine-readable Transparent copy along with each Opaque copy, 22265 or state in or with each Opaque copy a publicly-accessible 22266 computer-network location containing a complete Transparent 22267 copy of the Document, free of added material, which the 22268 general network-using public has access to download 22269 anonymously at no charge using public-standard network 22270 protocols. If you use the latter option, you must take 22271 reasonably prudent steps, when you begin distribution of 22272 Opaque copies in quantity, to ensure that this Transparent 22273 copy will remain thus accessible at the stated location until 22274 at least one year after the last time you distribute an Opaque 22275 copy (directly or through your agents or retailers) of that 22276 edition to the public. 22277 22278 It is requested, but not required, that you contact the 22279 authors of the Document well before redistributing any large 22280 number of copies, to give them a chance to provide you with an 22281 updated version of the Document. 22282 _________________________________________________________ 22283 22284 A.5. MODIFICATIONS 22285 22286 You may copy and distribute a Modified Version of the Document 22287 under the conditions of sections 2 and 3 above, provided that 22288 you release the Modified Version under precisely this License, 22289 with the Modified Version filling the role of the Document, 22290 thus licensing distribution and modification of the Modified 22291 Version to whoever possesses a copy of it. In addition, you 22292 must do these things in the Modified Version: 22293 22294 A. Use in the Title Page (and on the covers, if any) a title 22295 distinct from that of the Document, and from those of 22296 previous versions (which should, if there were any, be 22297 listed in the History section of the Document). You may 22298 use the same title as a previous version if the original 22299 publisher of that version gives permission. 22300 B. List on the Title Page, as authors, one or more persons or 22301 entities responsible for authorship of the modifications 22302 in the Modified Version, together with at least five of 22303 the principal authors of the Document (all of its 22304 principal authors, if it has less than five). 22305 C. State on the Title page the name of the publisher of the 22306 Modified Version, as the publisher. 22307 D. Preserve all the copyright notices of the Document. 22308 E. Add an appropriate copyright notice for your modifications 22309 adjacent to the other copyright notices. 22310 F. Include, immediately after the copyright notices, a 22311 license notice giving the public permission to use the 22312 Modified Version under the terms of this License, in the 22313 form shown in the Addendum below. 22314 G. Preserve in that license notice the full lists of 22315 Invariant Sections and required Cover Texts given in the 22316 Document's license notice. 22317 H. Include an unaltered copy of this License. 22318 I. Preserve the section entitled "History", and its title, 22319 and add to it an item stating at least the title, year, 22320 new authors, and publisher of the Modified Version as 22321 given on the Title Page. If there is no section entitled 22322 "History" in the Document, create one stating the title, 22323 year, authors, and publisher of the Document as given on 22324 its Title Page, then add an item describing the Modified 22325 Version as stated in the previous sentence. 22326 J. Preserve the network location, if any, given in the 22327 Document for public access to a Transparent copy of the 22328 Document, and likewise the network locations given in the 22329 Document for previous versions it was based on. These may 22330 be placed in the "History" section. You may omit a network 22331 location for a work that was published at least four years 22332 before the Document itself, or if the original publisher 22333 of the version it refers to gives permission. 22334 K. In any section entitled "Acknowledgements" or 22335 "Dedications", preserve the section's title, and preserve 22336 in the section all the substance and tone of each of the 22337 contributor acknowledgements and/or dedications given 22338 therein. 22339 L. Preserve all the Invariant Sections of the Document, 22340 unaltered in their text and in their titles. Section 22341 numbers or the equivalent are not considered part of the 22342 section titles. 22343 M. Delete any section entitled "Endorsements". Such a section 22344 may not be included in the Modified Version. 22345 N. Do not retitle any existing section as "Endorsements" or 22346 to conflict in title with any Invariant Section. 22347 22348 If the Modified Version includes new front-matter sections or 22349 appendices that qualify as Secondary Sections and contain no 22350 material copied from the Document, you may at your option 22351 designate some or all of these sections as invariant. To do 22352 this, add their titles to the list of Invariant Sections in 22353 the Modified Version's license notice. These titles must be 22354 distinct from any other section titles. 22355 22356 You may add a section entitled "Endorsements", provided it 22357 contains nothing but endorsements of your Modified Version by 22358 various parties--for example, statements of peer review or 22359 that the text has been approved by an organization as the 22360 authoritative definition of a standard. 22361 22362 You may add a passage of up to five words as a Front-Cover 22363 Text, and a passage of up to 25 words as a Back-Cover Text, to 22364 the end of the list of Cover Texts in the Modified Version. 22365 Only one passage of Front-Cover Text and one of Back-Cover 22366 Text may be added by (or through arrangements made by) any one 22367 entity. If the Document already includes a cover text for the 22368 same cover, previously added by you or by arrangement made by 22369 the same entity you are acting on behalf of, you may not add 22370 another; but you may replace the old one, on explicit 22371 permission from the previous publisher that added the old one. 22372 22373 The author(s) and publisher(s) of the Document do not by this 22374 License give permission to use their names for publicity for 22375 or to assert or imply endorsement of any Modified Version. 22376 _________________________________________________________ 22377 22378 A.6. COMBINING DOCUMENTS 22379 22380 You may combine the Document with other documents released 22381 under this License, under the terms defined in section 4 above 22382 for modified versions, provided that you include in the 22383 combination all of the Invariant Sections of all of the 22384 original documents, unmodified, and list them all as Invariant 22385 Sections of your combined work in its license notice. 22386 22387 The combined work need only contain one copy of this License, 22388 and multiple identical Invariant Sections may be replaced with 22389 a single copy. If there are multiple Invariant Sections with 22390 the same name but different contents, make the title of each 22391 such section unique by adding at the end of it, in 22392 parentheses, the name of the original author or publisher of 22393 that section if known, or else a unique number. Make the same 22394 adjustment to the section titles in the list of Invariant 22395 Sections in the license notice of the combined work. 22396 22397 In the combination, you must combine any sections entitled 22398 "History" in the various original documents, forming one 22399 section entitled "History"; likewise combine any sections 22400 entitled "Acknowledgements", and any sections entitled 22401 "Dedications". You must delete all sections entitled 22402 "Endorsements." 22403 _________________________________________________________ 22404 22405 A.7. COLLECTIONS OF DOCUMENTS 22406 22407 You may make a collection consisting of the Document and other 22408 documents released under this License, and replace the 22409 individual copies of this License in the various documents 22410 with a single copy that is included in the collection, 22411 provided that you follow the rules of this License for 22412 verbatim copying of each of the documents in all other 22413 respects. 22414 22415 You may extract a single document from such a collection, and 22416 distribute it individually under this License, provided you 22417 insert a copy of this License into the extracted document, and 22418 follow this License in all other respects regarding verbatim 22419 copying of that document. 22420 _________________________________________________________ 22421 22422 A.8. AGGREGATION WITH INDEPENDENT WORKS 22423 22424 A compilation of the Document or its derivatives with other 22425 separate and independent documents or works, in or on a volume 22426 of a storage or distribution medium, does not as a whole count 22427 as a Modified Version of the Document, provided no compilation 22428 copyright is claimed for the compilation. Such a compilation 22429 is called an "aggregate", and this License does not apply to 22430 the other self-contained works thus compiled with the 22431 Document, on account of their being thus compiled, if they are 22432 not themselves derivative works of the Document. 22433 22434 If the Cover Text requirement of section 3 is applicable to 22435 these copies of the Document, then if the Document is less 22436 than one quarter of the entire aggregate, the Document's Cover 22437 Texts may be placed on covers that surround only the Document 22438 within the aggregate. Otherwise they must appear on covers 22439 around the whole aggregate. 22440 _________________________________________________________ 22441 22442 A.9. TRANSLATION 22443 22444 Translation is considered a kind of modification, so you may 22445 distribute translations of the Document under the terms of 22446 section 4. Replacing Invariant Sections with translations 22447 requires special permission from their copyright holders, but 22448 you may include translations of some or all Invariant Sections 22449 in addition to the original versions of these Invariant 22450 Sections. You may include a translation of this License 22451 provided that you also include the original English version of 22452 this License. In case of a disagreement between the 22453 translation and the original English version of this License, 22454 the original English version will prevail. 22455 _________________________________________________________ 22456 22457 A.10. TERMINATION 22458 22459 You may not copy, modify, sublicense, or distribute the 22460 Document except as expressly provided for under this License. 22461 Any other attempt to copy, modify, sublicense or distribute 22462 the Document is void, and will automatically terminate your 22463 rights under this License. However, parties who have received 22464 copies, or rights, from you under this License will not have 22465 their licenses terminated so long as such parties remain in 22466 full compliance. 22467 _________________________________________________________ 22468 22469 A.11. FUTURE REVISIONS OF THIS LICENSE 22470 22471 The Free Software Foundation may publish new, revised versions 22472 of the GNU Free Documentation License from time to time. Such 22473 new versions will be similar in spirit to the present version, 22474 but may differ in detail to address new problems or concerns. 22475 See http://www.gnu.org/copyleft/. 22476 22477 Each version of the License is given a distinguishing version 22478 number. If the Document specifies that a particular numbered 22479 version of this License "or any later version" applies to it, 22480 you have the option of following the terms and conditions 22481 either of that specified version or of any later version that 22482 has been published (not as a draft) by the Free Software 22483 Foundation. If the Document does not specify a version number 22484 of this License, you may choose any version ever published 22485 (not as a draft) by the Free Software Foundation. 22486 _________________________________________________________ 22487 22488 A.12. How to use this License for your documents 22489 22490 To use this License in a document you have written, include a 22491 copy of the License in the document and put the following 22492 copyright and license notices just after the title page: 22493 22494 Copyright (c) YEAR YOUR NAME. Permission is granted to 22495 copy, distribute and/or modify this document under the 22496 terms of the GNU Free Documentation License, Version 1.1 or 22497 any later version published by the Free Software 22498 Foundation; with the Invariant Sections being LIST THEIR 22499 TITLES, with the Front-Cover Texts being LIST, and with the 22500 Back-Cover Texts being LIST. A copy of the license is 22501 included in the section entitled "GNU Free Documentation 22502 License". 22503 22504 If you have no Invariant Sections, write "with no Invariant 22505 Sections" instead of saying which ones are invariant. If you 22506 have no Front-Cover Texts, write "no Front-Cover Texts" 22507 instead of "Front-Cover Texts being LIST"; likewise for 22508 Back-Cover Texts. 22509 22510 If your document contains nontrivial examples of program code, 22511 we recommend releasing these examples in parallel under your 22512 choice of free software license, such as the GNU General 22513 Public License, to permit their use in free software. 22514 22515 Notes 22516 22517 [1] 22518 22519 Future versions of this specification might define additional 22520 service names. 22521 [2] 22522 22523 Supplying an RPM format package is encouraged because it makes 22524 systems easier to manage. A future version of the LSB may 22525 require RPM, or specify a way for an installer to update a 22526 package database. 22527 22528 Applications are also encouraged to uninstall cleanly. 22529 [3] 22530 22531 The distribution itself may use a different packaging format 22532 for its own packages, and of course it may use any available 22533 mechanism for installing the LSB-conformant packages. 22534 [4] 22535 22536 For example, there are discrepancies among distributions 22537 concerning whether the name might be 22538 frobnicator-1.7-21-ppc32.rpm or 22539 frobnicator-1.7-21-powerpc32.rpm. The architecture aside, 22540 recommended practice is for the filename of the package file 22541 to match the name within the package. 22542 [5] 22543 22544 For example, if the name with the release and version is 22545 frobnicator-1.7-21, the name part is frobnicator and falls 22546 under the rules for a name with no hyphens. 22547 [6] 22548 22549 For example, "frobnicator". 22550 [7] 22551 22552 For example, ssh-common, ssh-client, kernel-pcmcia, and the 22553 like. Possible alternative names include sshcommon, 22554 foolinux-ssh-common (where foolinux is registered to the 22555 distribution), or lsb-foolinux-ssh-common. 22556 [8] 22557 22558 For example, if an application vendor has domain name 22559 visicalc.example.com and has registered visicalc as a provider 22560 name, they might name packages visicalc-base, 22561 visicalc.example.com-charting, and the like.