1998-07-10 18:14 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* manual/Makefile: Overhauled.  Generate libc.texinfo from the
	chapter files.  Exorcise the chapters, chapters-incl mess.
	Support inserting doc chapters from add-on modules.
	(chapters): New variable.
	(add-chapters): New variable.
	(appendices): New variable.
	(libc.texinfo): New target.
	(clean): Fix bugs.
	(realclean): Fix bugs.

	* manual/texis.awk: New file.
	* manual/libc-texinfo.sh: New file.
	* manual/libc-texinfo.in: New file.

	* manual/conf.texi (top @node): Remove next pointer.
	* manual/lang.texi (top @node): Remove prev pointer.

	* manual/job.texi (top @node): Add explicit pointers.
	* manual/message.texi (top @node): Add explicit pointers.
	* manual/nss.texi (top @node): Add explicit pointers.
	* manual/process.texi (top @node): Add explicit pointers.
	* manual/startup.texi (top @node): Add explicit pointers.
	* manual/terminal.texi (top @node): Add explicit pointers.
	* manual/users.texi (top @node): Add explicit pointers.

	* manual/arith.texi: Add %MENU% tag.
	* manual/conf.texi: Add %MENU% tag.
	* manual/contrib.texi: Add %MENU% tag.
	* manual/ctype.texi: Add %MENU% tag.
	* manual/errno.texi: Add %MENU% tag.
	* manual/filesys.texi: Add %MENU% tag.
	* manual/header.texi: Add %MENU% tag.
	* manual/install.texi: Add %MENU% tag.
	* manual/intro.texi: Add %MENU% tag.
	* manual/io.texi: Add %MENU% tag.
	* manual/job.texi: Add %MENU% tag.
	* manual/lang.texi: Add %MENU% tag.
	* manual/llio.texi: Add %MENU% tag.
	* manual/locale.texi: Add %MENU% tag.
	* manual/maint.texi: Add %MENU% tag.
	* manual/math.texi: Add %MENU% tag.
	* manual/mbyte.texi: Add %MENU% tag.
	* manual/memory.texi: Add %MENU% tag.
	* manual/message.texi: Add %MENU% tag.
	* manual/nss.texi: Add %MENU% tag.
	* manual/pattern.texi: Add %MENU% tag.
	* manual/pipe.texi: Add %MENU% tag.
	* manual/process.texi: Add %MENU% tag.
	* manual/search.texi: Add %MENU% tag.
	* manual/setjmp.texi: Add %MENU% tag.
	* manual/signal.texi: Add %MENU% tag.
	* manual/socket.texi: Add %MENU% tag.
	* manual/startup.texi: Add %MENU% tag.
	* manual/stdio.texi: Add %MENU% tag.
	* manual/string.texi: Add %MENU% tag.
	* manual/sysinfo.texi: Add %MENU% tag.
	* manual/terminal.texi: Add %MENU% tag.
	* manual/time.texi: Add %MENU% tag.
	* manual/users.texi: Add %MENU% tag.

1998-07-13  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/i386/dl-procinfo.h (x86_cap_flags):
	Update.

1998-07-11  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/unix/sysv/linux/recvmsg.c (__libc_recvmsg): Use ANSI
	style declaration to avoid warning.
	* sysdeps/unix/sysv/linux/sendmsg.c (__libc_sendmsg): Likewise.

1998-07-04  Mark Kettenis  <kettenis@phys.uva.nl>

	* elf/rtld.c (process_dl_debug): Add missing continue.

1998-07-12  Mark Kettenis  <kettenis@phys.uva.nl>

	* elf/rtld.c (_dl_skip_args): Make global because the Hurd startup
	code needs it.

1998-07-10  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makeconfig ($(common-objpfx)sysd-dirs): Write out definition of
	sysd-dirs-done.
	* Makerules: Don't generate version maps too early.
	($(common-objpfx)sysd-versions): Force regeneration if the list of
	subdirs has changed.

1998-07-10  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* elf/dlfcn.h (DL_CALL_FCT): Use portable comma expression.

1998-07-11  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* iconv/gconv_db.c (gen_steps): Always set *handle and *nsteps.
	* iconv/gconv_dl.c (__gconv_find_shlib): Correct use of tfind
	return value.

1998-07-12  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* elf/dl-open.c (dl_open_worker): New function.
	(_dl_open): Call it to do the actual work while catching errors.
	* elf/dl-close.c (_dl_close): Only call termination function if
	the initialisation function was called.

1998-07-13  Ulrich Drepper  <drepper@cygnus.com>

	* libio/libioP.h (_IO_cleanup_registration_needed): Use __PMT.
	Reported by Felix von Leitner <leitner@amdiv.de>.

1998-07-13 10:28  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
	* elf/rtld.c (process_dl_debug): Add missing continue.

1998-06-23  Mark Kettenis  <kettenis@phys.uva.nl>
This commit is contained in:
Ulrich Drepper 1998-07-13 12:29:13 +00:00
parent ceb27555a1
commit 7a68c94a5b
54 changed files with 4246 additions and 2631 deletions

118
ChangeLog
View File

@ -1,4 +1,116 @@
Mon Jul 13 10:28:28 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1998-07-10 18:14 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
* manual/Makefile: Overhauled. Generate libc.texinfo from the
chapter files. Exorcise the chapters, chapters-incl mess.
Support inserting doc chapters from add-on modules.
(chapters): New variable.
(add-chapters): New variable.
(appendices): New variable.
(libc.texinfo): New target.
(clean): Fix bugs.
(realclean): Fix bugs.
* manual/texis.awk: New file.
* manual/libc-texinfo.sh: New file.
* manual/libc-texinfo.in: New file.
* manual/conf.texi (top @node): Remove next pointer.
* manual/lang.texi (top @node): Remove prev pointer.
* manual/job.texi (top @node): Add explicit pointers.
* manual/message.texi (top @node): Add explicit pointers.
* manual/nss.texi (top @node): Add explicit pointers.
* manual/process.texi (top @node): Add explicit pointers.
* manual/startup.texi (top @node): Add explicit pointers.
* manual/terminal.texi (top @node): Add explicit pointers.
* manual/users.texi (top @node): Add explicit pointers.
* manual/arith.texi: Add %MENU% tag.
* manual/conf.texi: Add %MENU% tag.
* manual/contrib.texi: Add %MENU% tag.
* manual/ctype.texi: Add %MENU% tag.
* manual/errno.texi: Add %MENU% tag.
* manual/filesys.texi: Add %MENU% tag.
* manual/header.texi: Add %MENU% tag.
* manual/install.texi: Add %MENU% tag.
* manual/intro.texi: Add %MENU% tag.
* manual/io.texi: Add %MENU% tag.
* manual/job.texi: Add %MENU% tag.
* manual/lang.texi: Add %MENU% tag.
* manual/llio.texi: Add %MENU% tag.
* manual/locale.texi: Add %MENU% tag.
* manual/maint.texi: Add %MENU% tag.
* manual/math.texi: Add %MENU% tag.
* manual/mbyte.texi: Add %MENU% tag.
* manual/memory.texi: Add %MENU% tag.
* manual/message.texi: Add %MENU% tag.
* manual/nss.texi: Add %MENU% tag.
* manual/pattern.texi: Add %MENU% tag.
* manual/pipe.texi: Add %MENU% tag.
* manual/process.texi: Add %MENU% tag.
* manual/search.texi: Add %MENU% tag.
* manual/setjmp.texi: Add %MENU% tag.
* manual/signal.texi: Add %MENU% tag.
* manual/socket.texi: Add %MENU% tag.
* manual/startup.texi: Add %MENU% tag.
* manual/stdio.texi: Add %MENU% tag.
* manual/string.texi: Add %MENU% tag.
* manual/sysinfo.texi: Add %MENU% tag.
* manual/terminal.texi: Add %MENU% tag.
* manual/time.texi: Add %MENU% tag.
* manual/users.texi: Add %MENU% tag.
1998-07-13 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/dl-procinfo.h (x86_cap_flags):
Update.
1998-07-11 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/recvmsg.c (__libc_recvmsg): Use ANSI
style declaration to avoid warning.
* sysdeps/unix/sysv/linux/sendmsg.c (__libc_sendmsg): Likewise.
1998-07-04 Mark Kettenis <kettenis@phys.uva.nl>
* elf/rtld.c (process_dl_debug): Add missing continue.
1998-07-12 Mark Kettenis <kettenis@phys.uva.nl>
* elf/rtld.c (_dl_skip_args): Make global because the Hurd startup
code needs it.
1998-07-10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makeconfig ($(common-objpfx)sysd-dirs): Write out definition of
sysd-dirs-done.
* Makerules: Don't generate version maps too early.
($(common-objpfx)sysd-versions): Force regeneration if the list of
subdirs has changed.
1998-07-10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/dlfcn.h (DL_CALL_FCT): Use portable comma expression.
1998-07-11 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* iconv/gconv_db.c (gen_steps): Always set *handle and *nsteps.
* iconv/gconv_dl.c (__gconv_find_shlib): Correct use of tfind
return value.
1998-07-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/dl-open.c (dl_open_worker): New function.
(_dl_open): Call it to do the actual work while catching errors.
* elf/dl-close.c (_dl_close): Only call termination function if
the initialisation function was called.
1998-07-13 Ulrich Drepper <drepper@cygnus.com>
* libio/libioP.h (_IO_cleanup_registration_needed): Use __PMT.
Reported by Felix von Leitner <leitner@amdiv.de>.
1998-07-13 10:28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/dl-envvars.h: New file.
@ -855,6 +967,10 @@ Mon Jul 13 10:28:28 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.
* grp/initgroups.c: Use _CALL_DL_FCT.
1998-06-23 Mark Kettenis <kettenis@phys.uva.nl>
* elf/rtld.c (process_dl_debug): Add missing continue.
1998-06-23 Mark Kettenis <kettenis@phys.uva.nl>
* elf/dl-load.c (_dl_map_object_from_fd): Add missing cast.

View File

@ -777,7 +777,9 @@ all-Subdirs-files = $(wildcard $(addsuffix /Subdirs, $(config-sysdirs)))
$(common-objpfx)sysd-dirs: $(common-objpfx)config.make $(all-Subdirs-files)
(echo define sysdep-subdirs; \
sed 's/#.*$$//' $(all-Subdirs-files) /dev/null; \
echo endef) > $@-tmp
echo endef; \
echo 'sysd-dirs-done = t'; \
) > $@-tmp
mv -f $@-tmp $@
endif # Makeconfig not yet included

View File

@ -276,22 +276,31 @@ ifndef sysd-rules-done
no_deps=t
endif
# Generate version maps.
# Generate version maps, but wait until sysdep-subdirs is known
ifdef sysd-dirs-done
ifeq ($(versioning),yes)
ifndef no_deps
-include $(common-objpfx)sysd-versions
$(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
generated += $(version-maps)
common-generated += $(version-maps) sysd-versions
ifndef avoid-generated
ifneq ($(sysd-versions-subdirs),$(all-subdirs) $(config-sysdirs))
sysd-versions-force = FORCE
FORCE:
endif
$(common-objpfx)sysd-versions: $(..)Versions.def $(..)scripts/versions.awk \
$(wildcard $(all-subdirs:%=$(..)%/Versions)) \
$(wildcard $(+sysdep_dirs:%=%/Versions))
$(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
-v move_if_change='$(move-if-change)' \
-f $(filter-out $<,$^) > $@T
$(wildcard $(sysdirs:%=%/Versions)) \
$(sysd-versions-force)
{ echo 'sysd-versions-subdirs = $(all-subdirs) $(config-sysdirs)' ; \
$(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
-v move_if_change='$(move-if-change)' \
-f $(filter-out $< $(sysd-versions-force),$^); \
} > $@T
mv -f $@T $@
endif
endif
endif # avoid-generated
endif # $(versioning) = yes
endif # sysd-dirs-done
ifndef compile-command.S
compile-command.S = $(compile.S) $(OUTPUT_OPTION)

View File

@ -62,7 +62,9 @@ _dl_close (struct link_map *map)
{
struct link_map *imap = list[i];
if (imap->l_opencount == 1 && imap->l_type == lt_loaded
&& imap->l_info[DT_FINI])
&& imap->l_info[DT_FINI]
/* Skip any half-cooked objects that were never initialized. */
&& imap->l_init_called)
{
/* When debugging print a message first. */
if (_dl_debug_impcalls)

View File

@ -20,6 +20,7 @@
#include <dlfcn.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <bits/libc-lock.h>
#include <elf/ldsodefs.h>
@ -50,25 +51,31 @@ static size_t _dl_global_scope_alloc;
__libc_lock_define_initialized_recursive (, _dl_load_lock)
struct link_map *
internal_function
_dl_open (const char *file, int mode)
/* We must be carefull not to leave us in an inconsistent state. Thus we
catch any error and re-raise it after cleaning up. */
struct dl_open_args
{
const char *file;
int mode;
struct link_map *map;
};
static void
dl_open_worker (void *a)
{
struct dl_open_args *args = a;
const char *file = args->file;
int mode = args->mode;
struct link_map *new, *l;
ElfW(Addr) init;
struct r_debug *r;
/* Make sure we are alone. */
__libc_lock_lock (_dl_load_lock);
/* Load the named object. */
new = _dl_map_object (NULL, file, 0, lt_loaded, 0);
args->map = new = _dl_map_object (NULL, file, 0, lt_loaded, 0);
if (new->l_searchlist)
{
/* It was already open. */
__libc_lock_unlock (_dl_load_lock);
return new;
}
/* It was already open. */
return;
/* Load that object's dependencies. */
_dl_map_object_deps (new, NULL, 0, 0);
@ -147,7 +154,7 @@ _dl_open (const char *file, int mode)
{
_dl_global_scope = _dl_default_scope;
nomem:
_dl_close (new);
new->l_global = 0;
_dl_signal_error (ENOMEM, file, "cannot extend global scope");
}
_dl_global_scope[2] = _dl_default_scope[2];
@ -158,8 +165,8 @@ _dl_open (const char *file, int mode)
}
else
{
if (_dl_global_scope_alloc <
(size_t) (_dl_global_scope_end - _dl_global_scope + 2))
if (_dl_global_scope_end + 2
== _dl_global_scope + _dl_global_scope_alloc)
{
/* Must extend the list. */
struct link_map **new = realloc (_dl_global_scope,
@ -167,9 +174,8 @@ _dl_open (const char *file, int mode)
* sizeof (struct link_map *));
if (! new)
goto nomem;
_dl_global_scope_end = new + (_dl_global_scope_end -
_dl_global_scope);
_dl_global_scope = new;
_dl_global_scope_end = new + _dl_global_scope_alloc - 2;
_dl_global_scope_alloc *= 2;
}
@ -199,9 +205,49 @@ _dl_open (const char *file, int mode)
/* We must be the static _dl_open in libc.a. A static program that
has loaded a dynamic object now has competition. */
__libc_multiple_libcs = 1;
}
struct link_map *
internal_function
_dl_open (const char *file, int mode)
{
struct dl_open_args args;
char *errstring;
int errcode;
/* Make sure we are alone. */
__libc_lock_lock (_dl_load_lock);
args.file = file;
args.mode = mode;
args.map = NULL;
errcode = _dl_catch_error (&errstring, dl_open_worker, &args);
/* Release the lock. */
__libc_lock_unlock (_dl_load_lock);
return new;
if (errstring)
{
/* Some error occured during loading. */
char *local_errstring;
/* Reset the global scope. */
*_dl_global_scope_end = NULL;
/* Remove the object from memory. It may be in an inconsistent
state if relocation failed, for example. */
if (args.map)
_dl_close (args.map);
/* Make a local copy of the error string so that we can release the
memory allocated for it. */
local_errstring = strdupa (errstring);
free (errstring);
/* Reraise the error. */
_dl_signal_error (errcode, NULL, local_errstring);
}
return args.map;
}

View File

@ -81,14 +81,8 @@ extern int dladdr __P ((const void *__address, Dl_info *__info));
into
foo = DL_CALL_FCT (fctp, (arg1, arg2));
*/
# if __GNUC__ >= 2
# define DL_CALL_FCT(fctp, args) \
(__extension__ ({ _dl_mcount_wrapper_check (fctp); \
(*fctp) args; }))
# else
/* This feature is not available without GCC. */
# define DL_CALL_FCT(fctp, args) (*fctp) args
# endif
# define DL_CALL_FCT(fctp, args) \
(_dl_mcount_wrapper_check (fctp), (*(fctp)) args)
/* This function calls the profiling functions. */
extern void _dl_mcount_wrapper_check __P ((void *__selfpc));

View File

@ -239,6 +239,7 @@ gen_steps (struct derivation_step *best, const char *toset,
}
free (result);
*nsteps = 0;
*handle = NULL;
status = GCONV_NOCONV;
}
else
@ -247,6 +248,11 @@ gen_steps (struct derivation_step *best, const char *toset,
status = GCONV_OK;
}
}
else
{
*nsteps = 0;
*handle = NULL;
}
return status;
}

View File

@ -129,6 +129,7 @@ internal_function
__gconv_find_shlib (const char *name)
{
struct gconv_loaded_object *found;
void *keyp;
/* Search the tree of shared objects previously requested. Data in
the tree are `loaded_object' structures, whose first member is a
@ -139,8 +140,8 @@ __gconv_find_shlib (const char *name)
enough to a pointer to our structure to use as a lookup key that
will be passed to `known_compare' (above). */
found = __tfind (&name, &loaded, known_compare);
if (found == NULL)
keyp = __tfind (&name, &loaded, known_compare);
if (keyp == NULL)
{
/* This name was not known before. */
found = malloc (sizeof (struct gconv_loaded_object));
@ -159,6 +160,8 @@ __gconv_find_shlib (const char *name)
}
}
}
else
found = *(struct gconv_loaded_object **) keyp;
/* Try to load the shared object if the usage count is 0. This
implies that if the shared object is not loadable, the handle is

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ TODO COPYING* AUTHORS copyr-* copying.*
glibc-*
*.dvi* *.info* *.c.texi *.ps
*.toc *.aux *.log
*.toc *.aux *.log *.tmp
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
chapters chapters-incl1 chapters-incl2 summary.texi stamp-*

View File

@ -41,47 +41,37 @@ all: info
info: libc.info dir-add.info
endif
# Set chapters and chapters-incl[12].
-include chapters
chapters: libc.texinfo
$(find-includes)
ifdef chapters
# @includes in chapter files
-include chapters-incl1
chapters-incl1: $(chapters)
$(find-includes)
chapters-incl1 := $(filter-out summary.texi,$(chapters-incl1))
endif
ifdef chapters-incl1
# @includes in files included by chapter files, if any
-include chapters-incl2
chapters-incl2: $(chapters-incl1)
$(find-includes)
endif
chapters-incl := $(chapters-incl1) $(chapters-incl2)
define find-includes
(echo '$(@F) :=' \\ ;\
$(AWK) '$$1 == "@include" { print $$2 " \\" }' $^) > $@.new
mv -f $@.new $@
endef
# scripts we use
ifndef move-if-change
move-if-change = ./move-if-change
endif
mkinstalldirs = $(..)scripts/mkinstalldirs
libc.dvi libc.info: $(chapters) summary.texi $(chapters-incl)
chapters = $(addsuffix .texi, \
intro errno memory ctype string mbyte locale message search \
pattern io stdio llio filesys pipe socket terminal math \
arith time setjmp signal startup process job nss users \
sysinfo conf)
add-chapters = $(wildcard $(patsubst %, ../%.texi, \
$(join $(add-ons:=/),$(add-ons))))
appendices = lang.texi header.texi install.texi maint.texi contrib.texi
-include texis
texis: $(chapters) $(add-chapters) $(appendices) lgpl.texinfo
$(AWK) -f texis.awk $^ > $@.T
mv -f $@.T $@
nonexamples = $(filter-out %.c.texi, $(texis))
examples = $(filter %.c.texi, $(texis))
# Kludge: implicit rule so Make knows the one command does it all.
chapters.% top-menu.%: $(texis)
AWK=$(AWK) $(SHELL) libc-texinfo.sh \
'$(chapters)' '$(add-chapters)' '$(appendices)'
libc.dvi libc.info: chapters.texi top-menu.texi
libc.dvi: texinfo.tex
%.info: %.texinfo
$(MAKEINFO) $<
%.dvi: %.texinfo
$(TEXI2DVI) $<
# Generate the summary from the Texinfo source files for each chapter.
summary.texi: stamp-summary ;
stamp-summary: summary.awk $(chapters) $(chapters-incl)
@ -93,7 +83,7 @@ stamp-summary: summary.awk $(chapters) $(chapters-incl)
# Generate a file which can be added to the `dir' content to provide direct
# access to the documentation of the function, variables, and other
# definitions.
dir-add.texinfo: xtract-typefun.awk $(chapters) $(chapters-incl)
dir-add.texinfo: xtract-typefun.awk $(texis)
(echo "@dircategory GNU C library functions"; \
echo "@direntry"; \
$(AWK) -f $^; \
@ -109,18 +99,22 @@ dir-add.texinfo: xtract-typefun.awk $(chapters) $(chapters-incl)
$< | expand > $@.new
mv -f $@.new $@
%.info: %.texinfo
$(MAKEINFO) $<
%.dvi: %.texinfo
$(TEXI2DVI) $<
# Distribution.
minimal-dist = summary.awk texis.awk libc-texinfo.sh libc.texinfo \
$(filter-out summary.texi, $(nonexamples)) \
$(patsubst %.c.texi,examples/%.c, $(examples))
minimal-dist = summary.awk libc.texinfo $(chapters) \
$(patsubst %.c.texi,examples/%.c, \
$(filter-out summary.texi,$(chapters-incl)))
doc-only-dist = Makefile COPYING.LIB
distribute = $(minimal-dist) \
$(patsubst examples/%.c,%.c.texi,$(filter examples/%.c, \
$(minimal-dist))) \
libc.info* libc.?? libc.??s texinfo.tex summary.texi \
stamp-summary chapters chapters-incl1 chapters-incl2 \
distribute = $(minimal-dist) $(examples) texis stdio-fp.c \
libc.info* libc.?? libc.??s texinfo.tex stamp-summary \
xtract-typefun.awk dir-add.texinfo dir-add.info dir \
stdio-fp.c
chapters.texi top-menu.texi
export distribute := $(distribute)
tar-it = tar chovf $@ $^
@ -149,15 +143,17 @@ glibc-doc-$(edition).tar: $(doc-only-dist) $(distribute)
.PHONY: mostlyclean distclean realclean clean
mostlyclean:
-rm -f libc.dvi libc.info* dir-add.info stubs
-rm -f libc.dvi libc.tmp libc.info* dir-add.info
-rm -f $(objpfx)stubs $(objpfx)distinfo
-rm -f $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
clean: mostlyclean
distclean: clean
indices = cp fn pg tp vr ky
realclean: distclean
-rm -f chapters chapters-incl* summary.texi stamp-summary *.c.texi
-rm -f texis summary.texi stamp-summary *.c.texi
-rm -f $(foreach index,$(indices),libc.$(index) libc.$(index)s)
-rm -f libc.log libc.aux libc.toc dir-add.texi
-rm -f libc.log libc.aux libc.toc dir-add.texinfo
-rm -f top-menu.texi chapters.texi
.PHONY: install subdir_install installdirs install-data
install-data subdir_install: install

File diff suppressed because it is too large Load Diff

35
manual/chapters.texi Normal file
View File

@ -0,0 +1,35 @@
@include intro.texi
@include errno.texi
@include memory.texi
@include ctype.texi
@include string.texi
@include mbyte.texi
@include locale.texi
@include message.texi
@include search.texi
@include pattern.texi
@include io.texi
@include stdio.texi
@include llio.texi
@include filesys.texi
@include pipe.texi
@include socket.texi
@include terminal.texi
@include math.texi
@include arith.texi
@include time.texi
@include setjmp.texi
@include signal.texi
@include startup.texi
@include process.texi
@include job.texi
@include nss.texi
@include users.texi
@include sysinfo.texi
@include conf.texi
@include ../linuxthreads/linuxthreads.texi
@include lang.texi
@include header.texi
@include install.texi
@include maint.texi
@include contrib.texi

View File

@ -1,4 +1,6 @@
@node System Configuration, Language Features, System Information, Top
@c This node must have no next pointer.
@node System Configuration, , System Information, Top
@c %MENU% Parameters describing operating system limits
@chapter System Configuration Parameters
The functions and macros listed in this chapter give information about

View File

@ -1,4 +1,5 @@
@node Contributors, Copying, Maintenance, Top
@c %MENU% Who wrote what parts of the GNU C library
@appendix Contributors to the GNU C Library
The GNU C library was written originally by Roland McGrath, and is

View File

@ -1,4 +1,5 @@
@node Character Handling, String and Array Utilities, Memory Allocation, Top
@c %MENU% Character testing and conversion functions
@chapter Character Handling
Programs that work with characters and strings often need to classify a

View File

@ -1,5 +1,6 @@
@node Error Reporting, Memory Allocation, Introduction, Top
@chapter Error Reporting
@c %MENU% How library functions report errors
@cindex error reporting
@cindex reporting errors
@cindex error codes

View File

@ -1,4 +1,5 @@
@node File System Interface, Pipes and FIFOs, Low-Level I/O, Top
@c %MENU% Functions for manipulating files
@chapter File System Interface
This chapter describes the GNU C library's functions for manipulating

View File

@ -1,4 +1,5 @@
@node Library Summary, Installation, Language Features, Top
@c %MENU% A summary showing the syntax, header file, and derivation of each library feature
@appendix Summary of Library Facilities
This appendix is a complete list of the facilities declared within the

View File

@ -3,6 +3,7 @@
@setfilename INSTALL
@node Installation, Maintenance, Library Summary, Top
@c %MENU% How to install the GNU C library
@appendix Installing the GNU C Library
@menu

View File

@ -1,5 +1,6 @@
@node Introduction, Error Reporting, Top, Top
@chapter Introduction
@c %MENU% Purpose of the GNU C Library
The C language provides no built-in facilities for performing such
common operations as input/output, memory management, string

View File

@ -1,4 +1,5 @@
@node I/O Overview, I/O on Streams, Pattern Matching, Top
@c %MENU% Introduction to the I/O facilities
@chapter Input/Output Overview
Most programs need to do either input (reading data) or output (writing

View File

@ -1,4 +1,5 @@
@node Job Control
@node Job Control, Name Service Switch, Processes, Top
@c %MENU% All about process groups and sessions
@chapter Job Control
@cindex process groups

View File

@ -1,4 +1,6 @@
@node Language Features, Library Summary, System Configuration, Top
@c This node must not have a prev pointer.
@node Language Features, Library Summary, , Top
@c %MENU% C language features provided by the library
@appendix C Language Facilities in the Library
Some of the facilities implemented by the C library really should be

115
manual/libc-texinfo.sh Normal file
View File

@ -0,0 +1,115 @@
#! /bin/sh
# Create libc.texinfo from the chapter files.
grep '^@node.*Top' $1 | cut -d, -f-2 |
sed 's/, /:/; s/:@node /:/; s/ /_/g; s/:/ /g' >cnodes.$$
$AWK '{ file[$2] = $1; nnode[$2] = $3 }
END { for(x in file)
if(file[x] != "")
print file[x] ":" x, file[nnode[x]] ":" nnode[x] }' \
cnodes.$$ | tsort | sed 's/_/ /g; $d' >corder.$$
[ -z "$2" ] || grep '^@node.*Top' `echo $2 /dev/null | tr ' ' '\n' | sort` |
cut -d, -f1 | sed 's/@node //' >xorder.$$
grep '^@node.*Top' $3 | cut -d, -f-2 |
sed 's/, /:/; s/:@node /:/; s/ /_/g; s/:/ /g' >anodes.$$
$AWK '{ file[$2] = $1; nnode[$2] = $3 }
END { for(x in file)
if(file[x] != "")
print file[x] ":" x, file[nnode[x]] ":" nnode[x] }' \
anodes.$$ | tsort | sed 's/_/ /g; $d' >aorder.$$
IFS=:
>incl.$$
>smenu.$$
>lmenu.$$
while read file node; do
echo "@include $file" >>incl.$$
echo "* $node:: `sed -n 's/^@c %MENU% //p' $file`" >>smenu.$$
lmenu=`sed -n '/^@menu/,/^@end menu/p; /^@end menu/q' $file |
sed '/^@menu/d; /^@end menu/d'`
[ -z "$lmenu" ] || (
echo; echo "$node"; echo
echo "$lmenu"
) >>lmenu.$$
done <corder.$$
if [ -f xorder.$$ ]; then
(echo; echo 'Add-ons'; echo) >>smenu.$$
while read file node; do
echo "@include $file" >>incl.$$
echo "* $node:: `sed -n 's/^@c %MENU% //p' $file`" >>smenu.$$
lmenu=`sed -n '/^@menu/,/^@end menu/p; /^@end menu/q' $file |
sed '/^@menu/d; /^@end menu/d'`
[ -z "$lmenu" ] || (
echo; echo "$node"; echo
echo "$lmenu"
) >>lmenu.$$
done <xorder.$$
fi
(echo; echo 'Appendices'; echo) >>smenu.$$
while read file node; do
echo "@include $file" >>incl.$$
echo "* $node:: `sed -n 's/^@c %MENU% //p' $file`" >>smenu.$$
lmenu=`sed -n '/^@menu/,/^@end menu/p; /^@end menu/q' $file |
sed '/^@menu/d; /^@end menu/d'`
[ -z "$lmenu" ] || (
echo; echo "$node"; echo
echo "$lmenu"
) >>lmenu.$$
done <aorder.$$
$AWK '
BEGIN { FS=":" }
/^\*/ {
printf("%-32s", $1 "::");
x = split($3, word, " ");
hpos = 34;
for(i = 1; i <= x; i++) {
hpos += length(word[i]) + 1;
if(hpos > 78) {
printf("\n%34s", "");
hpos = 35 + length(word[i]);
}
printf(" %s", word[i]);
}
print ".";
}
!/^\*/ { print; }
' smenu.$$ >smenux.$$
mv -f incl.$$ chapters.texi
(echo '@menu'
cat smenux.$$
cat <<EOF
* Copying:: The GNU Library General Public License says
how you can copy and share the GNU C Library.
Indices
* Concept Index:: Index of concepts and names.
* Type Index:: Index of types and type qualifiers.
* Function Index:: Index of functions and function-like macros.
* Variable Index:: Index of variables and variable-like macros.
* File Index:: Index of programs and files.
--- The Detailed Node Listing ---
EOF
cat lmenu.$$
echo '@end menu' ) >top-menu.texi.$$
mv -f top-menu.texi.$$ top-menu.texi
rm -f *.$$

View File

@ -109,896 +109,8 @@ This is Edition @value{EDITION}, last updated @value{UPDATED}, of
of the GNU C Library.
@end ifinfo
@menu
* Introduction:: Purpose of the GNU C Library.
* Error Reporting:: How the GNU Library functions report
error conditions.
* Memory Allocation:: Your program can allocate memory dynamically
and manipulate it via pointers.
* Character Handling:: Character testing and conversion functions.
* String and Array Utilities:: Utilities for copying and comparing
strings and arrays.
* Extended Characters:: Support for extended character sets.
* Locales:: The country and language can affect
the behavior of library functions.
* Message Translation:: How to make the program speak the users
language.
* Searching and Sorting:: General searching and sorting functions.
* Pattern Matching:: Matching wildcards and regular expressions,
and shell-style ``word expansion''.
* I/O Overview:: Introduction to the I/O facilities.
* Streams: I/O on Streams. High-level, portable I/O facilities.
* Low-Level I/O:: Low-level, less portable I/O.
* File System Interface:: Functions for manipulating files.
* Pipes and FIFOs:: A simple interprocess communication mechanism.
* Sockets:: A more complicated interprocess communication
mechanism, with support for networking.
* Low-Level Terminal Interface::How to change the characteristics
of a terminal device.
* Mathematics:: Math functions (transcendental functions,
random numbers, absolute value, etc.).
* Arithmetic:: Low-level arithmetic functions.
* Date and Time:: Functions for getting the date and time,
and for conversion between formats.
* Non-Local Exits:: The @code{setjmp} and @code{longjmp} facilities.
* Signal Handling:: All about signals; how to send them,
block them, and handle them.
* Process Startup:: Writing the beginning and end of your program.
* Processes:: How to create processes and run other programs.
* Job Control:: All about process groups and sessions.
* Name Service Switch:: Accessing the various system databases.
* Users and Groups:: How users are identified and classified.
* System Information:: Getting information about the
hardware and software configuration
of the machine a program runs on.
* System Configuration:: Parameters describing operating system limits.
Appendices
* Language Features:: C language features provided by the library.
* Library Summary:: A summary showing the syntax, header file,
and derivation of each library feature.
* Installation:: How to install the GNU C library.
* Maintenance:: How to enhance and port the GNU C Library.
* Contributors:: Who wrote what parts of the GNU C Library.
* Copying:: The GNU Library General Public License says
how you can copy and share the GNU C Library.
Indices
* Concept Index:: Index of concepts and names.
* Type Index:: Index of types and type qualifiers.
* Function Index:: Index of functions and function-like macros.
* Variable Index:: Index of variables and variable-like macros.
* File Index:: Index of programs and files.
--- The Detailed Node Listing ---
Introduction
* Getting Started:: Getting Started
* Standards and Portability:: Standards and Portability
* Using the Library:: Using the Library
* Roadmap to the Manual:: Roadmap to the Manual
Standards and Portability
* ISO C:: The American National Standard for the
C programming language.
* POSIX:: The ISO/IEC 9945 (aka IEEE 1003) standards
for operating systems.
* Berkeley Unix:: BSD and SunOS.
* SVID:: The System V Interface Description.
Using the Library
* Header Files:: How to use the header files in your programs.
* Macro Definitions:: Some functions in the library may really
be implemented as macros.
* Reserved Names:: The C standard reserves some names for
the library, and some for users.
* Feature Test Macros:: How to control what names are defined.
Error Reporting
* Checking for Errors:: How errors are reported by library functions.
* Error Codes:: What all the error codes are.
* Error Messages:: Mapping error codes onto error messages.
Memory Allocation
* Memory Concepts:: An introduction to concepts and terminology.
* Dynamic Allocation and C:: How to get different kinds of allocation in C.
* Unconstrained Allocation:: The @code{malloc} facility allows fully general
dynamic allocation.
* Obstacks:: Obstacks are less general than malloc
but more efficient and convenient.
* Variable Size Automatic:: Allocation of variable-sized blocks
of automatic storage that are freed when the
calling function returns.
* Relocating Allocator:: Waste less memory, if you can tolerate
automatic relocation of the blocks you get.
Unconstrained Allocation
* Basic Allocation:: Simple use of @code{malloc}.
* Malloc Examples:: Examples of @code{malloc}. @code{xmalloc}.
* Freeing after Malloc:: Use @code{free} to free a block you
got with @code{malloc}.
* Changing Block Size:: Use @code{realloc} to make a block
bigger or smaller.
* Allocating Cleared Space:: Use @code{calloc} to allocate a
block and clear it.
* Efficiency and Malloc:: Efficiency considerations in use of
these functions.
* Aligned Memory Blocks:: Allocating specially aligned memory:
@code{memalign} and @code{valloc}.
* Heap Consistency Checking:: Automatic checking for errors.
* Hooks for Malloc:: You can use these hooks for debugging
programs that use @code{malloc}.
* Statistics of Malloc:: Getting information about how much
memory your program is using.
* Summary of Malloc:: Summary of @code{malloc} and related functions.
Obstacks
* Creating Obstacks:: How to declare an obstack in your program.
* Preparing for Obstacks:: Preparations needed before you can
use obstacks.
* Allocation in an Obstack:: Allocating objects in an obstack.
* Freeing Obstack Objects:: Freeing objects in an obstack.
* Obstack Functions:: The obstack functions are both
functions and macros.
* Growing Objects:: Making an object bigger by stages.
* Extra Fast Growing:: Extra-high-efficiency (though more
complicated) growing objects.
* Status of an Obstack:: Inquiries about the status of an obstack.
* Obstacks Data Alignment:: Controlling alignment of objects in obstacks.
* Obstack Chunks:: How obstacks obtain and release chunks.
Efficiency considerations.
* Summary of Obstacks::
Automatic Storage with Variable Size
* Alloca Example:: Example of using @code{alloca}.
* Advantages of Alloca:: Reasons to use @code{alloca}.
* Disadvantages of Alloca:: Reasons to avoid @code{alloca}.
* GNU C Variable-Size Arrays:: Only in GNU C, here is an alternative
method of allocating dynamically and
freeing automatically.
Relocating Allocator
* Relocator Concepts:: How to understand relocating allocation.
* Using Relocator:: Functions for relocating allocation.
Character Handling
* Classification of Characters::Testing whether characters are
letters, digits, punctuation, etc.
* Case Conversion:: Case mapping, and the like.
String and Array Utilities
* Representation of Strings:: Introduction to basic concepts.
* String/Array Conventions:: Whether to use a string function or an
arbitrary array function.
* String Length:: Determining the length of a string.
* Copying and Concatenation:: Functions to copy the contents of strings
and arrays.
* String/Array Comparison:: Functions for byte-wise and character-wise
comparison.
* Collation Functions:: Functions for collating strings.
* Search Functions:: Searching for a specific element or substring.
* Finding Tokens in a String:: Splitting a string into tokens by looking
for delimiters.
Extended Characters
* Extended Char Intro:: Multibyte codes versus wide characters.
* Locales and Extended Chars:: The locale selects the character codes.
* Multibyte Char Intro:: How multibyte codes are represented.
* Wide Char Intro:: How wide characters are represented.
* Wide String Conversion:: Converting wide strings to multibyte code
and vice versa.
* Length of Char:: how many bytes make up one multibyte char.
* Converting One Char:: Converting a string character by character.
* Example of Conversion:: Example showing why converting
one character at a time may be useful.
* Shift State:: Multibyte codes with "shift characters".
Locales and Internationalization
* Effects of Locale:: Actions affected by the choice of locale.
* Choosing Locale:: How the user specifies a locale.
* Locale Categories:: Different purposes for which
you can select a locale.
* Setting the Locale:: How a program specifies the locale.
* Standard Locales:: Locale names available on all systems.
* Numeric Formatting:: How to format numbers for the chosen locale.
Message Translation
* Message catalogs a la X/Open:: The @code{catgets} family of functions.
* The Uniforum approach:: The @code{gettext} family of functions.
Searching and Sorting
* Comparison Functions:: Defining how to compare two objects.
Since the sort and search facilities are
general, you have to specify the ordering.
* Array Search Function:: The @code{bsearch} function.
* Array Sort Function:: The @code{qsort} function.
* Search/Sort Example:: An example program.
Pattern Matching
* Wildcard Matching:: Matching a wildcard pattern against a single string.
* Globbing:: Finding the files that match a wildcard pattern.
* Regular Expressions:: Matching regular expressions against strings.
* Word Expansion:: Expanding shell variables, nested commands,
arithmetic, and wildcards.
This is what the shell does with shell commands.
I/O Overview
* I/O Concepts:: Some basic information and terminology.
* File Names:: How to refer to a file.
I/O Concepts
* Streams and File Descriptors:: The GNU Library provides two ways
to access the contents of files.
* File Position:: The number of bytes from the
beginning of the file.
File Names
* Directories:: Directories contain entries for files.
* File Name Resolution:: A file name specifies how to look up a file.
* File Name Errors:: Error conditions relating to file names.
* File Name Portability:: File name portability and syntax issues.
I/O on Streams
* Streams:: About the data type representing a stream.
* Standard Streams:: Streams to the standard input and output
devices are created for you.
* Opening Streams:: How to create a stream to talk to a file.
* Closing Streams:: Close a stream when you are finished with it.
* Simple Output:: Unformatted output by characters and lines.
* Character Input:: Unformatted input by characters and words.
* Line Input:: Reading a line or a record from a stream.
* Unreading:: Peeking ahead/pushing back input just read.
* Formatted Output:: @code{printf} and related functions.
* Customizing Printf:: You can define new conversion specifiers for
@code{printf} and friends.
* Formatted Input:: @code{scanf} and related functions.
* Block Input/Output:: Input and output operations on blocks of data.
* EOF and Errors:: How you can tell if an I/O error happens.
* Binary Streams:: Some systems distinguish between text files
and binary files.
* File Positioning:: About random-access streams.
* Portable Positioning:: Random access on peculiar ISO C systems.
* Stream Buffering:: How to control buffering of streams.
* Temporary Files:: How to open a temporary file.
* Other Kinds of Streams:: Other Kinds of Streams
Unreading
* Unreading Idea:: An explanation of unreading with pictures.
* How Unread:: How to call @code{ungetc} to do unreading.
Formatted Output
* Formatted Output Basics:: Some examples to get you started.
* Output Conversion Syntax:: General syntax of conversion specifications.
* Table of Output Conversions:: Summary of output conversions, what they do.
* Integer Conversions:: Details of formatting integers.
* Floating-Point Conversions:: Details of formatting floating-point numbers.
* Other Output Conversions:: Details about formatting of strings,
characters, pointers, and the like.
* Formatted Output Functions:: Descriptions of the actual functions.
* Variable Arguments Output:: @code{vprintf} and friends.
* Parsing a Template String:: What kinds of arguments does
a given template call for?
Customizing Printf
* Registering New Conversions::
* Conversion Specifier Options::
* Defining the Output Handler::
* Printf Extension Example::
Formatted Input
* Formatted Input Basics:: Some basics to get you started.
* Input Conversion Syntax:: Syntax of conversion specifications.
* Table of Input Conversions:: Summary of input conversions and what they do.
* Numeric Input Conversions:: Details of conversions for reading numbers.
* String Input Conversions:: Details of conversions for reading strings.
* Other Input Conversions:: Details of miscellaneous other conversions.
* Formatted Input Functions:: Descriptions of the actual functions.
* Variable Arguments Input:: @code{vscanf} and friends.
Stream Buffering
* Buffering Concepts:: Terminology is defined here.
* Flushing Buffers:: How to ensure that output buffers are flushed.
* Controlling Buffering:: How to specify what kind of buffering to use.
Other Kinds of Streams
* String Streams::
* Custom Streams::
Programming Your Own Custom Streams
* Streams and Cookies::
* Hook Functions::
Low-Level I/O
* Opening and Closing Files:: How to open and close file descriptors.
* I/O Primitives:: Reading and writing data.
* File Position Primitive:: Setting a descriptor's file position.
* Descriptors and Streams:: Converting descriptor to stream or vice-versa.
* Stream/Descriptor Precautions:: Precautions needed if you use both
descriptors and streams.
* Waiting for I/O:: How to check for input or output
on multiple file descriptors.
* Control Operations:: Various other operations on file descriptors.
* Duplicating Descriptors:: Fcntl commands for duplicating descriptors.
* Descriptor Flags:: Fcntl commands for manipulating flags
associated with file descriptors.
* File Status Flags:: Fcntl commands for manipulating flags
associated with open files.
* File Locks:: Fcntl commands for implementing file locking.
* Interrupt Input:: Getting a signal when input arrives.
File System Interface
* Working Directory:: This is used to resolve relative file names.
* Accessing Directories:: Finding out what files a directory contains.
* Hard Links:: Adding alternate names to a file.
* Symbolic Links:: A file that ``points to'' a file name.
* Deleting Files:: How to delete a file, and what that means.
* Renaming Files:: Changing a file's name.
* Creating Directories:: A system call just for creating a directory.
* File Attributes:: Attributes of individual files.
* Making Special Files:: How to create special files.
Accessing Directories
* Directory Entries:: Format of one directory entry.
* Opening a Directory:: How to open a directory stream.
* Reading/Closing Directory:: How to read directory entries from the stream.
* Simple Directory Lister:: A very simple directory listing program.
* Random Access Directory:: Rereading part of the directory
already read with the same stream.
File Attributes
* Attribute Meanings:: The names of the file attributes,
and what their values mean.
* Reading Attributes:: How to read the attributes of a file.
* Testing File Type:: Distinguishing ordinary files,
directories, links...
* File Owner:: How ownership for new files is determined,
and how to change it.
* Permission Bits:: How information about a file's access mode
is stored.
* Access Permission:: How the system decides who can access a file.
* Setting Permissions:: How permissions for new files are assigned,
and how to change them.
* Testing File Access:: How to find out if your process can
access a file.
* File Times:: About the time attributes of a file.
Pipes and FIFOs
* Creating a Pipe:: Making a pipe with the @code{pipe} function.
* Pipe to a Subprocess:: Using a pipe to communicate with a child.
* FIFO Special Files:: Making a FIFO special file.
Sockets
* Socket Concepts:: Basic concepts you need to know about.
* Communication Styles:: Stream communication, datagrams, and others.
* Socket Addresses:: How socket names (``addresses'') work.
* Local Namespace:: Details about the local namespace.
* Internet Namespace:: Details about the Internet namespace.
* Open/Close Sockets:: Creating sockets and destroying them.
* Connections:: Operations on sockets with connection state.
* Datagrams:: Operations on datagram sockets.
* Socket Options:: Miscellaneous low-level socket options.
* Networks Database:: Accessing the database of network names.
Socket Addresses
* Address Formats:: About @code{struct sockaddr}.
* Setting Address:: Binding an address to a socket.
* Reading Address:: Reading the address of a socket.
Internet Domain
* Internet Address Formats:: How socket addresses are specified in the
Internet namespace.
* Host Addresses:: All about host addresses of Internet hosts.
* Protocols Database:: Referring to protocols by name.
* Services Database:: Ports may have symbolic names.
* Byte Order:: Different hosts may use different byte
ordering conventions; you need to
canonicalize host address and port number.
* Inet Example:: Putting it all together.
Host Addresses
* Abstract Host Addresses:: What a host number consists of.
* Data type: Host Address Data Type. Data type for a host number.
* Functions: Host Address Functions. Functions to operate on them.
* Names: Host Names. Translating host names to host numbers.
Open/Close Sockets
* Creating a Socket:: How to open a socket.
* Closing a Socket:: How to close a socket.
* Socket Pairs:: These are created like pipes.
Connections
* Connecting:: What the client program must do.
* Listening:: How a server program waits for requests.
* Accepting Connections:: What the server does when it gets a request.
* Who is Connected:: Getting the address of the
other side of a connection.
* Transferring Data:: How to send and receive data.
* Byte Stream Example:: An example client for communicating over a
byte stream socket in the Internet namespace.
* Server Example:: A corresponding server program.
* Out-of-Band Data:: This is an advanced feature.
Transferring Data
* Sending Data:: Sending data with @code{write}.
* Receiving Data:: Reading data with @code{read}.
* Socket Data Options:: Using @code{send} and @code{recv}.
Datagrams
* Sending Datagrams:: Sending packets on a datagram socket.
* Receiving Datagrams:: Receiving packets on a datagram socket.
* Datagram Example:: An example program: packets sent over a
datagram stream in the local namespace.
* Example Receiver:: Another program, that receives those packets.
Socket Options
* Socket Option Functions:: The basic functions for setting and getting
socket options.
* Socket-Level Options:: Details of the options at the socket level.
Low-Level Terminal Interface
* Is It a Terminal:: How to determine if a file is a terminal
device, and what its name is.
* I/O Queues:: About flow control and typeahead.
* Canonical or Not:: Two basic styles of input processing.
* Terminal Modes:: How to examine and modify flags controlling
terminal I/O: echoing, signals, editing.
* Line Control:: Sending break sequences, clearing buffers...
* Noncanon Example:: How to read single characters without echo.
Terminal Modes
* Mode Data Types:: The data type @code{struct termios} and related types.
* Mode Functions:: Functions to read and set terminal attributes.
* Setting Modes:: The right way to set attributes reliably.
* Input Modes:: Flags controlling low-level input handling.
* Output Modes:: Flags controlling low-level output handling.
* Control Modes:: Flags controlling serial port behavior.
* Local Modes:: Flags controlling high-level input handling.
* Line Speed:: How to read and set the terminal line speed.
* Special Characters:: Characters that have special effects,
and how to change them.
* Noncanonical Input:: Controlling how long to wait for input.
Special Characters
* Editing Characters::
* Signal Characters::
* Start/Stop Characters::
Mathematics
* Domain and Range Errors:: How overflow conditions and the
like are reported.
* Not a Number:: Making NANs and testing for NANs.
* Trig Functions:: Sine, cosine, and tangent.
* Inverse Trig Functions:: Arc sine, arc cosine, and arc tangent.
* Exponents and Logarithms:: Also includes square root.
* Hyperbolic Functions:: Hyperbolic sine and friends.
* Pseudo-Random Numbers:: Functions for generating pseudo-random numbers.
* Absolute Value:: Absolute value functions.
Pseudo-Random Numbers
* ISO Random:: @code{rand} and friends.
* BSD Random:: @code{random} and friends.
Low-Level Arithmetic Functions
* Normalization Functions:: Hacks for radix-2 representations.
* Rounding and Remainders:: Determining the integer and
fractional parts of a float.
* Integer Division:: Functions for performing integer division.
* Parsing of Numbers:: Functions for ``reading'' numbers from strings.
* Predicates on Floats:: Some miscellaneous test functions.
Parsing of Numbers
* Parsing of Integers:: Functions for conversion of integer values.
* Parsing of Floats:: Functions for conversion of floating-point.
Date and Time
* Processor Time:: Measures processor time used by a program.
* Calendar Time:: Manipulation of ``real'' dates and times.
* Setting an Alarm:: Sending a signal after a specified time.
* Sleeping:: Waiting for a period of time.
Processor Time
* Basic CPU Time:: The @code{clock} function.
* Detailed CPU Time:: The @code{times} function.
Calendar Time
* Simple Calendar Time:: Facilities for manipulating calendar time.
* High-Resolution Calendar:: A time representation with greater precision.
* Broken-down Time:: Facilities for manipulating local time.
* Formatting Date and Time:: Converting times to strings.
* TZ Variable:: How users specify the time zone.
* Time Zone Functions:: Functions to examine or specify the time zone.
* Time Functions Example:: An example program showing use of some of
the time functions.
Signal Handling
* Concepts of Signals:: Introduction to the signal facilities.
* Standard Signals:: Particular kinds of signals with standard
names and meanings.
* Signal Actions:: Specifying what happens when a particular
signal is delivered.
* Defining Handlers:: How to write a signal handler function.
* Generating Signals:: How to send a signal to a process.
* Blocking Signals:: Making the system hold signals temporarily.
* Waiting for a Signal:: Suspending your program until a signal arrives.
* Signal Stack:: Using a Separate Signal Stack
* BSD Signal Handling:: Additional functions for backward
compatibility with BSD.
Basic Concepts of Signals
* Kinds of Signals:: Some examples of what can cause a signal.
* Signal Generation:: Concepts of why and how signals occur.
* Delivery of Signal:: Concepts of what a signal does to the process.
Standard Signals
* Program Error Signals:: Used to report serious program errors.
* Termination Signals:: Used to interrupt and/or terminate the program.
* Alarm Signals:: Used to indicate expiration of timers.
* Asynchronous I/O Signals:: Used to indicate input is available.
* Job Control Signals:: Signals used to support job control.
* Operation Error Signals:: Used to report operational system errors.
* Miscellaneous Signals:: Miscellaneous Signals.
* Signal Messages:: Printing a message describing a signal.
Specifying Signal Actions
* Basic Signal Handling:: The simple @code{signal} function.
* Advanced Signal Handling:: The more powerful @code{sigaction} function.
* Signal and Sigaction:: How those two functions interact.
* Sigaction Function Example:: An example of using the sigaction function.
* Flags for Sigaction:: Specifying options for signal handling.
* Initial Signal Actions:: How programs inherit signal actions.
Defining Signal Handlers
* Handler Returns::
* Termination in Handler::
* Longjmp in Handler::
* Signals in Handler::
* Nonreentrancy::
* Atomic Data Access::
Generating Signals
* Signaling Yourself:: Signaling Yourself
* Signaling Another Process:: Send a signal to another process.
* Permission for kill:: Permission for using @code{kill}
* Kill Example:: Using @code{kill} for Communication
Blocking Signals
* Why Block:: The purpose of blocking signals.
* Signal Sets:: How to specify which signals to block.
* Process Signal Mask:: Blocking delivery of signals to your
process during normal execution.
* Testing for Delivery:: Blocking to Test for Delivery of a Signal
* Blocking for Handler:: Blocking additional signals while a
handler is being run.
* Checking for Pending Signals::Checking for Pending Signals
* Remembering a Signal:: How you can get almost the same effect
as blocking a signal, by handling it
and setting a flag to be tested later.
Waiting for a Signal
* Using Pause:: The simple way, using @code{pause}.
* Pause Problems:: Why the simple way is often not very good.
* Sigsuspend:: Reliably waiting for a specific signal.
BSD Signal Handling
* BSD Handler:: BSD Function to Establish a Handler.
* Blocking in BSD:: BSD Functions for Blocking Signals
Process Startup and Termination
* Program Arguments:: Parsing your program's command-line arguments.
* Environment Variables:: How to access parameters inherited from
a parent process.
* Program Termination:: How to cause a process to terminate and
return status information to its parent.
Program Arguments
* Argument Syntax:: By convention, options start with a hyphen.
* Parsing Program Arguments:: Ways to parse program options and arguments.
Parsing Program Arguments
* Getopt:: Parsing program options using @code{getopt}.
* Argp:: Parsing program options using @code{argp_parse}.
* Suboptions:: Some programs need more detailed options.
* Suboptions Example:: This shows how it could be done for @code{mount}.
Environment Variables
* Environment Access:: How to get and set the values of
environment variables.
* Standard Environment:: These environment variables have
standard interpretations.
Program Termination
* Normal Termination:: If a program calls @code{exit}, a
process terminates normally.
* Exit Status:: The @code{exit status} provides information
about why the process terminated.
* Cleanups on Exit:: A process can run its own cleanup
functions upon normal termination.
* Aborting a Program:: The @code{abort} function causes
abnormal program termination.
* Termination Internals:: What happens when a process terminates.
Child Processes
* Running a Command:: The easy way to run another program.
* Process Creation Concepts:: An overview of the hard way to do it.
* Process Identification:: How to get the process ID of a process.
* Creating a Process:: How to fork a child process.
* Executing a File:: How to make a child execute another program.
* Process Completion:: How to tell when a child process has completed.
* Process Completion Status:: How to interpret the status value
returned from a child process.
* BSD Wait Functions:: More functions, for backward compatibility.
* Process Creation Example:: A complete example program.
Job Control
* Concepts of Job Control :: Concepts of Job Control
* Job Control is Optional:: Not all POSIX systems support job control.
* Controlling Terminal:: How a process gets its controlling terminal.
* Access to the Terminal:: How processes share the controlling terminal.
* Orphaned Process Groups:: Jobs left after the user logs out.
* Implementing a Shell:: What a shell must do to implement job control.
* Functions for Job Control:: Functions to control process groups.
Implementing a Job Control Shell
* Data Structures:: Introduction to the sample shell.
* Initializing the Shell:: What the shell must do to take
responsibility for job control.
* Launching Jobs:: Creating jobs to execute commands.
* Foreground and Background:: Putting a job in foreground of background.
* Stopped and Terminated Jobs:: Reporting job status.
* Continuing Stopped Jobs:: How to continue a stopped job in
the foreground or background.
* Missing Pieces:: Other parts of the shell.
Functions for Job Control
* Identifying the Terminal:: Determining the controlling terminal's name.
* Process Group Functions:: Functions for manipulating process groups.
* Terminal Access Functions:: Functions for controlling terminal access.
Name Service Switch
* NSS Basics:: What is this NSS good for.
* NSS Configuration File:: Configuring NSS.
* NSS Module Internals:: How does it work internally.
* Extending NSS:: What to do to add services or databases.
Users and Groups
* User and Group IDs:: Each user and group has a unique numeric ID.
* Process Persona:: The user IDs and group IDs of a process.
* Why Change Persona:: Why a program might need to change
its user and/or group IDs.
* How Change Persona:: Restrictions on changing user and group IDs.
* Reading Persona:: Examining the process's user and group IDs.
* Setting User ID::
* Setting Groups::
* Enable/Disable Setuid::
* Setuid Program Example:: Setuid Program Example
* Tips for Setuid::
* Who Logged In:: Getting the name of the user who logged in,
or of the real user ID of the current process.
* User Database:: Functions and data structures for
accessing the user database.
* Group Database:: Functions and data structures for
accessing the group database.
* Database Example:: Example program showing use of database
inquiry functions.
User Database
* User Data Structure::
* Lookup User::
* Scanning All Users:: Scanning the List of All Users
* Writing a User Entry::
Group Database
* Group Data Structure::
* Lookup Group::
* Scanning All Groups:: Scanning the List of All Groups
System Information
* Host Identification:: Determining the name of the machine.
* Hardware/Software Type ID:: Determining the hardware type and
operating system type.
System Configuration Limits
* General Limits:: Constants and functions that describe
various process-related limits that have
one uniform value for any given machine.
* System Options:: Optional POSIX features.
* Version Supported:: Version numbers of POSIX.1 and POSIX.2.
* Sysconf:: Getting specific configuration values
of general limits and system options.
* Minimums:: Minimum values for general limits.
* Limits for Files:: Size limitations on individual files.
These can vary between file systems
or even from file to file.
* Options for Files:: Optional features that some files may support.
* File Minimums:: Minimum values for file limits.
* Pathconf:: Getting the limit values for a particular file.
* Utility Limits:: Capacity limits of POSIX.2 utility programs.
* Utility Minimums:: Minimum allowable values of those limits.
* String Parameters:: Getting the default search path.
Library Facilities that are Part of the C Language
* Consistency Checking:: Using @code{assert} to abort
if something ``impossible'' happens.
* Variadic Functions:: Defining functions with varying
numbers of arguments.
* Null Pointer Constant:: The macro @code{NULL}.
* Important Data Types:: Data types for object sizes.
* Data Type Measurements:: Parameters of data type representations.
Variadic Functions
* Why Variadic:: Reasons for making functions take
variable arguments.
* How Variadic:: How to define and call variadic functions.
* Argument Macros:: Detailed specification of the macros
for accessing variable arguments.
* Variadic Example:: A complete example.
How Variadic Functions are Defined and Used
* Variadic Prototypes:: How to make a prototype for a function
with variable arguments.
* Receiving Arguments:: Steps you must follow to access the
optional argument values.
* How Many Arguments:: How to decide whether there are more arguments.
* Calling Variadics:: Things you need to know about calling
variable arguments functions.
Data Type Measurements
* Width of Type:: How many bits does an integer type hold?
* Range of Type:: What are the largest and smallest values
that an integer type can hold?
* Floating Type Macros:: Parameters that measure floating-point types.
* Structure Measurement:: Getting measurements on structure types.
Floating Type Macros
* Floating Point Concepts:: Definitions of terminology.
* Floating Point Parameters:: Dimensions, limits of floating point types.
* IEEE Floating Point:: How one common representation is described.
Library Maintenance
* Installation:: How to configure, compile and install
the GNU C library.
* Reporting Bugs:: How to report bugs (if you want to
get them fixed) and other troubles
you may have with the GNU C library.
@c * Traditional C Compatibility:: Using the GNU C library with non-ANSI
@c C compilers.
Porting the GNU C Library
* Hierarchy Conventions:: How the @file{sysdeps} hierarchy is
layed out.
* Porting to Unix:: Porting the library to an average
Unix-like system.
@end menu
@comment Includes of all the individual chapters.
@include intro.texi
@include errno.texi
@include memory.texi
@include ctype.texi
@include string.texi
@include mbyte.texi
@include locale.texi
@include message.texi
@include search.texi
@include pattern.texi
@include io.texi
@include stdio.texi
@include llio.texi
@include filesys.texi
@include pipe.texi
@include socket.texi
@include terminal.texi
@include math.texi
@include arith.texi
@include time.texi
@include setjmp.texi
@include signal.texi
@include startup.texi
@include process.texi
@include job.texi
@include nss.texi
@include users.texi
@include sysinfo.texi
@include conf.texi
@comment Includes of the appendices.
@include lang.texi
@include header.texi
@include install.texi
@include maint.texi
@include contrib.texi
@include top-menu.texi
@include chapters.texi
@set lgpl-appendix
@node Copying, Concept Index, Contributors, Top

View File

@ -1,4 +1,5 @@
@node Low-Level I/O, File System Interface, I/O on Streams, Top
@c %MENU% Low-level, less portable I/O
@chapter Low-Level Input/Output
This chapter describes functions for performing low-level input/output

View File

@ -1,4 +1,5 @@
@node Locales, Message Translation, Extended Characters, Top
@c %MENU% The country and language can affect the behavior of library functions
@chapter Locales and Internationalization
Different countries and cultures have varying conventions for how to

View File

@ -1,4 +1,5 @@
@node Maintenance, Contributors, Installation, Top
@c %MENU% How to enhance and port the GNU C Library
@appendix Library Maintenance
@menu

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
@node Extended Characters, Locales, String and Array Utilities, Top
@c %MENU% Support for extended character sets
@chapter Extended Characters
A number of languages use character sets that are larger than the range

View File

@ -3,6 +3,7 @@
@node Memory Allocation, Character Handling, Error Reporting, Top
@chapter Memory Allocation
@c %MENU% Allocating memory dynamically and manipulating it via pointers
@cindex memory allocation
@cindex storage allocation

View File

@ -1,4 +1,5 @@
@node Message Translation
@node Message Translation, Searching and Sorting, Locales, Top
@c %MENU% How to make the program speak the user's language
@chapter Message Translation
The program's interface with the human should be designed in a way to

View File

@ -1,11 +1,10 @@
@c each section should have index entries corresponding to the section title
@node Name Service Switch
@node Name Service Switch, Users and Groups, Job Control, Top
@chapter System Databases and Name Service Switch
@c %MENU% Accessing system databases
@cindex Name Service Switch
@cindex NSS
@cindex databases
Various functions in the C Library need to be configured to work
correctly in the local environment. Traditionally, this was done by
using files (e.g., @file{/etc/passwd}), but other nameservices (like the

View File

@ -1,4 +1,5 @@
@node Pattern Matching, I/O Overview, Searching and Sorting, Top
@c %MENU% Matching shell ``globs'' and regular expressions
@chapter Pattern Matching
The GNU C Library provides pattern matching facilities for two kinds of

View File

@ -1,4 +1,5 @@
@node Pipes and FIFOs, Sockets, File System Interface, Top
@c %MENU% A simple interprocess communication mechanism
@chapter Pipes and FIFOs
@cindex pipe

View File

@ -1,4 +1,5 @@
@node Processes
@node Processes, Job Control, Process Startup, Top
@c %MENU% How to create processes and run other programs
@chapter Processes
@cindex process

View File

@ -1,4 +1,5 @@
@node Searching and Sorting, Pattern Matching, Message Translation, Top
@c %MENU% General searching and sorting functions
@chapter Searching and Sorting
This chapter describes functions for searching and sorting arrays of

View File

@ -1,4 +1,5 @@
@node Non-Local Exits, Signal Handling, Date and Time, Top
@c %MENU% Jumping out of nested function calls
@chapter Non-Local Exits
@cindex non-local exits
@cindex long jumps

View File

@ -1,4 +1,5 @@
@node Signal Handling, Process Startup, Non-Local Exits, Top
@c %MENU% How to send, block, and handle signals
@chapter Signal Handling
@cindex signal

View File

@ -1,4 +1,5 @@
@node Sockets, Low-Level Terminal Interface, Pipes and FIFOs, Top
@c %MENU% A more complicated IPC mechanism, with networking support
@chapter Sockets
This chapter describes the GNU facilities for interprocess

View File

@ -1,4 +1,5 @@
@node Process Startup
@node Process Startup, Processes, Signal Handling, Top
@c %MENU% Writing the beginning and end of your program
@chapter Process Startup and Termination
@cindex process

View File

@ -1,4 +1,5 @@
@node I/O on Streams, Low-Level I/O, I/O Overview, Top
@c %MENU% Hign-level, portable I/O facilities
@chapter Input/Output on Streams
@c fix an overfull:
@tex

View File

@ -1,4 +1,5 @@
@node String and Array Utilities, Extended Characters, Character Handling, Top
@c %MENU% Utilities for copying and comparing strings and arrays
@chapter String and Array Utilities
Operations on strings (or arrays of characters) are an important part of

View File

@ -1,4 +1,5 @@
@node System Information, System Configuration, Users and Groups, Top
@c %MENU% Getting information about the hardware and operating system
@chapter System Information
This chapter describes functions that return information about the

View File

@ -1,4 +1,5 @@
@node Low-Level Terminal Interface
@node Low-Level Terminal Interface, Mathematics, Sockets, Top
@c %MENU% How to change the characteristics of a terminal device
@chapter Low-Level Terminal Interface
This chapter describes functions that are specific to terminal devices.

78
manual/texis Normal file
View File

@ -0,0 +1,78 @@
texis = \
intro.texi \
creature.texi \
errno.texi \
memory.texi \
ctype.texi \
string.texi \
stpcpy.c.texi \
strdupa.c.texi \
strncat.c.texi \
mbyte.texi \
locale.texi \
message.texi \
search.texi \
search.c.texi \
pattern.texi \
io.texi \
stdio.texi \
rprintf.c.texi \
memopen.c.texi \
memstrm.c.texi \
fmtmsgexpl.c.texi \
llio.texi \
select.c.texi \
filesys.texi \
dir.c.texi \
dir2.c.texi \
pipe.texi \
pipe.c.texi \
popen.c.texi \
socket.texi \
mkfsock.c.texi \
mkisock.c.texi \
isockad.c.texi \
inetcli.c.texi \
inetsrv.c.texi \
filesrv.c.texi \
filecli.c.texi \
terminal.texi \
termios.c.texi \
math.texi \
arith.texi \
time.texi \
strftim.c.texi \
setjmp.texi \
setjmp.c.texi \
signal.texi \
sigh1.c.texi \
sigusr.c.texi \
startup.texi \
getopt.texi \
testopt.c.texi \
longopt.c.texi \
argp.texi \
argp-ex1.c.texi \
argp-ex2.c.texi \
argp-ex3.c.texi \
argp-ex4.c.texi \
subopt.c.texi \
atexit.c.texi \
process.texi \
job.texi \
nss.texi \
nsswitch.texi \
users.texi \
db.c.texi \
sysinfo.texi \
conf.texi \
../linuxthreads/linuxthreads.texi \
lang.texi \
add.c.texi \
header.texi \
summary.texi \
install.texi \
maint.texi \
contrib.texi \
lgpl.texinfo \

21
manual/texis.awk Normal file
View File

@ -0,0 +1,21 @@
BEGIN {
print "texis = \\";
for(x = 1; x < ARGC; x++)
{
input[0] = ARGV[x];
print ARGV[x], "\\";
for (s = 0; s >= 0; s--)
{
while ((getline < input[s]) > 0)
{
if ($1 == "@include")
{
input[++s] = $2;
print $2, "\\";
}
}
close(input[stackptr]);
}
}
print "";
}

View File

@ -1,4 +1,5 @@
@node Date and Time, Non-Local Exits, Arithmetic, Top
@c %MENU% Functions for getting the date and time and formatting them nicely
@chapter Date and Time
This chapter describes functions for manipulating dates and times,

499
manual/top-menu.texi Normal file
View File

@ -0,0 +1,499 @@
@menu
* Introduction:: Purpose of the GNU C Library.
* Error Reporting:: How library functions report errors.
* Memory Allocation:: Allocating memory dynamically and
manipulating it via pointers.
* Character Handling:: Character testing and conversion functions.
* String and Array Utilities:: Utilities for copying and comparing strings
and arrays.
* Extended Characters:: Support for extended character sets.
* Locales:: The country and language can affect the
behavior of library functions.
* Message Translation:: How to make the program speak the user's
language.
* Searching and Sorting:: General searching and sorting functions.
* Pattern Matching:: Matching shell ``globs'' and regular
expressions.
* I/O Overview:: Introduction to the I/O facilities.
* I/O on Streams:: Hign-level, portable I/O facilities.
* Low-Level I/O:: Low-level, less portable I/O.
* File System Interface:: Functions for manipulating files.
* Pipes and FIFOs:: A simple interprocess communication
mechanism.
* Sockets:: A more complicated IPC mechanism, with
networking support.
* Low-Level Terminal Interface:: How to change the characteristics of a
terminal device.
* Mathematics:: Math functions, useful constants, random
numbers.
* Arithmetic:: Low level arithmetic functions.
* Date and Time:: Functions for getting the date and time and
formatting them nicely.
* Non-Local Exits:: Jumping out of nested function calls.
* Signal Handling:: How to send, block, and handle signals.
* Process Startup:: Writing the beginning and end of your
program.
* Processes:: How to create processes and run other
programs.
* Job Control:: All about process groups and sessions.
* Name Service Switch:: Accessing system databases.
* Users and Groups:: How users are identified and classified.
* System Information:: Getting information about the hardware and
operating system.
* System Configuration:: Parameters describing operating system
limits.
Add-ons
* POSIX Threads:: The standard threads library.
Appendices
* Language Features:: C language features provided by the library.
* Library Summary:: A summary showing the syntax, header file,
and derivation of each library feature.
* Installation:: How to install the GNU C library.
* Maintenance:: How to enhance and port the GNU C Library.
* Contributors:: Who wrote what parts of the GNU C library.
* Copying:: The GNU Library General Public License says
how you can copy and share the GNU C Library.
Indices
* Concept Index:: Index of concepts and names.
* Type Index:: Index of types and type qualifiers.
* Function Index:: Index of functions and function-like macros.
* Variable Index:: Index of variables and variable-like macros.
* File Index:: Index of programs and files.
--- The Detailed Node Listing ---
Introduction
* Getting Started:: What this manual is for and how to use it.
* Standards and Portability:: Standards and sources upon which the GNU
C library is based.
* Using the Library:: Some practical uses for the library.
* Roadmap to the Manual:: Overview of the remaining chapters in
this manual.
Error Reporting
* Checking for Errors:: How errors are reported by library functions.
* Error Codes:: Error code macros; all of these expand
into integer constant values.
* Error Messages:: Mapping error codes onto error messages.
Memory Allocation
* Memory Concepts:: An introduction to concepts and terminology.
* Dynamic Allocation and C:: How to get different kinds of allocation in C.
* Unconstrained Allocation:: The @code{malloc} facility allows fully general
dynamic allocation.
* Allocation Debugging:: Finding memory leaks and not freed memory.
* Obstacks:: Obstacks are less general than malloc
but more efficient and convenient.
* Variable Size Automatic:: Allocation of variable-sized blocks
of automatic storage that are freed when the
calling function returns.
* Relocating Allocator:: Waste less memory, if you can tolerate
automatic relocation of the blocks you get.
Character Handling
* Classification of Characters:: Testing whether characters are
letters, digits, punctuation, etc.
* Case Conversion:: Case mapping, and the like.
String and Array Utilities
* Representation of Strings:: Introduction to basic concepts.
* String/Array Conventions:: Whether to use a string function or an
arbitrary array function.
* String Length:: Determining the length of a string.
* Copying and Concatenation:: Functions to copy the contents of strings
and arrays.
* String/Array Comparison:: Functions for byte-wise and character-wise
comparison.
* Collation Functions:: Functions for collating strings.
* Search Functions:: Searching for a specific element or substring.
* Finding Tokens in a String:: Splitting a string into tokens by looking
for delimiters.
* Encode Binary Data:: Encoding and Decoding of Binary Data.
* Argz and Envz Vectors:: Null-separated string vectors.
Extended Characters
* Extended Char Intro:: Multibyte codes versus wide characters.
* Locales and Extended Chars:: The locale selects the character codes.
* Multibyte Char Intro:: How multibyte codes are represented.
* Wide Char Intro:: How wide characters are represented.
* Wide String Conversion:: Converting wide strings to multibyte code
and vice versa.
* Length of Char:: how many bytes make up one multibyte char.
* Converting One Char:: Converting a string character by character.
* Example of Conversion:: Example showing why converting
one character at a time may be useful.
* Shift State:: Multibyte codes with "shift characters".
Locales
* Effects of Locale:: Actions affected by the choice of
locale.
* Choosing Locale:: How the user specifies a locale.
* Locale Categories:: Different purposes for which you can
select a locale.
* Setting the Locale:: How a program specifies the locale
with library functions.
* Standard Locales:: Locale names available on all systems.
* Numeric Formatting:: How to format numbers according to the
chosen locale.
Message Translation
* Message catalogs a la X/Open:: The @code{catgets} family of functions.
* The Uniforum approach:: The @code{gettext} family of functions.
Searching and Sorting
* Comparison Functions:: Defining how to compare two objects.
Since the sort and search facilities
are general, you have to specify the
ordering.
* Array Search Function:: The @code{bsearch} function.
* Array Sort Function:: The @code{qsort} function.
* Search/Sort Example:: An example program.
* Hash Search Function:: The @code{hsearch} function.
* Tree Search Function:: The @code{tsearch} function.
Pattern Matching
* Wildcard Matching:: Matching a wildcard pattern against a single string.
* Globbing:: Finding the files that match a wildcard pattern.
* Regular Expressions:: Matching regular expressions against strings.
* Word Expansion:: Expanding shell variables, nested commands,
arithmetic, and wildcards.
This is what the shell does with shell commands.
I/O Overview
* I/O Concepts:: Some basic information and terminology.
* File Names:: How to refer to a file.
I/O on Streams
* Streams:: About the data type representing a stream.
* Standard Streams:: Streams to the standard input and output
devices are created for you.
* Opening Streams:: How to create a stream to talk to a file.
* Closing Streams:: Close a stream when you are finished with it.
* Simple Output:: Unformatted output by characters and lines.
* Character Input:: Unformatted input by characters and words.
* Line Input:: Reading a line or a record from a stream.
* Unreading:: Peeking ahead/pushing back input just read.
* Block Input/Output:: Input and output operations on blocks of data.
* Formatted Output:: @code{printf} and related functions.
* Customizing Printf:: You can define new conversion specifiers for
@code{printf} and friends.
* Formatted Input:: @code{scanf} and related functions.
* EOF and Errors:: How you can tell if an I/O error happens.
* Binary Streams:: Some systems distinguish between text files
and binary files.
* File Positioning:: About random-access streams.
* Portable Positioning:: Random access on peculiar ISO C systems.
* Stream Buffering:: How to control buffering of streams.
* Other Kinds of Streams:: Streams that do not necessarily correspond
to an open file.
* Formatted Messages:: Print strictly formatted messages.
Low-Level I/O
* Opening and Closing Files:: How to open and close file
descriptors.
* Truncating Files:: Change the size of a file.
* I/O Primitives:: Reading and writing data.
* File Position Primitive:: Setting a descriptor's file
position.
* Descriptors and Streams:: Converting descriptor to stream
or vice-versa.
* Stream/Descriptor Precautions:: Precautions needed if you use both
descriptors and streams.
* Waiting for I/O:: How to check for input or output
on multiple file descriptors.
* Synchronizing I/O:: Making sure all I/O actions completed.
* Asynchronous I/O:: Perform I/O in parallel.
* Control Operations:: Various other operations on file
descriptors.
* Duplicating Descriptors:: Fcntl commands for duplicating
file descriptors.
* Descriptor Flags:: Fcntl commands for manipulating
flags associated with file
descriptors.
* File Status Flags:: Fcntl commands for manipulating
flags associated with open files.
* File Locks:: Fcntl commands for implementing
file locking.
* Interrupt Input:: Getting an asynchronous signal when
input arrives.
File System Interface
* Working Directory:: This is used to resolve relative
file names.
* Accessing Directories:: Finding out what files a directory
contains.
* Working on Directory Trees:: Apply actions to all files or a selectable
subset of a directory hierarchy.
* Hard Links:: Adding alternate names to a file.
* Symbolic Links:: A file that ``points to'' a file name.
* Deleting Files:: How to delete a file, and what that means.
* Renaming Files:: Changing a file's name.
* Creating Directories:: A system call just for creating a directory.
* File Attributes:: Attributes of individual files.
* Making Special Files:: How to create special files.
* Temporary Files:: Naming and creating temporary files.
Pipes and FIFOs
* Creating a Pipe:: Making a pipe with the @code{pipe} function.
* Pipe to a Subprocess:: Using a pipe to communicate with a
child process.
* FIFO Special Files:: Making a FIFO special file.
* Pipe Atomicity:: When pipe (or FIFO) I/O is atomic.
Sockets
* Socket Concepts:: Basic concepts you need to know about.
* Communication Styles::Stream communication, datagrams, and other styles.
* Socket Addresses:: How socket names (``addresses'') work.
* Interface Naming:: Identifying specific network interfaces.
* Local Namespace:: Details about the local namespace.
* Internet Namespace:: Details about the Internet namespace.
* Misc Namespaces:: Other namespaces not documented fully here.
* Open/Close Sockets:: Creating sockets and destroying them.
* Connections:: Operations on sockets with connection state.
* Datagrams:: Operations on datagram sockets.
* Inetd:: Inetd is a daemon that starts servers on request.
The most convenient way to write a server
is to make it work with Inetd.
* Socket Options:: Miscellaneous low-level socket options.
* Networks Database:: Accessing the database of network names.
Low-Level Terminal Interface
* Is It a Terminal:: How to determine if a file is a terminal
device, and what its name is.
* I/O Queues:: About flow control and typeahead.
* Canonical or Not:: Two basic styles of input processing.
* Terminal Modes:: How to examine and modify flags controlling
details of terminal I/O: echoing,
signals, editing.
* Line Control:: Sending break sequences, clearing
terminal buffers @dots{}
* Noncanon Example:: How to read single characters without echo.
* Pseudo-Terminals:: How to open a pseudo-terminal.
Mathematics
* Mathematical Constants:: Precise numeric values for often-used
constants.
* Trig Functions:: Sine, cosine, tangent, and friends.
* Inverse Trig Functions:: Arcsine, arccosine, etc.
* Exponents and Logarithms:: Also pow and sqrt.
* Hyperbolic Functions:: sinh, cosh, tanh, etc.
* Special Functions:: Bessel, gamma, erf.
* Pseudo-Random Numbers:: Functions for generating pseudo-random
numbers.
* FP Function Optimizations:: Fast code or small code.
Arithmetic
* Floating Point Numbers:: Basic concepts. IEEE 754.
* Floating Point Classes:: The five kinds of floating-point number.
* Floating Point Errors:: When something goes wrong in a calculation.
* Rounding:: Controlling how results are rounded.
* Control Functions:: Saving and restoring the FPU's state.
* Arithmetic Functions:: Fundamental operations provided by the library.
* Complex Numbers:: The types. Writing complex constants.
* Operations on Complex:: Projection, conjugation, decomposition.
* Integer Division:: Integer division with guaranteed rounding.
* Parsing of Numbers:: Converting strings to numbers.
* System V Number Conversion:: An archaic way to convert numbers to strings.
Date and Time
* Processor Time:: Measures processor time used by a program.
* Calendar Time:: Manipulation of ``real'' dates and times.
* Setting an Alarm:: Sending a signal after a specified time.
* Sleeping:: Waiting for a period of time.
* Resource Usage:: Measuring various resources used.
* Limits on Resources:: Specifying limits on resource usage.
* Priority:: Reading or setting process run priority.
Non-Local Exits
* Intro: Non-Local Intro. When and how to use these facilities.
* Details: Non-Local Details. Functions for nonlocal exits.
* Non-Local Exits and Signals:: Portability issues.
Signal Handling
* Concepts of Signals:: Introduction to the signal facilities.
* Standard Signals:: Particular kinds of signals with
standard names and meanings.
* Signal Actions:: Specifying what happens when a
particular signal is delivered.
* Defining Handlers:: How to write a signal handler function.
* Interrupted Primitives:: Signal handlers affect use of @code{open},
@code{read}, @code{write} and other functions.
* Generating Signals:: How to send a signal to a process.
* Blocking Signals:: Making the system hold signals temporarily.
* Waiting for a Signal:: Suspending your program until a signal
arrives.
* Signal Stack:: Using a Separate Signal Stack.
* BSD Signal Handling:: Additional functions for backward
compatibility with BSD.
Process Startup
* Program Arguments:: Parsing your program's command-line arguments.
* Environment Variables:: How to access parameters inherited from
a parent process.
* Program Termination:: How to cause a process to terminate and
return status information to its parent.
Processes
* Running a Command:: The easy way to run another program.
* Process Creation Concepts:: An overview of the hard way to do it.
* Process Identification:: How to get the process ID of a process.
* Creating a Process:: How to fork a child process.
* Executing a File:: How to make a process execute another program.
* Process Completion:: How to tell when a child process has completed.
* Process Completion Status:: How to interpret the status value
returned from a child process.
* BSD Wait Functions:: More functions, for backward compatibility.
* Process Creation Example:: A complete example program.
Job Control
* Concepts of Job Control:: Jobs can be controlled by a shell.
* Job Control is Optional:: Not all POSIX systems support job control.
* Controlling Terminal:: How a process gets its controlling terminal.
* Access to the Terminal:: How processes share the controlling terminal.
* Orphaned Process Groups:: Jobs left after the user logs out.
* Implementing a Shell:: What a shell must do to implement job control.
* Functions for Job Control:: Functions to control process groups.
Name Service Switch
* NSS Basics:: What is this NSS good for.
* NSS Configuration File:: Configuring NSS.
* NSS Module Internals:: How does it work internally.
* Extending NSS:: What to do to add services or databases.
Users and Groups
* User and Group IDs:: Each user has a unique numeric ID;
likewise for groups.
* Process Persona:: The user IDs and group IDs of a process.
* Why Change Persona:: Why a program might need to change
its user and/or group IDs.
* How Change Persona:: Changing the user and group IDs.
* Reading Persona:: How to examine the user and group IDs.
* Setting User ID:: Functions for setting the user ID.
* Setting Groups:: Functions for setting the group IDs.
* Enable/Disable Setuid:: Turning setuid access on and off.
* Setuid Program Example:: The pertinent parts of one sample program.
* Tips for Setuid:: How to avoid granting unlimited access.
* Who Logged In:: Getting the name of the user who logged in,
or of the real user ID of the current process.
* User Accounting Database:: Keeping information about users and various
actions in databases.
* User Database:: Functions and data structures for
accessing the user database.
* Group Database:: Functions and data structures for
accessing the group database.
* Database Example:: Example program showing the use of database
inquiry functions.
* Netgroup Database:: Functions for accessing the netgroup database.
System Information
* Host Identification:: Determining the name of the machine.
* Hardware/Software Type ID:: Determining the hardware type of the
machine and what operating system it is
running.
* Filesystem handling:: Which is mounted and/or available?
System Configuration
* General Limits:: Constants and functions that describe
various process-related limits that have
one uniform value for any given machine.
* System Options:: Optional POSIX features.
* Version Supported:: Version numbers of POSIX.1 and POSIX.2.
* Sysconf:: Getting specific configuration values
of general limits and system options.
* Minimums:: Minimum values for general limits.
* Limits for Files:: Size limitations that pertain to individual files.
These can vary between file systems
or even from file to file.
* Options for Files:: Optional features that some files may support.
* File Minimums:: Minimum values for file limits.
* Pathconf:: Getting the limit values for a particular file.
* Utility Limits:: Capacity limits of some POSIX.2 utility programs.
* Utility Minimums:: Minimum allowable values of those limits.
* String Parameters:: Getting the default search path.
POSIX Threads
* Basic Thread Operations:: Creating, terminating, and waiting for threads.
* Thread Attributes:: Tuning thread scheduling.
* Cancellation:: Stopping a thread before it's done.
* Cleanup Handlers:: Deallocating resources when a thread is
cancelled.
* Mutexes:: One way to synchronize threads.
* Condition Variables:: Another way.
* POSIX Semaphores:: And a third way.
* Thread-Specific Data:: Variables with different values in
different threads.
* Threads and Signal Handling:: Why you should avoid mixing the two, and
how to do it if you must.
* Miscellaneous Thread Functions:: A grab bag of utility routines.
Language Features
* Consistency Checking:: Using @code{assert} to abort if
something ``impossible'' happens.
* Variadic Functions:: Defining functions with varying numbers
of args.
* Null Pointer Constant:: The macro @code{NULL}.
* Important Data Types:: Data types for object sizes.
* Data Type Measurements:: Parameters of data type representations.
Installation
* Tools for Installation:: We recommend using these tools to build.
* Supported Configurations:: What systems the GNU C library runs on.
* Tips for Installation:: Useful hints for the installation.
* Reporting Bugs:: How to report bugs (if you want to
get them fixed) and other troubles
you may have with the GNU C library.
Maintenance
* Source Layout:: How to add new functions or header files
to the GNU C library.
* Porting:: How to port the GNU C library to
a new machine or operating system.
@end menu

View File

@ -1,4 +1,5 @@
@node Users and Groups
@node Users and Groups, System Information, Name Service Switch, Top
@c %MENU% How users are identified and classified
@chapter Users and Groups
Every user who can log in on the system is identified by a unique number

View File

@ -27,8 +27,8 @@ static const char x86_cap_flags[][7] =
{
"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
"cx8", "apic", "10", "sep", "mtrr", "pge", "mca", "cmov",
"fcmov", "17", "18", "19", "20", "21", "22", "mmx",
"osfxsr", "25", "26", "27", "28", "29", "30", "amd3d"
"pat", "pse36", "18", "19", "20", "21", "22", "mmx",
"fxsr", "25", "26", "27", "28", "29", "30", "amd3d"
};
static inline int

View File

@ -35,10 +35,7 @@ struct __kernel_ucred
extern int __syscall_recvmsg (int, struct msghdr *, int);
int
__libc_recvmsg (fd, message, flags)
int fd;
struct msghdr *message;
int flags;
__libc_recvmsg (int fd, struct msghdr *message, int flags)
{
struct cmsghdr *cm;
int ret;

View File

@ -37,10 +37,7 @@ extern int __syscall_sendmsg (int, const struct msghdr *, int);
/* Send a message described by MESSAGE on socket FD.
Returns the number of bytes sent, or -1 for errors. */
int
__libc_sendmsg (fd, message, flags)
int fd;
const struct msghdr *message;
int flags;
__libc_sendmsg (int fd, const struct msghdr *message, int flags)
{
struct cmsghdr *cm;
struct cmsgcred *cc;