Change all _ISxxx to _ISwxxx.
[glibc.git] / manual / libc.texinfo
blob02fb7487fd8c0f9d10ffa204ff2d238033bb39bd
1 \input texinfo                  @c -*- Texinfo -*-
2 @comment %**start of header (This is for running Texinfo on a region.)
3 @setfilename libc.info
4 @settitle The GNU C Library
5 @setchapternewpage odd
7 @comment Tell install-info what to do.
8 @dircategory GNU libraries
9 @direntry
10 * Libc: (libc).                 C library.
11 @end direntry
13 @c This tells texinfo.tex to use the real section titles in xrefs in
14 @c place of the node name, when no section title is explicitly given.
15 @set xref-automatic-section-title
16 @smallbook
17 @comment %**end of header (This is for running Texinfo on a region.)
19 @c sold 0.06/1.09, print run out 21may96
20 @set EDITION 0.07 DRAFT
21 @set VERSION 2.00 Beta
22 @set UPDATED 4 Oct 1996
23 @set ISBN 1-882114-53-1
25 @ifinfo
26 This file documents the GNU C library.
28 This is Edition @value{EDITION}, last updated @value{UPDATED},
29 of @cite{The GNU C Library Reference Manual}, for Version @value{VERSION}.
31 Copyright (C) 1993, '94, '95, '96, '97 Free Software Foundation, Inc.
33 Permission is granted to make and distribute verbatim copies of
34 this manual provided the copyright notice and this permission notice
35 are preserved on all copies.
37 @ignore
38 Permission is granted to process this file through TeX and print the
39 results, provided the printed document carries copying permission
40 notice identical to this one except for the removal of this paragraph
41 (this paragraph not being relevant to the printed manual).
43 @end ignore
44 Permission is granted to copy and distribute modified versions of this
45 manual under the conditions for verbatim copying, provided also that the
46 section entitled ``GNU Library General Public License'' is included
47 exactly as in the original, and provided that the entire resulting
48 derived work is distributed under the terms of a permission notice
49 identical to this one.
51 Permission is granted to copy and distribute translations of this manual
52 into another language, under the above conditions for modified versions,
53 except that the text of the translation of the section entitled ``GNU
54 Library General Public License'' must be approved for accuracy by the
55 Foundation.
56 @end ifinfo
58 @iftex
59 @shorttitlepage The GNU C Library Reference Manual
60 @end iftex
61 @titlepage
62 @center @titlefont{The GNU C Library}
63 @sp 1
64 @center @titlefont{Reference Manual}
65 @sp 2
66 @center Sandra Loosemore
67 @center with
68 @center Richard M. Stallman, Roland McGrath, Andrew Oram, and Ulrich Drepper
69 @sp 3
70 @center Edition @value{EDITION}
71 @sp 1
72 @center last updated @value{UPDATED}
73 @sp 1
74 @center for version @value{VERSION}
75 @page
76 @vskip 0pt plus 1filll
77 Copyright @copyright{} 1993, '94, '95, '96, '97 Free Software Foundation, Inc.
78 @sp 2
79 Published by the Free Software Foundation @*
80 59 Temple Place -- Suite 330, @*
81 Boston, MA 02111-1307 USA @*
82 Printed copies are available for $50 each. @*
83 ISBN @value{ISBN} @*
85 Permission is granted to make and distribute verbatim copies of
86 this manual provided the copyright notice and this permission notice
87 are preserved on all copies.
89 Permission is granted to copy and distribute modified versions of this
90 manual under the conditions for verbatim copying, provided also that the
91 section entitled ``GNU Library General Public License'' is included
92 exactly as in the original, and provided that the entire resulting
93 derived work is distributed under the terms of a permission notice
94 identical to this one.
96 Permission is granted to copy and distribute translations of this manual
97 into another language, under the above conditions for modified versions,
98 except that the text of the translation of the section entitled ``GNU
99 Library General Public License'' must be approved for accuracy by the
100 Foundation.
101 @end titlepage
102 @page
104 @ifinfo
105 @node Top, Introduction, (dir), (dir)
106 @top Main Menu
107 This is Edition @value{EDITION}, last updated @value{UPDATED}, of
108 @cite{The GNU C Library Reference Manual}, for Version @value{VERSION}
109 of the GNU C Library.
110 @end ifinfo
113 @menu
114 * Introduction::                Purpose of the GNU C Library.
115 * Error Reporting::             How the GNU Library functions report
116                                  error conditions.
117 * Memory Allocation::           Your program can allocate memory dynamically
118                                  and manipulate it via pointers.
119 * Character Handling::          Character testing and conversion functions.
120 * String and Array Utilities::  Utilities for copying and comparing
121                                  strings and arrays.
122 * Extended Characters::         Support for extended character sets.
123 * Locales::                     The country and language can affect
124                                  the behavior of library functions.
125 * Searching and Sorting::       General searching and sorting functions.
126 * Pattern Matching::            Matching wildcards and regular expressions,
127                                  and shell-style ``word expansion''.
128 * I/O Overview::                Introduction to the I/O facilities.
129 * Streams: I/O on Streams.      High-level, portable I/O facilities.
130 * Low-Level I/O::               Low-level, less portable I/O.
131 * File System Interface::       Functions for manipulating files.
132 * Pipes and FIFOs::             A simple interprocess communication mechanism.
133 * Sockets::                     A more complicated interprocess communication
134                                  mechanism, with support for networking.
135 * Low-Level Terminal Interface::How to change the characteristics
136                                  of a terminal device.
137 * Mathematics::                 Math functions (transcendental functions,
138                                  random numbers, absolute value, etc.).
139 * Arithmetic::                  Low-level arithmetic functions.
140 * Date and Time::               Functions for getting the date and time,
141                                  and for conversion between formats.
142 * Non-Local Exits::             The @code{setjmp} and @code{longjmp} facilities.
143 * Signal Handling::             All about signals; how to send them,
144                                  block them, and handle them.
145 * Process Startup::             Writing the beginning and end of your program.
146 * Processes::                   How to create processes and run other programs.
147 * Job Control::                 All about process groups and sessions.
148 * Name Service Switch::         Accessing the various system databases.
149 * Users and Groups::            How users are identified and classified.
150 * System Information::          Getting information about the
151                                  hardware and software configuration
152                                  of the machine a program runs on.
153 * System Configuration::        Parameters describing operating system limits.
155 Appendices
157 * Language Features::           C language features provided by the library.
159 * Library Summary::             A summary showing the syntax, header file,
160                                  and derivation of each library feature.
161 * Maintenance::                 How to install and maintain the GNU C Library.
162 * Copying::                     The GNU Library General Public License says
163                                  how you can copy and share the GNU C Library.
165 Indices
167 * Concept Index::               Index of concepts and names.
168 * Type Index::                  Index of types and type qualifiers.
169 * Function Index::              Index of functions and function-like macros.
170 * Variable Index::              Index of variables and variable-like macros.
171 * File Index::                  Index of programs and files.
173  --- The Detailed Node Listing ---
175 Introduction
177 * Getting Started::             Getting Started
178 * Standards and Portability::   Standards and Portability
179 * Using the Library::           Using the Library
180 * Roadmap to the Manual::       Roadmap to the Manual
182 Standards and Portability
184 * ISO C::                       The American National Standard for the
185                                  C programming language.
186 * POSIX::                       The ISO/IEC 9945 (aka IEEE 1003) standards
187                                  for operating systems.
188 * Berkeley Unix::               BSD and SunOS.
189 * SVID::                        The System V Interface Description.
191 Using the Library
193 * Header Files::                How to use the header files in your programs.
194 * Macro Definitions::           Some functions in the library may really
195                                  be implemented as macros.
196 * Reserved Names::              The C standard reserves some names for
197                                  the library, and some for users.
198 * Feature Test Macros::         How to control what names are defined.
200 Error Reporting
202 * Checking for Errors::         How errors are reported by library functions.
203 * Error Codes::                 What all the error codes are.
204 * Error Messages::              Mapping error codes onto error messages.
206 Memory Allocation
208 * Memory Concepts::             An introduction to concepts and terminology.
209 * Dynamic Allocation and C::    How to get different kinds of allocation in C.
210 * Unconstrained Allocation::    The @code{malloc} facility allows fully general
211                                  dynamic allocation.
212 * Obstacks::                    Obstacks are less general than malloc
213                                  but more efficient and convenient.
214 * Variable Size Automatic::     Allocation of variable-sized blocks
215                                  of automatic storage that are freed when the
216                                  calling function returns.
217 * Relocating Allocator::        Waste less memory, if you can tolerate
218                                  automatic relocation of the blocks you get.
220 Unconstrained Allocation
222 * Basic Allocation::            Simple use of @code{malloc}.
223 * Malloc Examples::             Examples of @code{malloc}.  @code{xmalloc}.
224 * Freeing after Malloc::        Use @code{free} to free a block you
225                                  got with @code{malloc}.
226 * Changing Block Size::         Use @code{realloc} to make a block
227                                  bigger or smaller.
228 * Allocating Cleared Space::    Use @code{calloc} to allocate a
229                                  block and clear it.
230 * Efficiency and Malloc::       Efficiency considerations in use of
231                                  these functions.
232 * Aligned Memory Blocks::       Allocating specially aligned memory:
233                                  @code{memalign} and @code{valloc}.
234 * Heap Consistency Checking::   Automatic checking for errors.
235 * Hooks for Malloc::            You can use these hooks for debugging
236                                  programs that use @code{malloc}.
237 * Statistics of Malloc::        Getting information about how much
238                                  memory your program is using.
239 * Summary of Malloc::           Summary of @code{malloc} and related functions.
241 Obstacks
243 * Creating Obstacks::           How to declare an obstack in your program.
244 * Preparing for Obstacks::      Preparations needed before you can
245                                  use obstacks.
246 * Allocation in an Obstack::    Allocating objects in an obstack.
247 * Freeing Obstack Objects::     Freeing objects in an obstack.
248 * Obstack Functions::           The obstack functions are both
249                                  functions and macros.
250 * Growing Objects::             Making an object bigger by stages.
251 * Extra Fast Growing::          Extra-high-efficiency (though more
252                                  complicated) growing objects.
253 * Status of an Obstack::        Inquiries about the status of an obstack.
254 * Obstacks Data Alignment::     Controlling alignment of objects in obstacks.
255 * Obstack Chunks::              How obstacks obtain and release chunks.
256                                 Efficiency considerations.
257 * Summary of Obstacks::
259 Automatic Storage with Variable Size
261 * Alloca Example::              Example of using @code{alloca}.
262 * Advantages of Alloca::        Reasons to use @code{alloca}.
263 * Disadvantages of Alloca::     Reasons to avoid @code{alloca}.
264 * GNU C Variable-Size Arrays::  Only in GNU C, here is an alternative
265                                  method of allocating dynamically and
266                                  freeing automatically.
267 Relocating Allocator
269 * Relocator Concepts::          How to understand relocating allocation.
270 * Using Relocator::             Functions for relocating allocation.
272 Character Handling
274 * Classification of Characters::Testing whether characters are
275                                  letters, digits, punctuation, etc.
276 * Case Conversion::             Case mapping, and the like.
278 String and Array Utilities
280 * Representation of Strings::   Introduction to basic concepts.
281 * String/Array Conventions::    Whether to use a string function or an
282                                  arbitrary array function.
283 * String Length::               Determining the length of a string.
284 * Copying and Concatenation::   Functions to copy the contents of strings
285                                  and arrays.
286 * String/Array Comparison::     Functions for byte-wise and character-wise
287                                  comparison.
288 * Collation Functions::         Functions for collating strings.
289 * Search Functions::            Searching for a specific element or substring.
290 * Finding Tokens in a String::  Splitting a string into tokens by looking
291                                  for delimiters.
293 Extended Characters
295 * Extended Char Intro::         Multibyte codes versus wide characters.
296 * Locales and Extended Chars::  The locale selects the character codes.
297 * Multibyte Char Intro::        How multibyte codes are represented.
298 * Wide Char Intro::             How wide characters are represented.
299 * Wide String Conversion::      Converting wide strings to multibyte code
300                                    and vice versa.
301 * Length of Char::              how many bytes make up one multibyte char.
302 * Converting One Char::         Converting a string character by character.
303 * Example of Conversion::       Example showing why converting
304                                    one character at a time may be useful.
305 * Shift State::                 Multibyte codes with "shift characters".
307 Locales and Internationalization
309 * Effects of Locale::           Actions affected by the choice of locale.
310 * Choosing Locale::             How the user specifies a locale.
311 * Locale Categories::           Different purposes for which
312                                  you can select a locale.
313 * Setting the Locale::          How a program specifies the locale.
314 * Standard Locales::            Locale names available on all systems.
315 * Numeric Formatting::          How to format numbers for the chosen locale.
317 Searching and Sorting
319 * Comparison Functions::        Defining how to compare two objects.
320                                 Since the sort and search facilities are
321                                 general, you have to specify the ordering.
322 * Array Search Function::       The @code{bsearch} function.
323 * Array Sort Function::         The @code{qsort} function.
324 * Search/Sort Example::         An example program.
326 Pattern Matching
328 * Wildcard Matching::    Matching a wildcard pattern against a single string.
329 * Globbing::             Finding the files that match a wildcard pattern.
330 * Regular Expressions::  Matching regular expressions against strings.
331 * Word Expansion::       Expanding shell variables, nested commands,
332                           arithmetic, and wildcards.
333                           This is what the shell does with shell commands.
335 I/O Overview
337 * I/O Concepts::                Some basic information and terminology.
338 * File Names::                  How to refer to a file.
340 I/O Concepts
342 * Streams and File Descriptors:: The GNU Library provides two ways
343                                   to access the contents of files.
344 * File Position::               The number of bytes from the
345                                  beginning of the file.
347 File Names
349 * Directories::                 Directories contain entries for files.
350 * File Name Resolution::        A file name specifies how to look up a file.
351 * File Name Errors::            Error conditions relating to file names.
352 * File Name Portability::       File name portability and syntax issues.
354 I/O on Streams
356 * Streams::                     About the data type representing a stream.
357 * Standard Streams::            Streams to the standard input and output
358                                  devices are created for you.
359 * Opening Streams::             How to create a stream to talk to a file.
360 * Closing Streams::             Close a stream when you are finished with it.
361 * Simple Output::               Unformatted output by characters and lines.
362 * Character Input::             Unformatted input by characters and words.
363 * Line Input::                  Reading a line or a record from a stream.
364 * Unreading::                   Peeking ahead/pushing back input just read.
365 * Formatted Output::            @code{printf} and related functions.
366 * Customizing Printf::          You can define new conversion specifiers for
367                                  @code{printf} and friends.
368 * Formatted Input::             @code{scanf} and related functions.
369 * Block Input/Output::          Input and output operations on blocks of data.
370 * EOF and Errors::              How you can tell if an I/O error happens.
371 * Binary Streams::              Some systems distinguish between text files
372                                  and binary files.
373 * File Positioning::            About random-access streams.
374 * Portable Positioning::        Random access on peculiar ISO C systems.
375 * Stream Buffering::            How to control buffering of streams.
376 * Temporary Files::             How to open a temporary file.
377 * Other Kinds of Streams::      Other Kinds of Streams
379 Unreading
381 * Unreading Idea::              An explanation of unreading with pictures.
382 * How Unread::                  How to call @code{ungetc} to do unreading.
384 Formatted Output
386 * Formatted Output Basics::     Some examples to get you started.
387 * Output Conversion Syntax::    General syntax of conversion specifications.
388 * Table of Output Conversions:: Summary of output conversions, what they do.
389 * Integer Conversions::         Details of formatting integers.
390 * Floating-Point Conversions::  Details of formatting floating-point numbers.
391 * Other Output Conversions::    Details about formatting of strings,
392                                  characters, pointers, and the like.
393 * Formatted Output Functions::  Descriptions of the actual functions.
394 * Variable Arguments Output::   @code{vprintf} and friends.
395 * Parsing a Template String::   What kinds of arguments does
396                                  a given template call for?
398 Customizing Printf
400 * Registering New Conversions::
401 * Conversion Specifier Options::
402 * Defining the Output Handler::
403 * Printf Extension Example::
405 Formatted Input
407 * Formatted Input Basics::      Some basics to get you started.
408 * Input Conversion Syntax::     Syntax of conversion specifications.
409 * Table of Input Conversions::  Summary of input conversions and what they do.
410 * Numeric Input Conversions::   Details of conversions for reading numbers.
411 * String Input Conversions::    Details of conversions for reading strings.
412 * Other Input Conversions::     Details of miscellaneous other conversions.
413 * Formatted Input Functions::   Descriptions of the actual functions.
414 * Variable Arguments Input::    @code{vscanf} and friends.
416 Stream Buffering
418 * Buffering Concepts::          Terminology is defined here.
419 * Flushing Buffers::            How to ensure that output buffers are flushed.
420 * Controlling Buffering::       How to specify what kind of buffering to use.
422 Other Kinds of Streams
424 * String Streams::
425 * Custom Streams::
427 Programming Your Own Custom Streams
429 * Streams and Cookies::
430 * Hook Functions::
432 Low-Level I/O
434 * Opening and Closing Files::   How to open and close file descriptors.
435 * I/O Primitives::              Reading and writing data.
436 * File Position Primitive::     Setting a descriptor's file position.
437 * Descriptors and Streams::     Converting descriptor to stream or vice-versa.
438 * Stream/Descriptor Precautions::  Precautions needed if you use both
439                                     descriptors and streams.
440 * Waiting for I/O::             How to check for input or output
441                                  on multiple file descriptors.
442 * Control Operations::          Various other operations on file descriptors.
443 * Duplicating Descriptors::     Fcntl commands for duplicating descriptors.
444 * Descriptor Flags::            Fcntl commands for manipulating flags
445                                  associated with file descriptors.
446 * File Status Flags::           Fcntl commands for manipulating flags
447                                  associated with open files.
448 * File Locks::                  Fcntl commands for implementing file locking.
449 * Interrupt Input::             Getting a signal when input arrives.
451 File System Interface
453 * Working Directory::           This is used to resolve relative file names.
454 * Accessing Directories::       Finding out what files a directory contains.
455 * Hard Links::                  Adding alternate names to a file.
456 * Symbolic Links::              A file that ``points to'' a file name.
457 * Deleting Files::              How to delete a file, and what that means.
458 * Renaming Files::              Changing a file's name.
459 * Creating Directories::        A system call just for creating a directory.
460 * File Attributes::             Attributes of individual files.
461 * Making Special Files::        How to create special files.
463 Accessing Directories
465 * Directory Entries::           Format of one directory entry.
466 * Opening a Directory::         How to open a directory stream.
467 * Reading/Closing Directory::   How to read directory entries from the stream.
468 * Simple Directory Lister::     A very simple directory listing program.
469 * Random Access Directory::     Rereading part of the directory
470                                   already read with the same stream.
472 File Attributes
474 * Attribute Meanings::          The names of the file attributes,
475                                  and what their values mean.
476 * Reading Attributes::          How to read the attributes of a file.
477 * Testing File Type::           Distinguishing ordinary files,
478                                  directories, links...
479 * File Owner::                  How ownership for new files is determined,
480                                  and how to change it.
481 * Permission Bits::             How information about a file's access mode
482                                  is stored.
483 * Access Permission::           How the system decides who can access a file.
484 * Setting Permissions::         How permissions for new files are assigned,
485                                  and how to change them.
486 * Testing File Access::         How to find out if your process can
487                                  access a file.
488 * File Times::                  About the time attributes of a file.
490 Pipes and FIFOs
492 * Creating a Pipe::             Making a pipe with the @code{pipe} function.
493 * Pipe to a Subprocess::        Using a pipe to communicate with a child.
494 * FIFO Special Files::          Making a FIFO special file.
496 Sockets
498 * Socket Concepts::             Basic concepts you need to know about.
499 * Communication Styles::        Stream communication, datagrams, and others.
500 * Socket Addresses::            How socket names (``addresses'') work.
501 * File Namespace::              Details about the file namespace.
502 * Internet Namespace::          Details about the Internet namespace.
503 * Open/Close Sockets::          Creating sockets and destroying them.
504 * Connections::                 Operations on sockets with connection state.
505 * Datagrams::                   Operations on datagram sockets.
506 * Socket Options::              Miscellaneous low-level socket options.
507 * Networks Database::           Accessing the database of network names.
509 Socket Addresses
511 * Address Formats::             About @code{struct sockaddr}.
512 * Setting Address::             Binding an address to a socket.
513 * Reading Address::             Reading the address of a socket.
515 Internet Domain
517 * Internet Address Formats::    How socket addresses are specified in the
518                                  Internet namespace.
519 * Host Addresses::              All about host addresses of Internet hosts.
520 * Protocols Database::          Referring to protocols by name.
521 * Services Database::           Ports may have symbolic names.
522 * Byte Order::                  Different hosts may use different byte
523                                  ordering conventions; you need to
524                                  canonicalize host address and port number.
525 * Inet Example::                Putting it all together.
527 Host Addresses
529 * Abstract Host Addresses::             What a host number consists of.
530 * Data type: Host Address Data Type.    Data type for a host number.
531 * Functions: Host Address Functions.    Functions to operate on them.
532 * Names: Host Names.                    Translating host names to host numbers.
534 Open/Close Sockets
536 * Creating a Socket::           How to open a socket.
537 * Closing a Socket::            How to close a socket.
538 * Socket Pairs::                These are created like pipes.
540 Connections
542 * Connecting::                  What the client program must do.
543 * Listening::                   How a server program waits for requests.
544 * Accepting Connections::       What the server does when it gets a request.
545 * Who is Connected::            Getting the address of the
546                                  other side of a connection.
547 * Transferring Data::           How to send and receive data.
548 * Byte Stream Example::         An example client for communicating over a
549                                  byte stream socket in the Internet namespace.
550 * Server Example::              A corresponding server program.
551 * Out-of-Band Data::            This is an advanced feature.
553 Transferring Data
555 * Sending Data::                Sending data with @code{write}.
556 * Receiving Data::              Reading data with @code{read}.
557 * Socket Data Options::         Using @code{send} and @code{recv}.
559 Datagrams
561 * Sending Datagrams::           Sending packets on a datagram socket.
562 * Receiving Datagrams::         Receiving packets on a datagram socket.
563 * Datagram Example::            An example program: packets sent over a
564                                  datagram stream in the file namespace.
565 * Example Receiver::            Another program, that receives those packets.
567 Socket Options
569 * Socket Option Functions::     The basic functions for setting and getting
570                                  socket options.
571 * Socket-Level Options::        Details of the options at the socket level.
573 Low-Level Terminal Interface
575 * Is It a Terminal::            How to determine if a file is a terminal
576                                  device, and what its name is.
577 * I/O Queues::                  About flow control and typeahead.
578 * Canonical or Not::            Two basic styles of input processing.
579 * Terminal Modes::              How to examine and modify flags controlling
580                                  terminal I/O: echoing, signals, editing.
581 * Line Control::                Sending break sequences, clearing  buffers...
582 * Noncanon Example::            How to read single characters without echo.
584 Terminal Modes
586 * Mode Data Types::             The data type @code{struct termios} and related types.
587 * Mode Functions::              Functions to read and set terminal attributes.
588 * Setting Modes::               The right way to set attributes reliably.
589 * Input Modes::                 Flags controlling low-level input handling.
590 * Output Modes::                Flags controlling low-level output handling.
591 * Control Modes::               Flags controlling serial port behavior.
592 * Local Modes::                 Flags controlling high-level input handling.
593 * Line Speed::                  How to read and set the terminal line speed.
594 * Special Characters::          Characters that have special effects,
595                                  and how to change them.
596 * Noncanonical Input::          Controlling how long to wait for input.
598 Special Characters
600 * Editing Characters::
601 * Signal Characters::
602 * Start/Stop Characters::
604 Mathematics
606 * Domain and Range Errors::     How overflow conditions and the
607                                  like are reported.
608 * Not a Number::                Making NANs and testing for NANs.
609 * Trig Functions::              Sine, cosine, and tangent.
610 * Inverse Trig Functions::      Arc sine, arc cosine, and arc tangent.
611 * Exponents and Logarithms::    Also includes square root.
612 * Hyperbolic Functions::        Hyperbolic sine and friends.
613 * Pseudo-Random Numbers::       Functions for generating pseudo-random numbers.
614 * Absolute Value::              Absolute value functions.
616 Pseudo-Random Numbers
618 * ISO Random::                  @code{rand} and friends.
619 * BSD Random::                  @code{random} and friends.
621 Low-Level Arithmetic Functions
623 * Normalization Functions::     Hacks for radix-2 representations.
624 * Rounding and Remainders::     Determining the integer and
625                                  fractional parts of a float.
626 * Integer Division::            Functions for performing integer division.
627 * Parsing of Numbers::          Functions for ``reading'' numbers from strings.
628 * Predicates on Floats::        Some miscellaneous test functions.
630 Parsing of Numbers
632 * Parsing of Integers::         Functions for conversion of integer values.
633 * Parsing of Floats::           Functions for conversion of floating-point.
635 Date and Time
637 * Processor Time::              Measures processor time used by a program.
638 * Calendar Time::               Manipulation of ``real'' dates and times.
639 * Setting an Alarm::            Sending a signal after a specified time.
640 * Sleeping::                    Waiting for a period of time.
642 Processor Time
644 * Basic CPU Time::              The @code{clock} function.
645 * Detailed CPU Time::           The @code{times} function.
647 Calendar Time
649 * Simple Calendar Time::        Facilities for manipulating calendar time.
650 * High-Resolution Calendar::    A time representation with greater precision.
651 * Broken-down Time::            Facilities for manipulating local time.
652 * Formatting Date and Time::    Converting times to strings.
653 * TZ Variable::                 How users specify the time zone.
654 * Time Zone Functions::         Functions to examine or specify the time zone.
655 * Time Functions Example::      An example program showing use of some of
656                                  the time functions.
658 Signal Handling
660 * Concepts of Signals::         Introduction to the signal facilities.
661 * Standard Signals::            Particular kinds of signals with standard
662                                  names and meanings.
663 * Signal Actions::              Specifying what happens when a particular
664                                  signal is delivered.
665 * Defining Handlers::           How to write a signal handler function.
666 * Generating Signals::          How to send a signal to a process.
667 * Blocking Signals::            Making the system hold signals temporarily.
668 * Waiting for a Signal::        Suspending your program until a signal arrives.
669 * Signal Stack::                Using a Separate Signal Stack
670 * BSD Signal Handling::         Additional functions for backward
671                                  compatibility with BSD.
673 Basic Concepts of Signals
675 * Kinds of Signals::            Some examples of what can cause a signal.
676 * Signal Generation::           Concepts of why and how signals occur.
677 * Delivery of Signal::          Concepts of what a signal does to the process.
679 Standard Signals
681 * Program Error Signals::       Used to report serious program errors.
682 * Termination Signals::         Used to interrupt and/or terminate the program.
683 * Alarm Signals::               Used to indicate expiration of timers.
684 * Asynchronous I/O Signals::    Used to indicate input is available.
685 * Job Control Signals::         Signals used to support job control.
686 * Operation Error Signals::     Used to report operational system errors.
687 * Miscellaneous Signals::       Miscellaneous Signals.
688 * Signal Messages::             Printing a message describing a signal.
690 Specifying Signal Actions
692 * Basic Signal Handling::       The simple @code{signal} function.
693 * Advanced Signal Handling::    The more powerful @code{sigaction} function.
694 * Signal and Sigaction::        How those two functions interact.
695 * Sigaction Function Example::  An example of using the sigaction function.
696 * Flags for Sigaction::         Specifying options for signal handling.
697 * Initial Signal Actions::      How programs inherit signal actions.
699 Defining Signal Handlers
701 * Handler Returns::
702 * Termination in Handler::
703 * Longjmp in Handler::
704 * Signals in Handler::
705 * Nonreentrancy::
706 * Atomic Data Access::
708 Generating Signals
710 * Signaling Yourself::          Signaling Yourself
711 * Signaling Another Process::   Send a signal to another process.
712 * Permission for kill::         Permission for using @code{kill}
713 * Kill Example::                Using @code{kill} for Communication
715 Blocking Signals
717 * Why Block::                   The purpose of blocking signals.
718 * Signal Sets::                 How to specify which signals to block.
719 * Process Signal Mask::         Blocking delivery of signals to your
720                                  process during normal execution.
721 * Testing for Delivery::        Blocking to Test for Delivery of a Signal
722 * Blocking for Handler::        Blocking additional signals while a
723                                  handler is being run.
724 * Checking for Pending Signals::Checking for Pending Signals
725 * Remembering a Signal::        How you can get almost the same effect
726                                  as blocking a signal, by handling it
727                                  and setting a flag to be tested later.
729 Waiting for a Signal
731 * Using Pause::                 The simple way, using @code{pause}.
732 * Pause Problems::              Why the simple way is often not very good.
733 * Sigsuspend::                  Reliably waiting for a specific signal.
735 BSD Signal Handling
737 * BSD Handler::                 BSD Function to Establish a Handler.
738 * Blocking in BSD::             BSD Functions for Blocking Signals
740 Process Startup and Termination
742 * Program Arguments::           Parsing your program's command-line arguments.
743 * Environment Variables::       How to access parameters inherited from
744                                  a parent process.
745 * Program Termination::         How to cause a process to terminate and
746                                  return status information to its parent.
748 Program Arguments
750 * Argument Syntax::             By convention, options start with a hyphen.
751 * Parsing Options::             The @code{getopt} function.
752 * Example of Getopt::           An example of parsing options with @code{getopt}.
753 * Long Options::                GNU utilities should accept long-named options.
754                                  Here is how to do that.
755 * Long Option Example::         An example of using @code{getopt_long}.
757 Environment Variables
759 * Environment Access::          How to get and set the values of
760                                  environment variables.
761 * Standard Environment::        These environment variables have
762                                  standard interpretations.
764 Program Termination
766 * Normal Termination::          If a program calls @code{exit}, a
767                                  process terminates normally.
768 * Exit Status::                 The @code{exit status} provides information
769                                  about why the process terminated.
770 * Cleanups on Exit::            A process can run its own cleanup
771                                  functions upon normal termination.
772 * Aborting a Program::          The @code{abort} function causes
773                                  abnormal program termination.
774 * Termination Internals::       What happens when a process terminates.
777 Child Processes
779 * Running a Command::           The easy way to run another program.
780 * Process Creation Concepts::   An overview of the hard way to do it.
781 * Process Identification::      How to get the process ID of a process.
782 * Creating a Process::          How to fork a child process.
783 * Executing a File::            How to make a child execute another program.
784 * Process Completion::          How to tell when a child process has completed.
785 * Process Completion Status::   How to interpret the status value
786                                  returned from a child process.
787 * BSD Wait Functions::          More functions, for backward compatibility.
788 * Process Creation Example::    A complete example program.
790 Job Control
792 * Concepts of Job Control ::    Concepts of Job Control
793 * Job Control is Optional::     Not all POSIX systems support job control.
794 * Controlling Terminal::        How a process gets its controlling terminal.
795 * Access to the Terminal::      How processes share the controlling terminal.
796 * Orphaned Process Groups::     Jobs left after the user logs out.
797 * Implementing a Shell::        What a shell must do to implement job control.
798 * Functions for Job Control::   Functions to control process groups.
800 Implementing a Job Control Shell
802 * Data Structures::             Introduction to the sample shell.
803 * Initializing the Shell::      What the shell must do to take
804                                  responsibility for job control.
805 * Launching Jobs::              Creating jobs to execute commands.
806 * Foreground and Background::   Putting a job in foreground of background.
807 * Stopped and Terminated Jobs:: Reporting job status.
808 * Continuing Stopped Jobs::     How to continue a stopped job in
809                                  the foreground or background.
810 * Missing Pieces::              Other parts of the shell.
812 Functions for Job Control
814 * Identifying the Terminal::    Determining the controlling terminal's name.
815 * Process Group Functions::     Functions for manipulating process groups.
816 * Terminal Access Functions::   Functions for controlling terminal access.
818 Name Service Switch
820 * NSS Basics::                  What is this NSS good for.
821 * NSS Configuration File::      Configuring NSS.
822 * NSS Module Internals::        How does it work internally.
823 * Extending NSS::               What to do to add services or databases.
825 Users and Groups
827 * User and Group IDs::          Each user and group has a unique numeric ID.
828 * Process Persona::             The user IDs and group IDs of a process.
829 * Why Change Persona::          Why a program might need to change
830                                  its user and/or group IDs.
831 * How Change Persona::          Restrictions on changing user and group IDs.
832 * Reading Persona::             Examining the process's user and group IDs.
833 * Setting User ID::
834 * Setting Groups::
835 * Enable/Disable Setuid::
836 * Setuid Program Example::      Setuid Program Example
837 * Tips for Setuid::
838 * Who Logged In::               Getting the name of the user who logged in,
839                                  or of the real user ID of the current process.
841 * User Database::               Functions and data structures for
842                                  accessing the user database.
843 * Group Database::              Functions and data structures for
844                                  accessing the group database.
845 * Database Example::            Example program showing use of database
846                                  inquiry functions.
848 User Database
850 * User Data Structure::
851 * Lookup User::
852 * Scanning All Users::          Scanning the List of All Users
853 * Writing a User Entry::
855 Group Database
857 * Group Data Structure::
858 * Lookup Group::
859 * Scanning All Groups::         Scanning the List of All Groups
861 System Information
863 * Host Identification::         Determining the name of the machine.
864 * Hardware/Software Type ID::   Determining the hardware type and
865                                  operating system type.
867 System Configuration Limits
869 * General Limits::              Constants and functions that describe
870                                  various process-related limits that have
871                                  one uniform value for any given machine.
872 * System Options::              Optional POSIX features.
873 * Version Supported::           Version numbers of POSIX.1 and POSIX.2.
874 * Sysconf::                     Getting specific configuration values
875                                  of general limits and system options.
876 * Minimums::                    Minimum values for general limits.
878 * Limits for Files::            Size limitations on individual files.
879                                  These can vary between file systems
880                                   or even from file to file.
881 * Options for Files::           Optional features that some files may support.
882 * File Minimums::               Minimum values for file limits.
883 * Pathconf::                    Getting the limit values for a particular file.
885 * Utility Limits::              Capacity limits of POSIX.2 utility programs.
886 * Utility Minimums::            Minimum allowable values of those limits.
888 * String Parameters::           Getting the default search path.
890 Library Facilities that are Part of the C Language
892 * Consistency Checking::        Using @code{assert} to abort
893                                  if something ``impossible'' happens.
894 * Variadic Functions::          Defining functions with varying
895                                  numbers of arguments.
896 * Null Pointer Constant::       The macro @code{NULL}.
897 * Important Data Types::        Data types for object sizes.
898 * Data Type Measurements::      Parameters of data type representations.
900 Variadic Functions
902 * Why Variadic::                Reasons for making functions take
903                                  variable arguments.
904 * How Variadic::                How to define and call variadic functions.
905 * Argument Macros::             Detailed specification of the macros
906                                  for accessing variable arguments.
907 * Variadic Example::            A complete example.
909 How Variadic Functions are Defined and Used
911 * Variadic Prototypes::         How to make a prototype for a function
912                                  with variable arguments.
913 * Receiving Arguments::         Steps you must follow to access the
914                                  optional argument values.
915 * How Many Arguments::          How to decide whether there are more arguments.
916 * Calling Variadics::           Things you need to know about calling
917                                  variable arguments functions.
919 Data Type Measurements
921 * Width of Type::               How many bits does an integer type hold?
922 * Range of Type::               What are the largest and smallest values
923                                  that an integer type can hold?
924 * Floating Type Macros::        Parameters that measure floating-point types.
925 * Structure Measurement::       Getting measurements on structure types.
927 Floating Type Macros
929 * Floating Point Concepts::     Definitions of terminology.
930 * Floating Point Parameters::   Dimensions, limits of floating point types.
931 * IEEE Floating Point::         How one common representation is described.
933 Library Maintenance
935 * Installation::                How to configure, compile and install
936                                  the GNU C library.
937 * Reporting Bugs::              How to report bugs (if you want to
938                                  get them fixed) and other troubles
939                                  you may have with the GNU C library.
940 * Porting::                     How to port the GNU C library to
941                                  a new machine or operating system.
942 @c * Traditional C Compatibility::  Using the GNU C library with non-ANSI
943 @c                                          C compilers.
944 * Contributors::                Who wrote what parts of the GNU C Library.
946 Porting the GNU C Library
948 * Hierarchy Conventions::       How the @file{sysdeps} hierarchy is
949                                  layed out.
950 * Porting to Unix::             Porting the library to an average
951                                  Unix-like system.
952 @end menu
955 @comment Includes of all the individual chapters.
956 @include intro.texi
957 @include errno.texi
958 @include memory.texi
959 @include ctype.texi
960 @include string.texi
961 @include io.texi
962 @include stdio.texi
963 @include llio.texi
964 @include filesys.texi
965 @include pipe.texi
966 @include socket.texi
967 @include terminal.texi
968 @include math.texi
969 @include arith.texi
970 @include search.texi
971 @include pattern.texi
972 @include time.texi
973 @include mbyte.texi
974 @include locale.texi
975 @include setjmp.texi
976 @include signal.texi
977 @include startup.texi
978 @include process.texi
979 @include job.texi
980 @include nss.texi
981 @include users.texi
982 @include sysinfo.texi
983 @include conf.texi
985 @comment Includes of the appendices.
986 @include lang.texi
987 @include header.texi
988 @include maint.texi
991 @set lgpl-appendix
992 @node Copying, Concept Index, Maintenance, Top
993 @include lgpl.texinfo
996 @node Concept Index, Type Index, Copying, Top
997 @unnumbered Concept Index
999 @printindex cp
1001 @node Type Index, Function Index, Concept Index, Top
1002 @unnumbered Type Index
1004 @printindex tp
1006 @node Function Index, Variable Index, Type Index, Top
1007 @unnumbered Function and Macro Index
1009 @printindex fn
1011 @node Variable Index, File Index, Function Index, Top
1012 @unnumbered Variable and Constant Macro Index
1014 @printindex vr
1016 @node File Index, , Variable Index, Top
1017 @unnumbered Program and File Index
1019 @printindex pg
1022 @shortcontents
1023 @contents
1024 @bye