   This file documents the GNU C library.

   This is Edition 0.06 DRAFT, last updated 24 October 1994, of `The
GNU C Library Reference Manual', for Version 1.09 Beta.

   Copyright (C) 1993, 1994 Free Software Foundation, Inc.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the section entitled "GNU Library General Public License" is
included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the text of the translations of the section
entitled "GNU Library General Public License" must be approved for
accuracy by the Foundation.

Main Menu
*********

   This is Edition 0.06 DRAFT, last updated 24 October 1994, of `The
GNU C Library Reference Manual', for Version 1.09 Beta of the GNU C
Library.

Appendices

Indices

Relocating Allocator

Introduction
************

   The C language provides no built-in facilities for performing such
common operations as input/output, memory management, string
manipulation, and the like.  Instead, these facilities are defined in a
standard "library", which you compile and link with your programs.

   The GNU C library, described in this document, defines all of the
library functions that are specified by the ANSI C standard, as well as
additional features specific to POSIX and other derivatives of the Unix
operating system, and extensions specific to the GNU system.

   The purpose of this manual is to tell you how to use the facilities
of the GNU library.  We have mentioned which features belong to which
standards to help you identify things that are potentially nonportable
to other systems.  But the emphasis in this manual is not on strict
portability.

Getting Started
===============

   This manual is written with the assumption that you are at least
somewhat familiar with the C programming language and basic programming
concepts.  Specifically, familiarity with ANSI standard C (see ANSI C.),
rather than "traditional" pre-ANSI C dialects, is assumed.

   The GNU C library includes several "header files", each of which
provides definitions and declarations for a group of related facilities;
this information is used by the C compiler when processing your program.
For example, the header file `stdio.h' declares facilities for
performing input and output, and the header file `string.h' declares
string processing utilities.  The organization of this manual generally
follows the same division as the header files.

   If you are reading this manual for the first time, you should read
all of the introductory material and skim the remaining chapters.
There are a *lot* of functions in the GNU C library and it's not
realistic to expect that you will be able to remember exactly *how* to
use each and every one of them.  It's more important to become
generally familiar with the kinds of facilities that the library
provides, so that when you are writing your programs you can recognize
*when* to make use of library functions, and *where* in this manual you
can find more specific information about them.

Standards and Portability
=========================

   This section discusses the various standards and other sources that
the GNU C library is based upon.  These sources include the ANSI C and
POSIX standards, and the System V and Berkeley Unix implementations.

   The primary focus of this manual is to tell you how to make effective
use of the GNU library facilities.  But if you are concerned about
making your programs compatible with these standards, or portable to
operating systems other than GNU, this can affect how you use the
library.  This section gives you an overview of these standards, so that
you will know what they are when they are mentioned in other parts of
the manual.

   See Library Summary, for an alphabetical list of the functions
and other symbols provided by the library.  This list also states which
standards each function or symbol comes from.

ANSI C
------

   The GNU C library is compatible with the C standard adopted by the
American National Standards Institute (ANSI): `American National
Standard X3.159-1989--"ANSI C"'.  The header files and library
facilities that make up the GNU library are a superset of those
specified by the ANSI C standard.

   If you are concerned about strict adherence to the ANSI C standard,
you should use the `-ansi' option when you compile your programs with
the GNU C compiler.  This tells the compiler to define *only* ANSI
standard features from the library header files, unless you explicitly
ask for additional features.  See Feature Test Macros, for
information on how to do this.

   Being able to restrict the library to include only ANSI C features is
important because ANSI C puts limitations on what names can be defined
by the library implementation, and the GNU extensions don't fit these
limitations.  See Reserved Names, for more information about these
restrictions.

   This manual does not attempt to give you complete details on the
differences between ANSI C and older dialects.  It gives advice on how
to write programs to work portably under multiple C dialects, but does
not aim for completeness.

POSIX (The Portable Operating System Interface)
-----------------------------------------------

   The GNU library is also compatible with the IEEE "POSIX" family of
standards, known more formally as the "Portable Operating System
Interface for Computer Environments".  POSIX is derived mostly from
various versions of the Unix operating system.

   The library facilities specified by the POSIX standards are a
superset of those required by ANSI C; POSIX specifies additional
features for ANSI C functions, as well as specifying new additional
functions.  In general, the additional requirements and functionality
defined by the POSIX standards are aimed at providing lower-level
support for a particular kind of operating system environment, rather
than general programming language support which can run in many diverse
operating system environments.

   The GNU C library implements all of the functions specified in `IEEE
Std 1003.1-1990, the POSIX System Application Program Interface',
commonly referred to as POSIX.1.  The primary extensions to the ANSI C
facilities specified by this standard include file system interface
primitives (see File System Interface.), device-specific terminal
control functions (see Low-Level Terminal Interface.), and process
control functions (see Processes.).

   Some facilities from `IEEE Std 1003.2-1992, the POSIX Shell and
Utilities standard' (POSIX.2) are also implemented in the GNU library.
These include utilities for dealing with regular expressions and other
pattern matching facilities (see Pattern Matching.).

Berkeley Unix
-------------

   The GNU C library defines facilities from some versions of Unix which
are not formally standardized, specifically from the 4.2 BSD, 4.3 BSD,
and 4.4 BSD Unix systems (also known as "Berkeley Unix") and from
"SunOS" (a popular 4.2 BSD derivative that includes some Unix System V
functionality).  These systems support most of the ANSI and POSIX
facilities, and 4.4 BSD and newer releases of SunOS in fact support
them all.

   The BSD facilities include symbolic links (see Symbolic Links.),
the `select' function (see Waiting for I/O.), the BSD signal
functions (see BSD Signal Handling.), and sockets (see
Sockets.).

SVID (The System V Interface Description)
-----------------------------------------

   The "System V Interface Description" (SVID) is a document describing
the AT&T Unix System V operating system.  It is to some extent a
superset of the POSIX standard (see POSIX.).

   The GNU C library defines some of the facilities required by the SVID
that are not also required by the ANSI or POSIX standards, for
compatibility with  System V Unix and other Unix systems (such as
SunOS) which include these facilities.  However, many of the more
obscure and less generally useful facilities required by the SVID are
not included.  (In fact, Unix System V itself does not provide them
all.)

Using the Library
=================

   This section describes some of the practical issues involved in using
the GNU C library.