diff -durpN glibc-2.0.4/BUGS glibc-2.0.5/BUGS --- glibc-2.0.4/BUGS Wed May 21 14:55:46 1997 +++ glibc-2.0.5/BUGS Mon Aug 4 19:45:22 1997 @@ -1,20 +1,20 @@ List of known bugs (certainly very incomplete) ---------------------------------------------- -Time-stamp: <1997-05-21T20:55:45+0200 drepper> +Time-stamp: <1997-08-04T00:50:04+0200 drepper> This following list contains those bugs which I'm aware of. Please make sure that bugs you report are not listed here. If you can fix one of these bugs/limitations I'll certainly be glad to receive a patch. Another source of information about bugs is the problem data base of the -GNU project. There is an easy to use WWW interface is available at +GNU project. There is an easy to use WWW interface available at http://www-gnats.gnu.ai.mit.edu:8080/cgi-bin/wwwgnats.pl I would appreciate it very much if you could verify the problem was not -reported before by looking though the database. To make the information -in this data as useful as possible please report bugs always using the +reported before by looking through the database. To make the information +in this database as useful as possible please report bugs always using the `glibcbug' shell script which gets installed with GNU libc. @@ -23,14 +23,8 @@ in this data as useful as possible pleas Severity: [ *] to [***] -[ **] For GNU libc on Linux, there is still no solution for the UTMP - problem. Two people are working on a possible solution. - [Among others: PR libc/39] - [ **] There are problems with signal handling when using LinuxThreads. -[ **] The `cbrtl' function for ix86 does not work in the moment. - [ *] The precision of the `sinhl' and/or `asinhl' function do not seem to be the best. @@ -50,13 +44,13 @@ Severity: [ *] to [***] symbols in available. [PR libc/140] -[ *] The localedef program should interpret only the required categories - addressed by `copy' statements. This especially means that limited - character sets must not lead to errors if the LC_CTYPE category in - the locale addressed by `copy' is not really used. +[ *] The localedef program should not generate errors if for categories + which are not used for the output there are characters referenced + which are not defined in the charmap. + [PR libc/229] -[ *] Statically linking with libpthread leads to strange warnings - from the linker. I don't know why this happen so far. +[ *] The rcmd() functions (more concrete: the handling of .rhosts) does + not support netgroups and wildcards (+). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ulrich Drepper diff -durpN glibc-2.0.4/ChangeLog glibc-2.0.5/ChangeLog --- glibc-2.0.4/ChangeLog Mon May 26 17:29:35 1997 +++ glibc-2.0.5/ChangeLog Mon Aug 25 16:47:11 1997 @@ -1,3 +1,707 @@ +1997-08-25 17:01 Ulrich Drepper + + * sysdeps/i386/selectbits.h: Correct assembler versions to work even + for descriptors >= 32. + + * stdlib/alloca.h: Don't define alloca to __alloca since if gcc + is used __alloca is not defined to __builtin_alloca and so might + not be available. + Reported by Uwe Ohse . + + * sysdeps/unix/sysv/linux/sys/sysmacros.h: Define macros in a special + way if gcc is not used and so dev_t is an array. + Reported by Uwe Ohse . + + * sysdeps/unix/sysv/linux/netinet/tcp.h: Include features.h instead + of sys/cdefs.h. Pretty print. + +1997-08-25 12:22 Ulrich Drepper + + * sunrpc/rpc/xdr.h: Change name of parameters in prototypes of + xdr_reference, xdrmem_create, and xdrstdio_create because of clash + with g++ internal symbols. + Patch by Sudish Joseph . + +1997-08-24 18:36 Ulrich Drepper + + * string/argz.h: Add missing __END_DECLS. + Patch by Miles Bader . + +1997-08-24 00:48 Ulrich Drepper + + * locale/iso-4217.def: Update for more complete ISO 4217 match. + + * libio/stdio.h: Make {,v}snprintf functions available is __USE_BSD. + + * sysdeps/generic/dl-sysdep.c: Don't use fstat, use fxstat. + +1997-08-17 Paul Eggert + + * tzset.c (__tzset_internal): Fix memory leak when the user + specifies a TZ value that uses a default rule file. + Do not assume US DST rules when the user specifies + that there is no DST. + +1997-08-16 Andreas Schwab + + * sysdeps/unix/sysv/linux/sys/mount.h: Remove the IS_* macros, + they operate on internal kernel structures and have no place in a + user header. + +1997-08-18 01:52 Ulrich Drepper + + * sysdeps/mach/libc-lock.h: Fix typo. + Reported by Marcus G. Daniels . + +1997-08-16 21:33 Ulrich Drepper + + * sysdeps/mach/hurd/Dist: Add cthreads.c. + + * catgets/gencat.c (usage): Fix help text. + + Update of UTMP interface. + * login/Makefile (routines): Add utmpname, remove utmp_db. + * login/getutent.c: Rename to __getutent and make getutent a weak + alias. + * login/getutent.c: Rename to __getutid and make getutid a weak + alias. + * login/getutent.c: Rename to __getutline and make getutline a weak + alias. + * login/getutent_r.c: Rewrite to use jump table correctly. + * login/getutid_r.c: Likewise. + * login/getutline_r.c: Likewise. + * login/updwtmp.c: Likewise. + * login/login.c (login): Correct test for result of utmpname. + Use updwtmp instead of implementing this here again. + * login/logout.c (logout): Correct test for result of utmpname + and pututline. Handle ut_type field correctly if it exists. + * login/utmp-private.h: Update for changed internal functions. + * login/utmp.h: Reformat and correct typos. + * login/utmp_file.c: Rewrite lock handling. + * login/utmpname.c: New file. + Patches by Mark Kettenis . + + * socket/sys/socket.h (getpeername): Correct type of len argument. + Reported by a sun . + + * sysdeps/generic/_G_config.h: Include , not + . + * sysdeps/unix/sysv/linux/_G_config.h: Likewise. + + * sysdeps/mach/libc-lock.h: Introduce thread-specific key handling + functions. + + * sysdeps/mach/hurd/Makefile [subdir=misc] (sysdep_routines): Add + cthreads. + * sysdeps/mach/hurd/cthreads.c: New file. + +1997-08-16 04:06 Ulrich Drepper + + * assert/assert.h [__USE_GNU]: Undefine assert_perror. + Reported by Theodore C. Belding . + +1997-08-10 18:29:08 1997 Mark Kettenis + + * login/login.c (login): Check for correct return value of + utmpname. + +1997-08-10 18:44 Ulrich Drepper + + * time/tzset.c: Interpret no DST information in user provided time + zone specification as it is meant: no DST. + Patch by Paul Eggert . + +1997-08-09 13:12 Ulrich Drepper + + * sysdeps/mach/libc-lock.h (__libc_once): Fix typos. + Add macros for key handling. + * sysdeps/mach/hurd/Makefile [$(subdir)=misc] (sysdep_routines): Add + cthreads. + * sysdeps/mach/hurd/cthreads.c: New file. + Patches by Marcus G. Daniels . + +1997-08-08 Thomas Bushnell, n/BSG + + * sysdeps/mach/bits/libc-lock.h (__libc_once): Define correctly. + +1997-08-08 02:25 Ulrich Drepper + + * sysdeps/stub/libc-lock.h (__libc_once_define): Add new parameter + for storage class. + * inet/inet_ntoa.c: Add static to parameter list for __libc_once_init. + + * login/Makefile (routines): Add updwtmp. + * login/logwtmp.c: Move definition of updwtmp to ... + * login/updwtmp.c: here. New file. + + * sysdeps/libm-ieee754/s_cbrt.c: Complete rewrite. + * sysdeps/libm-ieee754/s_cbrtf.c: Likewise. + * sysdeps/libm-ieee754/s_cbrtl.c: Likewise. + +1997-07-26 14:42 H.J. Lu + + * libio/stdfiles.c (_libio_using_thunks): Define if + _G_USING_THUNKS is defined. + + * libio/_G_config.h: Moved to + * sysdeps/generic/_G_config.h: ...here. + + * sysdeps/unix/sysv/linux/_G_config.h: New, add vtable thunks support. + +1997-08-07 Thomas Bushnell, n/BSG + + * sysdeps/mach/hurd/profil.c (fetch_samples): Put parens in the + right place. + +1997-08-06 Thomas Bushnell, n/BSG + + * sysdeps/mach/hurd/profil.c (fetch_samples): Do arithmetic on + PC's in long long to avoid overflow. + +1997-08-07 Thomas Bushnell, n/BSG + + * sysdeps/mach/bits/libc-lock.h (__libc_once, __libc_once_define): + New macros. + +1997-08-06 13:54 Ulrich Drepper + + * gmon/gmon.c (_mcleanup): Fix typos. + + * gmon/sys/gmon.h: Add prototype for write_profiling. + +1997-08-01 Andreas Schwab + + * sysdeps/m68k/__longjmp.c: Replace call to abort by infinite + loop, to avoid dragging stdio into the dynamic linker. + +1997-08-04 13:06 Thomas Bushnell, n/BSG + + * gmon/gmon.c (write_gmon): New function; guts from _mcleanup. + (_mcleanup): Use write_gmon. + (write_profiling): This function can be safely called at any time + to write a current histogram without interfering with ongoing + profiling. + + * sysdeps/mach/hurd/profil.c (fetch_samples): Initialize NSAMPLES. + +1997-08-01 17:53 Thomas Bushnell, n/BSG + + * sysdeps/mach/hurd/profil.c (fetch_samples): Sample buffer need + not be vm_deallocated; it's a stack buffer. + (profil_vm_deallocate): Delete prototype. + (#include <../mach/RPC_vm_deallocate_rpc.c>): Drop this + inclusion. + * sysdeps/mach/hurd/Makefile + ($(common-objpfx)hurd/../mach/RPC_vm_deallocate_rpc.c): Delete + this rule. + + * sysdeps/mach/hurd/profil.c (fetch_samples): New function, guts + from profile_waiter. + (profile_waiter): Use fetch_samples. + (profil): When turning off profiling, fetch the last bunch of + samples before disabling PC sampling. + (fetch_samples): Add prototype. + +1997-07-30 12:53 Thomas Bushnell, n/BSG + + * sysdeps/mach/hurd/Makefile: Give normal rules for the mach RPC + source included by profil.c instead of trying to use + before-compile grot. + +1997-07-23 15:04 Thomas Bushnell, n/BSG + + * sysdeps/mach/hurd/profil.c (profile_waiter): Do vm_deallocate + after releasing lock. Use special RPC stubs and avoid assert, + thus making this function entirely independent of the threadvar + mechanism and of cthreads. + (lock): Convert to be a spin lock instead of a mutex, so that the + waiter thread need not use cthreads. Use a fork prepare hook + instead of _hurd_fork_locks to make sure we are clean before + forking. + (fork_profil_child): Renamed from fork_profil. + (profil_reply_port): New variable. + (profil_vm_deallocate, profil_task_get_sampled_pcs): Special RPC + stubs made by special hacks. + * sysdeps/mach/hurd/Makefile (before-compile): Add the mach RPC + source files that profil.c needs if we are in the gmon directory. + + * mach/setup-thread.c (__mach_setup_thread): Delete avoidance of a + cthreads bug that hasn't existed for two years. + +1997-08-04 15:29 Ulrich Drepper + + * locale/programs/localedef.c (main): Set bit in avail for those + categories which are successfully read. + * locale/programs/locfile.c (check_all_categories): Don't check + categories if they are not available. + (write_all_categories): Don't write categories if they are not + available. + + * socket/sys/socket.h (bind, getsockname, connect, sendto, recvfrom, + getsockopt, setsockopt, accept): Change size argument to type + socklen_t. + Pretty print. + * manual/socket.texi: Describe socklen_t and change prototypes of + socket functions to use socklen_t. + * sysdeps/generic/bits/socket.h: Define socklen_t. + (struct msghdr): Correct types to use socklen_t. + * sysdeps/unix/sysv/linux/bits/socket.h: Likewise. + * sysdeps/unix/sysv/linux/mips/bits/socket.h: Likewise. + + * stdio-common/printf_fp.c (__printf_fp): Correct rounding of numbers + 1.0 < x < 8.0. + * stdio-common/tfformat.c: Add new tests for above bug. + + * termios/cfsetspeed.c: Rewrite loop to do what it shall do. + + * wcsmbs/Makefile (tests): Add tst-wcstof. + * wcsmbs/tst-wcstof.c: New file. + * wcsmbs/wcstof.c (FLT): Define as FLT. + +1997-08-02 01:57 Ulrich Drepper + + * sysdeps/unix/sysv/linux/ptrace.c: Don't set errno in error + case since the __syscall_ptrace call already did this. + Reported by Philip Gladstone . + +1997-07-29 Andreas Jaeger + + * sysdeps/unix/sysv/linux/sys/fsuid.h: Change include + to . + +1997-08-01 23:18 Ulrich Drepper + + * locale/programs/locale.c (print_escaped): New function. + (show_info): Use print_escaped if strings can control unprintable + characters. + Patch by Jochen Hein . + +1997-07-31 Andreas Schwab + + * md5-crypt/Makefile (extra-objs): Add onlymd5-crypt.o for + dependencies. + +1997-07-28 23:35 Ulrich Drepper + + * nis/nss_compat/compat-grp.c (internal_setgrent): Set FD_CLOEXEC + for stream on input file. + * nis/nss_compat/compat-pwd.c (internal_setpwent): Likewise. + * nis/nss_compat/compat-spwd.c (internal_setspent): Likewise. + * nss/nss_db/db-XXX.c (internal_setent): Likewise. + * nss/nss_db/db-alias.c (internal_setent): Likewise. + * nss/nss_db/db-netgrp.c (internal_setent): Likewise. + * nss/nss_files/files-XXX.c (internal_setent): Likewise. + * nss/nss_files/files-alias.c (internal_setent): Likewise. + * nss/nss_files/files-netgrp.c (internal_setent): Likewise. + +1997-07-23 05:10 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sys/fsuid.h: New file. + Provided by Michael Deutschmann . + * sysdeps/unix/sysv/linux/Makefile (headers): Add sys/fsuid.h. + * sysdeps/unix/sysv/linux/Dist: Add sys/fsuid.h. + +1997-07-19 22:53 Ulrich Drepper + + * time/africa: Update from tzdata1997g. + * time/asia: Likewise. + * time/australasia: Likewise. + * time/europe: Likewise. + * time/iso3166.tab: Likewise. + * time/zone.tab: Likewise. + * time/private.h: Update from tzcode1997f. + * time/scheck.c: Likewise. + +1997-07-17 Andreas Schwab + + * include/gnu-versions.h (_GNU_OBSTACK_INTERFACE_VERSION): + Synchronize with malloc/obstack.c. + +1997-07-15 Marcus G. Daniels + + * manual/Makefile (INSTALL_INFO): Introduce variable to override + path to install-info for systems like Debian that have an + install-info with a different command line interface from the + canonical GNU texinfo version. + +1997-07-15 Andreas Jaeger + + * sysdeps/posix/ttyname_r.c (__ttyname_r): Correct comment. + * posix/unistd.h: Likewise. + * sysdeps/stub/ttyname_r.c: Likewise. + +1997-06-22 Paul Eggert + + * time/strftime.c (strftime): Use tm_zone if available, even if _LIBC. + + * time/tzfile.c (__tzstring): New decl. + (__tzfile_read, __tzfile_default): Set __tzname to permanent strings. + (__tzfile_default): First two args are now const char *. + + * time/tzset.c (__tzstring): New function. + (tz_rule): Name is now const char *. + (struct tzstring_head): New type. + (tzstring_list, tzstring_last_buffer_size): New static vars. + (__tzset_internal): Time zone names are now permanent, not temporary. + +1997-07-12 18:47 Ulrich Drepper + + * assert/assert.h [!NDEBUG] (assert, assert_perror): Don't use || + and && in tests to allow use in C++ code which overloads these + operators. Reported by Istvan Marko . + +1997-07-12 17:56 Ulrich Drepper + + * login/login.c (tty_name): Test return value of ttyname_r for != + 0, not < 0. + * misc/ttyslot.c (ttyslot): Test return value of ttyname_r for == + 0, not >= 0. + * sysdeps/unix/getlogin.c (getlogin): Test return value of + ttyname_r for != 0. + * sysdeps/unix/getlogin_r.c (getlogin_r): Likewise. + +1997-07-11 03:00 Ulrich Drepper + + * inet/inet_ntoa.c: Prevent looking for thread data key if we found + one. + + * signal/sigandset.c: Include stddef.h to get NULL defined. + * signal/sigisempty.c: Likewise. + * signal/sigorset.c: Likewise. + +1997-07-09 07:19 H.J. Lu + + * posix/execvp.c (execvp): Handle ESTALE. + +1997-07-09 08:16 H.J. Lu + + * libio/fileops.c (_IO_file_underflow): Adjust pointers + before calling _IO_SYSREAD (). + +1997-07-08 13:59 Ulrich Drepper + + * time/strftime.c (spaces, zeroes): Handle broken SGI compiler. + Patch by Richard Stallman . + +1997-07-08 02:18 Ulrich Drepper + + * io/lockf.c (lockf): Clear fl before using. + Patch by sr@adb.fr. + + * libio/strops.c: Correctly handle _IO_write_end. + + * nss/nss_files/files-netgrp.c (_nss_netgroup_parseline): Don't + panic if setnetgrent wasn't called before, return error. + Patch by Thorsten Kukuk . + + * time/mktime.c: Define localtime_r function as my_mktime_localtime_r + if locally defined. + * time/strftime.c: Define localtime_r function as my_ftime_localtime_r + if locally defined. + Define tm_diff function as ftime_tm_diff if locally defined. + Reported by Richard Stallman . + +1997-07-04 18:04 H.J. Lu + + * stdlib/tst-strtol.c: Don't assume cpp takes ~0UL as long + in cc1. Cpp in gcc doesn't do it. + +1997-07-05 11:56 Ulrich Drepper + + * login/login.c (tty_name): Use newly allocated buffer. + Patch by Jaakko Hyvätti . + + * time/asctime.c: Never translate week and month name according + to LC_TIME. Patch by Paul Eggert . + +1997-06-28 20:52 Ulrich Drepper + + * sysdeps/unix/sysv/linux/syscalls.list: Add getresgid and + setresgid. + +1997-06-27 02:17 Ulrich Drepper + + * sysdeps/unix/sysv/linux/syscalls.list: Add quotactl. + Reported by a sun. + +1997-06-26 14:28 Ulrich Drepper + + * time/strftime.c: Don't define `memcpy' macro if HAVE_MEMCPY is + defined. Reported by Akim Demaille . + +1997-06-23 23:39 Ulrich Drepper + + * math/math.h: Add warning about use of M_* constants. + Pretty print. + +1997-06-21 02:48 Ulrich Drepper + + * locale/programs/locale.c: Correct comment. + + * po/ko.po: Update. + +1997-06-20 02:35 a sun + + * sysdeps/unix/sysv/linux/netipx/ipx.h: Don't use kernel header. + +1997-06-19 19:38 Ulrich Drepper + + * inet/rcmd.c: Correct a few typos. Reported by Erik Troan. + + * manual/Makefile (distribute): Add dir. + * manual/dir: New file. + +1997-06-19 07:37 H.J. Lu + + * time/tzfile.c (__tzfile_read): Store getc () return in int. + +1997-06-18 Miles Bader + + * string/Makefile (routines): Add argz-replace. + +1997-06-12 Miles Bader + + * string/argz.h (__argz_replace, argz_replace): New declarations. + * string/argz-replace.c: New file. + +1997-06-18 00:11 Andreas Schwab + + * stdio-common/vfscanf.c (inchar, ungetc): Don't count EOF as + character read in/put back. + * stdio-common/tstscanf.c: Add test case for this. + +1997-06-18 12:01 Ulrich Drepper + + * manual/Makefile (install): Make sure `dir' file exists if we use + install-info. + +1997-06-17 19:32 Andreas Schwab + + * manual/Makefile (info): Depend on dir-add.info. + +1997-06-17 00:26 Andreas Schwab + + * sysdeps/stub/e_acoshl.c: Set errno to ENOSYS. + * sysdeps/stub/e_acosl.c: Likewise. + * sysdeps/stub/e_asinl.c: Likewise. + * sysdeps/stub/e_atan2l.c: Likewise. + * sysdeps/stub/e_expl.c: Likewise. + * sysdeps/stub/e_fmodl.c: Likewise. + * sysdeps/stub/e_j0l.c: Likewise. + * sysdeps/stub/e_j1l.c: Likewise. + * sysdeps/stub/e_jnl.c: Likewise. + * sysdeps/stub/e_lgammal_r.c: Likewise. + * sysdeps/stub/e_log10l.c: Likewise. + * sysdeps/stub/e_logl.c: Likewise. + * sysdeps/stub/e_powl.c: Likewise. + * sysdeps/stub/e_rem_pio2l.c: Likewise. + * sysdeps/stub/e_sqrtl.c: Likewise. + * sysdeps/stub/k_cosl.c: Likewise. + * sysdeps/stub/k_rem_pio2l.c: Likewise. + * sysdeps/stub/k_sinl.c: Likewise. + * sysdeps/stub/k_tanl.c: Likewise. + * sysdeps/stub/s_atanl.c: Likewise. + * sysdeps/stub/s_erfl.c: Likewise. + * sysdeps/stub/s_expm1l.c: Likewise. + * sysdeps/stub/s_log1pl.c: Likewise. + +1997-06-16 03:07 Ulrich Drepper + + * sysdeps/libm-ieee754/k_standard.c: Undo change of Tue Aug 6 + 01:13:56 1996. + +1997-06-15 00:43 Ulrich Drepper + + * sysdeps/libm-i387/s_asinh.S: Handle +-Inf and NaN correctly. + * sysdeps/libm-i387/s_asinhf.S: Likewise. + * sysdeps/libm-i387/s_asinhl.S: Likewise. + * sysdeps/libm-i387/s_nearbyint.S: Correctly leave function. + * sysdeps/libm-i387/s_nearbyintf.S: Likewise. + * sysdeps/libm-i387/s_nearbyintl.S: Likewise. + +1997-06-12 21:22 Ulrich Drepper + + * Makefile (manual/dir-add.info): New rule. + + * inet/arpa/tftp.h (struct tftphdr): Change type of tu_block to + `unsigned short'. + + * manual/Makefile (dir-add.texi): Also emit wrapper text for + info/install-info. + (distribute): Add dir-add.texi and dir-add.info. + (mostlyclean): Add dir-add.info. + (realclean): Add dir-add.texi. + (install): Add entries in `dir' file using install-info. + + * manual/libc.texinfo: Add @dircategory and @direntry text. + Reported by Miles Bader . + +1997-06-12 12:45 Ulrich Drepper + + * sysdeps/i386/fpu/__math.h (__M_SQRT2): Define here since we + cannot rely on M_SQRT2 being defined. (log1p): Use __M_SQRT2 not + M_SQRT2. + * math/math.h (_Mldbl): Define even if M_* constants are not + defined. + Reported by corsepiu@faw.uni-ulm.de. + +1997-06-12 03:08 Philip Blundell + + * nss/getXXbyYY_r.c (do_weak_alias): Remove extra parentheses. + +1997-06-11 13:22 Ulrich Drepper + + * misc/regexp.h (compile): Allow use of macro INIT for variable + declaration. Add documentation for INIT. + Reported by Robert Bihlmeyer . + +1997-06-11 10:47 Philip Blundell + + * sysdeps/unix/sysv/linux/net/if_arp.h: Add two new hardware types. + +1997-06-05 23:10 Andreas Schwab + + * sysdeps/unix/sysv/linux/Dist: Remove netatalk/atalk.h and + netinet/icmp.h, add netatalk/at.h. + * sysdeps/unix/sysv/linux/powerpc/Dist: Remove termios.h. + * sysdeps/unix/sysv/linux/sparc/Dist: Remove start.c. + +1997-06-05 13:43 Fila Kolodny + + * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add netipx/ipx.h. + +1997-06-05 17:08 Ulrich Drepper + + * string/argz-addsep.c: Correct weak alias. + Reported by Ben Pfaff . + + * locale/setlocale.c (setlocale): Free variable with locale path + before returning. + (setname): Don't test for _nl_current[category] being NULL before + freeing. + Reported by Ben Pfaff . + +1997-06-03 23:42 Ulrich Drepper + + * time/Makefile: Make tzselect depend on config.make. + +1997-06-01 12:48 Ulrich Drepper + + * sysdeps/unix/sysv/linux/alpha/gnu/types.h (__fd_mask): Change + type to `unsigned long int'. + Patch by Richard Henderson . + +1997-05-30 17:34 Andreas Jaeger + + * nss/nss_files/files-hosts.c: Delete inclusion of + "../resolv/mapv4v6hostent.h". + +1997-05-31 02:33 Ulrich Drepper + + * libio/libio.h: Define bits for libg++-2.8. + +1997-05-30 09:50 Richard Henderson + + * manual/maint.texi: ECOFF hasn't been tested in ages and I don't + plan on doing so ever again. Don't say alpha-linuxecoff is known + to work. + + * sysdeps/alpha/Makefile: Temporarily turn on -mieee globally. This + will last until I figure out how to build a parallel libm_ieee. + + * sysdeps/alpha/fpu/fpu_control.h: Update copyright. Change default + FP mode to round to nearest, no exceptions as for Intel. + * sysdeps/unix/sysv/linux/alpha/setfpucw.c: Add copyright. + (rdfpcr): Use excb rather than trapb. Be more efficient about + getting at the fpcr. + (wrfpcr): Likewise. + (__setfpucw): Reformat. + + * sysdeps/unix/alpha/sysdep.S: Tiny cleanups. + * sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/brk.S: Don't use jmp macro to make + sure the stack frame is released the very instruction before the + real jump out. + * sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise. + + * sysdeps/unix/sysv/linux/alpha/gnu/types.h: Undef some bits we may + have gotten from . + + * sysdeps/unix/sysv/linux/alpha/ioperm.c: Add definition for Miata. + +1997-05-29 13:59 Andreas Schwab + + * Makefile (manual/dir-add.texi): Force execution. + +1997-05-29 13:55 Andreas Schwab + + * stdlib/strfmon.c: Don't run past EOS after `='. + +1997-05-29 12:48 Ulrich Drepper + + Update resolver code to bind-4.9.6-T1A. + * resolv/Banner: Update. + * nss/digits_dots.c: Adapt text address matching to T1A. + * nss/nss_files/files-hosts.c: Always use inet_pton. + * resolv/base64.c (b64_pton): Follow T1A but don't use this code since + it would lead to warnings. + * resolv/gethnamaddr.c (getanswer): Test host name for maximal length + at several places. + * resolv/inet_net_pton.c (inet_net_pton_ipv4): Correct typo in comment. + * resolv/res_comp.c (dn_expand): Check for overflow. + (dn_comp): Likewise. + * resolv/res_debug.c (precsize_aton): Better implementation. + * resolv/res_init.c (res_init): Make `buf' of size MAXDNAME. + * resolv/res_send.c (res_send): Check for overflow in descriptor set. + * resolv/nss_dns/dns-host.c (getanswer_r): Test host name for maximal + length at several places. + +1997-05-28 21:56 Andreas Jaeger + + * sysdeps/unix/sysv/linux/net/ppp_defs.h: Include for + time_t. + + * login/pty.h: Include for definition of struct + winsize. + +1997-05-28 22:51 Ulrich Drepper + + * time/strptime.c (strptime_internal, case 'Y'): Restrict year + number to four digits and to representable range for 4 byte time_t + values. + Patch by H.J. Lu . + +1997-07-16 Miles Bader + + * sysdeps/mach/hurd/mmap.c (__mmap): Check for !MAP_SHARED rather + than MAP_COPY|MAP_PRIVATE, since those values are defined wierdly. + Return EACCES rather than EGRATUITOUS if a R/W request isn't writable. + +1997-07-05 11:56 Ulrich Drepper + + * login/login.c (tty_name): Use newly allocated buffer. + Patch by Jaakko Hyvätti . + + * time/asctime.c: Never translate week and month name according + to LC_TIME. Patch by Paul Eggert . + +1997-07-01 16:40 Thomas Bushnell, n/BSG + + * hurd/hurdsig.c: Include . + (reauth_proc): Call proc_setowner appropriately too. + +1997-05-29 14:02 Andreas Schwab + + * sysdeps/unix/sysv/linux/sys/ttydefaults.h (CEOL, CSTATUS): Use + correct value for _POSIX_VDISABLE. + +1997-05-06 13:25 H.J. Lu + + * stdio-common/bug3.c: use /tmp/bug3.test for concurrency. + + * stdio-common/bug4.c: use /tmp/bug4.test for concurrency. + 1997-05-26 23:29 Ulrich Drepper * Net release 2.0.4. diff -durpN glibc-2.0.4/FAQ glibc-2.0.5/FAQ --- glibc-2.0.4/FAQ Fri Apr 4 19:49:09 1997 +++ glibc-2.0.5/FAQ Thu Aug 21 07:56:19 1997 @@ -77,6 +77,16 @@ please let me know. [Q21] ``On Linux I've got problems with the declarations in Linux kernel headers.'' + +[Q22] ``When I try to compile code which uses IPv6 header and + definitions on my Linux 2.x.y system I am in trouble. + Nothing seems to work.'' + +[Q23] ``When compiling GNU libc I get lots of errors saying functions + in glibc are duplicated in libgcc.'' + +[Q24] ``I have set up /etc/nis.conf, and the Linux libc 5 with NYS + works great. But the glibc NIS+ doesn't seem to work.'' ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ [Q1] ``What systems does the GNU C Library run on?'' @@ -173,7 +183,12 @@ Library. slow. * plenty of time (approx 1h for i?86-linux on i586@133 or 2.5h on - i486@66 or 4.5h on i486@33). For Hurd systems times are much higher. + i486@66 or 4.5h on i486@33), both for shared and static only). + For Hurd systems times are much higher. + + For Atari Falcon (Motorola 68030 @ 16 Mhz, 14 Mb memory) James Troup + reports for a full build (shared, static, + and profiled) a compile time of 45h34m. If you have some more measurements let me know. @@ -417,7 +432,7 @@ ship the cryptographic function together But of course we provide the code and there is an very easy way to use this code. First get the extra package. People in the US way get it from the same place they got the GNU libc from. People outside the US -should get the code from ftp.uni-c.dk [129.142.6.74], or another +should get the code from ftp://ftp.ifi.uio.no/pub/gnu, or another archive site outside the USA. The README explains how to install the sources. @@ -550,7 +565,7 @@ by in the above example specs file to make it work for other systems. -Version 2.7.2.2 does and future versions of GCC will automatically +Version 2.7.2.3 does and future versions of GCC will automatically provide the correct specs. @@ -568,6 +583,10 @@ something like this: GROUP ( libc.so.6 ld.so.1 libc.a ) +or in ix86/Linux and alpha/Linux: + +GROUP ( libc.so.6 ld-linux.so.2 libc.a ) + ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ [Q18] ``The prototypes for `connect', `accept', `getsockopt', @@ -576,13 +595,9 @@ GROUP ( libc.so.6 ld.so.1 libc.a ) any other system I saw. This is a bug, isn't it?'' [A18] {UD} No, this is no bug. This version of the GNU libc already -follows the to-be-released POSIX.1g standard. In this standard -the type `size_t' is used for all parameters which describe a size. -So better change now. - -This change is critical for system which have - sizeof (int) != sizeof (size_t) -like the Alpha. +follows the Single Unix specifications (and I think the POSIX.1g +draft which adopted the solution). The type for parameter describing +a size is now `socklen_t', a new type. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ @@ -598,22 +613,9 @@ invalid. I.e., an emulated FPU is for t [Q20] ``How can I compile gcc 2.7.2.1 from the gcc source code using glibc 2.x? -[A20] {AJ} There's only support for glibc 2.0 in gcc 2.7.2.2 or later. -For 2.7.2.2 you should use the following patch and configure for -e.g. i486-linux. ------------------------------------------------------------------------ ---- configure Tue Feb 11 15:57:17 1997 -+++ configure Wed Feb 12 23:09:29 1997 -@@ -1021,7 +1021,7 @@ - gnu_ld=yes - # GNU libc version 2 does not supply these; - # we want them from GCC. -- extra_parts="crtbegin.o crtend.o" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - ;; - i[3456]86-go32-msdos | i[3456]86-*-go32) - cpu_type=i386 ------------------------------------------------------------------------ +[A20] {AJ} There's only correct support for glibc 2.0.x in gcc 2.7.2.3 +or later. You should get at least gcc 2.7.2.3. All previous versions +had problems with glibc support. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ @@ -637,13 +639,60 @@ results because of type conflicts. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +[Q22] ``When I try to compile code which uses IPv6 header and + definitions on my Linux 2.x.y system I am in trouble. + Nothing seems to work.'' + +[A22] {UD} The problem is that the IPv6 development still has not reached +a point where it is stable. There are still lots of incompatible changes +made and the libc headers have to follow. + +Currently (as of 970401) according to Philip Blundell +the required kernel version is 2.1.30. + + +~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +[Q23] ``When compiling GNU libc I get lots of errors saying functions + in glibc are duplicated in libgcc.'' + +[A23] {EY} This is *exactly* the same problem that I was having. The +problem was due to the fact that the autoconfigure didn't correctly +detect that linker flag --no-whole-archive was supported in my linker. +In my case it was because I had run ./configure with bogus CFLAGS, and +the test failed. + +One thing that is particularly annoying about this problem is that +once this is misdetected, running configure again won't fix it unless +you first delete config.cache. + +{UD} Starting with glibc-2.0.3 there should be a better test to avoid +some problems of this kind. The setting of CFLAGS is checked at the +very beginning and if it is not usable `configure' will bark. + + + +~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +[Q24] ``I have set up /etc/nis.conf, and the Linux libc 5 with NYS + works great. But the glibc NIS+ doesn't seem to work.'' + +[A24] The glibc NIS+ implementation uses a /var/nis/NIS_COLD_START +file for storing information about the NIS+ server and their public +keys, because the nis.conf file do not contain all necessary +information. You have to copy a NIS_COLD_START file from a Solaris +client (the NIS_COLD_START file is byte order independend) or generate +it new with nisinit from the nis-tools (look at +http://www-vt.uni-paderborn.de/~kukuk/linux/nisplus.html). + + +~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Answers were given by: {UD} Ulrich Drepper, {DMT} David Mosberger-Tang, {RM} Roland McGrath, {HJL} H.J. Lu, -{AJ} Andreas Jaeger, +{AJ} Andreas Jaeger, +{EY} Eric Youngdale, Local Variables: mode:text diff -durpN glibc-2.0.4/INSTALL glibc-2.0.5/INSTALL --- glibc-2.0.4/INSTALL Mon May 26 08:14:49 1997 +++ glibc-2.0.5/INSTALL Sat Aug 23 15:33:39 1997 @@ -157,13 +157,13 @@ build the GNU C library: recommend you port GNU `make' instead. *Really.* We recommend version GNU `make' version 3.75 or later. - * GCC 2.7.2 + * GCC 2.7.2.3 On most platforms, the GNU C library can only be compiled with the GNU C compiler. We recommend GCC version 2.7.2 or later; earlier versions may have problems. - * `binutils' 2.8 + * `binutils' 2.8.1 Using the GNU `binutils' (assembler, linker, and related tools) is preferable when possible, and they are required to build an ELF @@ -171,6 +171,18 @@ build the GNU C library: earlier versions are known to have problems or to not support all architectures. +If you change any configuration file you will need also + + * `autoconf' 2.12 + +and if you change any of the message translation files you will also need + + * `GNU gettext' 0.10 or later + +If you upgrade your source tree using the patches made available you probably +will need those package above in any case. + + Supported Configurations ------------------------ @@ -922,4 +934,3 @@ parts of the library were contributed or or any improvements or extensions that they make and grant Carnegie Mellon the rights to redistribute these changes. - diff -durpN glibc-2.0.4/Makefile glibc-2.0.5/Makefile --- glibc-2.0.4/Makefile Thu Apr 17 16:41:03 1997 +++ glibc-2.0.5/Makefile Wed Aug 6 08:14:16 1997 @@ -303,8 +303,9 @@ makeinfo --no-validate --no-warn --no-he endef INSTALL: manual/maint.texi; $(format-me) NOTES: manual/creature.texi; $(format-me) -manual/dir-add.texi: +manual/dir-add.texi manual/dir-add.info: FORCE $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) +FORCE: rpm/%: subdir_distinfo $(MAKE) $(PARALLELMFLAGS) -C $(@D) subdirs='$(subdirs)' $(@F) diff -durpN glibc-2.0.4/NEWS glibc-2.0.5/NEWS --- glibc-2.0.4/NEWS Tue Mar 18 08:30:40 1997 +++ glibc-2.0.5/NEWS Thu Aug 7 20:34:15 1997 @@ -7,6 +7,26 @@ Please send GNU C library bug reports us . Questions and suggestions should be send to . +Version 2.0.5 + +* more bug fixes + +* inet_ntoa is thread-safe + +* updwtmp is moved from libutil to libc + +* rewrite of cbrt function + +* update of timezone data + +Version 2.0.4 + +* more bug fixes + +Version 2.0.3 + +* more bug fixes + Version 2.0.2 * more bug fixes diff -durpN glibc-2.0.4/PROJECTS glibc-2.0.5/PROJECTS --- glibc-2.0.4/PROJECTS Thu Jan 23 21:23:12 1997 +++ glibc-2.0.5/PROJECTS Mon Aug 4 20:21:01 1997 @@ -1,6 +1,6 @@ Open jobs for finishing GNU libc: --------------------------------- -Status: January 1997 +Status: August 1997 If you have time and talent to take over any of the jobs below please contact @@ -19,7 +19,16 @@ contact standards if they do not contradict each other. -[ 3] Write translations for the GNU libc message for the so far +[ 3] The IMHO opinion most important task is to write a more complete + test suite. We cannot get too many people working on this. It is + not difficult to write a test, find a definition of the function + which I normally can provide, if necessary, and start writing tests + to test for compliance. Beside this, take a look at the sources + and write tests which in total test as many paths of execution as + possible. + + +[ 4] Write translations for the GNU libc message for the so far unsupported languages. GNU libc is fully internationalized and users can immediately benefit from this. @@ -28,15 +37,7 @@ contact for the current status (of course better use a mirror of prep). -[ 4] Write wordexp() function; this is described in POSIX.2, the - header already exists. - - Implementation idea: use some functions from bash. - -**** Somebody is working on this. Help may or may not be appreciated. - - -[ 5] Write `long double' versions of the math functions. This should be +[ 6] Write `long double' versions of the math functions. This should be done in collaboration with the NetBSD and FreeBSD people. The libm is in fact fdlibm (not the same as in Linux libc). @@ -45,7 +46,18 @@ contact the rest. -[ 6] If you enjoy assembler programming (as I do --drepper :-) you might +[ 7] Several math functions have to be written: + + - exp2 + + each with float, double, and long double arguments. + + Beside this most of the complex math functions which are new in + ISO C 9X should be improved. Writing some of them in assembler is + useful to exploit the parallelism which often is available. + + +[ 8] If you enjoy assembler programming (as I do --drepper :-) you might be interested in writing optimized versions for some functions. Especially the string handling functions can be optimized a lot. @@ -60,42 +72,38 @@ contact work. -[ 7] Write nftw() function. Perhaps it might be good to reimplement the - ftw() function as well to share most of the code. - -**** Almost done! - - -[ 8] Write AVL-tree based tsearch() et.al. functions. Currently only - a very simple algorithm is used. - There is a public domain version but using this would cause problems - with the assignment. - - -[ 9] Extend regex and/or rx to work with wide characters and complete +[10] Extend regex and/or rx to work with wide characters and complete implementation of character class and collation class handling. It is planed to do a complete rewrite. -[10] Write access function for netmasks, bootparams, and automount +[11] Write access function for netmasks, bootparams, and automount databases for nss_files and nss_db module. The functions should be embedded in the nss scheme. This is not hard and not all services must be supported at once. -[11] Rewrite utmp/wtmp functions to use database functions. This is much - better than the normal flat file format. +[13] Several more or less small functions have to be written: -**** There are plans for a new approach to this problem. Please contact - bug-glibc@prep.ai.mit.edu before starting to work.) + + tcgetid() and waitid() from XPG4.2 + + grantpt(), ptsname(), unlockpt() from XPG4.2 + + More information is available on request. -[12] Several more or less small functions have to be written: +[14] We need to write a library for on-the-fly transformation of streams + of text. In fact, this would be a recode-library (you know, GNU recode). + This is needed in several places in the GNU libc and I already have + rather concrete plans but so far no possibility to start this. - + tcgetid() and waitid() from XPG4.2 - + grantpt(), ptsname(), unlockpt() from XPG4.2 - + getdate() from XPG4.2 - + fmtmsg() from SVID - More information are available on request. +[15] Cleaning up the header files. Ideally, each header style should + follow the "good examples". Each variable and function should have + a short description of the function and its parameters. The prototypes + should always contain variable names which can help to identify their + meaning; better than + + int foo __P ((int, int, int, int)); + + Blargh! diff -durpN glibc-2.0.4/README glibc-2.0.5/README --- glibc-2.0.4/README Mon May 26 15:24:17 1997 +++ glibc-2.0.5/README Tue Aug 5 18:08:04 1997 @@ -1,4 +1,4 @@ -This directory contains the version 2.0.4 test release of the GNU C Library. +This directory contains the version 2.0.5 test release of the GNU C Library. Many bugs have been fixed since the last release. Some bugs surely remain. @@ -47,7 +47,7 @@ provides the Unix `crypt' function, plus Because of the United States export restriction on DES implementations, we are distributing this code separately from the rest of the C library. There is an extra distribution tar file just for crypt; it is -called `glibc-crypt-2.0.4.tar.gz'. You can just unpack the crypt +called `glibc-crypt-2.0.5.tar.gz'. You can just unpack the crypt distribution along with the rest of the C library and build; you can also build the library without getting crypt. Users outside the USA can get the crypt distribution via anonymous FTP from ftp.ifi.uio.no diff -durpN glibc-2.0.4/assert/assert.h glibc-2.0.5/assert/assert.h --- glibc-2.0.4/assert/assert.h Wed Oct 30 21:50:29 1996 +++ glibc-2.0.5/assert/assert.h Fri Aug 15 22:05:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 94, 95, 96, 97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,8 +22,12 @@ #ifdef _ASSERT_H -#undef _ASSERT_H -#undef assert +# undef _ASSERT_H +# undef assert + +# ifdef __USE_GNU +# undef assert_perror +# endif #endif /* assert.h */ @@ -37,7 +41,7 @@ #ifdef NDEBUG -#define assert(expr) ((void) 0) +# define assert(expr) ((void) 0) /* void assert_perror (int errnum); @@ -45,14 +49,12 @@ error message with the error text for ERRNUM and abort. (This is a GNU extension.) */ -#ifdef __USE_GNU -#define assert_perror(errnum) ((void) 0) -#endif +# ifdef __USE_GNU +# define assert_perror(errnum) ((void) 0) +# endif #else /* Not NDEBUG. */ -#include - __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ @@ -71,27 +73,27 @@ extern void __assert_perror_fail __P ((i __END_DECLS -#define assert(expr) \ - ((void) ((expr) || \ +# define assert(expr) \ + ((void) ((expr) ? 0 : \ (__assert_fail (__STRING(expr), \ __FILE__, __LINE__, __ASSERT_FUNCTION), 0))) -#ifdef __USE_GNU -#define assert_perror(errnum) \ - ((void) ((errnum) && (__assert_perror_fail ((errnum), \ - __FILE__, __LINE__, \ - __ASSERT_FUNCTION), 0))) -#endif +# ifdef __USE_GNU +# define assert_perror(errnum) \ + ((void) ((errnum) ? 0 : (__assert_perror_fail ((errnum), \ + __FILE__, __LINE__, \ + __ASSERT_FUNCTION), 0))) +# endif /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. This is broken in G++ before version 2.6. */ -#if (!defined (__GNUC__) || __GNUC__ < 2 || \ - __GNUC_MINOR__ < (defined (__cplusplus) ? 6 : 4)) -#define __ASSERT_FUNCTION ((__const char *) 0) -#else -#define __ASSERT_FUNCTION __PRETTY_FUNCTION__ -#endif +# if (!defined __GNUC__ || __GNUC__ < 2 || \ + __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4)) +# define __ASSERT_FUNCTION ((__const char *) 0) +# else +# define __ASSERT_FUNCTION __PRETTY_FUNCTION__ +# endif #endif /* NDEBUG. */ diff -durpN glibc-2.0.4/catgets/gencat.c glibc-2.0.5/catgets/gencat.c --- glibc-2.0.4/catgets/gencat.c Wed Jan 22 00:25:14 1997 +++ glibc-2.0.5/catgets/gencat.c Thu Aug 14 22:10:13 1997 @@ -213,7 +213,7 @@ usage (int status) Usage: %s [OPTION]... -o OUTPUT-FILE [INPUT-FILE]...\n\ %s [OPTION]... [OUTPUT-FILE [INPUT-FILE]...]\n\ Mandatory arguments to long options are mandatory for short options too.\n\ - -H, --header create C header file containing symbol definitions\n\ + -H, --header=NAME create C header file NAME containing symbol definitions\n\ -h, --help display this help and exit\n\ --new do not use existing catalog, force new output file\n\ -o, --output=NAME write output to file NAME\n\ diff -durpN glibc-2.0.4/configure glibc-2.0.5/configure --- glibc-2.0.4/configure Mon May 26 17:21:00 1997 +++ glibc-2.0.5/configure Mon Aug 4 21:08:42 1997 @@ -1930,7 +1930,7 @@ __throw () {} EOF if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles -Wl,--no-whole-archive - -o conftest conftest.c'; { (eval echo configure:1934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c 1>&5'; { (eval echo configure:1934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_ld_no_whole_archive=yes else libc_cv_ld_no_whole_archive=no @@ -1952,7 +1952,7 @@ __throw () {} EOF if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles -fno-exceptions - -o conftest conftest.c'; { (eval echo configure:1956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c 1>&5'; { (eval echo configure:1956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_no_exceptions=yes else libc_cv_gcc_no_exceptions=no diff -durpN glibc-2.0.4/configure.in glibc-2.0.5/configure.in --- glibc-2.0.4/configure.in Mon May 26 17:18:36 1997 +++ glibc-2.0.5/configure.in Mon Aug 4 18:35:21 1997 @@ -604,7 +604,7 @@ EOF dnl No \ in command here because it ends up inside ''. if AC_TRY_COMMAND([${CC-cc} $CFLAGS -nostdlib -nostartfiles -Wl,--no-whole-archive - -o conftest conftest.c]); then + -o conftest conftest.c 1>&AC_FD_CC]); then libc_cv_ld_no_whole_archive=yes else libc_cv_ld_no_whole_archive=no @@ -621,7 +621,7 @@ EOF dnl No \ in command here because it ends up inside ''. if AC_TRY_COMMAND([${CC-cc} $CFLAGS -nostdlib -nostartfiles -fno-exceptions - -o conftest conftest.c]); then + -o conftest conftest.c 1>&AC_FD_CC]); then libc_cv_gcc_no_exceptions=yes else libc_cv_gcc_no_exceptions=no diff -durpN glibc-2.0.4/gmon/gmon.c glibc-2.0.5/gmon/gmon.c --- glibc-2.0.4/gmon/gmon.c Sat May 24 21:24:46 1997 +++ glibc-2.0.5/gmon/gmon.c Wed Aug 6 07:36:50 1997 @@ -63,6 +63,7 @@ void moncontrol __P ((int mode)); static void write_hist __P ((int fd)); static void write_call_graph __P ((int fd)); static void write_bb_counts __P ((int fd)); +static void write_gmon __P ((void)); /* * Control profiling @@ -289,13 +290,12 @@ write_bb_counts (fd) } -void -_mcleanup () +static void +write_gmon () { struct gmon_hdr ghdr __attribute__ ((aligned (__alignof__ (int)))); int fd; - moncontrol (0); fd = __open ("gmon.out", O_CREAT|O_TRUNC|O_WRONLY, 0666); if (fd < 0) { @@ -319,6 +319,25 @@ _mcleanup () write_bb_counts (fd); __close (fd); +} + +void +__write_profiling () +{ + int save = _gmonparam.state; + _gmonparam.state = GMON_PROF_OFF; + if (save == GMON_PROF_ON) + write_gmon (); + _gmonparam.state = save; +} +weak_alias (__write_profiling, write_profiling) + +void +_mcleanup () +{ + moncontrol (0); + + write_gmon (); /* free the memory. */ free (_gmonparam.tos); diff -durpN glibc-2.0.4/gmon/sys/gmon.h glibc-2.0.5/gmon/sys/gmon.h --- glibc-2.0.4/gmon/sys/gmon.h Thu Mar 20 14:19:20 1997 +++ glibc-2.0.5/gmon/sys/gmon.h Tue Aug 5 20:41:24 1997 @@ -174,6 +174,10 @@ void monstartup __P ((u_long lowpc, u_lo /* Clean up profiling and write out gmon.out. */ void _mcleanup __P ((void)); +/* Write current profiling data to file. */ +void __write_profiling __P ((void)); +void write_profiling __P ((void)); + __END_DECLS #endif /* !_SYS_GMON_H_ */ diff -durpN glibc-2.0.4/hurd/hurdsig.c glibc-2.0.5/hurd/hurdsig.c --- glibc-2.0.4/hurd/hurdsig.c Tue May 13 16:32:03 1997 +++ glibc-2.0.5/hurd/hurdsig.c Wed Jul 2 07:34:54 1997 @@ -22,6 +22,7 @@ #include #include /* For `struct mutex'. */ #include +#include #include "hurdfault.h" #include "hurdmalloc.h" /* XXX */ @@ -1236,6 +1237,16 @@ reauth_proc (mach_port_t new) && ignore != MACH_PORT_NULL) __mach_port_deallocate (__mach_task_self (), ignore); __mach_port_destroy (__mach_task_self (), ref); + + /* Set the owner of the process here too. */ + mutex_lock (&_hurd_id.lock); + if (!_hurd_check_ids ()) + HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC], + __proc_setowner (port, + (_hurd_id.gen.nuids + ? _hurd_id.gen.uids[0] : 0), + !_hurd_id.gen.nuids)); + mutex_unlock (&_hurd_id.lock); (void) &reauth_proc; /* Silence compiler warning. */ } diff -durpN glibc-2.0.4/inet/arpa/tftp.h glibc-2.0.5/inet/arpa/tftp.h --- glibc-2.0.4/inet/arpa/tftp.h Sun Jul 31 14:40:19 1994 +++ glibc-2.0.5/inet/arpa/tftp.h Mon Aug 4 18:26:58 1997 @@ -33,8 +33,8 @@ * @(#)tftp.h 8.1 (Berkeley) 6/2/93 */ -#ifndef _TFTP_H_ -#define _TFTP_H_ +#ifndef _ARPA_TFTP_H +#define _ARPA_TFTP_H 1 /* * Trivial File Transfer Protocol (IEN-133) @@ -44,20 +44,20 @@ /* * Packet types. */ -#define RRQ 01 /* read request */ -#define WRQ 02 /* write request */ -#define DATA 03 /* data packet */ -#define ACK 04 /* acknowledgement */ -#define ERROR 05 /* error code */ +#define RRQ 01 /* read request */ +#define WRQ 02 /* write request */ +#define DATA 03 /* data packet */ +#define ACK 04 /* acknowledgement */ +#define ERROR 05 /* error code */ struct tftphdr { - short th_opcode; /* packet type */ + short th_opcode; /* packet type */ union { - short tu_block; /* block # */ - short tu_code; /* error code */ - char tu_stuff[1]; /* request packet stuff */ + unsigned short tu_block; /* block # */ + short tu_code; /* error code */ + char tu_stuff[1]; /* request packet stuff */ } th_u; - char th_data[1]; /* data or error string */ + char th_data[1]; /* data or error string */ }; #define th_block th_u.tu_block @@ -77,4 +77,4 @@ struct tftphdr { #define EEXISTS 6 /* file already exists */ #define ENOUSER 7 /* no such user */ -#endif /* !_TFTP_H_ */ +#endif /* arpa/tftp.h */ diff -durpN glibc-2.0.4/inet/inet_ntoa.c glibc-2.0.5/inet/inet_ntoa.c --- glibc-2.0.4/inet/inet_ntoa.c Sun Jul 31 14:53:43 1994 +++ glibc-2.0.5/inet/inet_ntoa.c Thu Aug 7 15:46:45 1997 @@ -1,59 +1,97 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ +/* Convert Inet number to ASCII representation. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -/* - * Convert network-format internet address - * to base 256 d.d.d.d representation. - */ -#include -#include -#include #include +#include +#include +#include + +/* The interface of this function is completely stupid, it requires a + static buffer. We relax this a bit in that we allow at least one + buffer for each thread. */ + +/* This is the key for the thread specific memory. */ +static __libc_key_t key; + +/* If nonzero the key allocation failed and we should better use a + static buffer than fail. */ +static char local_buf[18]; +static char *static_buf; + +/* Destructor for the thread-specific data. */ +static void init (void); +static void free_key_mem (void *mem); + char * -inet_ntoa(in) - struct in_addr in; +inet_ntoa (struct in_addr in) { - static char b[18]; - register char *p; + __libc_once_define (static, once); + char *buffer; + unsigned char *bytes; - p = (char *)∈ -#define UC(b) (((int)b)&0xff) - (void)snprintf(b, sizeof(b), - "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3])); - return (b); + /* If we have not yet initialized the buffer do it now. */ + __libc_once (once, init); + + if (static_buf != NULL) + buffer = static_buf; + else + { + /* We don't use the static buffer and so we have a key. Use it + to get the thread-specific buffer. */ + buffer = __libc_getspecific (key); + if (buffer == NULL) + { + /* No buffer allocated so far. */ + buffer = malloc (18); + if (buffer == NULL) + /* No more memory available. We use the static buffer. */ + buffer = local_buf; + else + __libc_setspecific (key, buffer); + } + } + + bytes = (unsigned char *) ∈ + snprintf (buffer, 18, "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]); + + return buffer; +} + + +/* Initialize buffer. */ +static void +init (void) +{ + if (__libc_key_create (&key, free_key_mem)) + /* Creating the key failed. This means something really went + wrong. In any case use a static buffer which is better than + nothing. */ + static_buf = local_buf; +} + + +/* free the thread specific data, this is done if a thread terminates. */ +static void +free_key_mem (void *mem) +{ + free (mem); + __libc_setspecific (key, NULL); } diff -durpN glibc-2.0.4/inet/rcmd.c glibc-2.0.5/inet/rcmd.c --- glibc-2.0.4/inet/rcmd.c Thu Apr 17 15:44:57 1997 +++ glibc-2.0.5/inet/rcmd.c Mon Aug 4 18:55:34 1997 @@ -105,7 +105,7 @@ rcmd(ahost, rport, locuser, remuser, cmd else (void)fprintf(stderr, "rcmd: socket: %m\n"); sigsetmask(oldmask); - return (-1); + return -1; } fcntl(s, F_SETOWN, pid); sin.sin_family = hp->h_addrtype; @@ -140,7 +140,7 @@ rcmd(ahost, rport, locuser, remuser, cmd } (void)fprintf(stderr, "%s: %m\n", hp->h_name); sigsetmask(oldmask); - return (-1); + return -1; } lport--; if (fd2p == 0) { @@ -149,7 +149,7 @@ rcmd(ahost, rport, locuser, remuser, cmd } else { char num[8]; int s2 = rresvport(&lport), s3; - int len = sizeof(from); + size_t len = sizeof(from); if (s2 < 0) goto bad; @@ -211,14 +211,14 @@ rcmd(ahost, rport, locuser, remuser, cmd goto bad2; } sigsetmask(oldmask); - return (s); + return s; bad2: if (lport) (void)close(*fd2p); bad: (void)close(s); sigsetmask(oldmask); - return (-1); + return -1; } int @@ -232,20 +232,20 @@ rresvport(alport) sin.sin_addr.s_addr = INADDR_ANY; s = socket(AF_INET, SOCK_STREAM, 0); if (s < 0) - return (-1); + return -1; for (;;) { sin.sin_port = htons((u_short)*alport); if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) - return (s); + return s; if (errno != EADDRINUSE) { (void)close(s); - return (-1); + return -1; } (*alport)--; if (*alport == IPPORT_RESERVED/2) { (void)close(s); __set_errno (EAGAIN); /* close */ - return (-1); + return -1; } } } @@ -282,9 +282,9 @@ ruserok(rhost, superuser, ruser, luser) for (ap = hp->h_addr_list; *ap; ++ap) { bcopy(*ap, &addr, sizeof(addr)); if (iruserok(addr, superuser, ruser, luser) == 0) - return (0); + return 0; } - return (-1); + return -1; } /* @@ -314,7 +314,7 @@ again: if (hostf) { if (__ivaliduser(hostf, raddr, luser, ruser) == 0) { (void)fclose(hostf); - return (0); + return 0; } (void)fclose(hostf); } @@ -349,7 +349,7 @@ again: } if (hostf == NULL) - return (-1); + return -1; /* * If not a regular file, or is owned by someone other than * user or root or if writeable by anyone but the owner, quit. @@ -369,11 +369,11 @@ again: if (cp) { __rcmd_errstr = cp; (void)fclose(hostf); - return (-1); + return -1; } goto again; } - return (-1); + return -1; } /* @@ -415,11 +415,11 @@ __ivaliduser(hostf, raddr, luser, ruser) if (__icheckhost(raddr, buf) && strcmp(ruser, *user ? user : luser) == 0) { free (buf); - return (0); + return 0; } } free (buf); - return (-1); + return -1; } /* @@ -430,7 +430,7 @@ __icheckhost(raddr, lhost) u_int32_t raddr; register char *lhost; { - register struct hostent hostbuf, *hp; + struct hostent hostbuf, *hp; size_t buflen; char *buffer; register u_int32_t laddr; @@ -439,7 +439,7 @@ __icheckhost(raddr, lhost) /* Try for raw ip address first. */ if (isdigit(*lhost) && (int32_t)(laddr = inet_addr(lhost)) != -1) - return (raddr == laddr); + return raddr == laddr; /* Better be a hostname. */ buflen = 1024; @@ -452,14 +452,14 @@ __icheckhost(raddr, lhost) { /* Enlarge the buffer. */ buflen *= 2; - buflen = __alloca (buflen); + buffer = __alloca (buflen); } /* Spin through ip addresses. */ for (pp = hp->h_addr_list; *pp; ++pp) if (!bcmp(&raddr, *pp, sizeof(u_int32_t))) - return (1); + return 1; /* No match. */ - return (0); + return 0; } diff -durpN glibc-2.0.4/io/lockf.c glibc-2.0.5/io/lockf.c --- glibc-2.0.4/io/lockf.c Thu Sep 26 23:21:12 1996 +++ glibc-2.0.5/io/lockf.c Mon Aug 4 19:13:50 1997 @@ -1,25 +1,26 @@ -/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include #include #include +#include /* lockf is a simplified interface to fcntl's locking facilities. */ @@ -27,6 +28,8 @@ int lockf (int fd, int cmd, off_t len) { struct flock fl; + + memset ((char *) &fl, '\0', sizeof (fl)); switch (cmd) { diff -durpN glibc-2.0.4/libio/_G_config.h glibc-2.0.5/libio/_G_config.h --- glibc-2.0.4/libio/_G_config.h Fri Feb 14 21:32:30 1997 +++ glibc-2.0.5/libio/_G_config.h Wed Dec 31 19:00:00 1969 @@ -1,65 +0,0 @@ -/* This file is needed by libio to define various configuration parameters. - These are always the same in the GNU C library. */ - -#ifndef _G_config_h -#define _G_config_h 1 - -/* Define types for libio in terms of the standard internal type names. */ - -#include -#define __need_size_t -#define __need_wint_t -#include -#ifndef _WINT_T -/* Integral type unchanged by default argument promotions that can - hold any value corresponding to members of the extended character - set, as well as at least one value that does not correspond to any - member of the extended character set. */ -#define _WINT_T -typedef unsigned int wint_t; -#endif -#define _G_size_t size_t -#define _G_fpos_t __off_t -#define _G_ssize_t __ssize_t -#define _G_off_t __off_t -#define _G_pid_t __pid_t -#define _G_uid_t __uid_t -#define _G_wint_t wint_t - -typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); -typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); -typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); -typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); - -#define _G_HAVE_BOOL 1 - - -/* These library features are always available in the GNU C library. */ -#define _G_HAVE_ATEXIT 1 -#define _G_HAVE_SYS_CDEFS 1 -#define _G_HAVE_SYS_WAIT 1 -#define _G_NEED_STDARG_H 1 -#define _G_va_list __gnuc_va_list - -#define _G_HAVE_PRINTF_FP 1 -#define _G_HAVE_MMAP 1 -#define _G_HAVE_LONG_DOUBLE_IO 1 - -/* This is defined by if `st_blksize' exists. */ -#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) - -#define _G_BUFSIZ 8192 - -/* These are the vtbl details for ELF. */ -#define _G_NAMES_HAVE_UNDERSCORE 0 -#define _G_VTABLE_LABEL_PREFIX "_vt." -#define _G_VTABLE_LABEL_HAS_LENGTH 1 - - -#if defined (__cplusplus) || defined (__STDC__) -#define _G_ARGS(ARGLIST) ARGLIST -#else -#define _G_ARGS(ARGLIST) () -#endif - -#endif /* _G_config.h */ diff -durpN glibc-2.0.4/libio/fileops.c glibc-2.0.5/libio/fileops.c --- glibc-2.0.4/libio/fileops.c Sat Apr 5 19:43:44 1997 +++ glibc-2.0.5/libio/fileops.c Mon Aug 4 19:17:04 1997 @@ -291,6 +291,15 @@ DEFUN(_IO_file_underflow, (fp), _IO_switch_to_get_mode(fp); + /* This is very tricky. We have to adjust those + pointers before we call _IO_SYSREAD () since + we may longjump () out while waiting for + input. Those pointers may be screwed up. H.J. */ + fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base; + fp->_IO_read_end = fp->_IO_buf_base; + fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end + = fp->_IO_buf_base; + count = _IO_SYSREAD (fp, fp->_IO_buf_base, fp->_IO_buf_end - fp->_IO_buf_base); if (count <= 0) @@ -300,10 +309,7 @@ DEFUN(_IO_file_underflow, (fp), else fp->_flags |= _IO_ERR_SEEN, count = 0; } - fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base; - fp->_IO_read_end = fp->_IO_buf_base + count; - fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end - = fp->_IO_buf_base; + fp->_IO_read_end += count; if (count == 0) return EOF; if (fp->_offset != _IO_pos_BAD) diff -durpN glibc-2.0.4/libio/libio.h glibc-2.0.5/libio/libio.h --- glibc-2.0.4/libio/libio.h Sun Feb 2 22:17:25 1997 +++ glibc-2.0.5/libio/libio.h Mon Aug 4 17:57:47 1997 @@ -127,6 +127,7 @@ the executable file might be covered by #define _IO_CURRENTLY_PUTTING 0x800 #define _IO_IS_APPENDING 0x1000 #define _IO_IS_FILEBUF 0x2000 +#define _IO_BAD_SEEN 0x4000 /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 @@ -145,6 +146,7 @@ the executable file might be covered by #define _IO_UNITBUF 020000 #define _IO_STDIO 040000 #define _IO_DONT_CLOSE 0100000 +#define _IO_BOOLALPHA 0200000 struct _IO_jump_t; struct _IO_FILE; diff -durpN glibc-2.0.4/libio/stdfiles.c glibc-2.0.5/libio/stdfiles.c --- glibc-2.0.4/libio/stdfiles.c Mon Jan 6 17:05:14 1997 +++ glibc-2.0.5/libio/stdfiles.c Thu Aug 7 20:15:00 1997 @@ -48,3 +48,10 @@ DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_ _IO_NO_READS+_IO_UNBUFFERED); _IO_FILE *_IO_list_all = &_IO_stderr_.file; + +#ifdef _G_USING_THUNKS +#if defined(__GNUC__) && __GNUC__ >= 2 +const +#endif +int _libio_using_thunks = 1; +#endif diff -durpN glibc-2.0.4/libio/stdio.h glibc-2.0.5/libio/stdio.h --- glibc-2.0.4/libio/stdio.h Wed Jan 29 23:08:23 1997 +++ glibc-2.0.5/libio/stdio.h Wed Aug 20 21:56:37 1997 @@ -192,15 +192,17 @@ extern char *ctermid __P ((char *__buf)) extern char *cuserid __P ((char * __buf)); #endif -#ifdef __USE_GNU -extern _IO_ssize_t getdelim __P ((char **, size_t *, int, FILE*)); -extern _IO_ssize_t getline __P ((char **, size_t *, FILE *)); -extern _IO_ssize_t __getline __P ((char **, size_t *, FILE *)); - +#if defined __USE_BSD extern int snprintf __P ((char *, size_t, __const char *, ...)); extern int __snprintf __P ((char *, size_t, __const char *, ...)); extern int vsnprintf __P ((char *, size_t, __const char *, _G_va_list)); extern int __vsnprintf __P ((char *, size_t, __const char *, _G_va_list)); +#endif + +#ifdef __USE_GNU +extern _IO_ssize_t getdelim __P ((char **, size_t *, int, FILE*)); +extern _IO_ssize_t getline __P ((char **, size_t *, FILE *)); +extern _IO_ssize_t __getline __P ((char **, size_t *, FILE *)); extern int asprintf __P ((char **, const char *, ...)); extern int vasprintf __P ((char **, const char *, _G_va_list)); diff -durpN glibc-2.0.4/libio/strops.c glibc-2.0.5/libio/strops.c --- glibc-2.0.4/libio/strops.c Wed Mar 5 16:17:20 1997 +++ glibc-2.0.5/libio/strops.c Mon Aug 4 19:16:19 1997 @@ -88,7 +88,7 @@ DEFUN(_IO_str_init_static, (fp, ptr, siz if (pstart) { fp->_IO_write_ptr = pstart; - fp->_IO_write_end = ptr+size; + fp->_IO_write_end = ptr + size; fp->_IO_read_end = pstart; } else @@ -193,7 +193,7 @@ _IO_ssize_t DEFUN(_IO_str_count, (fp), register _IO_FILE *fp) { - return (fp->_IO_write_ptr > fp->_IO_read_end ? fp->_IO_write_ptr + return (fp->_IO_write_end > fp->_IO_read_end ? fp->_IO_write_end : fp->_IO_read_end) - fp->_IO_read_base; } diff -durpN glibc-2.0.4/locale/iso-4217.def glibc-2.0.5/locale/iso-4217.def --- glibc-2.0.4/locale/iso-4217.def Thu Dec 19 20:32:22 1996 +++ glibc-2.0.5/locale/iso-4217.def Sat Aug 23 18:47:47 1997 @@ -1,171 +1,185 @@ /* - * Defines the valid international currency symbols according to ISO-4217. + * Defines the valid international currency symbols according to ISO 4217. * This is used in monetary.c(monetary_check). * * If you find something missing or wrong contact * * !!! The list has to be sorted !!! */ -DEFINE_INT_CURR("AED ") /* United Arab Emirates */ -DEFINE_INT_CURR("AFA ") /* Afghanistan */ -DEFINE_INT_CURR("ALL ") /* Albania */ +DEFINE_INT_CURR("ADP ") /* Andorran Peseta */ +DEFINE_INT_CURR("AED ") /* United Arab Emirates Dirham */ +DEFINE_INT_CURR("AFA ") /* Afghanistan Afgani */ +DEFINE_INT_CURR("ALL ") /* Albanian Lek */ +DEFINE_INT_CURR("AMD ") /* Armenia Dram */ DEFINE_INT_CURR("ANG ") /* Netherlands Antilles */ -DEFINE_INT_CURR("AOK ") /* Angola */ -DEFINE_INT_CURR("ARP ") /* Argentina */ -DEFINE_INT_CURR("ATS ") /* Austria */ -DEFINE_INT_CURR("AUD ") /* Australia */ -DEFINE_INT_CURR("BBD ") /* Barbados */ -DEFINE_INT_CURR("BDT ") /* Bangladesh */ -DEFINE_INT_CURR("BEF ") /* Belgium */ -DEFINE_INT_CURR("BGL ") /* Bulgaria */ -DEFINE_INT_CURR("BHD ") /* Bahrain */ +DEFINE_INT_CURR("AOK ") /* Angolan Kwanza */ +DEFINE_INT_CURR("ARP ") /* Argentine Peso */ +DEFINE_INT_CURR("ATS ") /* Austrian Schilling */ +DEFINE_INT_CURR("AUD ") /* Australian Dollar */ +DEFINE_INT_CURR("AZM ") /* Azerbaijan Manat */ +DEFINE_INT_CURR("BBD ") /* Barbados Dollar */ +DEFINE_INT_CURR("BDT ") /* Bangladesh Taka */ +DEFINE_INT_CURR("BEF ") /* Belgian Franc */ +DEFINE_INT_CURR("BGL ") /* Bulgarian Lev */ +DEFINE_INT_CURR("BHD ") /* Bahraini Dinar */ DEFINE_INT_CURR("BIF ") /* Burundi */ -DEFINE_INT_CURR("BMD ") /* Burmuda */ -DEFINE_INT_CURR("BND ") /* Brunei */ -DEFINE_INT_CURR("BOP ") /* Bolivia */ -DEFINE_INT_CURR("BRC ") /* Brazil */ -DEFINE_INT_CURR("BSD ") /* Bahamas */ +DEFINE_INT_CURR("BMD ") /* Burmudian Dollar */ +DEFINE_INT_CURR("BND ") /* Brunei Dollar */ +DEFINE_INT_CURR("BOP ") /* Bolivian Boliviano */ +DEFINE_INT_CURR("BPS ") /* Canton and Enderbury Islands */ +DEFINE_INT_CURR("BRC ") /* Brazil Real */ +DEFINE_INT_CURR("BSD ") /* Bahamas Dollar */ +DEFINE_INT_CURR("BTN ") /* Bhutan Ngultrum */ DEFINE_INT_CURR("BUK ") /* Burma */ -DEFINE_INT_CURR("BWP ") /* Botswana */ -DEFINE_INT_CURR("BZD ") /* Belize */ -DEFINE_INT_CURR("CAD ") /* Canada */ -DEFINE_INT_CURR("CHF ") /* Switzerland, Liechtenstein */ -DEFINE_INT_CURR("CLP ") /* Chile */ -DEFINE_INT_CURR("CNY ") /* China */ -DEFINE_INT_CURR("COP ") /* Colombia */ -DEFINE_INT_CURR("CRC ") /* Costa Rica */ -DEFINE_INT_CURR("CSK ") /* Czechoslovakia */ -DEFINE_INT_CURR("CUP ") /* Cuba */ -DEFINE_INT_CURR("CVE ") /* Cape Verde */ -DEFINE_INT_CURR("CYP ") /* Cyprus */ -DEFINE_INT_CURR("DEM ") /* Germany */ -DEFINE_INT_CURR("DJF ") /* Djibouti */ -DEFINE_INT_CURR("DKK ") /* Denmark */ +DEFINE_INT_CURR("BWP ") /* Botswana Pula */ +DEFINE_INT_CURR("BZD ") /* Belize Dollar */ +DEFINE_INT_CURR("CAD ") /* Canadian Dollar */ +DEFINE_INT_CURR("CFP ") /* French Pacific Island Franc */ +DEFINE_INT_CURR("CHF ") /* Swiss Franc (Liechtenstein) */ +DEFINE_INT_CURR("CLP ") /* Chilean Peso */ +DEFINE_INT_CURR("CNY ") /* China Renminbi */ +DEFINE_INT_CURR("COP ") /* Colombian Peso */ +DEFINE_INT_CURR("CRC ") /* Costa Rican Colon */ +DEFINE_INT_CURR("CUP ") /* Cuban Peso */ +DEFINE_INT_CURR("CVE ") /* Cape Verde Escudo */ +DEFINE_INT_CURR("CYP ") /* Cypriot Pound */ +DEFINE_INT_CURR("CZK ") /* Czech Koruna */ +DEFINE_INT_CURR("DEM ") /* German Mark */ +DEFINE_INT_CURR("DJF ") /* Djibouti Franc */ +DEFINE_INT_CURR("DKK ") /* Danish Krone (Faroe Islands) */ DEFINE_INT_CURR("DOP ") /* Dominican Republic */ -DEFINE_INT_CURR("DZD ") /* Algeria */ -DEFINE_INT_CURR("ECS ") /* Ecuador */ -DEFINE_INT_CURR("EEK ") /* Estonia */ -DEFINE_INT_CURR("EGP ") /* Egypt */ -DEFINE_INT_CURR("ESP ") /* Spain */ -DEFINE_INT_CURR("ETB ") /* Ethiopia */ -DEFINE_INT_CURR("FIM ") /* Finland */ -DEFINE_INT_CURR("FJD ") /* Fiji */ -DEFINE_INT_CURR("FKP ") /* Falkland Islands (Malvinas) */ -DEFINE_INT_CURR("FRF ") /* France */ -DEFINE_INT_CURR("GBP ") /* Great Britain */ -DEFINE_INT_CURR("GHC ") /* Ghana */ -DEFINE_INT_CURR("GIP ") /* Gibraltar */ -DEFINE_INT_CURR("GMD ") /* Gambia */ -DEFINE_INT_CURR("GNS ") /* Guinea */ +DEFINE_INT_CURR("DZD ") /* Algerian Dinar */ +DEFINE_INT_CURR("ECS ") /* Ecuadoran Sucre */ +DEFINE_INT_CURR("EEK ") /* Estonian Kroon */ +DEFINE_INT_CURR("EGP ") /* Egyptian Pound */ +DEFINE_INT_CURR("ESP ") /* Spanish Peseta */ +DEFINE_INT_CURR("ETB ") /* Ethiopian Birr */ +DEFINE_INT_CURR("FIM ") /* Finnish Markka */ +DEFINE_INT_CURR("FJD ") /* Fiji Dollar */ +DEFINE_INT_CURR("FKP ") /* Falkland Islands Pound (Malvinas) */ +DEFINE_INT_CURR("FRF ") /* French Franc */ +DEFINE_INT_CURR("GBP ") /* British Pound */ +DEFINE_INT_CURR("GEK ") /* Georgia Lari */ +DEFINE_INT_CURR("GHC ") /* Ghana Cedi */ +DEFINE_INT_CURR("GIP ") /* Gibraltar Pound */ +DEFINE_INT_CURR("GMD ") /* Gambian Dalasi */ +DEFINE_INT_CURR("GNS ") /* Guinea Franc */ DEFINE_INT_CURR("GQE ") /* Equatorial Guinea */ -DEFINE_INT_CURR("GRD ") /* Greece */ -DEFINE_INT_CURR("GTQ ") /* Guatemala */ -DEFINE_INT_CURR("GWP ") /* Guinea-Bissau */ -DEFINE_INT_CURR("GYD ") /* Guyana */ -DEFINE_INT_CURR("HKD ") /* Hong Kong */ -DEFINE_INT_CURR("HNL ") /* Honduras */ -DEFINE_INT_CURR("HRD ") /* Croatia */ -DEFINE_INT_CURR("HTG ") /* Haiti */ -DEFINE_INT_CURR("HUF ") /* Hungary */ -DEFINE_INT_CURR("IDR ") /* Indonesia */ -DEFINE_INT_CURR("IEP ") /* Ireland */ -DEFINE_INT_CURR("ILS ") /* Israel */ -DEFINE_INT_CURR("INR ") /* India, Bhutan */ -DEFINE_INT_CURR("IQD ") /* Iraq */ -DEFINE_INT_CURR("IRR ") /* Iran */ -DEFINE_INT_CURR("ISK ") /* Iceland */ -DEFINE_INT_CURR("ITL ") /* Italy */ -DEFINE_INT_CURR("JMD ") /* Jamaica */ -DEFINE_INT_CURR("JOD ") /* Jordan */ -DEFINE_INT_CURR("JPY ") /* Japan */ -DEFINE_INT_CURR("KES ") /* Kenya */ +DEFINE_INT_CURR("GRD ") /* Greek Drachma */ +DEFINE_INT_CURR("GTQ ") /* Guatemala Quetzal */ +DEFINE_INT_CURR("GWP ") /* Guinea-Bissau Peso */ +DEFINE_INT_CURR("GYD ") /* Guyana Dollar */ +DEFINE_INT_CURR("HKD ") /* Hong Kong Dollar */ +DEFINE_INT_CURR("HNL ") /* Honduras Lempira */ +DEFINE_INT_CURR("HRK ") /* Croatia Kuna */ +DEFINE_INT_CURR("HTG ") /* Haiti Gourde */ +DEFINE_INT_CURR("HUF ") /* Hungarian Forint */ +DEFINE_INT_CURR("IDR ") /* Indonesia Rupiah */ +DEFINE_INT_CURR("IEP ") /* Irish Punt */ +DEFINE_INT_CURR("ILS ") /* Israeli Shekel */ +DEFINE_INT_CURR("INR ") /* Indian Rupee (Bhutan) */ +DEFINE_INT_CURR("IQD ") /* Iraqi Dinar */ +DEFINE_INT_CURR("IRR ") /* Iranian Rial */ +DEFINE_INT_CURR("ISK ") /* Iceland Krona */ +DEFINE_INT_CURR("ITL ") /* Italian Lira (San Marino, Vatican City) */ +DEFINE_INT_CURR("JMD ") /* Jamaica Dollar */ +DEFINE_INT_CURR("JOD ") /* Jordanian Dollar */ +DEFINE_INT_CURR("JPY ") /* Japanese Yen */ +DEFINE_INT_CURR("KES ") /* Kenyan Shilling */ +DEFINE_INT_CURR("KGS ") /* Kyrgyzstan Som */ DEFINE_INT_CURR("KHR ") /* Democratic Kampuchea */ -DEFINE_INT_CURR("KMF ") /* Comoros */ +DEFINE_INT_CURR("KMF ") /* Comoros Franc */ DEFINE_INT_CURR("KPW ") /* Democratic People's of Korea */ -DEFINE_INT_CURR("KRW ") /* Republic of Korea */ -DEFINE_INT_CURR("KWD ") /* Kuwait */ +DEFINE_INT_CURR("KRW ") /* Republic of Korea Won */ +DEFINE_INT_CURR("KWD ") /* Kuwaiti Dinar */ DEFINE_INT_CURR("KYD ") /* Cayman Islands */ -DEFINE_INT_CURR("LAK ") /* Lao People's Democratic Republic */ -DEFINE_INT_CURR("LBP ") /* Lebanon */ -DEFINE_INT_CURR("LKR ") /* Sri Lanka */ -DEFINE_INT_CURR("LRD ") /* Liberia */ -DEFINE_INT_CURR("LSM ") /* Lesotho */ -DEFINE_INT_CURR("LTL ") /* Lithuania */ -DEFINE_INT_CURR("LUF ") /* Luxembourg */ -DEFINE_INT_CURR("LVL ") /* Latvia */ -DEFINE_INT_CURR("LYD ") /* Libyan Arab Jamahiriya */ -DEFINE_INT_CURR("MAD ") /* Morocco */ +DEFINE_INT_CURR("KZT ") /* Kazakhstan Tenge */ +DEFINE_INT_CURR("LAK ") /* Lao People's Democratic Republic New Kip */ +DEFINE_INT_CURR("LBP ") /* Lebanese Pound */ +DEFINE_INT_CURR("LKR ") /* Sri Lankan Rupee */ +DEFINE_INT_CURR("LRD ") /* Liberian Dollar */ +DEFINE_INT_CURR("LSM ") /* Lesotho Loti */ +DEFINE_INT_CURR("LTL ") /* Lithuanian Lit */ +DEFINE_INT_CURR("LUF ") /* Luxembourg Franc */ +DEFINE_INT_CURR("LVL ") /* Latvia Lat */ +DEFINE_INT_CURR("LYD ") /* Libyan Arab Jamahiriya Dinar */ +DEFINE_INT_CURR("MAD ") /* Moroccan Dirham */ +DEFINE_INT_CURR("MDL ") /* Moldova Lei */ DEFINE_INT_CURR("MGF ") /* Madagascar */ DEFINE_INT_CURR("MLF ") /* Mali */ -DEFINE_INT_CURR("MNT ") /* Mongolia */ -DEFINE_INT_CURR("MOP ") /* Macau */ -DEFINE_INT_CURR("MRO ") /* Mauritania */ -DEFINE_INT_CURR("MTP ") /* Malta */ -DEFINE_INT_CURR("MUR ") /* Mauritius */ +DEFINE_INT_CURR("MMK ") /* Myanmar Kyat */ +DEFINE_INT_CURR("MNT ") /* Mongolia Tugrik */ +DEFINE_INT_CURR("MOP ") /* Macau Pataca */ +DEFINE_INT_CURR("MRO ") /* Mauritania Ouguiya */ +DEFINE_INT_CURR("MTP ") /* Maltese Lira */ +DEFINE_INT_CURR("MUR ") /* Mauritius Rupee */ DEFINE_INT_CURR("MVR ") /* Maldives */ -DEFINE_INT_CURR("MWK ") /* Malawi */ -DEFINE_INT_CURR("MXP ") /* Mexico */ -DEFINE_INT_CURR("MYR ") /* Malaysia */ -DEFINE_INT_CURR("MZM ") /* Mozambique */ -DEFINE_INT_CURR("NGN ") /* Nigeria */ -DEFINE_INT_CURR("NIC ") /* Nicaragua */ -DEFINE_INT_CURR("NLG ") /* Netherlands */ -DEFINE_INT_CURR("NOK ") /* Norway */ +DEFINE_INT_CURR("MWK ") /* Malawi Kwacha */ +DEFINE_INT_CURR("MXP ") /* Mexican Peso */ +DEFINE_INT_CURR("MYR ") /* Malaysian Ringgit */ +DEFINE_INT_CURR("MZM ") /* Mozambique Metical */ +DEFINE_INT_CURR("NGN ") /* Nigeria Naira */ +DEFINE_INT_CURR("NIC ") /* Nicaragua Cordoba */ +DEFINE_INT_CURR("NLG ") /* Dutch Guilder */ +DEFINE_INT_CURR("NOK ") /* Norwegian Krone */ DEFINE_INT_CURR("NPR ") /* Nepal */ -DEFINE_INT_CURR("NZD ") /* New Zealand */ -DEFINE_INT_CURR("OMR ") /* Oman */ -DEFINE_INT_CURR("PAB ") /* Panama */ -DEFINE_INT_CURR("PES ") /* Peru */ -DEFINE_INT_CURR("PGK ") /* Papau New Guinea */ -DEFINE_INT_CURR("PHP ") /* Philippines */ -DEFINE_INT_CURR("PKR ") /* Pakistan */ -DEFINE_INT_CURR("PLZ ") /* Poland */ -DEFINE_INT_CURR("PTE ") /* Portugal */ -DEFINE_INT_CURR("PYG ") /* Paraguay */ +DEFINE_INT_CURR("NZD ") /* New Zealand Dollar */ +DEFINE_INT_CURR("OMR ") /* Omani Rial */ +DEFINE_INT_CURR("PAB ") /* Panamaniam Balboa */ +DEFINE_INT_CURR("PEN ") /* Peruvian New Sol */ +DEFINE_INT_CURR("PGK ") /* Papau New Guinea Kina */ +DEFINE_INT_CURR("PHP ") /* Philippines Peso */ +DEFINE_INT_CURR("PKR ") /* Pakistan Rupee */ +DEFINE_INT_CURR("PLZ ") /* Polish Zloty */ +DEFINE_INT_CURR("PTE ") /* Portugese Escudo */ +DEFINE_INT_CURR("PYG ") /* Paraguay Guarani */ DEFINE_INT_CURR("QAR ") /* Qatar */ -DEFINE_INT_CURR("ROL ") /* Romania */ -DEFINE_INT_CURR("RUR ") /* Russia */ -DEFINE_INT_CURR("RWF ") /* Rwanda */ -DEFINE_INT_CURR("SAR ") /* Saudi Arabia */ -DEFINE_INT_CURR("SBD ") /* Solomon Islands */ -DEFINE_INT_CURR("SCR ") /* Seychelles */ -DEFINE_INT_CURR("SDP ") /* Sudan */ -DEFINE_INT_CURR("SEK ") /* Sweden */ -DEFINE_INT_CURR("SGD ") /* Singapore */ -DEFINE_INT_CURR("SHP ") /* St. Helena */ -DEFINE_INT_CURR("SIT ") /* Slovenia */ -DEFINE_INT_CURR("SLL ") /* Sierra Leone */ -DEFINE_INT_CURR("SOS ") /* Somalia */ -DEFINE_INT_CURR("SRG ") /* Suriname */ -DEFINE_INT_CURR("STD ") /* Sao Tome and Principe */ +DEFINE_INT_CURR("ROL ") /* Romanian Leu */ +DEFINE_INT_CURR("RUR ") /* Russian Ruble */ +DEFINE_INT_CURR("RWF ") /* Rwanda Franc */ +DEFINE_INT_CURR("SAR ") /* Saudi Arabia Riyal */ +DEFINE_INT_CURR("SBD ") /* Solomon Islands Dollar */ +DEFINE_INT_CURR("SCR ") /* Seychelles Rupee */ +DEFINE_INT_CURR("SDP ") /* Sudanese Pound */ +DEFINE_INT_CURR("SEK ") /* Swedish Krona */ +DEFINE_INT_CURR("SGD ") /* Singapore Dollar */ +DEFINE_INT_CURR("SHP ") /* St. Helena Pound */ +DEFINE_INT_CURR("SIT ") /* Slovenian Tolar */ +DEFINE_INT_CURR("SKK ") /* Slovakian Koruna */ +DEFINE_INT_CURR("SLL ") /* Sierra Leone Leone */ +DEFINE_INT_CURR("SOS ") /* Somalia Schilling */ +DEFINE_INT_CURR("SRG ") /* Suriname Guilder */ +DEFINE_INT_CURR("STD ") /* Sao Tome and Principe Dobra */ DEFINE_INT_CURR("SUR ") /* Ukrainian, Byelorussion */ -DEFINE_INT_CURR("SVC ") /* El Salvador */ -DEFINE_INT_CURR("SYP ") /* Syrian Arab Republic */ -DEFINE_INT_CURR("SZL ") /* Swaziland */ -DEFINE_INT_CURR("THB ") /* Thailand */ -DEFINE_INT_CURR("TND ") /* Tunisia */ -DEFINE_INT_CURR("TOP ") /* Tonga */ +DEFINE_INT_CURR("SVC ") /* El Salvador Colon */ +DEFINE_INT_CURR("SYP ") /* Syrian Arab Republic Pound */ +DEFINE_INT_CURR("SZL ") /* Swaziland Lilangeni */ +DEFINE_INT_CURR("THB ") /* Thai Baht */ +DEFINE_INT_CURR("TND ") /* Tunisian Dinar */ +DEFINE_INT_CURR("TOP ") /* Tonga Pa'Anga */ DEFINE_INT_CURR("TPE ") /* East Timor */ -DEFINE_INT_CURR("TRL ") /* Turkey */ +DEFINE_INT_CURR("TRL ") /* Turkish Lira */ DEFINE_INT_CURR("TTD ") /* Trinidad and Tobago */ -DEFINE_INT_CURR("TWD ") /* Taiwan, Province of China */ -DEFINE_INT_CURR("TZS ") /* United Republic of Tanzania */ -DEFINE_INT_CURR("UGS ") /* Uganda */ -DEFINE_INT_CURR("USD ") /* United States */ -DEFINE_INT_CURR("UYP ") /* Uruguay */ -DEFINE_INT_CURR("VEB ") /* Venezuela */ -DEFINE_INT_CURR("VND ") /* Viet Nam */ -DEFINE_INT_CURR("VUV ") /* Vanuatu */ +DEFINE_INT_CURR("TWD ") /* Taiwan, Province of China Dollar */ +DEFINE_INT_CURR("TZS ") /* United Republic of Tanzania Shilling */ +DEFINE_INT_CURR("UAK ") /* Ukraine Hryvna */ +DEFINE_INT_CURR("UGS ") /* Ugandan Shilling */ +DEFINE_INT_CURR("USD ") /* United States Dollar */ +DEFINE_INT_CURR("UYP ") /* Uruguay Peso */ +DEFINE_INT_CURR("UZS ") /* Uzbekistan Sum */ +DEFINE_INT_CURR("VEB ") /* Venezuelan Bolivar */ +DEFINE_INT_CURR("VND ") /* Viet Nam Dong */ +DEFINE_INT_CURR("VUV ") /* Vanuatu Dong */ DEFINE_INT_CURR("WST ") /* Samoa */ -DEFINE_INT_CURR("XAF ") /* United Republic of Cameroon, Central African Republic, Chad, Congo, Gabon */ -DEFINE_INT_CURR("XCD ") /* Antiqua, Dominica, Grenada, Montserrat, St. Kitts-Nevis-Anguilla, Saint Lucia, Saint Vincent and the Grenadines */ -DEFINE_INT_CURR("XOF ") /* Benin, Ivory Coast, Niger, Senegal, Togo, Upper Volta */ +DEFINE_INT_CURR("XAF ") /* Central African Franc (United Republic of Cameroon, Central African Republic, Chad, Congo, Gabon) */ +DEFINE_INT_CURR("XCD ") /* East Caribbean Dollar (Antiqua, Dominica, Grenada, Montserrat, St. Kitts-Nevis-Anguilla, Saint Lucia, Saint Vincent and the Grenadines) */ +DEFINE_INT_CURR("XDS ") /* St. Christopher Dollar */ +DEFINE_INT_CURR("XOF ") /* West African Franc (Benin, Ivory Coast, Niger, Senegal, Togo, Upper Volta) */ DEFINE_INT_CURR("XPF ") /* French polynesia, New Caledonia, Wallis and Futuna Islands */ -DEFINE_INT_CURR("YDD ") /* Democratic Yemen */ -DEFINE_INT_CURR("YER ") /* Yemen */ -DEFINE_INT_CURR("YUD ") /* Yugoslavia */ -DEFINE_INT_CURR("ZAL ") /* South Africa */ +DEFINE_INT_CURR("YDD ") /* Yemini Dinar (Democratic Yemen) */ +DEFINE_INT_CURR("YER ") /* Yemeni Rial */ +DEFINE_INT_CURR("ZAL ") /* South Africa Rand */ DEFINE_INT_CURR("ZAR ") /* Lesotho, Namibia */ -DEFINE_INT_CURR("ZMK ") /* Zambia */ -DEFINE_INT_CURR("ZRZ ") /* Zaire */ -DEFINE_INT_CURR("ZWD ") /* Zimbabwe */ +DEFINE_INT_CURR("ZMK ") /* Zambian Kwacha */ +DEFINE_INT_CURR("ZRZ ") /* Zaire Zaire */ +DEFINE_INT_CURR("ZWD ") /* Zimbabwe Dollar */ diff -durpN glibc-2.0.4/locale/programs/locale.c glibc-2.0.5/locale/programs/locale.c --- glibc-2.0.4/locale/programs/locale.c Mon Apr 28 14:17:41 1997 +++ glibc-2.0.5/locale/programs/locale.c Mon Aug 4 19:03:38 1997 @@ -205,13 +205,13 @@ warranty; not even for MERCHANTABILITY o /* `-a' requests the names of all available locales. */ if (do_all != 0) { - setlocale (LC_ALL, ""); + setlocale (LC_COLLATE, ""); write_locales (); exit (EXIT_SUCCESS); } /* `m' requests the names of all available charmaps. The names can be - used for the -f argument to localedef(3). */ + used for the -f argument to localedef(1). */ if (do_charmaps != 0) { write_charmaps (); @@ -509,6 +509,25 @@ show_locale_vars (void) } +/* Some of the "string" we print contain non-printable characters. We + encode them here. */ +static void +print_escaped (const char *string) +{ + const unsigned char *ch; + + ch = string; + while ('\0' != *ch) + { + if (isprint (*ch)) + putchar (*ch); + else + printf("<0x%02x>", *ch); + ++ch; + } +} + + /* Show the information request for NAME. */ static void show_info (const char *name) @@ -523,9 +542,11 @@ show_info (const char *name) switch (item->value_type) { case string: - printf ("%s%s%s", show_keyword_name ? "\"" : "", - nl_langinfo (item->item_id) ? : "", - show_keyword_name ? "\"" : ""); + if (show_keyword_name) + putchar ('"'); + print_escaped (nl_langinfo (item->item_id) ? : ""); + if (show_keyword_name) + putchar ('"'); break; case stringarray: { @@ -538,11 +559,14 @@ show_info (const char *name) for (cnt = 0; cnt < item->max - 1; ++cnt) { val = nl_langinfo (item->item_id + cnt); - printf ("%s;", val ? : ""); + if (val != NULL) + print_escaped (val); + putchar (';'); } val = nl_langinfo (item->item_id + cnt); - printf ("%s", val ? : ""); + if (val != NULL) + print_escaped (val); if (show_keyword_name) putchar ('"'); diff -durpN glibc-2.0.4/locale/programs/localedef.c glibc-2.0.5/locale/programs/localedef.c --- glibc-2.0.4/locale/programs/localedef.c Sun Mar 16 19:26:49 1997 +++ glibc-2.0.5/locale/programs/localedef.c Mon Aug 4 19:55:24 1997 @@ -255,8 +255,11 @@ warranty; not even for MERCHANTABILITY o { avail = act_add_locdef->locale->categories[cat].generic != NULL; if (avail) - localedef->categories[cat].generic - = act_add_locdef->locale->categories[cat].generic; + { + localedef->categories[cat].generic + = act_add_locdef->locale->categories[cat].generic; + localedef->avail |= 1 << cat; + } } if (! avail) diff -durpN glibc-2.0.4/locale/programs/locfile.c glibc-2.0.5/locale/programs/locfile.c --- glibc-2.0.4/locale/programs/locfile.c Sun Mar 16 19:27:54 1997 +++ glibc-2.0.5/locale/programs/locfile.c Mon Aug 4 19:55:43 1997 @@ -920,17 +920,23 @@ void check_all_categories (struct localedef_t *locale, struct charset_t *charset) { /* Call the finishing functions for all locales. */ - if ((locale->binary & (1 << LC_CTYPE)) == 0) + if ((locale->avail & (1 << LC_CTYPE)) != 0 + && (locale->binary & (1 << LC_CTYPE)) == 0) ctype_finish (locale, charset); - if ((locale->binary & (1 << LC_COLLATE)) == 0) + if ((locale->avail & (1 << LC_COLLATE)) != 0 + && (locale->binary & (1 << LC_COLLATE)) == 0) collate_finish (locale, charset); - if ((locale->binary & (1 << LC_MONETARY)) == 0) + if ((locale->avail & (1 << LC_MONETARY)) != 0 + && (locale->binary & (1 << LC_MONETARY)) == 0) monetary_finish (locale); - if ((locale->binary & (1 << LC_NUMERIC)) == 0) + if ((locale->avail & (1 << LC_NUMERIC)) != 0 + && (locale->binary & (1 << LC_NUMERIC)) == 0) numeric_finish (locale); - if ((locale->binary & (1 << LC_TIME)) == 0) + if ((locale->avail & (1 << LC_TIME)) != 0 + && (locale->binary & (1 << LC_TIME)) == 0) time_finish (locale); - if ((locale->binary & (1 << LC_MESSAGES)) == 0) + if ((locale->avail & (1 << LC_MESSAGES)) != 0 + && (locale->binary & (1 << LC_MESSAGES)) == 0) messages_finish (locale); } @@ -940,12 +946,18 @@ write_all_categories (struct localedef_t const char *output_path) { /* Call all functions to write locale data. */ - ctype_output (locale, charset, output_path); - collate_output (locale, charset, output_path); - monetary_output (locale, output_path); - numeric_output (locale, output_path); - time_output (locale, output_path); - messages_output (locale, output_path); + if ((locale->avail & (1 << LC_CTYPE)) != 0) + ctype_output (locale, charset, output_path); + if ((locale->avail & (1 << LC_COLLATE)) != 0) + collate_output (locale, charset, output_path); + if ((locale->avail & (1 << LC_MONETARY)) != 0) + monetary_output (locale, output_path); + if ((locale->avail & (1 << LC_NUMERIC)) != 0) + numeric_output (locale, output_path); + if ((locale->avail & (1 << LC_TIME)) != 0) + time_output (locale, output_path); + if ((locale->avail & (1 << LC_MESSAGES)) != 0) + messages_output (locale, output_path); } diff -durpN glibc-2.0.4/locale/setlocale.c glibc-2.0.5/locale/setlocale.c --- glibc-2.0.4/locale/setlocale.c Thu Apr 17 16:26:32 1997 +++ glibc-2.0.5/locale/setlocale.c Mon Aug 4 18:07:32 1997 @@ -204,8 +204,10 @@ new_composite_name (int category, char * static inline void setname (int category, const char *name) { - if (_nl_current[category] == NULL - && _nl_current_names[category] != _nl_C_name) + if (_nl_current_names[category] == name) + return; + + if (_nl_current_names[category] != _nl_C_name) free ((void *) _nl_current_names[category]); _nl_current_names[category] = name; @@ -355,6 +357,9 @@ setlocale (int category, const char *loc /* Critical section left. */ __libc_lock_unlock (__libc_setlocale_lock); + /* Free the resources (the locale path variable. */ + free (locale_path); + return composite; } else @@ -393,6 +398,9 @@ setlocale (int category, const char *loc /* Critical section left. */ __libc_lock_unlock (__libc_setlocale_lock); + + /* Free the resources (the locale path variable. */ + free (locale_path); return newname; } diff -durpN glibc-2.0.4/login/Makefile glibc-2.0.5/login/Makefile --- glibc-2.0.4/login/Makefile Wed May 21 12:05:35 1997 +++ glibc-2.0.5/login/Makefile Tue Aug 12 04:38:52 1997 @@ -25,7 +25,7 @@ subdir := login headers := utmp.h utmpbits.h lastlog.h pty.h routines := getutent getutent_r getutid getutline getutid_r getutline_r \ - utmp_file utmp_db + utmp_file updwtmp utmpname distribute := utmp-private.h diff -durpN glibc-2.0.4/login/getutent.c glibc-2.0.5/login/getutent.c --- glibc-2.0.4/login/getutent.c Wed Nov 27 01:08:01 1996 +++ glibc-2.0.5/login/getutent.c Mon Aug 11 18:45:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -25,7 +25,7 @@ static struct utmp buffer; struct utmp * -getutent (void) +__getutent (void) { struct utmp *result; @@ -34,3 +34,4 @@ getutent (void) return result; } +weak_alias (__getutent, getutent) diff -durpN glibc-2.0.4/login/getutent_r.c glibc-2.0.5/login/getutent_r.c --- glibc-2.0.4/login/getutent_r.c Thu Nov 28 21:20:52 1996 +++ glibc-2.0.5/login/getutent_r.c Mon Aug 11 18:45:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper and Paul Janzen , 1996. @@ -18,102 +18,126 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include #include -#include -#include -#include -#include #include -#include #include "utmp-private.h" -/* The various backends we have. */ -static int __setutent_unknown (int reset); -static int __getutent_r_unknown (struct utmp *buffer, struct utmp **result); -static struct utmp *__pututline_unknown (const struct utmp *data); -static void __endutent_unknown (void); - +/* Functions defined here. */ +static int setutent_unknown (void); +static int getutent_r_unknown (struct utmp *buffer, struct utmp **result); +static int getutid_r_unknown (const struct utmp *line, struct utmp *buffer, + struct utmp **result); +static int getutline_r_unknown (const struct utmp *id, struct utmp *buffer, + struct utmp **result); +static struct utmp *pututline_unknown (const struct utmp *data); +static void endutent_unknown (void); -/* We have three jump tables: unknown, db, or file. */ -static struct utfuncs unknown_functions = +/* Initial Jump table. */ +struct utfuncs __libc_utmp_unknown_functions = { - __setutent_unknown, - __getutent_r_unknown, - NULL, - NULL, - __pututline_unknown, - __endutent_unknown, + setutent_unknown, + getutent_r_unknown, + getutid_r_unknown, + getutline_r_unknown, + pututline_unknown, + endutent_unknown, NULL }; /* Currently selected backend. */ -struct utfuncs *__libc_utmp_jump_table = &unknown_functions; - -/* The tables from the services. */ -extern struct utfuncs __libc_utmp_db_functions; -extern struct utfuncs __libc_utmp_file_functions; - +struct utfuncs *__libc_utmp_jump_table = &__libc_utmp_unknown_functions; /* We need to protect the opening of the file. */ __libc_lock_define_initialized (, __libc_utmp_lock) -void -__setutent (void) + +static int +setutent_unknown (void) { - __libc_lock_lock (__libc_utmp_lock); + int result; - (void) (*__libc_utmp_jump_table->setutent) (1); + result = (*__libc_utmp_file_functions.setutent) (); + if (result) + __libc_utmp_jump_table = &__libc_utmp_file_functions; - __libc_lock_unlock (__libc_utmp_lock); + return result; } -weak_alias (__setutent, setutent) static int -__setutent_unknown (int reset) +getutent_r_unknown (struct utmp *buffer, struct utmp **result) { - /* We have to test whether it is still not decided which backend to use. */ - assert (__libc_utmp_jump_table == &unknown_functions); + /* The backend was not yet initialized. */ + if (setutent_unknown ()) + return (*__libc_utmp_jump_table->getutent_r) (buffer, result); - /* See whether utmp db file exists. */ - if ((*__libc_utmp_db_functions.setutent) (reset)) - __libc_utmp_jump_table = &__libc_utmp_db_functions; - else - { - /* Either the db file does not exist or we have other - problems. So use the normal file. */ - (*__libc_utmp_file_functions.setutent) (reset); - __libc_utmp_jump_table = &__libc_utmp_file_functions; - } + /* Not available. */ + *result = NULL; + return -1; +} - return 0; + +static int +getutid_r_unknown (const struct utmp *id, struct utmp *buffer, + struct utmp **result) +{ + /* The backend was not yet initialized. */ + if (setutent_unknown ()) + return (*__libc_utmp_jump_table->getutid_r) (id, buffer, result); + + /* Not available. */ + *result = NULL; + return -1; } -void -__endutent (void) +static int +getutline_r_unknown (const struct utmp *line, struct utmp *buffer, + struct utmp **result) { - __libc_lock_lock (__libc_utmp_lock); + /* The backend was not yet initialized. */ + if (setutent_unknown ()) + return (*__libc_utmp_jump_table->getutline_r) (line, buffer, result); - (*__libc_utmp_jump_table->endutent) (); + /* Not available. */ + *result = NULL; + return -1; +} - __libc_lock_unlock (__libc_utmp_lock); + +static struct utmp * +pututline_unknown (const struct utmp *data) +{ + /* The backend was not yet initialized. */ + if (setutent_unknown ()) + return (*__libc_utmp_jump_table->pututline) (data); + + /* Not available. */ + return NULL; } -weak_alias (__endutent, endutent) static void -__endutent_unknown (void) +endutent_unknown (void) { - /* Huh, how do we came here? Nothing to do. */ + /* Nothing to do. */ } +void +__setutent (void) +{ + __libc_lock_lock (__libc_utmp_lock); + + (*__libc_utmp_jump_table->setutent) (); + + __libc_lock_unlock (__libc_utmp_lock); +} +weak_alias (__setutent, setutent) + + int __getutent_r (struct utmp *buffer, struct utmp **result) { @@ -130,16 +154,6 @@ __getutent_r (struct utmp *buffer, struc weak_alias (__getutent_r, getutent_r) -static int -__getutent_r_unknown (struct utmp *buffer, struct utmp **result) -{ - /* It is not yet initialized. */ - __setutent_unknown (0); - - return (*__libc_utmp_jump_table->getutent_r) (buffer, result); -} - - struct utmp * __pututline (const struct utmp *data) { @@ -156,44 +170,14 @@ __pututline (const struct utmp *data) weak_alias (__pututline, pututline) -static struct utmp * -__pututline_unknown (const struct utmp *data) -{ - /* It is not yet initialized. */ - __setutent_unknown (0); - - return (*__libc_utmp_jump_table->pututline) (data); -} - - -int -__utmpname (const char *file) +void +__endutent (void) { - int result = -1; - __libc_lock_lock (__libc_utmp_lock); - /* Close the old file. */ (*__libc_utmp_jump_table->endutent) (); - - /* Store new names. */ - if ((*__libc_utmp_file_functions.utmpname) (file) == 0 - && !(*__libc_utmp_db_functions.utmpname) (file) == 0) - { - /* Try to find out whether we are supposed to work with a db - file or not. Do this by looking for the extension ".db". */ - const char *ext = strrchr (file, '.'); - - if (ext != NULL && strcmp (ext, ".db") == 0) - __libc_utmp_jump_table = &__libc_utmp_db_functions; - else - __libc_utmp_jump_table = &unknown_functions; - - result = 0; - } + __libc_utmp_jump_table = &__libc_utmp_unknown_functions; __libc_lock_unlock (__libc_utmp_lock); - - return result; } -weak_alias (__utmpname, utmpname) +weak_alias (__endutent, endutent) diff -durpN glibc-2.0.4/login/getutid.c glibc-2.0.5/login/getutid.c --- glibc-2.0.4/login/getutid.c Wed Nov 27 01:08:02 1996 +++ glibc-2.0.5/login/getutid.c Mon Aug 11 18:45:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -25,7 +25,7 @@ static struct utmp buffer; struct utmp * -getutid (const struct utmp *id) +__getutid (const struct utmp *id) { struct utmp *result; @@ -34,3 +34,4 @@ getutid (const struct utmp *id) return result; } +weak_alias (__getutid, getutid) diff -durpN glibc-2.0.4/login/getutid_r.c glibc-2.0.5/login/getutid_r.c --- glibc-2.0.4/login/getutid_r.c Wed Nov 27 01:08:02 1996 +++ glibc-2.0.5/login/getutid_r.c Mon Aug 11 18:45:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper and Paul Janzen , 1996. @@ -20,8 +20,6 @@ #include #include -#include -#include #include #include "utmp-private.h" @@ -38,7 +36,7 @@ int __getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result) { #if (_HAVE_UT_ID - 0) && (_HAVE_UT_TYPE - 0) - int retval = -1; + int retval; /* Test whether ID has any of the legal types. */ if (id->ut_type != RUN_LVL && id->ut_type != BOOT_TIME @@ -54,11 +52,7 @@ __getutid_r (const struct utmp *id, stru __libc_lock_lock (__libc_utmp_lock); - /* Not yet initialized. */ - if ((*__libc_utmp_jump_table->setutent) (0)) - retval = (*__libc_utmp_jump_table->getutid_r) (id, buffer, result); - else - *result = NULL; + retval = (*__libc_utmp_jump_table->getutid_r) (id, buffer, result); __libc_lock_unlock (__libc_utmp_lock); diff -durpN glibc-2.0.4/login/getutline.c glibc-2.0.5/login/getutline.c --- glibc-2.0.4/login/getutline.c Wed Nov 27 01:08:02 1996 +++ glibc-2.0.5/login/getutline.c Mon Aug 11 18:45:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -25,7 +25,7 @@ static struct utmp buffer; struct utmp * -getutline (const struct utmp *line) +__getutline (const struct utmp *line) { struct utmp *result; @@ -34,3 +34,4 @@ getutline (const struct utmp *line) return result; } +weak_alias (__getutline, getutline) diff -durpN glibc-2.0.4/login/getutline_r.c glibc-2.0.5/login/getutline_r.c --- glibc-2.0.4/login/getutline_r.c Wed Nov 27 01:08:03 1996 +++ glibc-2.0.5/login/getutline_r.c Mon Aug 11 18:45:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper and Paul Janzen , 1996. @@ -20,8 +20,6 @@ #include #include -#include -#include #include #include "utmp-private.h" @@ -38,15 +36,11 @@ int __getutline_r (const struct utmp *line, struct utmp *buffer, struct utmp **result) { - int retval = -1; + int retval; __libc_lock_lock (__libc_utmp_lock); - /* Not yet initialized. */ - if ((*__libc_utmp_jump_table->setutent) (0)) - retval = (*__libc_utmp_jump_table->getutline_r) (line, buffer, result); - else - *result = NULL; + retval = (*__libc_utmp_jump_table->getutline_r) (line, buffer, result); __libc_lock_unlock (__libc_utmp_lock); diff -durpN glibc-2.0.4/login/login.c glibc-2.0.5/login/login.c --- glibc-2.0.4/login/login.c Wed Nov 27 01:08:03 1996 +++ glibc-2.0.5/login/login.c Mon Aug 11 18:45:52 1997 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -23,7 +23,8 @@ #include #include #include - + + /* Return the result of ttyname in the buffer pointed to by TTY, which should be of length BUF_LEN. If it is too long to fit in this buffer, a sufficiently long buffer is allocated using malloc, and returned in TTY. @@ -42,7 +43,7 @@ tty_name (int fd, char **tty, size_t buf { rv = ttyname_r (fd, buf, buf_len); - if (rv < 0 || memchr (buf, '\0', buf_len)) + if (rv != 0 || memchr (buf, '\0', buf_len)) /* We either got an error, or we succeeded and the returned name fit in the buffer. */ break; @@ -65,6 +66,7 @@ tty_name (int fd, char **tty, size_t buf __set_errno (ENOMEM); break; } + buf = new_buf; } if (rv == 0) @@ -113,7 +115,7 @@ login (const struct utmp *ut) strncpy (copy.ut_line, ttyp, UT_LINESIZE); /* Tell that we want to use the UTMP file. */ - if (utmpname (_PATH_UTMP) != 0) + if (utmpname (_PATH_UTMP) == 0) { struct utmp *old; @@ -135,20 +137,5 @@ login (const struct utmp *ut) } /* Update the WTMP file. Here we have to add a new entry. */ - if (utmpname (_PATH_WTMP) != 0) - { - struct utmp *up; - - /* Open the WTMP file. */ - setutent (); - - /* Position at end of file. */ - while (! getutent_r (&utbuf, &up)); - - /* Write the new entry. */ - pututline (©); - - /* Close WTMP file. */ - endutent (); - } + updwtmp (_PATH_WTMP, ©); } diff -durpN glibc-2.0.4/login/logout.c glibc-2.0.5/login/logout.c --- glibc-2.0.4/login/logout.c Wed Nov 27 01:08:04 1996 +++ glibc-2.0.5/login/logout.c Mon Aug 11 18:45:52 1997 @@ -1,21 +1,21 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper , 1996. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include @@ -30,7 +30,7 @@ logout (const char *line) int result = 0; /* Tell that we want to use the UTMP file. */ - if (utmpname (_PATH_UTMP) == 0) + if (utmpname (_PATH_UTMP) == -1) return 0; /* Open UTMP file. */ @@ -55,8 +55,11 @@ logout (const char *line) #else time (&ut->ut_time); #endif +#if _HAVE_UT_TYPE - 0 + ut->ut_type = DEAD_PROCESS; +#endif - if (pututline (ut) >= 0) + if (pututline (ut) != NULL) result = 1; } diff -durpN glibc-2.0.4/login/logwtmp.c glibc-2.0.5/login/logwtmp.c --- glibc-2.0.4/login/logwtmp.c Fri Apr 18 10:10:00 1997 +++ glibc-2.0.5/login/logwtmp.c Mon Aug 11 18:45:52 1997 @@ -17,53 +17,12 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include +#include +#include #include #include -#include -#include - -void -updwtmp (const char *wtmp_file, const struct utmp *ut) -{ - struct stat st; - size_t written; - int fd; - /* Open WTMP file. */ - fd = __open (wtmp_file, O_WRONLY | O_APPEND); - if (fd < 0) - return; - - /* Try to lock the file. */ - if (__flock (fd, LOCK_EX | LOCK_NB) < 0 && errno != ENOSYS) - { - /* Oh, oh. The file is already locked. Wait a bit and try again. */ - sleep (1); - - /* This time we ignore the error. */ - __flock (fd, LOCK_EX | LOCK_NB); - } - - /* Remember original size of log file: */ - if (__fstat (fd, &st) < 0) - goto done; - - /* Write the entry. If we can't write all the bytes, reset the file - size back to the original size. That way, no partial entries - will remain. */ - written = __write (fd, ut, sizeof (struct utmp)); - if (written > 0 && written != sizeof (struct utmp)) - ftruncate (fd, st.st_size); - -done: - /* And unlock the file. */ - __flock (fd, LOCK_UN); - - /* Close WTMP file. */ - __close (fd); -} void logwtmp (const char *line, const char *name, const char *host) @@ -90,5 +49,5 @@ logwtmp (const char *line, const char *n time (&ut.ut_time); #endif - updwtmp(_PATH_WTMP, &ut); + updwtmp (_PATH_WTMP, &ut); } diff -durpN glibc-2.0.4/login/pty.h glibc-2.0.5/login/pty.h --- glibc-2.0.4/login/pty.h Thu Dec 19 20:32:33 1996 +++ glibc-2.0.5/login/pty.h Tue Aug 12 04:33:32 1997 @@ -1,5 +1,5 @@ /* pty.h - Functions for pseudo TTY handling. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ #define _PTY_H 1 #include +#include #include diff -durpN glibc-2.0.4/login/updwtmp.c glibc-2.0.5/login/updwtmp.c --- glibc-2.0.4/login/updwtmp.c Wed Dec 31 19:00:00 1969 +++ glibc-2.0.5/login/updwtmp.c Mon Aug 11 18:45:52 1997 @@ -0,0 +1,31 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Mark Kettenis , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +#include "utmp-private.h" + + +void +updwtmp (const char *wtmp_file, const struct utmp *utmp) +{ + (*__libc_utmp_file_functions.updwtmp) (wtmp_file, utmp); +} + diff -durpN glibc-2.0.4/login/utmp-private.h glibc-2.0.5/login/utmp-private.h --- glibc-2.0.4/login/utmp-private.h Wed Nov 27 01:08:06 1996 +++ glibc-2.0.5/login/utmp-private.h Mon Aug 11 18:45:55 1997 @@ -24,18 +24,26 @@ #include -/* The extra `int' argument for each function shows whether locking is - wanted or not. */ +/* The structure describing the functions in a backend. */ struct utfuncs { - int (*setutent) (int); + int (*setutent) (void); int (*getutent_r) (struct utmp *, struct utmp **); int (*getutid_r) (const struct utmp *, struct utmp *, struct utmp **); int (*getutline_r) (const struct utmp *, struct utmp *, struct utmp **); struct utmp *(*pututline) (const struct utmp *); void (*endutent) (void); - int (*utmpname) (const char *); - + int (*updwtmp) (const char *, const struct utmp *); }; + +/* The tables from the services. */ +extern struct utfuncs __libc_utmp_file_functions; +extern struct utfuncs __libc_utmp_unknown_functions; + +/* Currently selected backend. */ +extern struct utfuncs *__libc_utmp_jump_table; + +/* Current file name. */ +extern const char *__libc_utmp_file_name; #endif /* utmp-private.h */ diff -durpN glibc-2.0.4/login/utmp.h glibc-2.0.5/login/utmp.h --- glibc-2.0.4/login/utmp.h Fri Apr 18 09:51:55 1997 +++ glibc-2.0.5/login/utmp.h Mon Aug 11 18:45:55 1997 @@ -16,14 +16,14 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _UTMP_H +#define _UTMP_H 1 -#ifndef _UTMP_H_ - -#define _UTMP_H_ 1 #include #include + __BEGIN_DECLS /* Get system dependent values and data structures. */ @@ -48,21 +48,22 @@ extern void login __P ((__const struct u /* Write the utmp entry to say the user on UT_LINE has logged out. */ extern int logout __P ((__const char *__ut_line)); -/* Append the given entry to a wtmp file. */ -extern void updwtmp __P ((__const char *__wtmp_file, - __const struct utmp *__entry)); - /* Append to wtmp an entry for the current time and the given info. */ extern void logwtmp __P ((__const char *__ut_line, __const char *__ut_name, __const char *__ut_host)); +/* Append entry UTMP to the wtmp-like file WTMP_FILE. */ +extern void updwtmp __P ((__const char *__wtmp_file, + __const struct utmp *__utmp)); + /* Change name of the utmp file to be examined. */ +extern int __utmpname __P ((__const char *__file)); extern int utmpname __P ((__const char *__file)); /* Read next entry from a utmp-like file. */ extern struct utmp *getutent __P ((void)); -/* Rest the input stream to the beginning of the file. */ +/* Reset the input stream to the beginning of the file. */ extern void __setutent __P ((void)); extern void setutent __P ((void)); diff -durpN glibc-2.0.4/login/utmp_db.c glibc-2.0.5/login/utmp_db.c --- glibc-2.0.4/login/utmp_db.c Fri Jan 24 21:35:58 1997 +++ glibc-2.0.5/login/utmp_db.c Wed Dec 31 19:00:00 1969 @@ -1,104 +0,0 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper - and Paul Janzen , 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "utmp-private.h" - - -/* This is the default name. */ -static const char default_file_name[] = _PATH_UTMP_DB; - -/* Current file name. */ -static const char *file_name = (const char *) default_file_name; - -/* Descriptor for database. */ -#if 0 -/* XXX One day this will become meaningful again. */ -static DB *db_fd; -static char last_date[16]; -#endif - -/* Our local functions. */ -static int setutent_db (int reset); -static void endutent_db (void); -static int utmpname_db (const char *name); - - -/* The jump table for the local functions. */ -struct utfuncs __libc_utmp_db_functions = -{ - setutent_db, - NULL, - NULL, - NULL, - NULL, - endutent_db, - utmpname_db -}; - - -static int -setutent_db (int reset) -{ - return 0; -} - - -static void -endutent_db (void) -{ -} - - -static int -utmpname_db (const char *name) -{ - if (strcmp (name, file_name) != 0) - { - if (strcmp (name, default_file_name) == 0) - { - if (file_name != default_file_name) - free ((char *) file_name); - - file_name = default_file_name; - } - else - { - char *new_name = __strdup (name); - if (new_name == NULL) - /* Out of memory. */ - return -1; - - if (file_name != default_file_name) - free ((char *) file_name); - - file_name = new_name; - } - } - return 0; -} diff -durpN glibc-2.0.4/login/utmp_file.c glibc-2.0.5/login/utmp_file.c --- glibc-2.0.4/login/utmp_file.c Thu Apr 17 15:37:30 1997 +++ glibc-2.0.5/login/utmp_file.c Mon Aug 11 18:45:52 1997 @@ -18,34 +18,27 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include -#include #include -#include #include #include #include -#include -#include #include "utmp-private.h" -/* This is the default name. */ -static const char default_file_name[] = _PATH_UTMP; - -/* Current file name. */ -static const char *file_name = (const char *) default_file_name; - /* Descriptor for the file and position. */ -static int file_fd = INT_MIN; +static int file_fd = -1; static off_t file_offset; +/* Cache for the last read entry. */ static struct utmp last_entry; + /* Functions defined here. */ -static int setutent_file (int reset); +static int setutent_file (void); static int getutent_r_file (struct utmp *buffer, struct utmp **result); static int getutid_r_file (const struct utmp *key, struct utmp *buffer, struct utmp **result); @@ -53,8 +46,7 @@ static int getutline_r_file (const struc struct utmp **result); static struct utmp *pututline_file (const struct utmp *data); static void endutent_file (void); -static int utmpname_file (const char *name); - +static int updwtmp_file (const char *file, const struct utmp *utmp); /* Jump table for file functions. */ struct utfuncs __libc_utmp_file_functions = @@ -65,71 +57,49 @@ struct utfuncs __libc_utmp_file_function getutline_r_file, pututline_file, endutent_file, - utmpname_file + updwtmp_file }; static int -setutent_file (int reset) +setutent_file (void) { - if (file_fd == INT_MIN) + if (file_fd < 0) { - file_fd = open (file_name, O_RDWR); + file_fd = open (__libc_utmp_file_name, O_RDWR); if (file_fd == -1) { /* Hhm, read-write access did not work. Try read-only. */ - file_fd = open (file_name, O_RDONLY); + file_fd = open (__libc_utmp_file_name, O_RDONLY); if (file_fd == -1) { perror (_("while opening UTMP file")); return 0; } } - file_offset = 0; - -#if _HAVE_UT_TYPE - 0 - /* Make sure the entry won't match. */ - last_entry.ut_type = -1; -#endif } - else if (reset) - { - lseek (file_fd, 0, SEEK_SET); - /* Remember we are at beginning of file. */ - file_offset = 0; + lseek (file_fd, 0, SEEK_SET); + file_offset = 0; #if _HAVE_UT_TYPE - 0 - /* Make sure the entry won't match. */ - last_entry.ut_type = -1; + /* Make sure the entry won't match. */ + last_entry.ut_type = -1; #endif - } return 1; } -static void -endutent_file (void) -{ - if (file_fd >= 0) - close (file_fd); - - file_fd = INT_MIN; -} - - static int getutent_r_file (struct utmp *buffer, struct utmp **result) { - int nbytes; + ssize_t nbytes; struct flock fl; /* Information struct for locking. */ - /* Open utmp file if not already done. */ - if (file_fd == INT_MIN) - setutent_file (1); + assert (file_fd >= 0); - if (file_fd == -1 || file_offset == -1l) + if (file_offset == -1l) { /* Not available. */ *result = NULL; @@ -139,12 +109,16 @@ getutent_r_file (struct utmp *buffer, st /* XXX The following is not perfect. Instead of locking the file itself Marek Michalkiewicz suggests to use an extra locking file. */ + /* XXX I think using an extra locking file does not solve the + problems. Instead we should set an alarm, which causes fcntl to + fail, as in ../nis/lckcache.c. + Mark Kettenis . */ /* Try to get the lock. */ memset (&fl, '\0', sizeof (struct flock)); - fl.l_type = F_WRLCK; + fl.l_type = F_RDLCK; fl.l_whence = SEEK_SET; - fcntl (file_fd, F_SETLKW, &fl); + fcntl (file_fd, F_SETLK, &fl); /* Read the next entry. */ nbytes = read (file_fd, &last_entry, sizeof (struct utmp)); @@ -170,49 +144,6 @@ getutent_r_file (struct utmp *buffer, st } -/* For implementing this function we don't use the getutent_r function - because we can avoid the reposition on every new entry this way. */ -static int -getutline_r_file (const struct utmp *line, struct utmp *buffer, - struct utmp **result) -{ - if (file_fd < 0 || file_offset == -1l) - { - *result = NULL; - return -1; - } - - while (1) - { - /* Read the next entry. */ - if (read (file_fd, &last_entry, sizeof (struct utmp)) - != sizeof (struct utmp)) - { - __set_errno (ESRCH); - file_offset = -1l; - *result = NULL; - return -1; - } - file_offset += sizeof (struct utmp); - - /* Stop if we found a user or login entry. */ - if ( -#if _HAVE_UT_TYPE - 0 - (last_entry.ut_type == USER_PROCESS - || last_entry.ut_type == LOGIN_PROCESS) - && -#endif - !strncmp (line->ut_line, last_entry.ut_line, sizeof line->ut_line)) - break; - } - - memcpy (buffer, &last_entry, sizeof (struct utmp)); - *result = buffer; - - return 0; -} - - static int proc_utmp_eq (const struct utmp *entry, const struct utmp *match) { @@ -243,6 +174,15 @@ proc_utmp_eq (const struct utmp *entry, static int internal_getut_r (const struct utmp *id, struct utmp *buffer) { + int result = -1; + struct flock fl; + + /* Try to get the lock. */ + memset (&fl, '\0', sizeof (struct flock)); + fl.l_type = F_RDLCK; + fl.l_whence = SEEK_SET; + fcntl (file_fd, F_SETLKW, &fl); + #if _HAVE_UT_TYPE - 0 if (id->ut_type == RUN_LVL || id->ut_type == BOOT_TIME || id->ut_type == OLD_TIME || id->ut_type == NEW_TIME) @@ -258,7 +198,7 @@ internal_getut_r (const struct utmp *id, { __set_errno (ESRCH); file_offset = -1l; - return -1; + goto unlock_return; } file_offset += sizeof (struct utmp); @@ -280,7 +220,7 @@ internal_getut_r (const struct utmp *id, { __set_errno (ESRCH); file_offset = -1l; - return -1; + goto unlock_return; } file_offset += sizeof (struct utmp); @@ -289,7 +229,14 @@ internal_getut_r (const struct utmp *id, } } - return 0; + result = 0; + +unlock_return: + /* And unlock the file. */ + fl.l_type = F_UNLCK; + fcntl (file_fd, F_SETLK, &fl); + + return result; } @@ -299,7 +246,9 @@ static int getutid_r_file (const struct utmp *id, struct utmp *buffer, struct utmp **result) { - if (file_fd < 0 || file_offset == -1l) + assert (file_fd >= 0); + + if (file_offset == -1l) { *result = NULL; return -1; @@ -318,6 +267,64 @@ getutid_r_file (const struct utmp *id, s } +/* For implementing this function we don't use the getutent_r function + because we can avoid the reposition on every new entry this way. */ +static int +getutline_r_file (const struct utmp *line, struct utmp *buffer, + struct utmp **result) +{ + struct flock fl; + + assert (file_fd >= 0); + + if (file_offset == -1l) + { + *result = NULL; + return -1; + } + + /* Try to get the lock. */ + memset (&fl, '\0', sizeof (struct flock)); + fl.l_type = F_RDLCK; + fl.l_whence = SEEK_SET; + fcntl (file_fd, F_SETLKW, &fl); + + while (1) + { + /* Read the next entry. */ + if (read (file_fd, &last_entry, sizeof (struct utmp)) + != sizeof (struct utmp)) + { + __set_errno (ESRCH); + file_offset = -1l; + *result = NULL; + goto unlock_return; + } + file_offset += sizeof (struct utmp); + + /* Stop if we found a user or login entry. */ + if ( +#if _HAVE_UT_TYPE - 0 + (last_entry.ut_type == USER_PROCESS + || last_entry.ut_type == LOGIN_PROCESS) + && +#endif + !strncmp (line->ut_line, last_entry.ut_line, sizeof line->ut_line)) + break; + } + + memcpy (buffer, &last_entry, sizeof (struct utmp)); + *result = buffer; + +unlock_return: + /* And unlock the file. */ + fl.l_type = F_UNLCK; + fcntl (file_fd, F_SETLK, &fl); + + return ((*result == NULL) ? -1 : 0); +} + + static struct utmp * pututline_file (const struct utmp *data) { @@ -326,13 +333,7 @@ pututline_file (const struct utmp *data) struct utmp *pbuf; int found; - if (file_fd < 0) - /* Something went wrong. */ - return NULL; - - if (file_fd == INT_MIN) - /* The file is closed. Open it again. */ - setutent_file (0); + assert (file_fd >= 0); /* Find the correct place to insert the data. */ if (file_offset > 0 @@ -354,7 +355,7 @@ pututline_file (const struct utmp *data) memset (&fl, '\0', sizeof (struct flock)); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; - fcntl (file_fd, F_SETLKW, &fl); + fcntl (file_fd, F_SETLK, &fl); if (found < 0) { @@ -397,36 +398,70 @@ pututline_file (const struct utmp *data) unlock_return: /* And unlock the file. */ fl.l_type = F_UNLCK; - fcntl (file_fd, F_SETLKW, &fl); + fcntl (file_fd, F_SETLK, &fl); return pbuf; } +static void +endutent_file (void) +{ + assert (file_fd >= 0); + + close (file_fd); + file_fd = -1; +} + + static int -utmpname_file (const char *name) +updwtmp_file (const char *file, const struct utmp *utmp) { - if (strcmp (name, file_name) != 0) - { - if (strcmp (name, default_file_name) == 0) - { - if (file_name != default_file_name) - free ((char *) file_name); + int result = -1; + struct flock fl; + off_t offset; + int fd; - file_name = default_file_name; - } - else - { - char *new_name = __strdup (name); - if (new_name == NULL) - /* Out of memory. */ - return -1; + /* Open WTMP file. */ + fd = open (file, O_WRONLY); + if (fd < 0) + return -1; - if (file_name != default_file_name) - free ((char *) file_name); + /* Try to get the lock. */ + memset (&fl, '\0', sizeof (struct flock)); + fl.l_type = F_WRLCK; + fl.l_whence = SEEK_SET; + fcntl (fd, F_SETLK, &fl); - file_name = new_name; - } + /* Remember original size of log file. */ + offset = lseek (fd, 0, SEEK_END); + if (offset % sizeof (struct utmp) != 0) + { + offset -= offset % sizeof (struct utmp); + ftruncate (fd, offset); + + if (lseek (fd, 0, SEEK_END) < 0) + goto unlock_return; } - return 0; + + /* Write the entry. If we can't write all the bytes, reset the file + size back to the original size. That way, no partial entries + will remain. */ + if (write (fd, utmp, sizeof (struct utmp)) != sizeof (struct utmp)) + { + ftruncate (fd, offset); + goto unlock_return; + } + + result = 0; + +unlock_return: + /* And unlock the file. */ + fl.l_type = F_UNLCK; + fcntl (fd, F_SETLKW, &fl); + + /* Close WTMP file. */ + close (fd); + + return result; } diff -durpN glibc-2.0.4/login/utmpname.c glibc-2.0.5/login/utmpname.c --- glibc-2.0.4/login/utmpname.c Wed Dec 31 19:00:00 1969 +++ glibc-2.0.5/login/utmpname.c Mon Aug 11 18:45:52 1997 @@ -0,0 +1,78 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Mark Kettenis , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +#include "utmp-private.h" + + +/* This is the default name. */ +static const char default_file_name[] = _PATH_UTMP; + +/* Current file name. */ +const char *__libc_utmp_file_name = (const char *) default_file_name; + +/* We have to use the lock in getutent_r.c. */ +__libc_lock_define (extern, __libc_utmp_lock) + + +int +__utmpname (const char *file) +{ + int result = -1; + + __libc_lock_lock (__libc_utmp_lock); + + /* Close the old file. */ + (*__libc_utmp_jump_table->endutent) (); + __libc_utmp_jump_table = &__libc_utmp_unknown_functions; + + if (strcmp (file, __libc_utmp_file_name) != 0) + { + if (strcmp (file, default_file_name) == 0) + { + if (__libc_utmp_file_name != default_file_name) + free ((char *) __libc_utmp_file_name); + + __libc_utmp_file_name = default_file_name; + } + else + { + char *file_name = __strdup (file); + if (file_name == NULL) + /* Out of memory. */ + goto done; + + if (__libc_utmp_file_name != default_file_name) + free ((char *) __libc_utmp_file_name); + + __libc_utmp_file_name = file_name; + } + } + + result = 0; + +done: + __libc_lock_unlock (__libc_utmp_lock); + return result; +} +weak_alias (__utmpname, utmpname) diff -durpN glibc-2.0.4/mach/setup-thread.c glibc-2.0.5/mach/setup-thread.c --- glibc-2.0.4/mach/setup-thread.c Mon Jan 23 03:32:23 1995 +++ glibc-2.0.5/mach/setup-thread.c Tue Aug 5 20:42:58 1997 @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1994, 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include "thread_state.h" @@ -41,33 +41,14 @@ __mach_setup_thread (task_t task, thread mach_msg_type_number_t tssize = MACHINE_THREAD_STATE_COUNT; vm_address_t stack; vm_size_t size; - int anywhere = 0; + int anywhere; size = stack_size ? *stack_size ? : STACK_SIZE : STACK_SIZE; + stack = stack_base ? *stack_base ? : 0 : 0; + anywhere = !stack_base || !*stack_base; - if (stack_base && *stack_base) - stack = *stack_base; - else if (size == STACK_SIZE) - { - /* Cthreads has a bug that makes its stack-probing code fail if - the stack is too low in memory. It's bad to try and fix it there - until cthreads is integrated into libc, so we'll just do it here - by requesting a high address. When the cthreads bug is fixed, - this assignment to STACK should be changed to 0, and the ANYWHERE - argument to vm_allocate should be changed to 0. This comment should - be left, however, in order to confuse people who wonder why its - here. (Though perhaps that last sentence (and this one) should - be deleted to maximize the effect.) */ -#ifdef STACK_GROWTH_DOWN - stack = VM_MAX_ADDRESS - size - __vm_page_size; -#else - stack = VM_MIN_ADDRESS; -#endif - } - else - anywhere = 1; - - if (error = __vm_allocate (task, &stack, size + __vm_page_size, anywhere)) + error = __vm_allocate (task, &stack, size + __vm_page_size, anywhere); + if (error) return error; if (stack_size) @@ -91,7 +72,7 @@ __mach_setup_thread (task_t task, thread /* Create the red zone. */ if (error = __vm_protect (task, stack, __vm_page_size, 0, VM_PROT_NONE)) return error; - + return __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR, (int *) &ts, tssize); } diff -durpN glibc-2.0.4/manual/Makefile glibc-2.0.5/manual/Makefile --- glibc-2.0.4/manual/Makefile Thu Apr 17 16:28:55 1997 +++ glibc-2.0.5/manual/Makefile Mon Aug 4 18:25:52 1997 @@ -23,11 +23,13 @@ export subdir := $(subdir) # We need GNU awk for the xtract-typefun script. GAWK = gawk +# Allow override +INSTALL_INFO = install-info .PHONY: all dvi info all: dvi info dvi: libc.dvi -info: libc.info +info: libc.info dir-add.info # Get glibc's configuration info. ifneq (,$(wildcard ../Makeconfig)) @@ -66,8 +68,11 @@ stamp-summary: summary.awk $(chapters) $ # 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.texi: xtract-typefun.awk $(chapters) - $(GAWK) -f $^ | sort > $@.new; +dir-add.texi: xtract-typefun.awk $(chapters) $(chapters-incl) + (echo "@dircategory GNU C library functions"; \ + echo "@direntry"; \ + $(GAWK) -f $^ | sort; \ + echo "@end direntry";) > $@.new mv -f $@.new $@ # Generate Texinfo files from the C source for the example programs. @@ -75,7 +80,7 @@ dir-add.texi: xtract-typefun.awk $(chapt sed -e 's,[{}],@&,g' \ -e 's,/\*\(@.*\)\*/,\1,g' \ -e 's,/\* *,/* @r{,g' -e 's, *\*/,} */,' \ - -e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/'\ + -e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/g'\ $< | expand > $@.new mv -f $@.new $@ @@ -89,7 +94,7 @@ distribute = $(minimal-dist) $(minimal-dist))) \ libc.info* libc.?? libc.??s texinfo.tex summary.texi \ stamp-summary chapters chapters-incl \ - xtract-typefun.awk + xtract-typefun.awk dir-add.texi dir-add.info dir export distribute := $(distribute) tar-it = tar chovf $@ $^ @@ -118,18 +123,23 @@ glibc-doc-$(edition).tar: $(doc-only-dis .PHONY: mostlyclean distclean realclean clean mostlyclean: - -rm -f libc.dvi libc.info* + -rm -f libc.dvi libc.info* dir-add.info 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 $(foreach index,$(indices),libc.$(index) libc.$(index)s) - -rm -f libc.log libc.aux libc.toc + -rm -f libc.log libc.aux libc.toc dir-add.texi .PHONY: install subdir_install installdirs install-data install-data subdir_install: install -install: $(inst_infodir)/libc.info +install: $(inst_infodir)/libc.info dir-add.info + @if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \ + test -f $(inst_infodir)/dir || cp dir $(inst_infodir);\ + $(INSTALL_INFO) --info-dir=$(inst_infodir) $(inst_infodir)/libc.info;\ + $(INSTALL_INFO) --info-dir=$(inst_infodir) dir-add.info;\ + else : ; fi # Catchall implicit rule for other installation targets from the parent. install-%: ; diff -durpN glibc-2.0.4/manual/dir glibc-2.0.5/manual/dir --- glibc-2.0.4/manual/dir Wed Dec 31 19:00:00 1969 +++ glibc-2.0.5/manual/dir Tue Aug 5 19:34:20 1997 @@ -0,0 +1,16 @@ +$Id: dir,v 2.1.2.1 1997/08/05 23:34:20 drepper Exp $ +This is the file .../info/dir, which contains the topmost node of the +Info hierarchy. The first time you invoke Info you start off +looking at that node, which is (dir)Top. + +File: dir Node: Top This is the top of the INFO tree + + This (the Directory node) gives a menu of major topics. + Typing "q" exits, "?" lists all Info commands, "d" returns here, + "h" gives a primer for first-timers, + "mEmacs" visits the Emacs topic, etc. + + In Emacs, you can click mouse button 2 on a menu item or cross reference + to select it. + +* Menu: diff -durpN glibc-2.0.4/manual/dir-add.info glibc-2.0.5/manual/dir-add.info --- glibc-2.0.4/manual/dir-add.info Wed Dec 31 19:00:00 1969 +++ glibc-2.0.5/manual/dir-add.info Tue Aug 5 18:42:26 1997 @@ -0,0 +1,896 @@ +This is Info file dir-add.info, produced by Makeinfo version 1.67 from +the input file dir-add.texi. + +INFO-DIR-SECTION GNU C library functions +START-INFO-DIR-ENTRY +* ALTWERASE: (libc)Local Modes. +* ARG_MAX: (libc)General Limits. +* BC_BASE_MAX: (libc)Utility Limits. +* BC_DIM_MAX: (libc)Utility Limits. +* BC_DIM_MAX: (libc)Utility Limits. +* BC_SCALE_MAX: (libc)Utility Limits. +* BC_STRING_MAX: (libc)Utility Limits. +* BRKINT: (libc)Input Modes. +* BUFSIZ: (libc)Controlling Buffering. +* CCTS_OFLOW: (libc)Control Modes. +* CHILD_MAX: (libc)General Limits. +* CIGNORE: (libc)Control Modes. +* CLK_TCK: (libc)Basic CPU Time. +* CLOCAL: (libc)Control Modes. +* CLOCKS_PER_SEC: (libc)Basic CPU Time. +* COLL_WEIGHTS_MAX: (libc)Utility Limits. +* CREAD: (libc)Control Modes. +* CRTS_IFLOW: (libc)Control Modes. +* CS5: (libc)Control Modes. +* CS6: (libc)Control Modes. +* CS7: (libc)Control Modes. +* CS8: (libc)Control Modes. +* CSIZE: (libc)Control Modes. +* CSTOPB: (libc)Control Modes. +* DTTOIF: (libc)Directory Entries. +* E2BIG: (libc)Error Codes. +* EACCES: (libc)Error Codes. +* EADDRINUSE: (libc)Error Codes. +* EADDRNOTAVAIL: (libc)Error Codes. +* EADV: (libc)Error Codes. +* EAFNOSUPPORT: (libc)Error Codes. +* EAGAIN: (libc)Error Codes. +* EALREADY: (libc)Error Codes. +* EAUTH: (libc)Error Codes. +* EBACKGROUND: (libc)Error Codes. +* EBADE: (libc)Error Codes. +* EBADF: (libc)Error Codes. +* EBADFD: (libc)Error Codes. +* EBADMSG: (libc)Error Codes. +* EBADR: (libc)Error Codes. +* EBADRPC: (libc)Error Codes. +* EBADRQC: (libc)Error Codes. +* EBADSLT: (libc)Error Codes. +* EBFONT: (libc)Error Codes. +* EBUSY: (libc)Error Codes. +* ECHILD: (libc)Error Codes. +* ECHO: (libc)Local Modes. +* ECHOCTL: (libc)Local Modes. +* ECHOE: (libc)Local Modes. +* ECHOK: (libc)Local Modes. +* ECHOKE: (libc)Local Modes. +* ECHONL: (libc)Local Modes. +* ECHOPRT: (libc)Local Modes. +* ECHRNG: (libc)Error Codes. +* ECOMM: (libc)Error Codes. +* ECONNABORTED: (libc)Error Codes. +* ECONNREFUSED: (libc)Error Codes. +* ECONNRESET: (libc)Error Codes. +* ED: (libc)Error Codes. +* EDEADLK: (libc)Error Codes. +* EDEADLOCK: (libc)Error Codes. +* EDESTADDRREQ: (libc)Error Codes. +* EDIED: (libc)Error Codes. +* EDOM: (libc)Error Codes. +* EDOTDOT: (libc)Error Codes. +* EDQUOT: (libc)Error Codes. +* EEXIST: (libc)Error Codes. +* EFAULT: (libc)Error Codes. +* EFBIG: (libc)Error Codes. +* EFTYPE: (libc)Error Codes. +* EGRATUITOUS: (libc)Error Codes. +* EGREGIOUS: (libc)Error Codes. +* EHOSTDOWN: (libc)Error Codes. +* EHOSTUNREACH: (libc)Error Codes. +* EIDRM: (libc)Error Codes. +* EIEIO: (libc)Error Codes. +* EILSEQ: (libc)Error Codes. +* EINPROGRESS: (libc)Error Codes. +* EINTR: (libc)Error Codes. +* EINVAL: (libc)Error Codes. +* EIO: (libc)Error Codes. +* EISCONN: (libc)Error Codes. +* EISDIR: (libc)Error Codes. +* EISNAM: (libc)Error Codes. +* EL2HLT: (libc)Error Codes. +* EL2NSYNC: (libc)Error Codes. +* EL3HLT: (libc)Error Codes. +* EL3RST: (libc)Error Codes. +* ELIBACC: (libc)Error Codes. +* ELIBBAD: (libc)Error Codes. +* ELIBEXEC: (libc)Error Codes. +* ELIBMAX: (libc)Error Codes. +* ELIBSCN: (libc)Error Codes. +* ELNRNG: (libc)Error Codes. +* ELOOP: (libc)Error Codes. +* EMFILE: (libc)Error Codes. +* EMLINK: (libc)Error Codes. +* EMSGSIZE: (libc)Error Codes. +* EMULTIHOP: (libc)Error Codes. +* ENAMETOOLONG: (libc)Error Codes. +* ENAVAIL: (libc)Error Codes. +* ENEEDAUTH: (libc)Error Codes. +* ENETDOWN: (libc)Error Codes. +* ENETRESET: (libc)Error Codes. +* ENETUNREACH: (libc)Error Codes. +* ENFILE: (libc)Error Codes. +* ENOANO: (libc)Error Codes. +* ENOBUFS: (libc)Error Codes. +* ENOCSI: (libc)Error Codes. +* ENODATA: (libc)Error Codes. +* ENODEV: (libc)Error Codes. +* ENOENT: (libc)Error Codes. +* ENOEXEC: (libc)Error Codes. +* ENOLCK: (libc)Error Codes. +* ENOLINK: (libc)Error Codes. +* ENOMEM: (libc)Error Codes. +* ENOMSG: (libc)Error Codes. +* ENONET: (libc)Error Codes. +* ENOPKG: (libc)Error Codes. +* ENOPROTOOPT: (libc)Error Codes. +* ENOSPC: (libc)Error Codes. +* ENOSR: (libc)Error Codes. +* ENOSTR: (libc)Error Codes. +* ENOSYS: (libc)Error Codes. +* ENOTBLK: (libc)Error Codes. +* ENOTCONN: (libc)Error Codes. +* ENOTDIR: (libc)Error Codes. +* ENOTEMPTY: (libc)Error Codes. +* ENOTNAM: (libc)Error Codes. +* ENOTSOCK: (libc)Error Codes. +* ENOTTY: (libc)Error Codes. +* ENOTUNIQ: (libc)Error Codes. +* ENXIO: (libc)Error Codes. +* EOF: (libc)EOF and Errors. +* EOPNOTSUPP: (libc)Error Codes. +* EOVERFLOW: (libc)Error Codes. +* EPERM: (libc)Error Codes. +* EPFNOSUPPORT: (libc)Error Codes. +* EPIPE: (libc)Error Codes. +* EPROCLIM: (libc)Error Codes. +* EPROCUNAVAIL: (libc)Error Codes. +* EPROGMISMATCH: (libc)Error Codes. +* EPROGUNAVAIL: (libc)Error Codes. +* EPROTO: (libc)Error Codes. +* EPROTONOSUPPORT: (libc)Error Codes. +* EPROTOTYPE: (libc)Error Codes. +* EQUIV_CLASS_MAX: (libc)Utility Limits. +* ERANGE: (libc)Error Codes. +* EREMCHG: (libc)Error Codes. +* EREMOTE: (libc)Error Codes. +* EREMOTEIO: (libc)Error Codes. +* ERESTART: (libc)Error Codes. +* EROFS: (libc)Error Codes. +* ERPCMISMATCH: (libc)Error Codes. +* ESHUTDOWN: (libc)Error Codes. +* ESOCKTNOSUPPORT: (libc)Error Codes. +* ESPIPE: (libc)Error Codes. +* ESRCH: (libc)Error Codes. +* ESRMNT: (libc)Error Codes. +* ESTALE: (libc)Error Codes. +* ESTRPIPE: (libc)Error Codes. +* ETIME: (libc)Error Codes. +* ETIMEDOUT: (libc)Error Codes. +* ETOOMANYREFS: (libc)Error Codes. +* ETXTBSY: (libc)Error Codes. +* EUCLEAN: (libc)Error Codes. +* EUNATCH: (libc)Error Codes. +* EUSERS: (libc)Error Codes. +* EWOULDBLOCK: (libc)Error Codes. +* EXDEV: (libc)Error Codes. +* EXFULL: (libc)Error Codes. +* EXIT_FAILURE: (libc)Exit Status. +* EXIT_SUCCESS: (libc)Exit Status. +* EXPR_NEST_MAX: (libc)Utility Limits. +* FD_CLOEXEC: (libc)Descriptor Flags. +* FD_CLR: (libc)Waiting for I/O. +* FD_ISSET: (libc)Waiting for I/O. +* FD_SET: (libc)Waiting for I/O. +* FD_SETSIZE: (libc)Waiting for I/O. +* FD_ZERO: (libc)Waiting for I/O. +* FILENAME_MAX: (libc)Limits for Files. +* FLUSHO: (libc)Local Modes. +* FOPEN_MAX: (libc)Opening Streams. +* F_DUPFD: (libc)Duplicating Descriptors. +* F_GETFD: (libc)Descriptor Flags. +* F_GETFL: (libc)Getting File Status Flags. +* F_GETLK: (libc)File Locks. +* F_GETOWN: (libc)Interrupt Input. +* F_OK: (libc)Testing File Access. +* F_SETFD: (libc)Descriptor Flags. +* F_SETFL: (libc)Getting File Status Flags. +* F_SETLK: (libc)File Locks. +* F_SETLKW: (libc)File Locks. +* F_SETOWN: (libc)Interrupt Input. +* HUGE_VAL: (libc)Domain and Range Errors. +* HUGE_VALf: (libc)Domain and Range Errors. +* HUGE_VALl: (libc)Domain and Range Errors. +* HUPCL: (libc)Control Modes. +* ICANON: (libc)Local Modes. +* ICRNL: (libc)Input Modes. +* IEXTEN: (libc)Local Modes. +* IFTODT: (libc)Directory Entries. +* IGNBRK: (libc)Input Modes. +* IGNCR: (libc)Input Modes. +* IGNPAR: (libc)Input Modes. +* IMAXBEL: (libc)Input Modes. +* INADDR_ANY: (libc)Host Address Data Type. +* INADDR_BROADCAST: (libc)Host Address Data Type. +* INADDR_LOOPBACK: (libc)Host Address Data Type. +* INADDR_NONE: (libc)Host Address Data Type. +* INLCR: (libc)Input Modes. +* INPCK: (libc)Input Modes. +* IPPORT_RESERVED: (libc)Ports. +* IPPORT_USERRESERVED: (libc)Ports. +* ISIG: (libc)Local Modes. +* ISTRIP: (libc)Input Modes. +* IXANY: (libc)Input Modes. +* IXOFF: (libc)Input Modes. +* IXON: (libc)Input Modes. +* LINE_MAX: (libc)Utility Limits. +* LINK_MAX: (libc)Limits for Files. +* L_ctermid: (libc)Identifying the Terminal. +* L_cuserid: (libc)Who Logged In. +* L_tmpnam: (libc)Temporary Files. +* MAXNAMLEN: (libc)Limits for Files. +* MAX_CANON: (libc)Limits for Files. +* MAX_INPUT: (libc)Limits for Files. +* MB_CUR_MAX: (libc)Multibyte Char Intro. +* MB_LEN_MAX: (libc)Multibyte Char Intro. +* MDMBUF: (libc)Control Modes. +* MSG_DONTROUTE: (libc)Socket Data Options. +* MSG_OOB: (libc)Socket Data Options. +* MSG_PEEK: (libc)Socket Data Options. +* NAME_MAX: (libc)Limits for Files. +* NAN: (libc)Not a Number. +* NCCS: (libc)Mode Data Types. +* NGROUPS_MAX: (libc)General Limits. +* NOFLSH: (libc)Local Modes. +* NOKERNINFO: (libc)Local Modes. +* NSIG: (libc)Standard Signals. +* NULL: (libc)Null Pointer Constant. +* ONLCR: (libc)Output Modes. +* ONOEOT: (libc)Output Modes. +* OPEN_MAX: (libc)General Limits. +* OPOST: (libc)Output Modes. +* OXTABS: (libc)Output Modes. +* O_ACCMODE: (libc)Access Modes. +* O_APPEND: (libc)Operating Modes. +* O_ASYNC: (libc)Operating Modes. +* O_CREAT: (libc)Open-time Flags. +* O_EXCL: (libc)Open-time Flags. +* O_EXEC: (libc)Access Modes. +* O_EXLOCK: (libc)Open-time Flags. +* O_FSYNC: (libc)Operating Modes. +* O_IGNORE_CTTY: (libc)Open-time Flags. +* O_NDELAY: (libc)Operating Modes. +* O_NOATIME: (libc)Operating Modes. +* O_NOCTTY: (libc)Open-time Flags. +* O_NOLINK: (libc)Open-time Flags. +* O_NONBLOCK: (libc)Open-time Flags. +* O_NONBLOCK: (libc)Operating Modes. +* O_NOTRANS: (libc)Open-time Flags. +* O_RDONLY: (libc)Access Modes. +* O_RDWR: (libc)Access Modes. +* O_READ: (libc)Access Modes. +* O_SHLOCK: (libc)Open-time Flags. +* O_SYNC: (libc)Operating Modes. +* O_TRUNC: (libc)Open-time Flags. +* O_WRITE: (libc)Access Modes. +* O_WRONLY: (libc)Access Modes. +* PARENB: (libc)Control Modes. +* PARMRK: (libc)Input Modes. +* PARODD: (libc)Control Modes. +* PATH_MAX: (libc)Limits for Files. +* PA_FLAG_MASK: (libc)Parsing a Template String. +* PENDIN: (libc)Local Modes. +* PF_FILE: (libc)File Namespace Details. +* PF_INET: (libc)Internet Namespace. +* PF_UNIX: (libc)File Namespace Details. +* PIPE_BUF: (libc)Limits for Files. +* P_tmpdir: (libc)Temporary Files. +* RAND_MAX: (libc)ISO Random. +* RE_DUP_MAX: (libc)General Limits. +* R_OK: (libc)Testing File Access. +* SA_NOCLDSTOP: (libc)Flags for Sigaction. +* SA_ONSTACK: (libc)Flags for Sigaction. +* SA_RESTART: (libc)Flags for Sigaction. +* SEEK_CUR: (libc)File Positioning. +* SEEK_END: (libc)File Positioning. +* SEEK_SET: (libc)File Positioning. +* SIGABRT: (libc)Program Error Signals. +* SIGALRM: (libc)Alarm Signals. +* SIGBUS: (libc)Program Error Signals. +* SIGCHLD: (libc)Job Control Signals. +* SIGCLD: (libc)Job Control Signals. +* SIGCONT: (libc)Job Control Signals. +* SIGEMT: (libc)Program Error Signals. +* SIGFPE: (libc)Program Error Signals. +* SIGHUP: (libc)Termination Signals. +* SIGILL: (libc)Program Error Signals. +* SIGINFO: (libc)Miscellaneous Signals. +* SIGINT: (libc)Termination Signals. +* SIGIO: (libc)Asynchronous I/O Signals. +* SIGIOT: (libc)Program Error Signals. +* SIGKILL: (libc)Termination Signals. +* SIGLOST: (libc)Operation Error Signals. +* SIGPIPE: (libc)Operation Error Signals. +* SIGPOLL: (libc)Asynchronous I/O Signals. +* SIGPROF: (libc)Alarm Signals. +* SIGQUIT: (libc)Termination Signals. +* SIGSEGV: (libc)Program Error Signals. +* SIGSTOP: (libc)Job Control Signals. +* SIGSYS: (libc)Program Error Signals. +* SIGTERM: (libc)Termination Signals. +* SIGTRAP: (libc)Program Error Signals. +* SIGTSTP: (libc)Job Control Signals. +* SIGTTIN: (libc)Job Control Signals. +* SIGTTOU: (libc)Job Control Signals. +* SIGURG: (libc)Asynchronous I/O Signals. +* SIGUSR1: (libc)Miscellaneous Signals. +* SIGUSR2: (libc)Miscellaneous Signals. +* SIGVTALRM: (libc)Alarm Signals. +* SIGWINCH: (libc)Miscellaneous Signals. +* SIGXCPU: (libc)Operation Error Signals. +* SIGXFSZ: (libc)Operation Error Signals. +* SIG_ERR: (libc)Basic Signal Handling. +* SOCK_DGRAM: (libc)Communication Styles. +* SOCK_RAW: (libc)Communication Styles. +* SOCK_RDM: (libc)Communication Styles. +* SOCK_SEQPACKET: (libc)Communication Styles. +* SOCK_STREAM: (libc)Communication Styles. +* SOL_SOCKET: (libc)Socket-Level Options. +* SSIZE_MAX: (libc)General Limits. +* STREAM_MAX: (libc)General Limits. +* SV_INTERRUPT: (libc)BSD Handler. +* SV_ONSTACK: (libc)BSD Handler. +* SV_RESETHAND: (libc)BSD Handler. +* S_IFMT: (libc)Testing File Type. +* S_ISBLK: (libc)Testing File Type. +* S_ISCHR: (libc)Testing File Type. +* S_ISDIR: (libc)Testing File Type. +* S_ISFIFO: (libc)Testing File Type. +* S_ISLNK: (libc)Testing File Type. +* S_ISREG: (libc)Testing File Type. +* S_ISSOCK: (libc)Testing File Type. +* TMP_MAX: (libc)Temporary Files. +* TOSTOP: (libc)Local Modes. +* TZNAME_MAX: (libc)General Limits. +* VDISCARD: (libc)Other Special. +* VDSUSP: (libc)Signal Characters. +* VEOF: (libc)Editing Characters. +* VEOL2: (libc)Editing Characters. +* VEOL: (libc)Editing Characters. +* VERASE: (libc)Editing Characters. +* VINTR: (libc)Signal Characters. +* VKILL: (libc)Editing Characters. +* VLNEXT: (libc)Other Special. +* VMIN: (libc)Noncanonical Input. +* VQUIT: (libc)Signal Characters. +* VREPRINT: (libc)Editing Characters. +* VSTART: (libc)Start/Stop Characters. +* VSTATUS: (libc)Other Special. +* VSTOP: (libc)Start/Stop Characters. +* VSUSP: (libc)Signal Characters. +* VTIME: (libc)Noncanonical Input. +* VWERASE: (libc)Editing Characters. +* WCOREDUMP: (libc)Process Completion Status. +* WEXITSTATUS: (libc)Process Completion Status. +* WIFEXITED: (libc)Process Completion Status. +* WIFSIGNALED: (libc)Process Completion Status. +* WIFSTOPPED: (libc)Process Completion Status. +* WSTOPSIG: (libc)Process Completion Status. +* WTERMSIG: (libc)Process Completion Status. +* W_OK: (libc)Testing File Access. +* X_OK: (libc)Testing File Access. +* _IOFBF: (libc)Controlling Buffering. +* _IOLBF: (libc)Controlling Buffering. +* _IONBF: (libc)Controlling Buffering. +* _POSIX2_C_DEV: (libc)System Options. +* _POSIX2_C_VERSION: (libc)Version Supported. +* _POSIX2_FORT_DEV: (libc)System Options. +* _POSIX2_FORT_RUN: (libc)System Options. +* _POSIX2_LOCALEDEF: (libc)System Options. +* _POSIX2_SW_DEV: (libc)System Options. +* _POSIX_CHOWN_RESTRICTED: (libc)Options for Files. +* _POSIX_JOB_CONTROL: (libc)System Options. +* _POSIX_NO_TRUNC: (libc)Options for Files. +* _POSIX_SAVED_IDS: (libc)System Options. +* _POSIX_VDISABLE: (libc)Options for Files. +* _POSIX_VERSION: (libc)Version Supported. +* _exit: (libc)Termination Internals. +* _tolower: (libc)Case Conversion. +* _toupper: (libc)Case Conversion. +* abort: (libc)Aborting a Program. +* abs: (libc)Absolute Value. +* accept: (libc)Accepting Connections. +* access: (libc)Testing File Access. +* acos: (libc)Inverse Trig Functions. +* acosh: (libc)Hyperbolic Functions. +* adjtime: (libc)High-Resolution Calendar. +* alarm: (libc)Setting an Alarm. +* alloca: (libc)Variable Size Automatic. +* alphasort: (libc)Scanning Directory Content. +* asctime: (libc)Formatting Date and Time. +* asin: (libc)Inverse Trig Functions. +* asinh: (libc)Hyperbolic Functions. +* asprintf: (libc)Dynamic Output. +* assert: (libc)Consistency Checking. +* assert_perror: (libc)Consistency Checking. +* atan2: (libc)Inverse Trig Functions. +* atan: (libc)Inverse Trig Functions. +* atanh: (libc)Hyperbolic Functions. +* atexit: (libc)Cleanups on Exit. +* atof: (libc)Parsing of Floats. +* atoi: (libc)Parsing of Integers. +* atol: (libc)Parsing of Integers. +* bcmp: (libc)String/Array Comparison. +* bcopy: (libc)Copying and Concatenation. +* bind: (libc)Setting Address. +* bsearch: (libc)Array Search Function. +* bzero: (libc)Copying and Concatenation. +* cabs: (libc)Absolute Value. +* calloc: (libc)Allocating Cleared Space. +* cbrt: (libc)Exponents and Logarithms. +* ceil: (libc)Rounding and Remainders. +* cfgetispeed: (libc)Line Speed. +* cfgetospeed: (libc)Line Speed. +* cfmakeraw: (libc)Noncanonical Input. +* cfree: (libc)Freeing after Malloc. +* cfsetispeed: (libc)Line Speed. +* cfsetospeed: (libc)Line Speed. +* cfsetspeed: (libc)Line Speed. +* chdir: (libc)Working Directory. +* chmod: (libc)Setting Permissions. +* chown: (libc)File Owner. +* clearerr: (libc)EOF and Errors. +* clock: (libc)Basic CPU Time. +* close: (libc)Opening and Closing Files. +* closedir: (libc)Reading/Closing Directory. +* confstr: (libc)String Parameters. +* connect: (libc)Connecting. +* copysign: (libc)Normalization Functions. +* cos: (libc)Trig Functions. +* cosh: (libc)Hyperbolic Functions. +* creat: (libc)Opening and Closing Files. +* ctermid: (libc)Identifying the Terminal. +* ctime: (libc)Formatting Date and Time. +* cuserid: (libc)Who Logged In. +* difftime: (libc)Simple Calendar Time. +* div: (libc)Integer Division. +* drem: (libc)Rounding and Remainders. +* dup2: (libc)Duplicating Descriptors. +* dup: (libc)Duplicating Descriptors. +* endgrent: (libc)Scanning All Groups. +* endhostent: (libc)Host Names. +* endnetent: (libc)Networks Database. +* endnetgrent: (libc)Lookup Netgroup. +* endprotoent: (libc)Protocols Database. +* endpwent: (libc)Scanning All Users. +* endservent: (libc)Services Database. +* errno: (libc)Checking for Errors. +* execl: (libc)Executing a File. +* execle: (libc)Executing a File. +* execlp: (libc)Executing a File. +* execv: (libc)Executing a File. +* execve: (libc)Executing a File. +* execvp: (libc)Executing a File. +* exit: (libc)Normal Termination. +* exp: (libc)Exponents and Logarithms. +* expm1: (libc)Exponents and Logarithms. +* fabs: (libc)Absolute Value. +* fchmod: (libc)Setting Permissions. +* fchown: (libc)File Owner. +* fclean: (libc)Cleaning Streams. +* fclose: (libc)Closing Streams. +* fcloseall: (libc)Closing Streams. +* fcntl: (libc)Control Operations. +* fdopen: (libc)Descriptors and Streams. +* feof: (libc)EOF and Errors. +* ferror: (libc)EOF and Errors. +* fflush: (libc)Flushing Buffers. +* fgetc: (libc)Character Input. +* fgetgrent: (libc)Scanning All Groups. +* fgetgrent_r: (libc)Scanning All Groups. +* fgetpos: (libc)Portable Positioning. +* fgetpwent: (libc)Scanning All Users. +* fgetpwent_r: (libc)Scanning All Users. +* fgets: (libc)Line Input. +* fileno: (libc)Descriptors and Streams. +* finite: (libc)Predicates on Floats. +* floor: (libc)Rounding and Remainders. +* fmemopen: (libc)String Streams. +* fmod: (libc)Rounding and Remainders. +* fnmatch: (libc)Wildcard Matching. +* fopen: (libc)Opening Streams. +* fopencookie: (libc)Streams and Cookies. +* fork: (libc)Creating a Process. +* fpathconf: (libc)Pathconf. +* fprintf: (libc)Formatted Output Functions. +* fputc: (libc)Simple Output. +* fputs: (libc)Simple Output. +* fread: (libc)Block Input/Output. +* free: (libc)Freeing after Malloc. +* freopen: (libc)Opening Streams. +* frexp: (libc)Normalization Functions. +* fscanf: (libc)Formatted Input Functions. +* fseek: (libc)File Positioning. +* fsetpos: (libc)Portable Positioning. +* fstat: (libc)Reading Attributes. +* ftell: (libc)File Positioning. +* fwrite: (libc)Block Input/Output. +* getc: (libc)Character Input. +* getchar: (libc)Character Input. +* getcwd: (libc)Working Directory. +* getdelim: (libc)Line Input. +* getegid: (libc)Reading Persona. +* getenv: (libc)Environment Access. +* geteuid: (libc)Reading Persona. +* getgid: (libc)Reading Persona. +* getgrent: (libc)Scanning All Groups. +* getgrent_r: (libc)Scanning All Groups. +* getgrgid: (libc)Lookup Group. +* getgrgid_r: (libc)Lookup Group. +* getgrnam: (libc)Lookup Group. +* getgrnam_r: (libc)Lookup Group. +* getgroups: (libc)Reading Persona. +* gethostbyaddr: (libc)Host Names. +* gethostbyname2: (libc)Host Names. +* gethostbyname: (libc)Host Names. +* gethostent: (libc)Host Names. +* gethostid: (libc)Host Identification. +* gethostname: (libc)Host Identification. +* getitimer: (libc)Setting an Alarm. +* getline: (libc)Line Input. +* getlogin: (libc)Who Logged In. +* getnetbyaddr: (libc)Networks Database. +* getnetbyname: (libc)Networks Database. +* getnetent: (libc)Networks Database. +* getnetgrent: (libc)Lookup Netgroup. +* getnetgrent_r: (libc)Lookup Netgroup. +* getopt: (libc)Parsing Options. +* getopt_long: (libc)Long Options. +* getpeername: (libc)Who is Connected. +* getpgrp: (libc)Process Group Functions. +* getpgrp: (libc)Process Group Functions. +* getpid: (libc)Process Identification. +* getppid: (libc)Process Identification. +* getpriority: (libc)Priority. +* getprotobyname: (libc)Protocols Database. +* getprotobynumber: (libc)Protocols Database. +* getprotoent: (libc)Protocols Database. +* getpwent: (libc)Scanning All Users. +* getpwent_r: (libc)Scanning All Users. +* getpwnam: (libc)Lookup User. +* getpwnam_r: (libc)Lookup User. +* getpwuid: (libc)Lookup User. +* getpwuid_r: (libc)Lookup User. +* getrlimit: (libc)Limits on Resources. +* getrusage: (libc)Resource Usage. +* gets: (libc)Line Input. +* getservbyname: (libc)Services Database. +* getservbyport: (libc)Services Database. +* getservent: (libc)Services Database. +* getsockname: (libc)Reading Address. +* getsockopt: (libc)Socket Option Functions. +* getsubopt: (libc)Suboptions. +* gettimeofday: (libc)High-Resolution Calendar. +* getuid: (libc)Reading Persona. +* getumask: (libc)Setting Permissions. +* getw: (libc)Character Input. +* getwd: (libc)Working Directory. +* glob: (libc)Calling Glob. +* gmtime: (libc)Broken-down Time. +* gsignal: (libc)Signaling Yourself. +* htonl: (libc)Byte Order. +* htons: (libc)Byte Order. +* hypot: (libc)Exponents and Logarithms. +* in6addr_any: (libc)Host Address Data Type. +* in6addr_loopback: (libc)Host Address Data Type. +* index: (libc)Search Functions. +* inet_addr: (libc)Host Address Functions. +* inet_aton: (libc)Host Address Functions. +* inet_lnaof: (libc)Host Address Functions. +* inet_makeaddr: (libc)Host Address Functions. +* inet_netof: (libc)Host Address Functions. +* inet_network: (libc)Host Address Functions. +* inet_ntoa: (libc)Host Address Functions. +* inet_ntop: (libc)Host Address Functions. +* inet_pton: (libc)Host Address Functions. +* infnan: (libc)Predicates on Floats. +* initgroups: (libc)Setting Groups. +* initstate: (libc)BSD Random. +* innetgr: (libc)Netgroup Membership. +* isalnum: (libc)Classification of Characters. +* isalpha: (libc)Classification of Characters. +* isascii: (libc)Classification of Characters. +* isatty: (libc)Is It a Terminal. +* isblank: (libc)Classification of Characters. +* iscntrl: (libc)Classification of Characters. +* isdigit: (libc)Classification of Characters. +* isgraph: (libc)Classification of Characters. +* isinf: (libc)Predicates on Floats. +* islower: (libc)Classification of Characters. +* isnan: (libc)Predicates on Floats. +* isprint: (libc)Classification of Characters. +* ispunct: (libc)Classification of Characters. +* isspace: (libc)Classification of Characters. +* isupper: (libc)Classification of Characters. +* isxdigit: (libc)Classification of Characters. +* kill: (libc)Signaling Another Process. +* killpg: (libc)Signaling Another Process. +* labs: (libc)Absolute Value. +* ldexp: (libc)Normalization Functions. +* ldiv: (libc)Integer Division. +* link: (libc)Hard Links. +* listen: (libc)Listening. +* localeconv: (libc)Numeric Formatting. +* localtime: (libc)Broken-down Time. +* log10: (libc)Exponents and Logarithms. +* log1p: (libc)Exponents and Logarithms. +* log: (libc)Exponents and Logarithms. +* logb: (libc)Normalization Functions. +* longjmp: (libc)Non-Local Details. +* lseek: (libc)File Position Primitive. +* lstat: (libc)Reading Attributes. +* mallinfo: (libc)Statistics of Malloc. +* malloc: (libc)Basic Allocation. +* mallopt: (libc)Malloc Tunable Parameters. +* mblen: (libc)Length of Char. +* mbstowcs: (libc)Wide String Conversion. +* mbtowc: (libc)Converting One Char. +* mcheck: (libc)Heap Consistency Checking. +* memalign: (libc)Aligned Memory Blocks. +* memccpy: (libc)Copying and Concatenation. +* memchr: (libc)Search Functions. +* memcmp: (libc)String/Array Comparison. +* memcpy: (libc)Copying and Concatenation. +* memmem: (libc)Search Functions. +* memmove: (libc)Copying and Concatenation. +* memset: (libc)Copying and Concatenation. +* mkdir: (libc)Creating Directories. +* mkfifo: (libc)FIFO Special Files. +* mknod: (libc)Making Special Files. +* mkstemp: (libc)Temporary Files. +* mktemp: (libc)Temporary Files. +* mktime: (libc)Broken-down Time. +* modf: (libc)Rounding and Remainders. +* mprobe: (libc)Heap Consistency Checking. +* nice: (libc)Priority. +* ntohl: (libc)Byte Order. +* ntohs: (libc)Byte Order. +* obstack_1grow: (libc)Growing Objects. +* obstack_1grow_fast: (libc)Extra Fast Growing. +* obstack_alignment_mask: (libc)Obstacks Data Alignment. +* obstack_alloc: (libc)Allocation in an Obstack. +* obstack_base: (libc)Status of an Obstack. +* obstack_blank: (libc)Growing Objects. +* obstack_blank_fast: (libc)Extra Fast Growing. +* obstack_chunk_size: (libc)Obstack Chunks. +* obstack_copy0: (libc)Allocation in an Obstack. +* obstack_copy: (libc)Allocation in an Obstack. +* obstack_finish: (libc)Growing Objects. +* obstack_free: (libc)Freeing Obstack Objects. +* obstack_grow0: (libc)Growing Objects. +* obstack_grow: (libc)Growing Objects. +* obstack_init: (libc)Preparing for Obstacks. +* obstack_int_grow: (libc)Growing Objects. +* obstack_int_grow_fast: (libc)Extra Fast Growing. +* obstack_next_free: (libc)Status of an Obstack. +* obstack_object_size: (libc)Growing Objects. +* obstack_object_size: (libc)Status of an Obstack. +* obstack_printf: (libc)Dynamic Output. +* obstack_ptr_grow: (libc)Growing Objects. +* obstack_ptr_grow_fast: (libc)Extra Fast Growing. +* obstack_room: (libc)Extra Fast Growing. +* obstack_vprintf: (libc)Variable Arguments Output. +* offsetof: (libc)Structure Measurement. +* on_exit: (libc)Cleanups on Exit. +* open: (libc)Opening and Closing Files. +* open_memstream: (libc)String Streams. +* open_obstack_stream: (libc)Obstack Streams. +* opendir: (libc)Opening a Directory. +* parse_printf_format: (libc)Parsing a Template String. +* pathconf: (libc)Pathconf. +* pause: (libc)Using Pause. +* pclose: (libc)Pipe to a Subprocess. +* perror: (libc)Error Messages. +* pipe: (libc)Creating a Pipe. +* popen: (libc)Pipe to a Subprocess. +* pow: (libc)Exponents and Logarithms. +* printf: (libc)Formatted Output Functions. +* psignal: (libc)Signal Messages. +* putc: (libc)Simple Output. +* putchar: (libc)Simple Output. +* putenv: (libc)Environment Access. +* putpwent: (libc)Writing a User Entry. +* puts: (libc)Simple Output. +* putw: (libc)Simple Output. +* qsort: (libc)Array Sort Function. +* r_alloc: (libc)Using Relocator. +* r_alloc_free: (libc)Using Relocator. +* r_re_alloc: (libc)Using Relocator. +* raise: (libc)Signaling Yourself. +* rand: (libc)ISO Random. +* random: (libc)BSD Random. +* read: (libc)I/O Primitives. +* readdir: (libc)Reading/Closing Directory. +* readdir_r: (libc)Reading/Closing Directory. +* readlink: (libc)Symbolic Links. +* realloc: (libc)Changing Block Size. +* recv: (libc)Receiving Data. +* recvfrom: (libc)Receiving Datagrams. +* recvmsg: (libc)Receiving Datagrams. +* regcomp: (libc)POSIX Regexp Compilation. +* regerror: (libc)Regexp Cleanup. +* regexec: (libc)Matching POSIX Regexps. +* regfree: (libc)Regexp Cleanup. +* register_printf_function: (libc)Registering New Conversions. +* remove: (libc)Deleting Files. +* rename: (libc)Renaming Files. +* rewind: (libc)File Positioning. +* rewinddir: (libc)Random Access Directory. +* rindex: (libc)Search Functions. +* rint: (libc)Rounding and Remainders. +* rmdir: (libc)Deleting Files. +* scalb: (libc)Normalization Functions. +* scandir: (libc)Scanning Directory Content. +* scanf: (libc)Formatted Input Functions. +* seekdir: (libc)Random Access Directory. +* select: (libc)Waiting for I/O. +* send: (libc)Sending Data. +* sendmsg: (libc)Receiving Datagrams. +* sendto: (libc)Sending Datagrams. +* setbuf: (libc)Controlling Buffering. +* setbuffer: (libc)Controlling Buffering. +* setgid: (libc)Setting Groups. +* setgrent: (libc)Scanning All Groups. +* setgroups: (libc)Setting Groups. +* sethostent: (libc)Host Names. +* sethostid: (libc)Host Identification. +* sethostname: (libc)Host Identification. +* setitimer: (libc)Setting an Alarm. +* setjmp: (libc)Non-Local Details. +* setlinebuf: (libc)Controlling Buffering. +* setlocale: (libc)Setting the Locale. +* setnetent: (libc)Networks Database. +* setnetgrent: (libc)Lookup Netgroup. +* setpgid: (libc)Process Group Functions. +* setpgrp: (libc)Process Group Functions. +* setpriority: (libc)Priority. +* setprotoent: (libc)Protocols Database. +* setpwent: (libc)Scanning All Users. +* setregid: (libc)Setting Groups. +* setreuid: (libc)Setting User ID. +* setrlimit: (libc)Limits on Resources. +* setservent: (libc)Services Database. +* setsid: (libc)Process Group Functions. +* setsockopt: (libc)Socket Option Functions. +* setstate: (libc)BSD Random. +* settimeofday: (libc)High-Resolution Calendar. +* setuid: (libc)Setting User ID. +* setvbuf: (libc)Controlling Buffering. +* shutdown: (libc)Closing a Socket. +* sigaction: (libc)Advanced Signal Handling. +* sigaddset: (libc)Signal Sets. +* sigaltstack: (libc)Signal Stack. +* sigblock: (libc)Blocking in BSD. +* sigdelset: (libc)Signal Sets. +* sigemptyset: (libc)Signal Sets. +* sigfillset: (libc)Signal Sets. +* siginterrupt: (libc)BSD Handler. +* sigismember: (libc)Signal Sets. +* siglongjmp: (libc)Non-Local Exits and Signals. +* sigmask: (libc)Blocking in BSD. +* signal: (libc)Basic Signal Handling. +* sigpause: (libc)Blocking in BSD. +* sigpending: (libc)Checking for Pending Signals. +* sigprocmask: (libc)Process Signal Mask. +* sigsetjmp: (libc)Non-Local Exits and Signals. +* sigsetmask: (libc)Blocking in BSD. +* sigstack: (libc)Signal Stack. +* sigsuspend: (libc)Sigsuspend. +* sigvec: (libc)BSD Handler. +* sin: (libc)Trig Functions. +* sinh: (libc)Hyperbolic Functions. +* sleep: (libc)Sleeping. +* snprintf: (libc)Formatted Output Functions. +* socket: (libc)Creating a Socket. +* socketpair: (libc)Socket Pairs. +* sprintf: (libc)Formatted Output Functions. +* sqrt: (libc)Exponents and Logarithms. +* srand: (libc)ISO Random. +* srandom: (libc)BSD Random. +* sscanf: (libc)Formatted Input Functions. +* ssignal: (libc)Basic Signal Handling. +* stat: (libc)Reading Attributes. +* stpcpy: (libc)Copying and Concatenation. +* stpncpy: (libc)Copying and Concatenation. +* strcasecmp: (libc)String/Array Comparison. +* strcat: (libc)Copying and Concatenation. +* strchr: (libc)Search Functions. +* strcmp: (libc)String/Array Comparison. +* strcoll: (libc)Collation Functions. +* strcpy: (libc)Copying and Concatenation. +* strcspn: (libc)Search Functions. +* strdup: (libc)Copying and Concatenation. +* strdupa: (libc)Copying and Concatenation. +* strerror: (libc)Error Messages. +* strerror_r: (libc)Error Messages. +* strftime: (libc)Formatting Date and Time. +* strlen: (libc)String Length. +* strncasecmp: (libc)String/Array Comparison. +* strncat: (libc)Copying and Concatenation. +* strncmp: (libc)String/Array Comparison. +* strncpy: (libc)Copying and Concatenation. +* strndup: (libc)Copying and Concatenation. +* strndupa: (libc)Copying and Concatenation. +* strpbrk: (libc)Search Functions. +* strrchr: (libc)Search Functions. +* strsep: (libc)Finding Tokens in a String. +* strsignal: (libc)Signal Messages. +* strspn: (libc)Search Functions. +* strstr: (libc)Search Functions. +* strtod: (libc)Parsing of Floats. +* strtof: (libc)Parsing of Floats. +* strtok: (libc)Finding Tokens in a String. +* strtok_r: (libc)Finding Tokens in a String. +* strtol: (libc)Parsing of Integers. +* strtold: (libc)Parsing of Floats. +* strtoll: (libc)Parsing of Integers. +* strtoq: (libc)Parsing of Integers. +* strtoul: (libc)Parsing of Integers. +* strtoull: (libc)Parsing of Integers. +* strtouq: (libc)Parsing of Integers. +* strxfrm: (libc)Collation Functions. +* symlink: (libc)Symbolic Links. +* sysconf: (libc)Sysconf Definition. +* system: (libc)Running a Command. +* tan: (libc)Trig Functions. +* tanh: (libc)Hyperbolic Functions. +* tcdrain: (libc)Line Control. +* tcflow: (libc)Line Control. +* tcflush: (libc)Line Control. +* tcgetattr: (libc)Mode Functions. +* tcgetpgrp: (libc)Terminal Access Functions. +* tcsendbreak: (libc)Line Control. +* tcsetattr: (libc)Mode Functions. +* tcsetpgrp: (libc)Terminal Access Functions. +* telldir: (libc)Random Access Directory. +* tempnam: (libc)Temporary Files. +* time: (libc)Simple Calendar Time. +* times: (libc)Detailed CPU Time. +* tmpfile: (libc)Temporary Files. +* tmpnam: (libc)Temporary Files. +* tmpnam_r: (libc)Temporary Files. +* toascii: (libc)Case Conversion. +* tolower: (libc)Case Conversion. +* toupper: (libc)Case Conversion. +* ttyname: (libc)Is It a Terminal. +* tzset: (libc)Time Zone Functions. +* umask: (libc)Setting Permissions. +* uname: (libc)Hardware/Software Type ID. +* ungetc: (libc)How Unread. +* unlink: (libc)Deleting Files. +* utime: (libc)File Times. +* utimes: (libc)File Times. +* va_arg: (libc)Argument Macros. +* va_end: (libc)Argument Macros. +* va_start: (libc)Argument Macros. +* va_start: (libc)Old Varargs. +* valloc: (libc)Aligned Memory Blocks. +* vasprintf: (libc)Variable Arguments Output. +* vfork: (libc)Creating a Process. +* vfprintf: (libc)Variable Arguments Output. +* vfscanf: (libc)Variable Arguments Input. +* vprintf: (libc)Variable Arguments Output. +* vscanf: (libc)Variable Arguments Input. +* vsnprintf: (libc)Variable Arguments Output. +* vsprintf: (libc)Variable Arguments Output. +* vsscanf: (libc)Variable Arguments Input. +* wait3: (libc)BSD Wait Functions. +* wait4: (libc)Process Completion. +* wait: (libc)Process Completion. +* waitpid: (libc)Process Completion. +* wcstombs: (libc)Wide String Conversion. +* wctomb: (libc)Converting One Char. +* wordexp: (libc)Calling Wordexp. +* wordfree: (libc)Calling Wordexp. +* write: (libc)I/O Primitives. +END-INFO-DIR-ENTRY + diff -durpN glibc-2.0.4/manual/dir-add.texi glibc-2.0.5/manual/dir-add.texi --- glibc-2.0.4/manual/dir-add.texi Wed Dec 31 19:00:00 1969 +++ glibc-2.0.5/manual/dir-add.texi Tue Aug 5 18:42:25 1997 @@ -0,0 +1,892 @@ +@dircategory GNU C library functions +@direntry +* ALTWERASE: (libc)Local Modes. +* ARG_MAX: (libc)General Limits. +* BC_BASE_MAX: (libc)Utility Limits. +* BC_DIM_MAX: (libc)Utility Limits. +* BC_DIM_MAX: (libc)Utility Limits. +* BC_SCALE_MAX: (libc)Utility Limits. +* BC_STRING_MAX: (libc)Utility Limits. +* BRKINT: (libc)Input Modes. +* BUFSIZ: (libc)Controlling Buffering. +* CCTS_OFLOW: (libc)Control Modes. +* CHILD_MAX: (libc)General Limits. +* CIGNORE: (libc)Control Modes. +* CLK_TCK: (libc)Basic CPU Time. +* CLOCAL: (libc)Control Modes. +* CLOCKS_PER_SEC: (libc)Basic CPU Time. +* COLL_WEIGHTS_MAX: (libc)Utility Limits. +* CREAD: (libc)Control Modes. +* CRTS_IFLOW: (libc)Control Modes. +* CS5: (libc)Control Modes. +* CS6: (libc)Control Modes. +* CS7: (libc)Control Modes. +* CS8: (libc)Control Modes. +* CSIZE: (libc)Control Modes. +* CSTOPB: (libc)Control Modes. +* DTTOIF: (libc)Directory Entries. +* E2BIG: (libc)Error Codes. +* EACCES: (libc)Error Codes. +* EADDRINUSE: (libc)Error Codes. +* EADDRNOTAVAIL: (libc)Error Codes. +* EADV: (libc)Error Codes. +* EAFNOSUPPORT: (libc)Error Codes. +* EAGAIN: (libc)Error Codes. +* EALREADY: (libc)Error Codes. +* EAUTH: (libc)Error Codes. +* EBACKGROUND: (libc)Error Codes. +* EBADE: (libc)Error Codes. +* EBADF: (libc)Error Codes. +* EBADFD: (libc)Error Codes. +* EBADMSG: (libc)Error Codes. +* EBADR: (libc)Error Codes. +* EBADRPC: (libc)Error Codes. +* EBADRQC: (libc)Error Codes. +* EBADSLT: (libc)Error Codes. +* EBFONT: (libc)Error Codes. +* EBUSY: (libc)Error Codes. +* ECHILD: (libc)Error Codes. +* ECHO: (libc)Local Modes. +* ECHOCTL: (libc)Local Modes. +* ECHOE: (libc)Local Modes. +* ECHOK: (libc)Local Modes. +* ECHOKE: (libc)Local Modes. +* ECHONL: (libc)Local Modes. +* ECHOPRT: (libc)Local Modes. +* ECHRNG: (libc)Error Codes. +* ECOMM: (libc)Error Codes. +* ECONNABORTED: (libc)Error Codes. +* ECONNREFUSED: (libc)Error Codes. +* ECONNRESET: (libc)Error Codes. +* ED: (libc)Error Codes. +* EDEADLK: (libc)Error Codes. +* EDEADLOCK: (libc)Error Codes. +* EDESTADDRREQ: (libc)Error Codes. +* EDIED: (libc)Error Codes. +* EDOM: (libc)Error Codes. +* EDOTDOT: (libc)Error Codes. +* EDQUOT: (libc)Error Codes. +* EEXIST: (libc)Error Codes. +* EFAULT: (libc)Error Codes. +* EFBIG: (libc)Error Codes. +* EFTYPE: (libc)Error Codes. +* EGRATUITOUS: (libc)Error Codes. +* EGREGIOUS: (libc)Error Codes. +* EHOSTDOWN: (libc)Error Codes. +* EHOSTUNREACH: (libc)Error Codes. +* EIDRM: (libc)Error Codes. +* EIEIO: (libc)Error Codes. +* EILSEQ: (libc)Error Codes. +* EINPROGRESS: (libc)Error Codes. +* EINTR: (libc)Error Codes. +* EINVAL: (libc)Error Codes. +* EIO: (libc)Error Codes. +* EISCONN: (libc)Error Codes. +* EISDIR: (libc)Error Codes. +* EISNAM: (libc)Error Codes. +* EL2HLT: (libc)Error Codes. +* EL2NSYNC: (libc)Error Codes. +* EL3HLT: (libc)Error Codes. +* EL3RST: (libc)Error Codes. +* ELIBACC: (libc)Error Codes. +* ELIBBAD: (libc)Error Codes. +* ELIBEXEC: (libc)Error Codes. +* ELIBMAX: (libc)Error Codes. +* ELIBSCN: (libc)Error Codes. +* ELNRNG: (libc)Error Codes. +* ELOOP: (libc)Error Codes. +* EMFILE: (libc)Error Codes. +* EMLINK: (libc)Error Codes. +* EMSGSIZE: (libc)Error Codes. +* EMULTIHOP: (libc)Error Codes. +* ENAMETOOLONG: (libc)Error Codes. +* ENAVAIL: (libc)Error Codes. +* ENEEDAUTH: (libc)Error Codes. +* ENETDOWN: (libc)Error Codes. +* ENETRESET: (libc)Error Codes. +* ENETUNREACH: (libc)Error Codes. +* ENFILE: (libc)Error Codes. +* ENOANO: (libc)Error Codes. +* ENOBUFS: (libc)Error Codes. +* ENOCSI: (libc)Error Codes. +* ENODATA: (libc)Error Codes. +* ENODEV: (libc)Error Codes. +* ENOENT: (libc)Error Codes. +* ENOEXEC: (libc)Error Codes. +* ENOLCK: (libc)Error Codes. +* ENOLINK: (libc)Error Codes. +* ENOMEM: (libc)Error Codes. +* ENOMSG: (libc)Error Codes. +* ENONET: (libc)Error Codes. +* ENOPKG: (libc)Error Codes. +* ENOPROTOOPT: (libc)Error Codes. +* ENOSPC: (libc)Error Codes. +* ENOSR: (libc)Error Codes. +* ENOSTR: (libc)Error Codes. +* ENOSYS: (libc)Error Codes. +* ENOTBLK: (libc)Error Codes. +* ENOTCONN: (libc)Error Codes. +* ENOTDIR: (libc)Error Codes. +* ENOTEMPTY: (libc)Error Codes. +* ENOTNAM: (libc)Error Codes. +* ENOTSOCK: (libc)Error Codes. +* ENOTTY: (libc)Error Codes. +* ENOTUNIQ: (libc)Error Codes. +* ENXIO: (libc)Error Codes. +* EOF: (libc)EOF and Errors. +* EOPNOTSUPP: (libc)Error Codes. +* EOVERFLOW: (libc)Error Codes. +* EPERM: (libc)Error Codes. +* EPFNOSUPPORT: (libc)Error Codes. +* EPIPE: (libc)Error Codes. +* EPROCLIM: (libc)Error Codes. +* EPROCUNAVAIL: (libc)Error Codes. +* EPROGMISMATCH: (libc)Error Codes. +* EPROGUNAVAIL: (libc)Error Codes. +* EPROTO: (libc)Error Codes. +* EPROTONOSUPPORT: (libc)Error Codes. +* EPROTOTYPE: (libc)Error Codes. +* EQUIV_CLASS_MAX: (libc)Utility Limits. +* ERANGE: (libc)Error Codes. +* EREMCHG: (libc)Error Codes. +* EREMOTE: (libc)Error Codes. +* EREMOTEIO: (libc)Error Codes. +* ERESTART: (libc)Error Codes. +* EROFS: (libc)Error Codes. +* ERPCMISMATCH: (libc)Error Codes. +* ESHUTDOWN: (libc)Error Codes. +* ESOCKTNOSUPPORT: (libc)Error Codes. +* ESPIPE: (libc)Error Codes. +* ESRCH: (libc)Error Codes. +* ESRMNT: (libc)Error Codes. +* ESTALE: (libc)Error Codes. +* ESTRPIPE: (libc)Error Codes. +* ETIME: (libc)Error Codes. +* ETIMEDOUT: (libc)Error Codes. +* ETOOMANYREFS: (libc)Error Codes. +* ETXTBSY: (libc)Error Codes. +* EUCLEAN: (libc)Error Codes. +* EUNATCH: (libc)Error Codes. +* EUSERS: (libc)Error Codes. +* EWOULDBLOCK: (libc)Error Codes. +* EXDEV: (libc)Error Codes. +* EXFULL: (libc)Error Codes. +* EXIT_FAILURE: (libc)Exit Status. +* EXIT_SUCCESS: (libc)Exit Status. +* EXPR_NEST_MAX: (libc)Utility Limits. +* FD_CLOEXEC: (libc)Descriptor Flags. +* FD_CLR: (libc)Waiting for I/O. +* FD_ISSET: (libc)Waiting for I/O. +* FD_SET: (libc)Waiting for I/O. +* FD_SETSIZE: (libc)Waiting for I/O. +* FD_ZERO: (libc)Waiting for I/O. +* FILENAME_MAX: (libc)Limits for Files. +* FLUSHO: (libc)Local Modes. +* FOPEN_MAX: (libc)Opening Streams. +* F_DUPFD: (libc)Duplicating Descriptors. +* F_GETFD: (libc)Descriptor Flags. +* F_GETFL: (libc)Getting File Status Flags. +* F_GETLK: (libc)File Locks. +* F_GETOWN: (libc)Interrupt Input. +* F_OK: (libc)Testing File Access. +* F_SETFD: (libc)Descriptor Flags. +* F_SETFL: (libc)Getting File Status Flags. +* F_SETLK: (libc)File Locks. +* F_SETLKW: (libc)File Locks. +* F_SETOWN: (libc)Interrupt Input. +* HUGE_VAL: (libc)Domain and Range Errors. +* HUGE_VALf: (libc)Domain and Range Errors. +* HUGE_VALl: (libc)Domain and Range Errors. +* HUPCL: (libc)Control Modes. +* ICANON: (libc)Local Modes. +* ICRNL: (libc)Input Modes. +* IEXTEN: (libc)Local Modes. +* IFTODT: (libc)Directory Entries. +* IGNBRK: (libc)Input Modes. +* IGNCR: (libc)Input Modes. +* IGNPAR: (libc)Input Modes. +* IMAXBEL: (libc)Input Modes. +* INADDR_ANY: (libc)Host Address Data Type. +* INADDR_BROADCAST: (libc)Host Address Data Type. +* INADDR_LOOPBACK: (libc)Host Address Data Type. +* INADDR_NONE: (libc)Host Address Data Type. +* INLCR: (libc)Input Modes. +* INPCK: (libc)Input Modes. +* IPPORT_RESERVED: (libc)Ports. +* IPPORT_USERRESERVED: (libc)Ports. +* ISIG: (libc)Local Modes. +* ISTRIP: (libc)Input Modes. +* IXANY: (libc)Input Modes. +* IXOFF: (libc)Input Modes. +* IXON: (libc)Input Modes. +* LINE_MAX: (libc)Utility Limits. +* LINK_MAX: (libc)Limits for Files. +* L_ctermid: (libc)Identifying the Terminal. +* L_cuserid: (libc)Who Logged In. +* L_tmpnam: (libc)Temporary Files. +* MAXNAMLEN: (libc)Limits for Files. +* MAX_CANON: (libc)Limits for Files. +* MAX_INPUT: (libc)Limits for Files. +* MB_CUR_MAX: (libc)Multibyte Char Intro. +* MB_LEN_MAX: (libc)Multibyte Char Intro. +* MDMBUF: (libc)Control Modes. +* MSG_DONTROUTE: (libc)Socket Data Options. +* MSG_OOB: (libc)Socket Data Options. +* MSG_PEEK: (libc)Socket Data Options. +* NAME_MAX: (libc)Limits for Files. +* NAN: (libc)Not a Number. +* NCCS: (libc)Mode Data Types. +* NGROUPS_MAX: (libc)General Limits. +* NOFLSH: (libc)Local Modes. +* NOKERNINFO: (libc)Local Modes. +* NSIG: (libc)Standard Signals. +* NULL: (libc)Null Pointer Constant. +* ONLCR: (libc)Output Modes. +* ONOEOT: (libc)Output Modes. +* OPEN_MAX: (libc)General Limits. +* OPOST: (libc)Output Modes. +* OXTABS: (libc)Output Modes. +* O_ACCMODE: (libc)Access Modes. +* O_APPEND: (libc)Operating Modes. +* O_ASYNC: (libc)Operating Modes. +* O_CREAT: (libc)Open-time Flags. +* O_EXCL: (libc)Open-time Flags. +* O_EXEC: (libc)Access Modes. +* O_EXLOCK: (libc)Open-time Flags. +* O_FSYNC: (libc)Operating Modes. +* O_IGNORE_CTTY: (libc)Open-time Flags. +* O_NDELAY: (libc)Operating Modes. +* O_NOATIME: (libc)Operating Modes. +* O_NOCTTY: (libc)Open-time Flags. +* O_NOLINK: (libc)Open-time Flags. +* O_NONBLOCK: (libc)Open-time Flags. +* O_NONBLOCK: (libc)Operating Modes. +* O_NOTRANS: (libc)Open-time Flags. +* O_RDONLY: (libc)Access Modes. +* O_RDWR: (libc)Access Modes. +* O_READ: (libc)Access Modes. +* O_SHLOCK: (libc)Open-time Flags. +* O_SYNC: (libc)Operating Modes. +* O_TRUNC: (libc)Open-time Flags. +* O_WRITE: (libc)Access Modes. +* O_WRONLY: (libc)Access Modes. +* PARENB: (libc)Control Modes. +* PARMRK: (libc)Input Modes. +* PARODD: (libc)Control Modes. +* PATH_MAX: (libc)Limits for Files. +* PA_FLAG_MASK: (libc)Parsing a Template String. +* PENDIN: (libc)Local Modes. +* PF_FILE: (libc)File Namespace Details. +* PF_INET: (libc)Internet Namespace. +* PF_UNIX: (libc)File Namespace Details. +* PIPE_BUF: (libc)Limits for Files. +* P_tmpdir: (libc)Temporary Files. +* RAND_MAX: (libc)ISO Random. +* RE_DUP_MAX: (libc)General Limits. +* R_OK: (libc)Testing File Access. +* SA_NOCLDSTOP: (libc)Flags for Sigaction. +* SA_ONSTACK: (libc)Flags for Sigaction. +* SA_RESTART: (libc)Flags for Sigaction. +* SEEK_CUR: (libc)File Positioning. +* SEEK_END: (libc)File Positioning. +* SEEK_SET: (libc)File Positioning. +* SIGABRT: (libc)Program Error Signals. +* SIGALRM: (libc)Alarm Signals. +* SIGBUS: (libc)Program Error Signals. +* SIGCHLD: (libc)Job Control Signals. +* SIGCLD: (libc)Job Control Signals. +* SIGCONT: (libc)Job Control Signals. +* SIGEMT: (libc)Program Error Signals. +* SIGFPE: (libc)Program Error Signals. +* SIGHUP: (libc)Termination Signals. +* SIGILL: (libc)Program Error Signals. +* SIGINFO: (libc)Miscellaneous Signals. +* SIGINT: (libc)Termination Signals. +* SIGIO: (libc)Asynchronous I/O Signals. +* SIGIOT: (libc)Program Error Signals. +* SIGKILL: (libc)Termination Signals. +* SIGLOST: (libc)Operation Error Signals. +* SIGPIPE: (libc)Operation Error Signals. +* SIGPOLL: (libc)Asynchronous I/O Signals. +* SIGPROF: (libc)Alarm Signals. +* SIGQUIT: (libc)Termination Signals. +* SIGSEGV: (libc)Program Error Signals. +* SIGSTOP: (libc)Job Control Signals. +* SIGSYS: (libc)Program Error Signals. +* SIGTERM: (libc)Termination Signals. +* SIGTRAP: (libc)Program Error Signals. +* SIGTSTP: (libc)Job Control Signals. +* SIGTTIN: (libc)Job Control Signals. +* SIGTTOU: (libc)Job Control Signals. +* SIGURG: (libc)Asynchronous I/O Signals. +* SIGUSR1: (libc)Miscellaneous Signals. +* SIGUSR2: (libc)Miscellaneous Signals. +* SIGVTALRM: (libc)Alarm Signals. +* SIGWINCH: (libc)Miscellaneous Signals. +* SIGXCPU: (libc)Operation Error Signals. +* SIGXFSZ: (libc)Operation Error Signals. +* SIG_ERR: (libc)Basic Signal Handling. +* SOCK_DGRAM: (libc)Communication Styles. +* SOCK_RAW: (libc)Communication Styles. +* SOCK_RDM: (libc)Communication Styles. +* SOCK_SEQPACKET: (libc)Communication Styles. +* SOCK_STREAM: (libc)Communication Styles. +* SOL_SOCKET: (libc)Socket-Level Options. +* SSIZE_MAX: (libc)General Limits. +* STREAM_MAX: (libc)General Limits. +* SV_INTERRUPT: (libc)BSD Handler. +* SV_ONSTACK: (libc)BSD Handler. +* SV_RESETHAND: (libc)BSD Handler. +* S_IFMT: (libc)Testing File Type. +* S_ISBLK: (libc)Testing File Type. +* S_ISCHR: (libc)Testing File Type. +* S_ISDIR: (libc)Testing File Type. +* S_ISFIFO: (libc)Testing File Type. +* S_ISLNK: (libc)Testing File Type. +* S_ISREG: (libc)Testing File Type. +* S_ISSOCK: (libc)Testing File Type. +* TMP_MAX: (libc)Temporary Files. +* TOSTOP: (libc)Local Modes. +* TZNAME_MAX: (libc)General Limits. +* VDISCARD: (libc)Other Special. +* VDSUSP: (libc)Signal Characters. +* VEOF: (libc)Editing Characters. +* VEOL2: (libc)Editing Characters. +* VEOL: (libc)Editing Characters. +* VERASE: (libc)Editing Characters. +* VINTR: (libc)Signal Characters. +* VKILL: (libc)Editing Characters. +* VLNEXT: (libc)Other Special. +* VMIN: (libc)Noncanonical Input. +* VQUIT: (libc)Signal Characters. +* VREPRINT: (libc)Editing Characters. +* VSTART: (libc)Start/Stop Characters. +* VSTATUS: (libc)Other Special. +* VSTOP: (libc)Start/Stop Characters. +* VSUSP: (libc)Signal Characters. +* VTIME: (libc)Noncanonical Input. +* VWERASE: (libc)Editing Characters. +* WCOREDUMP: (libc)Process Completion Status. +* WEXITSTATUS: (libc)Process Completion Status. +* WIFEXITED: (libc)Process Completion Status. +* WIFSIGNALED: (libc)Process Completion Status. +* WIFSTOPPED: (libc)Process Completion Status. +* WSTOPSIG: (libc)Process Completion Status. +* WTERMSIG: (libc)Process Completion Status. +* W_OK: (libc)Testing File Access. +* X_OK: (libc)Testing File Access. +* _IOFBF: (libc)Controlling Buffering. +* _IOLBF: (libc)Controlling Buffering. +* _IONBF: (libc)Controlling Buffering. +* _POSIX2_C_DEV: (libc)System Options. +* _POSIX2_C_VERSION: (libc)Version Supported. +* _POSIX2_FORT_DEV: (libc)System Options. +* _POSIX2_FORT_RUN: (libc)System Options. +* _POSIX2_LOCALEDEF: (libc)System Options. +* _POSIX2_SW_DEV: (libc)System Options. +* _POSIX_CHOWN_RESTRICTED: (libc)Options for Files. +* _POSIX_JOB_CONTROL: (libc)System Options. +* _POSIX_NO_TRUNC: (libc)Options for Files. +* _POSIX_SAVED_IDS: (libc)System Options. +* _POSIX_VDISABLE: (libc)Options for Files. +* _POSIX_VERSION: (libc)Version Supported. +* _exit: (libc)Termination Internals. +* _tolower: (libc)Case Conversion. +* _toupper: (libc)Case Conversion. +* abort: (libc)Aborting a Program. +* abs: (libc)Absolute Value. +* accept: (libc)Accepting Connections. +* access: (libc)Testing File Access. +* acos: (libc)Inverse Trig Functions. +* acosh: (libc)Hyperbolic Functions. +* adjtime: (libc)High-Resolution Calendar. +* alarm: (libc)Setting an Alarm. +* alloca: (libc)Variable Size Automatic. +* alphasort: (libc)Scanning Directory Content. +* asctime: (libc)Formatting Date and Time. +* asin: (libc)Inverse Trig Functions. +* asinh: (libc)Hyperbolic Functions. +* asprintf: (libc)Dynamic Output. +* assert: (libc)Consistency Checking. +* assert_perror: (libc)Consistency Checking. +* atan2: (libc)Inverse Trig Functions. +* atan: (libc)Inverse Trig Functions. +* atanh: (libc)Hyperbolic Functions. +* atexit: (libc)Cleanups on Exit. +* atof: (libc)Parsing of Floats. +* atoi: (libc)Parsing of Integers. +* atol: (libc)Parsing of Integers. +* bcmp: (libc)String/Array Comparison. +* bcopy: (libc)Copying and Concatenation. +* bind: (libc)Setting Address. +* bsearch: (libc)Array Search Function. +* bzero: (libc)Copying and Concatenation. +* cabs: (libc)Absolute Value. +* calloc: (libc)Allocating Cleared Space. +* cbrt: (libc)Exponents and Logarithms. +* ceil: (libc)Rounding and Remainders. +* cfgetispeed: (libc)Line Speed. +* cfgetospeed: (libc)Line Speed. +* cfmakeraw: (libc)Noncanonical Input. +* cfree: (libc)Freeing after Malloc. +* cfsetispeed: (libc)Line Speed. +* cfsetospeed: (libc)Line Speed. +* cfsetspeed: (libc)Line Speed. +* chdir: (libc)Working Directory. +* chmod: (libc)Setting Permissions. +* chown: (libc)File Owner. +* clearerr: (libc)EOF and Errors. +* clock: (libc)Basic CPU Time. +* close: (libc)Opening and Closing Files. +* closedir: (libc)Reading/Closing Directory. +* confstr: (libc)String Parameters. +* connect: (libc)Connecting. +* copysign: (libc)Normalization Functions. +* cos: (libc)Trig Functions. +* cosh: (libc)Hyperbolic Functions. +* creat: (libc)Opening and Closing Files. +* ctermid: (libc)Identifying the Terminal. +* ctime: (libc)Formatting Date and Time. +* cuserid: (libc)Who Logged In. +* difftime: (libc)Simple Calendar Time. +* div: (libc)Integer Division. +* drem: (libc)Rounding and Remainders. +* dup2: (libc)Duplicating Descriptors. +* dup: (libc)Duplicating Descriptors. +* endgrent: (libc)Scanning All Groups. +* endhostent: (libc)Host Names. +* endnetent: (libc)Networks Database. +* endnetgrent: (libc)Lookup Netgroup. +* endprotoent: (libc)Protocols Database. +* endpwent: (libc)Scanning All Users. +* endservent: (libc)Services Database. +* errno: (libc)Checking for Errors. +* execl: (libc)Executing a File. +* execle: (libc)Executing a File. +* execlp: (libc)Executing a File. +* execv: (libc)Executing a File. +* execve: (libc)Executing a File. +* execvp: (libc)Executing a File. +* exit: (libc)Normal Termination. +* exp: (libc)Exponents and Logarithms. +* expm1: (libc)Exponents and Logarithms. +* fabs: (libc)Absolute Value. +* fchmod: (libc)Setting Permissions. +* fchown: (libc)File Owner. +* fclean: (libc)Cleaning Streams. +* fclose: (libc)Closing Streams. +* fcloseall: (libc)Closing Streams. +* fcntl: (libc)Control Operations. +* fdopen: (libc)Descriptors and Streams. +* feof: (libc)EOF and Errors. +* ferror: (libc)EOF and Errors. +* fflush: (libc)Flushing Buffers. +* fgetc: (libc)Character Input. +* fgetgrent: (libc)Scanning All Groups. +* fgetgrent_r: (libc)Scanning All Groups. +* fgetpos: (libc)Portable Positioning. +* fgetpwent: (libc)Scanning All Users. +* fgetpwent_r: (libc)Scanning All Users. +* fgets: (libc)Line Input. +* fileno: (libc)Descriptors and Streams. +* finite: (libc)Predicates on Floats. +* floor: (libc)Rounding and Remainders. +* fmemopen: (libc)String Streams. +* fmod: (libc)Rounding and Remainders. +* fnmatch: (libc)Wildcard Matching. +* fopen: (libc)Opening Streams. +* fopencookie: (libc)Streams and Cookies. +* fork: (libc)Creating a Process. +* fpathconf: (libc)Pathconf. +* fprintf: (libc)Formatted Output Functions. +* fputc: (libc)Simple Output. +* fputs: (libc)Simple Output. +* fread: (libc)Block Input/Output. +* free: (libc)Freeing after Malloc. +* freopen: (libc)Opening Streams. +* frexp: (libc)Normalization Functions. +* fscanf: (libc)Formatted Input Functions. +* fseek: (libc)File Positioning. +* fsetpos: (libc)Portable Positioning. +* fstat: (libc)Reading Attributes. +* ftell: (libc)File Positioning. +* fwrite: (libc)Block Input/Output. +* getc: (libc)Character Input. +* getchar: (libc)Character Input. +* getcwd: (libc)Working Directory. +* getdelim: (libc)Line Input. +* getegid: (libc)Reading Persona. +* getenv: (libc)Environment Access. +* geteuid: (libc)Reading Persona. +* getgid: (libc)Reading Persona. +* getgrent: (libc)Scanning All Groups. +* getgrent_r: (libc)Scanning All Groups. +* getgrgid: (libc)Lookup Group. +* getgrgid_r: (libc)Lookup Group. +* getgrnam: (libc)Lookup Group. +* getgrnam_r: (libc)Lookup Group. +* getgroups: (libc)Reading Persona. +* gethostbyaddr: (libc)Host Names. +* gethostbyname2: (libc)Host Names. +* gethostbyname: (libc)Host Names. +* gethostent: (libc)Host Names. +* gethostid: (libc)Host Identification. +* gethostname: (libc)Host Identification. +* getitimer: (libc)Setting an Alarm. +* getline: (libc)Line Input. +* getlogin: (libc)Who Logged In. +* getnetbyaddr: (libc)Networks Database. +* getnetbyname: (libc)Networks Database. +* getnetent: (libc)Networks Database. +* getnetgrent: (libc)Lookup Netgroup. +* getnetgrent_r: (libc)Lookup Netgroup. +* getopt: (libc)Parsing Options. +* getopt_long: (libc)Long Options. +* getpeername: (libc)Who is Connected. +* getpgrp: (libc)Process Group Functions. +* getpgrp: (libc)Process Group Functions. +* getpid: (libc)Process Identification. +* getppid: (libc)Process Identification. +* getpriority: (libc)Priority. +* getprotobyname: (libc)Protocols Database. +* getprotobynumber: (libc)Protocols Database. +* getprotoent: (libc)Protocols Database. +* getpwent: (libc)Scanning All Users. +* getpwent_r: (libc)Scanning All Users. +* getpwnam: (libc)Lookup User. +* getpwnam_r: (libc)Lookup User. +* getpwuid: (libc)Lookup User. +* getpwuid_r: (libc)Lookup User. +* getrlimit: (libc)Limits on Resources. +* getrusage: (libc)Resource Usage. +* gets: (libc)Line Input. +* getservbyname: (libc)Services Database. +* getservbyport: (libc)Services Database. +* getservent: (libc)Services Database. +* getsockname: (libc)Reading Address. +* getsockopt: (libc)Socket Option Functions. +* getsubopt: (libc)Suboptions. +* gettimeofday: (libc)High-Resolution Calendar. +* getuid: (libc)Reading Persona. +* getumask: (libc)Setting Permissions. +* getw: (libc)Character Input. +* getwd: (libc)Working Directory. +* glob: (libc)Calling Glob. +* gmtime: (libc)Broken-down Time. +* gsignal: (libc)Signaling Yourself. +* htonl: (libc)Byte Order. +* htons: (libc)Byte Order. +* hypot: (libc)Exponents and Logarithms. +* in6addr_any: (libc)Host Address Data Type. +* in6addr_loopback: (libc)Host Address Data Type. +* index: (libc)Search Functions. +* inet_addr: (libc)Host Address Functions. +* inet_aton: (libc)Host Address Functions. +* inet_lnaof: (libc)Host Address Functions. +* inet_makeaddr: (libc)Host Address Functions. +* inet_netof: (libc)Host Address Functions. +* inet_network: (libc)Host Address Functions. +* inet_ntoa: (libc)Host Address Functions. +* inet_ntop: (libc)Host Address Functions. +* inet_pton: (libc)Host Address Functions. +* infnan: (libc)Predicates on Floats. +* initgroups: (libc)Setting Groups. +* initstate: (libc)BSD Random. +* innetgr: (libc)Netgroup Membership. +* isalnum: (libc)Classification of Characters. +* isalpha: (libc)Classification of Characters. +* isascii: (libc)Classification of Characters. +* isatty: (libc)Is It a Terminal. +* isblank: (libc)Classification of Characters. +* iscntrl: (libc)Classification of Characters. +* isdigit: (libc)Classification of Characters. +* isgraph: (libc)Classification of Characters. +* isinf: (libc)Predicates on Floats. +* islower: (libc)Classification of Characters. +* isnan: (libc)Predicates on Floats. +* isprint: (libc)Classification of Characters. +* ispunct: (libc)Classification of Characters. +* isspace: (libc)Classification of Characters. +* isupper: (libc)Classification of Characters. +* isxdigit: (libc)Classification of Characters. +* kill: (libc)Signaling Another Process. +* killpg: (libc)Signaling Another Process. +* labs: (libc)Absolute Value. +* ldexp: (libc)Normalization Functions. +* ldiv: (libc)Integer Division. +* link: (libc)Hard Links. +* listen: (libc)Listening. +* localeconv: (libc)Numeric Formatting. +* localtime: (libc)Broken-down Time. +* log10: (libc)Exponents and Logarithms. +* log1p: (libc)Exponents and Logarithms. +* log: (libc)Exponents and Logarithms. +* logb: (libc)Normalization Functions. +* longjmp: (libc)Non-Local Details. +* lseek: (libc)File Position Primitive. +* lstat: (libc)Reading Attributes. +* mallinfo: (libc)Statistics of Malloc. +* malloc: (libc)Basic Allocation. +* mallopt: (libc)Malloc Tunable Parameters. +* mblen: (libc)Length of Char. +* mbstowcs: (libc)Wide String Conversion. +* mbtowc: (libc)Converting One Char. +* mcheck: (libc)Heap Consistency Checking. +* memalign: (libc)Aligned Memory Blocks. +* memccpy: (libc)Copying and Concatenation. +* memchr: (libc)Search Functions. +* memcmp: (libc)String/Array Comparison. +* memcpy: (libc)Copying and Concatenation. +* memmem: (libc)Search Functions. +* memmove: (libc)Copying and Concatenation. +* memset: (libc)Copying and Concatenation. +* mkdir: (libc)Creating Directories. +* mkfifo: (libc)FIFO Special Files. +* mknod: (libc)Making Special Files. +* mkstemp: (libc)Temporary Files. +* mktemp: (libc)Temporary Files. +* mktime: (libc)Broken-down Time. +* modf: (libc)Rounding and Remainders. +* mprobe: (libc)Heap Consistency Checking. +* nice: (libc)Priority. +* ntohl: (libc)Byte Order. +* ntohs: (libc)Byte Order. +* obstack_1grow: (libc)Growing Objects. +* obstack_1grow_fast: (libc)Extra Fast Growing. +* obstack_alignment_mask: (libc)Obstacks Data Alignment. +* obstack_alloc: (libc)Allocation in an Obstack. +* obstack_base: (libc)Status of an Obstack. +* obstack_blank: (libc)Growing Objects. +* obstack_blank_fast: (libc)Extra Fast Growing. +* obstack_chunk_size: (libc)Obstack Chunks. +* obstack_copy0: (libc)Allocation in an Obstack. +* obstack_copy: (libc)Allocation in an Obstack. +* obstack_finish: (libc)Growing Objects. +* obstack_free: (libc)Freeing Obstack Objects. +* obstack_grow0: (libc)Growing Objects. +* obstack_grow: (libc)Growing Objects. +* obstack_init: (libc)Preparing for Obstacks. +* obstack_int_grow: (libc)Growing Objects. +* obstack_int_grow_fast: (libc)Extra Fast Growing. +* obstack_next_free: (libc)Status of an Obstack. +* obstack_object_size: (libc)Growing Objects. +* obstack_object_size: (libc)Status of an Obstack. +* obstack_printf: (libc)Dynamic Output. +* obstack_ptr_grow: (libc)Growing Objects. +* obstack_ptr_grow_fast: (libc)Extra Fast Growing. +* obstack_room: (libc)Extra Fast Growing. +* obstack_vprintf: (libc)Variable Arguments Output. +* offsetof: (libc)Structure Measurement. +* on_exit: (libc)Cleanups on Exit. +* open: (libc)Opening and Closing Files. +* open_memstream: (libc)String Streams. +* open_obstack_stream: (libc)Obstack Streams. +* opendir: (libc)Opening a Directory. +* parse_printf_format: (libc)Parsing a Template String. +* pathconf: (libc)Pathconf. +* pause: (libc)Using Pause. +* pclose: (libc)Pipe to a Subprocess. +* perror: (libc)Error Messages. +* pipe: (libc)Creating a Pipe. +* popen: (libc)Pipe to a Subprocess. +* pow: (libc)Exponents and Logarithms. +* printf: (libc)Formatted Output Functions. +* psignal: (libc)Signal Messages. +* putc: (libc)Simple Output. +* putchar: (libc)Simple Output. +* putenv: (libc)Environment Access. +* putpwent: (libc)Writing a User Entry. +* puts: (libc)Simple Output. +* putw: (libc)Simple Output. +* qsort: (libc)Array Sort Function. +* r_alloc: (libc)Using Relocator. +* r_alloc_free: (libc)Using Relocator. +* r_re_alloc: (libc)Using Relocator. +* raise: (libc)Signaling Yourself. +* rand: (libc)ISO Random. +* random: (libc)BSD Random. +* read: (libc)I/O Primitives. +* readdir: (libc)Reading/Closing Directory. +* readdir_r: (libc)Reading/Closing Directory. +* readlink: (libc)Symbolic Links. +* realloc: (libc)Changing Block Size. +* recv: (libc)Receiving Data. +* recvfrom: (libc)Receiving Datagrams. +* recvmsg: (libc)Receiving Datagrams. +* regcomp: (libc)POSIX Regexp Compilation. +* regerror: (libc)Regexp Cleanup. +* regexec: (libc)Matching POSIX Regexps. +* regfree: (libc)Regexp Cleanup. +* register_printf_function: (libc)Registering New Conversions. +* remove: (libc)Deleting Files. +* rename: (libc)Renaming Files. +* rewind: (libc)File Positioning. +* rewinddir: (libc)Random Access Directory. +* rindex: (libc)Search Functions. +* rint: (libc)Rounding and Remainders. +* rmdir: (libc)Deleting Files. +* scalb: (libc)Normalization Functions. +* scandir: (libc)Scanning Directory Content. +* scanf: (libc)Formatted Input Functions. +* seekdir: (libc)Random Access Directory. +* select: (libc)Waiting for I/O. +* send: (libc)Sending Data. +* sendmsg: (libc)Receiving Datagrams. +* sendto: (libc)Sending Datagrams. +* setbuf: (libc)Controlling Buffering. +* setbuffer: (libc)Controlling Buffering. +* setgid: (libc)Setting Groups. +* setgrent: (libc)Scanning All Groups. +* setgroups: (libc)Setting Groups. +* sethostent: (libc)Host Names. +* sethostid: (libc)Host Identification. +* sethostname: (libc)Host Identification. +* setitimer: (libc)Setting an Alarm. +* setjmp: (libc)Non-Local Details. +* setlinebuf: (libc)Controlling Buffering. +* setlocale: (libc)Setting the Locale. +* setnetent: (libc)Networks Database. +* setnetgrent: (libc)Lookup Netgroup. +* setpgid: (libc)Process Group Functions. +* setpgrp: (libc)Process Group Functions. +* setpriority: (libc)Priority. +* setprotoent: (libc)Protocols Database. +* setpwent: (libc)Scanning All Users. +* setregid: (libc)Setting Groups. +* setreuid: (libc)Setting User ID. +* setrlimit: (libc)Limits on Resources. +* setservent: (libc)Services Database. +* setsid: (libc)Process Group Functions. +* setsockopt: (libc)Socket Option Functions. +* setstate: (libc)BSD Random. +* settimeofday: (libc)High-Resolution Calendar. +* setuid: (libc)Setting User ID. +* setvbuf: (libc)Controlling Buffering. +* shutdown: (libc)Closing a Socket. +* sigaction: (libc)Advanced Signal Handling. +* sigaddset: (libc)Signal Sets. +* sigaltstack: (libc)Signal Stack. +* sigblock: (libc)Blocking in BSD. +* sigdelset: (libc)Signal Sets. +* sigemptyset: (libc)Signal Sets. +* sigfillset: (libc)Signal Sets. +* siginterrupt: (libc)BSD Handler. +* sigismember: (libc)Signal Sets. +* siglongjmp: (libc)Non-Local Exits and Signals. +* sigmask: (libc)Blocking in BSD. +* signal: (libc)Basic Signal Handling. +* sigpause: (libc)Blocking in BSD. +* sigpending: (libc)Checking for Pending Signals. +* sigprocmask: (libc)Process Signal Mask. +* sigsetjmp: (libc)Non-Local Exits and Signals. +* sigsetmask: (libc)Blocking in BSD. +* sigstack: (libc)Signal Stack. +* sigsuspend: (libc)Sigsuspend. +* sigvec: (libc)BSD Handler. +* sin: (libc)Trig Functions. +* sinh: (libc)Hyperbolic Functions. +* sleep: (libc)Sleeping. +* snprintf: (libc)Formatted Output Functions. +* socket: (libc)Creating a Socket. +* socketpair: (libc)Socket Pairs. +* sprintf: (libc)Formatted Output Functions. +* sqrt: (libc)Exponents and Logarithms. +* srand: (libc)ISO Random. +* srandom: (libc)BSD Random. +* sscanf: (libc)Formatted Input Functions. +* ssignal: (libc)Basic Signal Handling. +* stat: (libc)Reading Attributes. +* stpcpy: (libc)Copying and Concatenation. +* stpncpy: (libc)Copying and Concatenation. +* strcasecmp: (libc)String/Array Comparison. +* strcat: (libc)Copying and Concatenation. +* strchr: (libc)Search Functions. +* strcmp: (libc)String/Array Comparison. +* strcoll: (libc)Collation Functions. +* strcpy: (libc)Copying and Concatenation. +* strcspn: (libc)Search Functions. +* strdup: (libc)Copying and Concatenation. +* strdupa: (libc)Copying and Concatenation. +* strerror: (libc)Error Messages. +* strerror_r: (libc)Error Messages. +* strftime: (libc)Formatting Date and Time. +* strlen: (libc)String Length. +* strncasecmp: (libc)String/Array Comparison. +* strncat: (libc)Copying and Concatenation. +* strncmp: (libc)String/Array Comparison. +* strncpy: (libc)Copying and Concatenation. +* strndup: (libc)Copying and Concatenation. +* strndupa: (libc)Copying and Concatenation. +* strpbrk: (libc)Search Functions. +* strrchr: (libc)Search Functions. +* strsep: (libc)Finding Tokens in a String. +* strsignal: (libc)Signal Messages. +* strspn: (libc)Search Functions. +* strstr: (libc)Search Functions. +* strtod: (libc)Parsing of Floats. +* strtof: (libc)Parsing of Floats. +* strtok: (libc)Finding Tokens in a String. +* strtok_r: (libc)Finding Tokens in a String. +* strtol: (libc)Parsing of Integers. +* strtold: (libc)Parsing of Floats. +* strtoll: (libc)Parsing of Integers. +* strtoq: (libc)Parsing of Integers. +* strtoul: (libc)Parsing of Integers. +* strtoull: (libc)Parsing of Integers. +* strtouq: (libc)Parsing of Integers. +* strxfrm: (libc)Collation Functions. +* symlink: (libc)Symbolic Links. +* sysconf: (libc)Sysconf Definition. +* system: (libc)Running a Command. +* tan: (libc)Trig Functions. +* tanh: (libc)Hyperbolic Functions. +* tcdrain: (libc)Line Control. +* tcflow: (libc)Line Control. +* tcflush: (libc)Line Control. +* tcgetattr: (libc)Mode Functions. +* tcgetpgrp: (libc)Terminal Access Functions. +* tcsendbreak: (libc)Line Control. +* tcsetattr: (libc)Mode Functions. +* tcsetpgrp: (libc)Terminal Access Functions. +* telldir: (libc)Random Access Directory. +* tempnam: (libc)Temporary Files. +* time: (libc)Simple Calendar Time. +* times: (libc)Detailed CPU Time. +* tmpfile: (libc)Temporary Files. +* tmpnam: (libc)Temporary Files. +* tmpnam_r: (libc)Temporary Files. +* toascii: (libc)Case Conversion. +* tolower: (libc)Case Conversion. +* toupper: (libc)Case Conversion. +* ttyname: (libc)Is It a Terminal. +* tzset: (libc)Time Zone Functions. +* umask: (libc)Setting Permissions. +* uname: (libc)Hardware/Software Type ID. +* ungetc: (libc)How Unread. +* unlink: (libc)Deleting Files. +* utime: (libc)File Times. +* utimes: (libc)File Times. +* va_arg: (libc)Argument Macros. +* va_end: (libc)Argument Macros. +* va_start: (libc)Argument Macros. +* va_start: (libc)Old Varargs. +* valloc: (libc)Aligned Memory Blocks. +* vasprintf: (libc)Variable Arguments Output. +* vfork: (libc)Creating a Process. +* vfprintf: (libc)Variable Arguments Output. +* vfscanf: (libc)Variable Arguments Input. +* vprintf: (libc)Variable Arguments Output. +* vscanf: (libc)Variable Arguments Input. +* vsnprintf: (libc)Variable Arguments Output. +* vsprintf: (libc)Variable Arguments Output. +* vsscanf: (libc)Variable Arguments Input. +* wait3: (libc)BSD Wait Functions. +* wait4: (libc)Process Completion. +* wait: (libc)Process Completion. +* waitpid: (libc)Process Completion. +* wcstombs: (libc)Wide String Conversion. +* wctomb: (libc)Converting One Char. +* wordexp: (libc)Calling Wordexp. +* wordfree: (libc)Calling Wordexp. +* write: (libc)I/O Primitives. +@end direntry diff -durpN glibc-2.0.4/manual/libc.info glibc-2.0.5/manual/libc.info --- glibc-2.0.4/manual/libc.info Fri Apr 18 11:50:42 1997 +++ glibc-2.0.5/manual/libc.info Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -27,572 +32,573 @@ accuracy by the Foundation.  Indirect: -libc.info-1: 1168 -libc.info-2: 50053 -libc.info-3: 97428 -libc.info-4: 147178 -libc.info-5: 194826 -libc.info-6: 239202 -libc.info-7: 286755 -libc.info-8: 336118 -libc.info-9: 381079 -libc.info-10: 429754 -libc.info-11: 479454 -libc.info-12: 528835 -libc.info-13: 577714 -libc.info-14: 626772 -libc.info-15: 676295 -libc.info-16: 725978 -libc.info-17: 774607 -libc.info-18: 821763 -libc.info-19: 869238 -libc.info-20: 919145 -libc.info-21: 969007 -libc.info-22: 1016092 -libc.info-23: 1063604 -libc.info-24: 1113339 -libc.info-25: 1163108 -libc.info-26: 1212983 -libc.info-27: 1261276 -libc.info-28: 1310174 -libc.info-29: 1416254 -libc.info-30: 1458628 -libc.info-31: 1485492 -libc.info-32: 1535560 -libc.info-33: 1572797 +libc.info-1: 1288 +libc.info-2: 50173 +libc.info-3: 97498 +libc.info-4: 147248 +libc.info-5: 194896 +libc.info-6: 239272 +libc.info-7: 286827 +libc.info-8: 336191 +libc.info-9: 381152 +libc.info-10: 429828 +libc.info-11: 479528 +libc.info-12: 528910 +libc.info-13: 577170 +libc.info-14: 626062 +libc.info-15: 670410 +libc.info-16: 719312 +libc.info-17: 768975 +libc.info-18: 815070 +libc.info-19: 859818 +libc.info-20: 906341 +libc.info-21: 955065 +libc.info-22: 1003313 +libc.info-23: 1050622 +libc.info-24: 1098937 +libc.info-25: 1147233 +libc.info-26: 1196110 +libc.info-27: 1244820 +libc.info-28: 1292793 +libc.info-29: 1314763 +libc.info-30: 1421431 +libc.info-31: 1464288 +libc.info-32: 1491152 +libc.info-33: 1541220 +libc.info-34: 1578773  Tag Table: (Indirect) -Node: Top1168 -Node: Introduction40400 -Node: Getting Started41748 -Node: Standards and Portability43208 -Node: ISO C44593 -Node: POSIX46110 -Node: Berkeley Unix47790 -Node: SVID48558 -Node: Using the Library49330 -Node: Header Files50053 -Node: Macro Definitions54005 -Node: Reserved Names56355 -Node: Feature Test Macros61037 -Node: Roadmap to the Manual66921 -Node: Error Reporting74134 -Node: Checking for Errors75062 -Node: Error Codes79277 -Node: Error Messages97428 -Node: Memory Allocation103039 -Node: Memory Concepts103976 -Node: Dynamic Allocation and C105246 -Node: Unconstrained Allocation107330 -Node: Basic Allocation108769 -Node: Malloc Examples110473 -Node: Freeing after Malloc112429 -Node: Changing Block Size114245 -Node: Allocating Cleared Space116772 -Node: Efficiency and Malloc117780 -Node: Aligned Memory Blocks118870 -Node: Malloc Tunable Parameters120250 -Node: Heap Consistency Checking121913 -Node: Hooks for Malloc124710 -Node: Statistics of Malloc126959 -Node: Summary of Malloc128892 -Node: Obstacks130841 -Node: Creating Obstacks132459 -Node: Preparing for Obstacks134358 -Node: Allocation in an Obstack136698 -Node: Freeing Obstack Objects139365 -Node: Obstack Functions140701 -Node: Growing Objects142931 -Node: Extra Fast Growing147178 -Node: Status of an Obstack150797 -Node: Obstacks Data Alignment152216 -Node: Obstack Chunks153902 -Node: Summary of Obstacks156259 -Node: Variable Size Automatic159673 -Node: Alloca Example161229 -Node: Advantages of Alloca162346 -Node: Disadvantages of Alloca164238 -Node: GNU C Variable-Size Arrays164983 -Node: Relocating Allocator166141 -Node: Relocator Concepts166679 -Node: Using Relocator168192 -Node: Character Handling169577 -Node: Classification of Characters170526 -Node: Case Conversion174187 -Node: String and Array Utilities176035 -Node: Representation of Strings177846 -Node: String/Array Conventions180788 -Node: String Length182620 -Node: Copying and Concatenation183605 -Node: String/Array Comparison194826 -Node: Collation Functions199888 -Node: Search Functions206850 -Node: Finding Tokens in a String211121 -Node: I/O Overview217263 -Node: I/O Concepts218776 -Node: Streams and File Descriptors219921 -Node: File Position223012 -Node: File Names225146 -Node: Directories226032 -Node: File Name Resolution227769 -Node: File Name Errors230698 -Node: File Name Portability232247 -Node: I/O on Streams234239 -Node: Streams236195 -Node: Standard Streams237536 -Node: Opening Streams239202 -Node: Closing Streams245059 -Node: Simple Output247603 -Node: Character Input249939 -Node: Line Input253048 -Node: Unreading258036 -Node: Unreading Idea258845 -Node: How Unread259671 -Node: Block Input/Output262154 -Node: Formatted Output264383 -Node: Formatted Output Basics266150 -Node: Output Conversion Syntax268643 -Node: Table of Output Conversions272369 -Node: Integer Conversions274902 -Node: Floating-Point Conversions279566 -Node: Other Output Conversions283595 -Node: Formatted Output Functions286755 -Node: Dynamic Output290436 -Node: Variable Arguments Output292073 -Node: Parsing a Template String297585 -Node: Example of Parsing301412 -Node: Customizing Printf303700 -Node: Registering New Conversions305549 -Node: Conversion Specifier Options307540 -Node: Defining the Output Handler311213 -Node: Printf Extension Example313679 -Node: Formatted Input315987 -Node: Formatted Input Basics317066 -Node: Input Conversion Syntax319746 -Node: Table of Input Conversions323108 -Node: Numeric Input Conversions325405 -Node: String Input Conversions329183 -Node: Dynamic String Input333276 -Node: Other Input Conversions334466 -Node: Formatted Input Functions336118 -Node: Variable Arguments Input337684 -Node: EOF and Errors339319 -Node: Binary Streams341539 -Node: File Positioning344063 -Node: Portable Positioning347896 -Node: Stream Buffering351367 -Node: Buffering Concepts352952 -Node: Flushing Buffers354315 -Node: Controlling Buffering355811 -Node: Other Kinds of Streams360246 -Node: String Streams361508 -Node: Obstack Streams365628 -Node: Custom Streams367662 -Node: Streams and Cookies368315 -Node: Hook Functions371362 -Node: Low-Level I/O373748 -Node: Opening and Closing Files376400 -Node: I/O Primitives381079 -Node: File Position Primitive389332 -Node: Descriptors and Streams394767 -Node: Stream/Descriptor Precautions397187 -Node: Linked Channels398394 -Node: Independent Channels399622 -Node: Cleaning Streams401525 -Node: Waiting for I/O403728 -Node: Control Operations411479 -Node: Duplicating Descriptors413763 -Node: Descriptor Flags418025 -Node: File Status Flags421431 -Node: Access Modes422885 -Node: Open-time Flags425174 -Node: Operating Modes429754 -Node: Getting File Status Flags432520 -Node: File Locks435131 -Node: Interrupt Input444034 -Node: File System Interface446453 -Node: Working Directory447853 -Node: Accessing Directories451607 -Node: Directory Entries453016 -Node: Opening a Directory455816 -Node: Reading/Closing Directory457508 -Node: Simple Directory Lister460442 -Node: Random Access Directory461460 -Node: Scanning Directory Content462962 -Node: Simple Directory Lister Mark II465217 -Node: Hard Links466338 -Node: Symbolic Links469131 -Node: Deleting Files472897 -Node: Renaming Files475827 -Node: Creating Directories479454 -Node: File Attributes481202 -Node: Attribute Meanings482698 -Node: Reading Attributes487781 -Node: Testing File Type489683 -Node: File Owner492899 -Node: Permission Bits496592 -Node: Access Permission501699 -Node: Setting Permissions502849 -Node: Testing File Access508064 -Node: File Times511707 -Node: Making Special Files516215 -Node: Temporary Files517892 -Node: Pipes and FIFOs524099 -Node: Creating a Pipe525682 -Node: Pipe to a Subprocess528835 -Node: FIFO Special Files531675 -Node: Pipe Atomicity533248 -Node: Sockets534132 -Node: Socket Concepts536007 -Node: Communication Styles539221 -Node: Socket Addresses541073 -Node: Address Formats543114 -Node: Setting Address545797 -Node: Reading Address547501 -Node: File Namespace549259 -Node: File Namespace Concepts549749 -Node: File Namespace Details551344 -Node: File Socket Example552958 -Node: Internet Namespace554282 -Node: Internet Address Format556009 -Node: Host Addresses557378 -Node: Abstract Host Addresses558438 -Node: Host Address Data Type561231 -Node: Host Address Functions563122 -Node: Host Names565549 -Node: Ports570561 -Node: Services Database572599 -Node: Byte Order575426 -Node: Protocols Database577714 -Node: Inet Example581255 -Node: Misc Namespaces583285 -Node: Open/Close Sockets584035 -Node: Creating a Socket584533 -Node: Closing a Socket586201 -Node: Socket Pairs587731 -Node: Connections589741 -Node: Connecting590835 -Node: Listening593391 -Node: Accepting Connections595476 -Node: Who is Connected598332 -Node: Transferring Data599428 -Node: Sending Data600538 -Node: Receiving Data602786 -Node: Socket Data Options604250 -Node: Byte Stream Example605113 -Node: Server Example607091 -Node: Out-of-Band Data611138 -Node: Datagrams616992 -Node: Sending Datagrams618021 -Node: Receiving Datagrams619678 -Node: Datagram Example621479 -Node: Example Receiver623397 -Node: Inetd625964 -Node: Inetd Servers626772 -Node: Configuring Inetd628015 -Node: Socket Options630689 -Node: Socket Option Functions631397 -Node: Socket-Level Options632955 -Node: Networks Database636589 -Node: Low-Level Terminal Interface639451 -Node: Is It a Terminal640786 -Node: I/O Queues642002 -Node: Canonical or Not643972 -Node: Terminal Modes645819 -Node: Mode Data Types647095 -Node: Mode Functions648923 -Node: Setting Modes652863 -Node: Input Modes654851 -Node: Output Modes660118 -Node: Control Modes661731 -Node: Local Modes665821 -Node: Line Speed672135 -Node: Special Characters676295 -Node: Editing Characters678207 -Node: Signal Characters682548 -Node: Start/Stop Characters685417 -Node: Other Special687288 -Node: Noncanonical Input689102 -Node: Line Control693915 -Node: Noncanon Example698227 -Node: Mathematics700422 -Node: Domain and Range Errors701626 -Node: Trig Functions704849 -Node: Inverse Trig Functions706219 -Node: Exponents and Logarithms708657 -Node: Hyperbolic Functions711558 -Node: Pseudo-Random Numbers713137 -Node: ISO Random714723 -Node: BSD Random715896 -Node: Arithmetic717813 -Node: Not a Number718722 -Node: Predicates on Floats720064 -Node: Absolute Value721638 -Node: Normalization Functions723136 -Node: Rounding and Remainders725978 -Node: Integer Division729346 -Node: Parsing of Numbers731496 -Node: Parsing of Integers732148 -Node: Parsing of Floats739623 -Node: Searching and Sorting744087 -Node: Comparison Functions744878 -Node: Array Search Function745992 -Node: Array Sort Function747415 -Node: Search/Sort Example749387 -Node: Pattern Matching752837 -Node: Wildcard Matching753639 -Node: Globbing756517 -Node: Calling Glob757307 -Node: Flags for Globbing760888 -Node: Regular Expressions764386 -Node: POSIX Regexp Compilation765370 -Node: Flags for POSIX Regexps769485 -Node: Matching POSIX Regexps770392 -Node: Regexp Subexpressions772553 -Node: Subexpression Complications774607 -Node: Regexp Cleanup776966 -Node: Word Expansion779292 -Node: Expansion Stages780460 -Node: Calling Wordexp781953 -Node: Flags for Wordexp785916 -Node: Wordexp Example787869 -Node: Date and Time789844 -Node: Processor Time790968 -Node: Basic CPU Time791726 -Node: Detailed CPU Time793745 -Node: Calendar Time796210 -Node: Simple Calendar Time797788 -Node: High-Resolution Calendar799545 -Node: Broken-down Time805265 -Node: Formatting Date and Time810481 -Node: TZ Variable821763 -Node: Time Zone Functions827824 -Node: Time Functions Example830489 -Node: Setting an Alarm831604 -Node: Sleeping836831 -Node: Resource Usage839487 -Node: Limits on Resources842998 -Node: Priority847372 -Node: Extended Characters850634 -Node: Extended Char Intro852242 -Node: Locales and Extended Chars854179 -Node: Multibyte Char Intro855229 -Node: Wide Char Intro862523 -Node: Wide String Conversion864290 -Node: Length of Char867527 -Node: Converting One Char869238 -Node: Example of Conversion872635 -Node: Shift State875525 -Node: Locales878178 -Node: Effects of Locale879746 -Node: Choosing Locale881682 -Node: Locale Categories883006 -Node: Setting the Locale884653 -Node: Standard Locales888547 -Node: Numeric Formatting889787 -Node: General Numeric891297 -Node: Currency Symbol894219 -Node: Sign of Money Amount898829 -Node: Non-Local Exits901133 -Node: Non-Local Intro901752 -Node: Non-Local Details905479 -Node: Non-Local Exits and Signals908555 -Node: Signal Handling910025 -Node: Concepts of Signals912060 -Node: Kinds of Signals912624 -Node: Signal Generation914021 -Node: Delivery of Signal916288 -Node: Standard Signals919145 -Node: Program Error Signals920738 -Node: Termination Signals928196 -Node: Alarm Signals932034 -Node: Asynchronous I/O Signals933274 -Node: Job Control Signals934465 -Node: Operation Error Signals939077 -Node: Miscellaneous Signals941016 -Node: Signal Messages942712 -Node: Signal Actions944598 -Node: Basic Signal Handling945543 -Node: Advanced Signal Handling950476 -Node: Signal and Sigaction953432 -Node: Sigaction Function Example955184 -Node: Flags for Sigaction957500 -Node: Initial Signal Actions959878 -Node: Defining Handlers961261 -Node: Handler Returns963446 -Node: Termination in Handler965496 -Node: Longjmp in Handler966912 -Node: Signals in Handler969007 -Node: Merged Signals971127 -Node: Nonreentrancy976837 -Node: Atomic Data Access982385 -Node: Non-atomic Example983421 -Node: Atomic Types985192 -Node: Atomic Usage986200 -Node: Interrupted Primitives987670 -Node: Generating Signals990970 -Node: Signaling Yourself991563 -Node: Signaling Another Process993545 -Node: Permission for kill996928 -Node: Kill Example998724 -Node: Blocking Signals1001068 -Node: Why Block1002840 -Node: Signal Sets1004377 -Node: Process Signal Mask1007403 -Node: Testing for Delivery1010411 -Node: Blocking for Handler1011661 -Node: Checking for Pending Signals1014080 -Node: Remembering a Signal1016092 -Node: Waiting for a Signal1019641 -Node: Using Pause1020186 -Node: Pause Problems1021406 -Node: Sigsuspend1023130 -Node: Signal Stack1025840 -Node: BSD Signal Handling1031184 -Node: BSD Handler1032458 -Node: Blocking in BSD1034892 -Node: Process Startup1036346 -Node: Program Arguments1037381 -Node: Argument Syntax1040110 -Node: Parsing Options1042740 -Node: Example of Getopt1046031 -Node: Long Options1048747 -Node: Long Option Example1052808 -Node: Suboptions1055657 -Node: Suboptions Example1057606 -Node: Environment Variables1059701 -Node: Environment Access1061562 -Node: Standard Environment1063604 -Node: Program Termination1067287 -Node: Normal Termination1068506 -Node: Exit Status1069732 -Node: Cleanups on Exit1072753 -Node: Aborting a Program1074570 -Node: Termination Internals1075469 -Node: Processes1077245 -Node: Running a Command1079268 -Node: Process Creation Concepts1080761 -Node: Process Identification1082771 -Node: Creating a Process1083695 -Node: Executing a File1087311 -Node: Process Completion1094346 -Node: Process Completion Status1099355 -Node: BSD Wait Functions1100999 -Node: Process Creation Example1102891 -Node: Job Control1105141 -Node: Concepts of Job Control1106421 -Node: Job Control is Optional1109778 -Node: Controlling Terminal1110828 -Node: Access to the Terminal1111735 -Node: Orphaned Process Groups1113339 -Node: Implementing a Shell1114331 -Node: Data Structures1115214 -Node: Initializing the Shell1117857 -Node: Launching Jobs1121593 -Node: Foreground and Background1129046 -Node: Stopped and Terminated Jobs1132155 -Node: Continuing Stopped Jobs1137337 -Node: Missing Pieces1138964 -Node: Functions for Job Control1140588 -Node: Identifying the Terminal1141068 -Node: Process Group Functions1142642 -Node: Terminal Access Functions1146194 -Node: Name Service Switch1149095 -Node: NSS Basics1150426 -Node: NSS Configuration File1152021 -Node: Services in the NSS configuration1153719 -Node: Actions in the NSS configuration1155000 -Node: Notes on NSS Configuration File1158159 -Node: NSS Module Internals1160035 -Node: NSS Module Names1160731 -Node: NSS Modules Interface1163108 -Node: Extending NSS1166637 -Node: Adding another Service to NSS1167568 -Node: NSS Module Function Internals1169787 -Node: Users and Groups1174188 -Node: User and Group IDs1176664 -Node: Process Persona1177571 -Node: Why Change Persona1179082 -Node: How Change Persona1180963 -Node: Reading Persona1182445 -Node: Setting User ID1184715 -Node: Setting Groups1186925 -Node: Enable/Disable Setuid1189482 -Node: Setuid Program Example1191521 -Node: Tips for Setuid1194990 -Node: Who Logged In1197078 -Node: User Database1199246 -Node: User Data Structure1199907 -Node: Lookup User1201186 -Node: Scanning All Users1204276 -Node: Writing a User Entry1207655 -Node: Group Database1208554 -Node: Group Data Structure1209141 -Node: Lookup Group1209927 -Node: Scanning All Groups1212983 -Node: Netgroup Database1216264 -Node: Netgroup Data1216698 -Node: Lookup Netgroup1218262 -Node: Netgroup Membership1221674 -Node: Database Example1223004 -Node: System Information1225178 -Node: Host Identification1225775 -Node: Hardware/Software Type ID1228994 -Node: System Configuration1231693 -Node: General Limits1233260 -Node: System Options1236899 -Node: Version Supported1240231 -Node: Sysconf1242068 -Node: Sysconf Definition1242704 -Node: Constants for Sysconf1243376 -Node: Examples of Sysconf1246509 -Node: Minimums1247502 -Node: Limits for Files1249578 -Node: Options for Files1252580 -Node: File Minimums1254869 -Node: Pathconf1256531 -Node: Utility Limits1259218 -Node: Utility Minimums1261276 -Node: String Parameters1263028 -Node: Language Features1265082 -Node: Consistency Checking1266013 -Node: Variadic Functions1270651 -Node: Why Variadic1271723 -Node: How Variadic1273688 -Node: Variadic Prototypes1274977 -Node: Receiving Arguments1276135 -Node: How Many Arguments1278849 -Node: Calling Variadics1280520 -Node: Argument Macros1282657 -Node: Variadic Example1284297 -Node: Old Varargs1285449 -Node: Null Pointer Constant1287119 -Node: Important Data Types1288204 -Node: Data Type Measurements1290770 -Node: Width of Type1291627 -Node: Range of Type1292533 -Node: Floating Type Macros1295797 -Node: Floating Point Concepts1297057 -Node: Floating Point Parameters1300792 -Node: IEEE Floating Point1307726 -Node: Structure Measurement1309479 -Node: Library Summary1310174 -Node: Maintenance1416254 -Node: Installation1416999 -Node: Tools for Installation1423845 -Node: Supported Configurations1424933 -Node: Reporting Bugs1426444 -Node: Source Layout1428821 -Node: Porting1432777 -Node: Hierarchy Conventions1440565 -Node: Porting to Unix1445485 -Node: Contributors1447330 -Node: Copying1458628 -Node: Concept Index1485492 -Node: Type Index1535560 -Node: Function Index1540350 -Node: Variable Index1572797 -Node: File Index1604275 +Node: Top1288 +Node: Introduction40520 +Node: Getting Started41868 +Node: Standards and Portability43328 +Node: ISO C44713 +Node: POSIX46230 +Node: Berkeley Unix47910 +Node: SVID48678 +Node: Using the Library49450 +Node: Header Files50173 +Node: Macro Definitions54125 +Node: Reserved Names56475 +Node: Feature Test Macros61158 +Node: Roadmap to the Manual67042 +Node: Error Reporting74255 +Node: Checking for Errors75183 +Node: Error Codes79398 +Node: Error Messages97498 +Node: Memory Allocation103109 +Node: Memory Concepts104046 +Node: Dynamic Allocation and C105316 +Node: Unconstrained Allocation107400 +Node: Basic Allocation108839 +Node: Malloc Examples110543 +Node: Freeing after Malloc112499 +Node: Changing Block Size114315 +Node: Allocating Cleared Space116842 +Node: Efficiency and Malloc117850 +Node: Aligned Memory Blocks118940 +Node: Malloc Tunable Parameters120320 +Node: Heap Consistency Checking121983 +Node: Hooks for Malloc124780 +Node: Statistics of Malloc127029 +Node: Summary of Malloc128962 +Node: Obstacks130911 +Node: Creating Obstacks132529 +Node: Preparing for Obstacks134428 +Node: Allocation in an Obstack136768 +Node: Freeing Obstack Objects139435 +Node: Obstack Functions140771 +Node: Growing Objects143001 +Node: Extra Fast Growing147248 +Node: Status of an Obstack150867 +Node: Obstacks Data Alignment152286 +Node: Obstack Chunks153972 +Node: Summary of Obstacks156329 +Node: Variable Size Automatic159743 +Node: Alloca Example161299 +Node: Advantages of Alloca162416 +Node: Disadvantages of Alloca164308 +Node: GNU C Variable-Size Arrays165053 +Node: Relocating Allocator166211 +Node: Relocator Concepts166749 +Node: Using Relocator168262 +Node: Character Handling169647 +Node: Classification of Characters170596 +Node: Case Conversion174257 +Node: String and Array Utilities176105 +Node: Representation of Strings177916 +Node: String/Array Conventions180858 +Node: String Length182690 +Node: Copying and Concatenation183675 +Node: String/Array Comparison194896 +Node: Collation Functions199958 +Node: Search Functions206920 +Node: Finding Tokens in a String211191 +Node: I/O Overview217333 +Node: I/O Concepts218846 +Node: Streams and File Descriptors219991 +Node: File Position223082 +Node: File Names225216 +Node: Directories226102 +Node: File Name Resolution227839 +Node: File Name Errors230768 +Node: File Name Portability232317 +Node: I/O on Streams234309 +Node: Streams236265 +Node: Standard Streams237606 +Node: Opening Streams239272 +Node: Closing Streams245129 +Node: Simple Output247673 +Node: Character Input250009 +Node: Line Input253118 +Node: Unreading258106 +Node: Unreading Idea258915 +Node: How Unread259741 +Node: Block Input/Output262224 +Node: Formatted Output264453 +Node: Formatted Output Basics266220 +Node: Output Conversion Syntax268713 +Node: Table of Output Conversions272439 +Node: Integer Conversions274973 +Node: Floating-Point Conversions279637 +Node: Other Output Conversions283667 +Node: Formatted Output Functions286827 +Node: Dynamic Output290508 +Node: Variable Arguments Output292145 +Node: Parsing a Template String297657 +Node: Example of Parsing301484 +Node: Customizing Printf303772 +Node: Registering New Conversions305621 +Node: Conversion Specifier Options307612 +Node: Defining the Output Handler311285 +Node: Printf Extension Example313751 +Node: Formatted Input316059 +Node: Formatted Input Basics317138 +Node: Input Conversion Syntax319818 +Node: Table of Input Conversions323181 +Node: Numeric Input Conversions325478 +Node: String Input Conversions329256 +Node: Dynamic String Input333349 +Node: Other Input Conversions334539 +Node: Formatted Input Functions336191 +Node: Variable Arguments Input337757 +Node: EOF and Errors339392 +Node: Binary Streams341612 +Node: File Positioning344136 +Node: Portable Positioning347969 +Node: Stream Buffering351440 +Node: Buffering Concepts353025 +Node: Flushing Buffers354388 +Node: Controlling Buffering355884 +Node: Other Kinds of Streams360319 +Node: String Streams361581 +Node: Obstack Streams365701 +Node: Custom Streams367735 +Node: Streams and Cookies368388 +Node: Hook Functions371435 +Node: Low-Level I/O373821 +Node: Opening and Closing Files376473 +Node: I/O Primitives381152 +Node: File Position Primitive389406 +Node: Descriptors and Streams394841 +Node: Stream/Descriptor Precautions397261 +Node: Linked Channels398468 +Node: Independent Channels399696 +Node: Cleaning Streams401599 +Node: Waiting for I/O403802 +Node: Control Operations411553 +Node: Duplicating Descriptors413837 +Node: Descriptor Flags418099 +Node: File Status Flags421505 +Node: Access Modes422959 +Node: Open-time Flags425248 +Node: Operating Modes429828 +Node: Getting File Status Flags432594 +Node: File Locks435205 +Node: Interrupt Input444108 +Node: File System Interface446527 +Node: Working Directory447927 +Node: Accessing Directories451681 +Node: Directory Entries453090 +Node: Opening a Directory455890 +Node: Reading/Closing Directory457582 +Node: Simple Directory Lister460516 +Node: Random Access Directory461534 +Node: Scanning Directory Content463036 +Node: Simple Directory Lister Mark II465291 +Node: Hard Links466412 +Node: Symbolic Links469205 +Node: Deleting Files472971 +Node: Renaming Files475901 +Node: Creating Directories479528 +Node: File Attributes481276 +Node: Attribute Meanings482772 +Node: Reading Attributes487856 +Node: Testing File Type489758 +Node: File Owner492974 +Node: Permission Bits496667 +Node: Access Permission501774 +Node: Setting Permissions502924 +Node: Testing File Access508139 +Node: File Times511782 +Node: Making Special Files516290 +Node: Temporary Files517967 +Node: Pipes and FIFOs524174 +Node: Creating a Pipe525757 +Node: Pipe to a Subprocess528910 +Node: FIFO Special Files531750 +Node: Pipe Atomicity533323 +Node: Sockets534207 +Node: Socket Concepts536082 +Node: Communication Styles540360 +Node: Socket Addresses542212 +Node: Address Formats544253 +Node: Setting Address547080 +Node: Reading Address548797 +Node: File Namespace550558 +Node: File Namespace Concepts551048 +Node: File Namespace Details552643 +Node: File Socket Example554257 +Node: Internet Namespace555581 +Node: Internet Address Formats557309 +Node: Host Addresses559455 +Node: Abstract Host Addresses560642 +Node: Host Address Data Type563435 +Node: Host Address Functions566054 +Node: Host Names569675 +Node: Ports575132 +Node: Services Database577170 +Node: Byte Order579997 +Node: Protocols Database582285 +Node: Inet Example585826 +Node: Misc Namespaces587856 +Node: Open/Close Sockets588606 +Node: Creating a Socket589104 +Node: Closing a Socket590772 +Node: Socket Pairs592302 +Node: Connections594312 +Node: Connecting595406 +Node: Listening597965 +Node: Accepting Connections600050 +Node: Who is Connected602909 +Node: Transferring Data604005 +Node: Sending Data605115 +Node: Receiving Data607363 +Node: Socket Data Options608827 +Node: Byte Stream Example609690 +Node: Server Example611668 +Node: Out-of-Band Data615715 +Node: Datagrams621569 +Node: Sending Datagrams622598 +Node: Receiving Datagrams624258 +Node: Datagram Example626062 +Node: Example Receiver627980 +Node: Inetd630547 +Node: Inetd Servers631355 +Node: Configuring Inetd632598 +Node: Socket Options635272 +Node: Socket Option Functions635980 +Node: Socket-Level Options637544 +Node: Networks Database641178 +Node: Low-Level Terminal Interface644040 +Node: Is It a Terminal645375 +Node: I/O Queues646591 +Node: Canonical or Not648561 +Node: Terminal Modes650408 +Node: Mode Data Types651684 +Node: Mode Functions653512 +Node: Setting Modes657452 +Node: Input Modes659440 +Node: Output Modes664707 +Node: Control Modes666320 +Node: Local Modes670410 +Node: Line Speed676724 +Node: Special Characters680884 +Node: Editing Characters682796 +Node: Signal Characters687137 +Node: Start/Stop Characters690006 +Node: Other Special691877 +Node: Noncanonical Input693691 +Node: Line Control698504 +Node: Noncanon Example702816 +Node: Mathematics705011 +Node: Domain and Range Errors706215 +Node: Trig Functions709438 +Node: Inverse Trig Functions710808 +Node: Exponents and Logarithms713246 +Node: Hyperbolic Functions716147 +Node: Pseudo-Random Numbers717726 +Node: ISO Random719312 +Node: BSD Random720485 +Node: Arithmetic722402 +Node: Not a Number723311 +Node: Predicates on Floats724653 +Node: Absolute Value726227 +Node: Normalization Functions727725 +Node: Rounding and Remainders730567 +Node: Integer Division733935 +Node: Parsing of Numbers736085 +Node: Parsing of Integers736737 +Node: Parsing of Floats744212 +Node: Searching and Sorting748676 +Node: Comparison Functions749467 +Node: Array Search Function750581 +Node: Array Sort Function752004 +Node: Search/Sort Example753976 +Node: Pattern Matching757426 +Node: Wildcard Matching758228 +Node: Globbing761106 +Node: Calling Glob761896 +Node: Flags for Globbing765477 +Node: Regular Expressions768975 +Node: POSIX Regexp Compilation769959 +Node: Flags for POSIX Regexps774074 +Node: Matching POSIX Regexps774981 +Node: Regexp Subexpressions777142 +Node: Subexpression Complications779196 +Node: Regexp Cleanup781555 +Node: Word Expansion783881 +Node: Expansion Stages785049 +Node: Calling Wordexp786542 +Node: Flags for Wordexp790505 +Node: Wordexp Example792458 +Node: Date and Time794433 +Node: Processor Time795557 +Node: Basic CPU Time796315 +Node: Detailed CPU Time798334 +Node: Calendar Time800799 +Node: Simple Calendar Time802377 +Node: High-Resolution Calendar804134 +Node: Broken-down Time809854 +Node: Formatting Date and Time815070 +Node: TZ Variable826352 +Node: Time Zone Functions832413 +Node: Time Functions Example835078 +Node: Setting an Alarm836193 +Node: Sleeping841420 +Node: Resource Usage844076 +Node: Limits on Resources847587 +Node: Priority851961 +Node: Extended Characters855223 +Node: Extended Char Intro856831 +Node: Locales and Extended Chars858768 +Node: Multibyte Char Intro859818 +Node: Wide Char Intro867112 +Node: Wide String Conversion868879 +Node: Length of Char872116 +Node: Converting One Char873827 +Node: Example of Conversion877224 +Node: Shift State880114 +Node: Locales882767 +Node: Effects of Locale884335 +Node: Choosing Locale886271 +Node: Locale Categories887595 +Node: Setting the Locale889242 +Node: Standard Locales893136 +Node: Numeric Formatting894376 +Node: General Numeric895886 +Node: Currency Symbol898808 +Node: Sign of Money Amount903418 +Node: Non-Local Exits905722 +Node: Non-Local Intro906341 +Node: Non-Local Details910068 +Node: Non-Local Exits and Signals913144 +Node: Signal Handling914614 +Node: Concepts of Signals916649 +Node: Kinds of Signals917213 +Node: Signal Generation918610 +Node: Delivery of Signal920877 +Node: Standard Signals923734 +Node: Program Error Signals925327 +Node: Termination Signals932785 +Node: Alarm Signals936623 +Node: Asynchronous I/O Signals937863 +Node: Job Control Signals939054 +Node: Operation Error Signals943666 +Node: Miscellaneous Signals945605 +Node: Signal Messages947301 +Node: Signal Actions949187 +Node: Basic Signal Handling950132 +Node: Advanced Signal Handling955065 +Node: Signal and Sigaction958021 +Node: Sigaction Function Example959773 +Node: Flags for Sigaction962089 +Node: Initial Signal Actions964467 +Node: Defining Handlers965850 +Node: Handler Returns968035 +Node: Termination in Handler970085 +Node: Longjmp in Handler971501 +Node: Signals in Handler973596 +Node: Merged Signals975716 +Node: Nonreentrancy981426 +Node: Atomic Data Access986974 +Node: Non-atomic Example988010 +Node: Atomic Types989781 +Node: Atomic Usage990789 +Node: Interrupted Primitives992259 +Node: Generating Signals995559 +Node: Signaling Yourself996152 +Node: Signaling Another Process998134 +Node: Permission for kill1001517 +Node: Kill Example1003313 +Node: Blocking Signals1005657 +Node: Why Block1007429 +Node: Signal Sets1008966 +Node: Process Signal Mask1011992 +Node: Testing for Delivery1015000 +Node: Blocking for Handler1016250 +Node: Checking for Pending Signals1018669 +Node: Remembering a Signal1020681 +Node: Waiting for a Signal1024230 +Node: Using Pause1024775 +Node: Pause Problems1025995 +Node: Sigsuspend1027719 +Node: Signal Stack1030429 +Node: BSD Signal Handling1035774 +Node: BSD Handler1037048 +Node: Blocking in BSD1039482 +Node: Process Startup1040936 +Node: Program Arguments1041971 +Node: Argument Syntax1044700 +Node: Parsing Options1047330 +Node: Example of Getopt1050622 +Node: Long Options1053338 +Node: Long Option Example1057399 +Node: Suboptions1060248 +Node: Suboptions Example1062197 +Node: Environment Variables1064292 +Node: Environment Access1066153 +Node: Standard Environment1068195 +Node: Program Termination1071878 +Node: Normal Termination1073097 +Node: Exit Status1074323 +Node: Cleanups on Exit1077344 +Node: Aborting a Program1079161 +Node: Termination Internals1080060 +Node: Processes1081836 +Node: Running a Command1083859 +Node: Process Creation Concepts1085352 +Node: Process Identification1087362 +Node: Creating a Process1088286 +Node: Executing a File1091902 +Node: Process Completion1098937 +Node: Process Completion Status1103946 +Node: BSD Wait Functions1105590 +Node: Process Creation Example1107482 +Node: Job Control1109732 +Node: Concepts of Job Control1111012 +Node: Job Control is Optional1114369 +Node: Controlling Terminal1115419 +Node: Access to the Terminal1116326 +Node: Orphaned Process Groups1117930 +Node: Implementing a Shell1118922 +Node: Data Structures1119805 +Node: Initializing the Shell1122448 +Node: Launching Jobs1126184 +Node: Foreground and Background1133637 +Node: Stopped and Terminated Jobs1136746 +Node: Continuing Stopped Jobs1141928 +Node: Missing Pieces1143555 +Node: Functions for Job Control1145179 +Node: Identifying the Terminal1145659 +Node: Process Group Functions1147233 +Node: Terminal Access Functions1150785 +Node: Name Service Switch1153686 +Node: NSS Basics1155017 +Node: NSS Configuration File1156612 +Node: Services in the NSS configuration1158310 +Node: Actions in the NSS configuration1159591 +Node: Notes on NSS Configuration File1162750 +Node: NSS Module Internals1164626 +Node: NSS Module Names1165322 +Node: NSS Modules Interface1167697 +Node: Extending NSS1171226 +Node: Adding another Service to NSS1172157 +Node: NSS Module Function Internals1174376 +Node: Users and Groups1178777 +Node: User and Group IDs1181253 +Node: Process Persona1182160 +Node: Why Change Persona1183671 +Node: How Change Persona1185552 +Node: Reading Persona1187034 +Node: Setting User ID1189304 +Node: Setting Groups1191514 +Node: Enable/Disable Setuid1194071 +Node: Setuid Program Example1196110 +Node: Tips for Setuid1199579 +Node: Who Logged In1201667 +Node: User Database1203835 +Node: User Data Structure1204496 +Node: Lookup User1205775 +Node: Scanning All Users1208865 +Node: Writing a User Entry1212244 +Node: Group Database1213143 +Node: Group Data Structure1213730 +Node: Lookup Group1214516 +Node: Scanning All Groups1217572 +Node: Netgroup Database1220853 +Node: Netgroup Data1221287 +Node: Lookup Netgroup1222851 +Node: Netgroup Membership1226263 +Node: Database Example1227593 +Node: System Information1229767 +Node: Host Identification1230364 +Node: Hardware/Software Type ID1233583 +Node: System Configuration1236282 +Node: General Limits1237849 +Node: System Options1241488 +Node: Version Supported1244820 +Node: Sysconf1246657 +Node: Sysconf Definition1247293 +Node: Constants for Sysconf1247965 +Node: Examples of Sysconf1251098 +Node: Minimums1252091 +Node: Limits for Files1254167 +Node: Options for Files1257169 +Node: File Minimums1259458 +Node: Pathconf1261120 +Node: Utility Limits1263807 +Node: Utility Minimums1265865 +Node: String Parameters1267617 +Node: Language Features1269671 +Node: Consistency Checking1270602 +Node: Variadic Functions1275240 +Node: Why Variadic1276312 +Node: How Variadic1278277 +Node: Variadic Prototypes1279566 +Node: Receiving Arguments1280724 +Node: How Many Arguments1283438 +Node: Calling Variadics1285109 +Node: Argument Macros1287246 +Node: Variadic Example1288886 +Node: Old Varargs1290038 +Node: Null Pointer Constant1291708 +Node: Important Data Types1292793 +Node: Data Type Measurements1295359 +Node: Width of Type1296216 +Node: Range of Type1297122 +Node: Floating Type Macros1300386 +Node: Floating Point Concepts1301646 +Node: Floating Point Parameters1305381 +Node: IEEE Floating Point1312315 +Node: Structure Measurement1314068 +Node: Library Summary1314763 +Node: Maintenance1421431 +Node: Installation1422176 +Node: Tools for Installation1429023 +Node: Supported Configurations1430111 +Node: Reporting Bugs1432104 +Node: Source Layout1434481 +Node: Porting1438437 +Node: Hierarchy Conventions1446225 +Node: Porting to Unix1451145 +Node: Contributors1452990 +Node: Copying1464288 +Node: Concept Index1491152 +Node: Type Index1541220 +Node: Function Index1546143 +Node: Variable Index1578773 +Node: File Index1610273  End Tag Table diff -durpN glibc-2.0.4/manual/libc.info-1 glibc-2.0.5/manual/libc.info-1 --- glibc-2.0.4/manual/libc.info-1 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-1 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -439,7 +444,7 @@ Socket Addresses Internet Domain -* Internet Address Format:: How socket addresses are specified in the +* 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. diff -durpN glibc-2.0.4/manual/libc.info-10 glibc-2.0.5/manual/libc.info-10 --- glibc-2.0.4/manual/libc.info-10 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-10 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 diff -durpN glibc-2.0.4/manual/libc.info-11 glibc-2.0.5/manual/libc.info-11 --- glibc-2.0.4/manual/libc.info-11 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-11 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -221,8 +226,8 @@ list of them. - Data Type: ino_t This is an arithmetic data type used to represent file serial numbers. (In Unix jargon, these are sometimes called "inode - numbers".) In the GNU system, this type is equivalent to `unsigned - long int'. + numbers".) In the GNU system, this type is equivalent to + `unsigned long int'. - Data Type: dev_t This is an arithmetic data type used to represent file device diff -durpN glibc-2.0.4/manual/libc.info-12 glibc-2.0.5/manual/libc.info-12 --- glibc-2.0.4/manual/libc.info-12 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-12 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -271,6 +276,27 @@ What you do need to know about protocols protocol" which you can request by specifying 0 as the protocol number. And that's what you should normally do--use the default. + Throughout the following description at various places +variables/parameters to denote sizes are required. And here the trouble +starts. In the first implementations the type of these variables was +simply `int'. This type was on almost all machines of this time 32 +bits wide and so a de-factor standard required 32 bit variables. This +is important since references to variables of this type are passed to +the kernel. + + But now the POSIX people came and unified the interface with their +words "all size values are of type `size_t'". But on 64 bit machines +`size_t' is 64 bits wide and so variable references are not anymore +possible. + + A solution provides the Unix98 specification which finally +introduces a type `socklen_t'. This type is used in all of the cases in +previously changed to use `size_t'. The only requirement of this type +is that it is an unsigned type of at least 32 bits. Therefore, +implementations which require references to 32 bit variables be passed +can be as happy as implementations which right from the start of 64 bit +values. +  File: libc.info, Node: Communication Styles, Next: Socket Addresses, Prev: Socket Concepts, Up: Sockets @@ -413,8 +439,12 @@ corresponding namespace. Here is a list `AF_INET' This designates the address format that goes with the Internet - namespace. (`PF_INET' is the name of that namespace.) *Note - Internet Address Format::. + namespace. (`PF_INET' is the name of that namespace.) *Note + Internet Address Formats::. + +`AF_INET6' + This is similar to `AF_INET', but refers to the IPv6 protocol. + (`PF_INET6' is the name of the corresponding namespace.) `AF_UNSPEC' This designates no particular address format. It is used only in @@ -440,7 +470,8 @@ prototype for `bind' is in the header fi examples of use, see *Note File Namespace::, or see *Note Inet Example::. - - Function: int bind (int SOCKET, struct sockaddr *ADDR, size_t LENGTH) + - Function: int bind (int SOCKET, struct sockaddr *ADDR, socklen_t + LENGTH) The `bind' function assigns an address to the socket SOCKET. The ADDR and LENGTH arguments specify the address; the detailed format of the address depends on the namespace. The first part of the @@ -485,8 +516,8 @@ Reading the Address of a Socket socket. The prototype for this function is in the header file `sys/socket.h'. - - Function: int getsockname (int SOCKET, struct sockaddr *ADDR, size_t - *LENGTH-PTR) + - Function: int getsockname (int SOCKET, struct sockaddr *ADDR, + socklen_t *LENGTH-PTR) The `getsockname' function returns information about the address of the socket SOCKET in the locations specified by the ADDR and LENGTH-PTR arguments. Note that the LENGTH-PTR is a pointer; you @@ -683,8 +714,8 @@ components: * The address of the machine you want to connect to. Internet addresses can be specified in several ways; these are discussed in - *Note Internet Address Format::, *Note Host Addresses::, and *Note - Host Names::. + *Note Internet Address Formats::, *Note Host Addresses::, and + *Note Host Names::. * A port number for that machine. *Note Ports::. @@ -694,7 +725,7 @@ information about this. * Menu: -* Internet Address Format:: How socket addresses are specified in the +* Internet Address Formats:: How socket addresses are specified in the Internet namespace. * Host Addresses:: All about host addresses of internet host. * Protocols Database:: Referring to protocols by name. @@ -706,18 +737,19 @@ information about this. * Inet Example:: Putting it all together.  -File: libc.info, Node: Internet Address Format, Next: Host Addresses, Up: Internet Namespace +File: libc.info, Node: Internet Address Formats, Next: Host Addresses, Up: Internet Namespace -Internet Socket Address Format ------------------------------- +Internet Socket Address Formats +------------------------------- - In the Internet namespace, a socket address consists of a host -address and a port on that host. In addition, the protocol you choose -serves effectively as a part of the address because local port numbers -are meaningful only within a particular protocol. + In the Internet namespace, for both IPv4 (`AF_INET') and IPv6 +(`AF_INET6'), a socket address consists of a host address and a port on +that host. In addition, the protocol you choose serves effectively as +a part of the address because local port numbers are meaningful only +within a particular protocol. - The data type for representing socket addresses in the Internet -namespace is defined in the header file `netinet/in.h'. + The data types for representing socket addresses in the Internet +namespace are defined in the header file `netinet/in.h'. - Data Type: struct sockaddr_in This is the data type used to represent socket addresses in the @@ -740,16 +772,39 @@ namespace is defined in the header file (struct sockaddr_in)' as the LENGTH parameter if you are using an Internet namespace socket address. + - Data Type: struct sockaddr_in6 + This is the data type used to represent socket addresses in the + IPv6 namespace. It has the following members: + + `short int sin6_family' + This identifies the address family or format of the socket + address. You should store the value of `AF_INET6' in this + member. *Note Socket Addresses::. + + `struct in6_addr sin6_addr' + This is the IPv6 address of the host machine. *Note Host + Addresses::, and *Note Host Names::, for how to get a value + to store here. + + `uint32_t sin6_flowinfo' + This is a currently unimplemented field. + + `uint16_t sin6_port' + This is the port number. *Note Ports::. + +  -File: libc.info, Node: Host Addresses, Next: Protocols Database, Prev: Internet Address Format, Up: Internet Namespace +File: libc.info, Node: Host Addresses, Next: Protocols Database, Prev: Internet Address Formats, Up: Internet Namespace Host Addresses -------------- Each computer on the Internet has one or more "Internet addresses", numbers which identify that computer among all those on the Internet. -Users typically write numeric host addresses as sequences of four -numbers, separated by periods, as in `128.52.46.32'. +Users typically write IPv4 numeric host addresses as sequences of four +numbers, separated by periods, as in `128.52.46.32', and IPv6 numeric +host addresses as sequences of up to eight numbers seperated by colons, +as in `5f03:1200:836f:c100::1'. Each computer also has one or more "host names", which are strings of words separated by periods, as in `churchy.gnu.ai.mit.edu'. @@ -852,7 +907,7 @@ header file `netinet/in.h': host address. It has just one field, named `s_addr', which records the host address number as an `unsigned long int'. - - Macro: unsigned long int INADDR_LOOPBACK + - Macro: unsigned int INADDR_LOOPBACK You can use this constant to stand for "the address of this machine," instead of finding its actual address. It is the Internet address `127.0.0.1', which is usually called `localhost'. @@ -861,18 +916,35 @@ header file `netinet/in.h': `INADDR_LOOPBACK' specially, avoiding any network traffic for the case of one machine talking to itself. - - Macro: unsigned long int INADDR_ANY + - Macro: unsigned int INADDR_ANY You can use this constant to stand for "any incoming address," when binding to an address. *Note Setting Address::. This is the usual address to give in the `sin_addr' member of `struct sockaddr_in' when you want to accept Internet connections. - - Macro: unsigned long int INADDR_BROADCAST + - Macro: unsigned int INADDR_BROADCAST This constant is the address you use to send a broadcast message. - - Macro: unsigned long int INADDR_NONE + - Macro: unsigned int INADDR_NONE This constant is returned by some functions to indicate an error. + - Data Type: struct in6_addr + This data type is used to store an IPv6 address. It stores 128 + bits of data, which can be accessed (via a union) in a variety of + ways. + + - Constant: struct in6_addr in6addr_loopback. + This constant is the IPv6 address `::1', the loopback address. See + above for a description of what this means. The macro + `IN6ADDR_LOOPBACK_INIT' is provided to allow you to initialise your + own variables to this value. + + - Constant: struct in6_addr in6addr_any + This constant is the IPv6 address `::', the unspecified address. + See above for a description of what this means. The macro + `IN6ADDR_ANY_INIT' is provided to allow you to initialise your own + variables to this value. +  File: libc.info, Node: Host Address Functions, Next: Host Names, Prev: Host Address Data Type, Up: Host Addresses @@ -912,6 +984,11 @@ Order::, for an explanation of network a overwrite the same buffer, so you should copy the string if you need to save it. + In multi-threaded programs each thread has an own + statically-allocated buffer. But still subsequent calls of + `inet_ntoa' in the same thread will overwrite the result of the + last call. + - Function: struct in_addr inet_makeaddr (int NET, int LOCAL) This function makes an Internet host address by combining the network number NET with the local-address-within-network number @@ -925,6 +1002,23 @@ Order::, for an explanation of network a This function returns the network number part of the Internet host address ADDR. + - Function: int inet_pton (int AF, const char *CP, void *BUF) + This function converts an Internet address (either IPv4 or IPv6) + from presentation (textual) to network (binary) format. AF should + be either `AF_INET' or `AF_INET6', as appropriate for the type of + address being converted. CP is a pointer to the input string, and + BUF is a pointer to a buffer for the result. It is the caller's + responsibility to make sure the buffer is large enough. + + - Function: char * inet_ntop (int AF, const void *CP, char *BUF, + size_t LEN) + This function converts an Internet address (either IPv4 or IPv6) + from network (binary) to presentation (textual) form. AF should be + either `AF_INET' or `AF_INET6', as appropriate. CP is a pointer + to the address to be converted. BUF should be a pointer to a + buffer to hold the result, and LEN is the length of this buffer. + The return value from the function will be this buffer address. +  File: libc.info, Node: Host Names, Prev: Host Address Functions, Up: Host Addresses @@ -958,10 +1052,12 @@ include `netdb.h'. `int h_addrtype' This is the host address type; in practice, its value is - always `AF_INET'. In principle other kinds of addresses + always either `AF_INET' or `AF_INET6', with the latter being + used for IPv6 hosts. In principle other kinds of addresses could be represented in the data base as well as Internet addresses; if this were done, you might find a value in this - field other than `AF_INET'. *Note Socket Addresses::. + field other than `AF_INET' or `AF_INET6'. *Note Socket + Addresses::. `int h_length' This is the length, in bytes, of each address. @@ -983,15 +1079,21 @@ or an `unsigned long int'. Host address structure are always given in network byte order; see *Note Byte Order::. - You can use `gethostbyname' or `gethostbyaddr' to search the hosts -database for information about a particular host. The information is -returned in a statically-allocated structure; you must copy the -information if you need to save it across calls. + You can use `gethostbyname', `gethostbyname2' or `gethostbyaddr' to +search the hosts database for information about a particular host. The +information is returned in a statically-allocated structure; you must +copy the information if you need to save it across calls. You can also +use `getaddrinfo' and `getnameinfo' to obtain this information. - Function: struct hostent * gethostbyname (const char *NAME) The `gethostbyname' function returns information about the host named NAME. If the lookup fails, it returns a null pointer. + - Function: struct hostent * gethostbyname2 (const char *NAME, int AF) + The `gethostbyname2' function is like `gethostbyname', but allows + the caller to specify the desired address family (e.g. `AF_INET' + or `AF_INET6') for the result. + - Function: struct hostent * gethostbyaddr (const char *ADDR, int LENGTH, int FORMAT) The `gethostbyaddr' function returns information about the host @@ -1091,126 +1193,4 @@ numbers. To reuse a port number, you mu Port numbers greater than or equal to `IPPORT_USERRESERVED' are reserved for explicit use; they will never be allocated automatically. - - -File: libc.info, Node: Services Database, Next: Byte Order, Prev: Ports, Up: Internet Namespace - -The Services Database ---------------------- - - The database that keeps track of "well-known" services is usually -either the file `/etc/services' or an equivalent from a name server. -You can use these utilities, declared in `netdb.h', to access the -services database. - - - Data Type: struct servent - This data type holds information about entries from the services - database. It has the following members: - - `char *s_name' - This is the "official" name of the service. - - `char **s_aliases' - These are alternate names for the service, represented as an - array of strings. A null pointer terminates the array. - - `int s_port' - This is the port number for the service. Port numbers are - given in network byte order; see *Note Byte Order::. - - `char *s_proto' - This is the name of the protocol to use with this service. - *Note Protocols Database::. - - To get information about a particular service, use the -`getservbyname' or `getservbyport' functions. The information is -returned in a statically-allocated structure; you must copy the -information if you need to save it across calls. - - - Function: struct servent * getservbyname (const char *NAME, const - char *PROTO) - The `getservbyname' function returns information about the service - named NAME using protocol PROTO. If it can't find such a service, - it returns a null pointer. - - This function is useful for servers as well as for clients; servers - use it to determine which port they should listen on (*note - Listening::.). - - - Function: struct servent * getservbyport (int PORT, const char - *PROTO) - The `getservbyport' function returns information about the service - at port PORT using protocol PROTO. If it can't find such a - service, it returns a null pointer. - - You can also scan the services database using `setservent', -`getservent', and `endservent'. Be careful in using these functions, -because they are not reentrant. - - - Function: void setservent (int STAYOPEN) - This function opens the services database to begin scanning it. - - If the STAYOPEN argument is nonzero, this sets a flag so that - subsequent calls to `getservbyname' or `getservbyport' will not - close the database (as they usually would). This makes for more - efficiency if you call those functions several times, by avoiding - reopening the database for each call. - - - Function: struct servent * getservent (void) - This function returns the next entry in the services database. If - there are no more entries, it returns a null pointer. - - - Function: void endservent (void) - This function closes the services database. - - -File: libc.info, Node: Byte Order, Next: Inet Example, Prev: Services Database, Up: Internet Namespace - -Byte Order Conversion ---------------------- - - Different kinds of computers use different conventions for the -ordering of bytes within a word. Some computers put the most -significant byte within a word first (this is called "big-endian" -order), and others put it last ("little-endian" order). - - So that machines with different byte order conventions can -communicate, the Internet protocols specify a canonical byte order -convention for data transmitted over the network. This is known as the -"network byte order". - - When establishing an Internet socket connection, you must make sure -that the data in the `sin_port' and `sin_addr' members of the -`sockaddr_in' structure are represented in the network byte order. If -you are encoding integer data in the messages sent through the socket, -you should convert this to network byte order too. If you don't do -this, your program may fail when running on or talking to other kinds -of machines. - - If you use `getservbyname' and `gethostbyname' or `inet_addr' to get -the port number and host address, the values are already in the network -byte order, and you can copy them directly into the `sockaddr_in' -structure. - - Otherwise, you have to convert the values explicitly. Use `htons' -and `ntohs' to convert values for the `sin_port' member. Use `htonl' -and `ntohl' to convert values for the `sin_addr' member. (Remember, -`struct in_addr' is equivalent to `unsigned long int'.) These -functions are declared in `netinet/in.h'. - - - Function: unsigned short int htons (unsigned short int HOSTSHORT) - This function converts the `short' integer HOSTSHORT from host - byte order to network byte order. - - - Function: unsigned short int ntohs (unsigned short int NETSHORT) - This function converts the `short' integer NETSHORT from network - byte order to host byte order. - - - Function: unsigned long int htonl (unsigned long int HOSTLONG) - This function converts the `long' integer HOSTLONG from host byte - order to network byte order. - - - Function: unsigned long int ntohl (unsigned long int NETLONG) - This function converts the `long' integer NETLONG from network - byte order to host byte order. diff -durpN glibc-2.0.4/manual/libc.info-13 glibc-2.0.5/manual/libc.info-13 --- glibc-2.0.4/manual/libc.info-13 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-13 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,128 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Services Database, Next: Byte Order, Prev: Ports, Up: Internet Namespace + +The Services Database +--------------------- + + The database that keeps track of "well-known" services is usually +either the file `/etc/services' or an equivalent from a name server. +You can use these utilities, declared in `netdb.h', to access the +services database. + + - Data Type: struct servent + This data type holds information about entries from the services + database. It has the following members: + + `char *s_name' + This is the "official" name of the service. + + `char **s_aliases' + These are alternate names for the service, represented as an + array of strings. A null pointer terminates the array. + + `int s_port' + This is the port number for the service. Port numbers are + given in network byte order; see *Note Byte Order::. + + `char *s_proto' + This is the name of the protocol to use with this service. + *Note Protocols Database::. + + To get information about a particular service, use the +`getservbyname' or `getservbyport' functions. The information is +returned in a statically-allocated structure; you must copy the +information if you need to save it across calls. + + - Function: struct servent * getservbyname (const char *NAME, const + char *PROTO) + The `getservbyname' function returns information about the service + named NAME using protocol PROTO. If it can't find such a service, + it returns a null pointer. + + This function is useful for servers as well as for clients; servers + use it to determine which port they should listen on (*note + Listening::.). + + - Function: struct servent * getservbyport (int PORT, const char + *PROTO) + The `getservbyport' function returns information about the service + at port PORT using protocol PROTO. If it can't find such a + service, it returns a null pointer. + + You can also scan the services database using `setservent', +`getservent', and `endservent'. Be careful in using these functions, +because they are not reentrant. + + - Function: void setservent (int STAYOPEN) + This function opens the services database to begin scanning it. + + If the STAYOPEN argument is nonzero, this sets a flag so that + subsequent calls to `getservbyname' or `getservbyport' will not + close the database (as they usually would). This makes for more + efficiency if you call those functions several times, by avoiding + reopening the database for each call. + + - Function: struct servent * getservent (void) + This function returns the next entry in the services database. If + there are no more entries, it returns a null pointer. + + - Function: void endservent (void) + This function closes the services database. + + +File: libc.info, Node: Byte Order, Next: Inet Example, Prev: Services Database, Up: Internet Namespace + +Byte Order Conversion +--------------------- + + Different kinds of computers use different conventions for the +ordering of bytes within a word. Some computers put the most +significant byte within a word first (this is called "big-endian" +order), and others put it last ("little-endian" order). + + So that machines with different byte order conventions can +communicate, the Internet protocols specify a canonical byte order +convention for data transmitted over the network. This is known as the +"network byte order". + + When establishing an Internet socket connection, you must make sure +that the data in the `sin_port' and `sin_addr' members of the +`sockaddr_in' structure are represented in the network byte order. If +you are encoding integer data in the messages sent through the socket, +you should convert this to network byte order too. If you don't do +this, your program may fail when running on or talking to other kinds +of machines. + + If you use `getservbyname' and `gethostbyname' or `inet_addr' to get +the port number and host address, the values are already in the network +byte order, and you can copy them directly into the `sockaddr_in' +structure. + + Otherwise, you have to convert the values explicitly. Use `htons' +and `ntohs' to convert values for the `sin_port' member. Use `htonl' +and `ntohl' to convert values for the `sin_addr' member. (Remember, +`struct in_addr' is equivalent to `unsigned long int'.) These +functions are declared in `netinet/in.h'. + + - Function: unsigned short int htons (unsigned short int HOSTSHORT) + This function converts the `short' integer HOSTSHORT from host + byte order to network byte order. + + - Function: unsigned short int ntohs (unsigned short int NETSHORT) + This function converts the `short' integer NETSHORT from network + byte order to host byte order. + + - Function: unsigned long int htonl (unsigned long int HOSTLONG) + This function converts the `long' integer HOSTLONG from host byte + order to network byte order. + + - Function: unsigned long int ntohl (unsigned long int NETLONG) + This function converts the `long' integer NETLONG from network + byte order to host byte order. + + File: libc.info, Node: Protocols Database, Next: Ports, Prev: Host Addresses, Up: Internet Namespace Protocols Database @@ -386,7 +513,7 @@ server waits for and accepts the connect client program must do, using the `connect' function, which is declared in `sys/socket.h'. - - Function: int connect (int SOCKET, struct sockaddr *ADDR, size_t + - Function: int connect (int SOCKET, struct sockaddr *ADDR, socklen_t LENGTH) The `connect' function initiates a connection from the socket with file descriptor SOCKET to the socket whose address is specified by @@ -520,7 +647,7 @@ length of this queue as an argument to t the system may also impose its own internal limit on the length of this queue. - - Function: int accept (int SOCKET, struct sockaddr *ADDR, size_t + - Function: int accept (int SOCKET, struct sockaddr *ADDR, socklen_t *LENGTH-PTR) This function is used to accept a connection request on the server socket SOCKET. @@ -1149,7 +1276,7 @@ packet there. You can cancel the defaul *Note Connecting::, for more information about the `connect' function. - Function: int sendto (int SOCKET, void *BUFFER. size_t SIZE, int - FLAGS, struct sockaddr *ADDR, size_t LENGTH) + FLAGS, struct sockaddr *ADDR, socklen_t LENGTH) The `sendto' function transmits the data in the BUFFER through the socket SOCKET to the destination address specified by the ADDR and LENGTH arguments. The SIZE argument specifies the number of bytes @@ -1178,7 +1305,7 @@ also tells you where it was sent from. `sys/socket.h'. - Function: int recvfrom (int SOCKET, void *BUFFER, size_t SIZE, int - FLAGS, struct sockaddr *ADDR, size_t *LENGTH-PTR) + FLAGS, struct sockaddr *ADDR, socklen_t *LENGTH-PTR) The `recvfrom' function reads one packet from the socket SOCKET into the buffer BUFFER. The SIZE argument specifies the maximum number of bytes to be read. @@ -1205,169 +1332,4 @@ also tells you where it was sent from. (either because you know where it should come from or because you treat all possible senders alike). Even `read' can be used if you don't want to specify FLAGS (*note I/O Primitives::.). - - -File: libc.info, Node: Datagram Example, Next: Example Receiver, Prev: Receiving Datagrams, Up: Datagrams - -Datagram Socket Example ------------------------ - - Here is a set of example programs that send messages over a datagram -stream in the file namespace. Both the client and server programs use -the `make_named_socket' function that was presented in *Note File -Namespace::, to create and name their sockets. - - First, here is the server program. It sits in a loop waiting for -messages to arrive, bouncing each message back to the sender. -Obviously, this isn't a particularly useful program, but it does show -the general ideas involved. - - #include - #include - #include - #include - #include - - #define SERVER "/tmp/serversocket" - #define MAXMSG 512 - - int - main (void) - { - int sock; - char message[MAXMSG]; - struct sockaddr_un name; - size_t size; - int nbytes; - - /* Make the socket, then loop endlessly. */ - - sock = make_named_socket (SERVER); - while (1) - { - /* Wait for a datagram. */ - size = sizeof (name); - nbytes = recvfrom (sock, message, MAXMSG, 0, - (struct sockaddr *) & name, &size); - if (nbytes < 0) - { - perror ("recfrom (server)"); - exit (EXIT_FAILURE); - } - - /* Give a diagnostic message. */ - fprintf (stderr, "Server: got message: %s\n", message); - - /* Bounce the message back to the sender. */ - nbytes = sendto (sock, message, nbytes, 0, - (struct sockaddr *) & name, size); - if (nbytes < 0) - { - perror ("sendto (server)"); - exit (EXIT_FAILURE); - } - } - } - - -File: libc.info, Node: Example Receiver, Prev: Datagram Example, Up: Datagrams - -Example of Reading Datagrams ----------------------------- - - Here is the client program corresponding to the server above. - - It sends a datagram to the server and then waits for a reply. Notice -that the socket for the client (as well as for the server) in this -example has to be given a name. This is so that the server can direct -a message back to the client. Since the socket has no associated -connection state, the only way the server can do this is by referencing -the name of the client. - - #include - #include - #include - #include - #include - #include - - #define SERVER "/tmp/serversocket" - #define CLIENT "/tmp/mysocket" - #define MAXMSG 512 - #define MESSAGE "Yow!!! Are we having fun yet?!?" - - int - main (void) - { - extern int make_named_socket (const char *name); - int sock; - char message[MAXMSG]; - struct sockaddr_un name; - size_t size; - int nbytes; - - /* Make the socket. */ - sock = make_named_socket (CLIENT); - - /* Initialize the server socket address. */ - name.sun_family = AF_UNIX; - strcpy (name.sun_path, SERVER); - size = strlen (name.sun_path) + sizeof (name.sun_family); - - /* Send the datagram. */ - nbytes = sendto (sock, MESSAGE, strlen (MESSAGE) + 1, 0, - (struct sockaddr *) & name, size); - if (nbytes < 0) - { - perror ("sendto (client)"); - exit (EXIT_FAILURE); - } - - /* Wait for a reply. */ - nbytes = recvfrom (sock, message, MAXMSG, 0, NULL, 0); - if (nbytes < 0) - { - perror ("recfrom (client)"); - exit (EXIT_FAILURE); - } - - /* Print a diagnostic message. */ - fprintf (stderr, "Client: got message: %s\n", message); - - /* Clean up. */ - remove (CLIENT); - close (sock); - } - - Keep in mind that datagram socket communications are unreliable. In -this example, the client program waits indefinitely if the message -never reaches the server or if the server's response never comes back. -It's up to the user running the program to kill it and restart it, if -desired. A more automatic solution could be to use `select' (*note -Waiting for I/O::.) to establish a timeout period for the reply, and in -case of timeout either resend the message or shut down the socket and -exit. - - -File: libc.info, Node: Inetd, Next: Socket Options, Prev: Datagrams, Up: Sockets - -The `inetd' Daemon -================== - - We've explained above how to write a server program that does its own -listening. Such a server must already be running in order for anyone -to connect to it. - - Another way to provide service for an Internet port is to let the -daemon program `inetd' do the listening. `inetd' is a program that -runs all the time and waits (using `select') for messages on a -specified set of ports. When it receives a message, it accepts the -connection (if the socket style calls for connections) and then forks a -child process to run the corresponding server program. You specify the -ports and their programs in the file `/etc/inetd.conf'. - -* Menu: - -* Inetd Servers:: -* Configuring Inetd:: diff -durpN glibc-2.0.4/manual/libc.info-14 glibc-2.0.5/manual/libc.info-14 --- glibc-2.0.4/manual/libc.info-14 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-14 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,171 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Datagram Example, Next: Example Receiver, Prev: Receiving Datagrams, Up: Datagrams + +Datagram Socket Example +----------------------- + + Here is a set of example programs that send messages over a datagram +stream in the file namespace. Both the client and server programs use +the `make_named_socket' function that was presented in *Note File +Namespace::, to create and name their sockets. + + First, here is the server program. It sits in a loop waiting for +messages to arrive, bouncing each message back to the sender. +Obviously, this isn't a particularly useful program, but it does show +the general ideas involved. + + #include + #include + #include + #include + #include + + #define SERVER "/tmp/serversocket" + #define MAXMSG 512 + + int + main (void) + { + int sock; + char message[MAXMSG]; + struct sockaddr_un name; + size_t size; + int nbytes; + + /* Make the socket, then loop endlessly. */ + + sock = make_named_socket (SERVER); + while (1) + { + /* Wait for a datagram. */ + size = sizeof (name); + nbytes = recvfrom (sock, message, MAXMSG, 0, + (struct sockaddr *) & name, &size); + if (nbytes < 0) + { + perror ("recfrom (server)"); + exit (EXIT_FAILURE); + } + + /* Give a diagnostic message. */ + fprintf (stderr, "Server: got message: %s\n", message); + + /* Bounce the message back to the sender. */ + nbytes = sendto (sock, message, nbytes, 0, + (struct sockaddr *) & name, size); + if (nbytes < 0) + { + perror ("sendto (server)"); + exit (EXIT_FAILURE); + } + } + } + + +File: libc.info, Node: Example Receiver, Prev: Datagram Example, Up: Datagrams + +Example of Reading Datagrams +---------------------------- + + Here is the client program corresponding to the server above. + + It sends a datagram to the server and then waits for a reply. Notice +that the socket for the client (as well as for the server) in this +example has to be given a name. This is so that the server can direct +a message back to the client. Since the socket has no associated +connection state, the only way the server can do this is by referencing +the name of the client. + + #include + #include + #include + #include + #include + #include + + #define SERVER "/tmp/serversocket" + #define CLIENT "/tmp/mysocket" + #define MAXMSG 512 + #define MESSAGE "Yow!!! Are we having fun yet?!?" + + int + main (void) + { + extern int make_named_socket (const char *name); + int sock; + char message[MAXMSG]; + struct sockaddr_un name; + size_t size; + int nbytes; + + /* Make the socket. */ + sock = make_named_socket (CLIENT); + + /* Initialize the server socket address. */ + name.sun_family = AF_UNIX; + strcpy (name.sun_path, SERVER); + size = strlen (name.sun_path) + sizeof (name.sun_family); + + /* Send the datagram. */ + nbytes = sendto (sock, MESSAGE, strlen (MESSAGE) + 1, 0, + (struct sockaddr *) & name, size); + if (nbytes < 0) + { + perror ("sendto (client)"); + exit (EXIT_FAILURE); + } + + /* Wait for a reply. */ + nbytes = recvfrom (sock, message, MAXMSG, 0, NULL, 0); + if (nbytes < 0) + { + perror ("recfrom (client)"); + exit (EXIT_FAILURE); + } + + /* Print a diagnostic message. */ + fprintf (stderr, "Client: got message: %s\n", message); + + /* Clean up. */ + remove (CLIENT); + close (sock); + } + + Keep in mind that datagram socket communications are unreliable. In +this example, the client program waits indefinitely if the message +never reaches the server or if the server's response never comes back. +It's up to the user running the program to kill it and restart it, if +desired. A more automatic solution could be to use `select' (*note +Waiting for I/O::.) to establish a timeout period for the reply, and in +case of timeout either resend the message or shut down the socket and +exit. + + +File: libc.info, Node: Inetd, Next: Socket Options, Prev: Datagrams, Up: Sockets + +The `inetd' Daemon +================== + + We've explained above how to write a server program that does its own +listening. Such a server must already be running in order for anyone +to connect to it. + + Another way to provide service for an Internet port is to let the +daemon program `inetd' do the listening. `inetd' is a program that +runs all the time and waits (using `select') for messages on a +specified set of ports. When it receives a message, it accepts the +connection (if the socket style calls for connections) and then forks a +child process to run the corresponding server program. You specify the +ports and their programs in the file `/etc/inetd.conf'. + +* Menu: + +* Inetd Servers:: +* Configuring Inetd:: + + File: libc.info, Node: Inetd Servers, Next: Configuring Inetd, Up: Inetd `inetd' Servers @@ -138,7 +308,7 @@ Socket Option Functions They are declared in `sys/socket.h'. - Function: int getsockopt (int SOCKET, int LEVEL, int OPTNAME, void - *OPTVAL, size_t *OPTLEN-PTR) + *OPTVAL, socklen_t *OPTLEN-PTR) The `getsockopt' function gets information about the value of option OPTNAME at level LEVEL for socket SOCKET. @@ -162,7 +332,7 @@ They are declared in `sys/socket.h'. The OPTNAME doesn't make sense for the given LEVEL. - Function: int setsockopt (int SOCKET, int LEVEL, int OPTNAME, void - *OPTVAL, size_t OPTLEN) + *OPTVAL, socklen_t OPTLEN) This function is used to set the socket option OPTNAME at level LEVEL for socket SOCKET. The value of the option is passed in the buffer OPTVAL, which has size OPTLEN. @@ -966,238 +1136,4 @@ systems and the GNU system. works.) This bit is never set in the structure filled in by `tcgetattr'. - - -File: libc.info, Node: Local Modes, Next: Line Speed, Prev: Control Modes, Up: Terminal Modes - -Local Modes ------------ - - This section describes the flags for the `c_lflag' member of the -`struct termios' structure. These flags generally control higher-level -aspects of input processing than the input modes flags described in -*Note Input Modes::, such as echoing, signals, and the choice of -canonical or noncanonical input. - - The `c_lflag' member itself is an integer, and you change the flags -and fields using the operators `&', `|', and `^'. Don't try to specify -the entire value for `c_lflag'--instead, change only specific flags and -leave the rest untouched (*note Setting Modes::.). - - - Macro: tcflag_t ICANON - This bit, if set, enables canonical input processing mode. - Otherwise, input is processed in noncanonical mode. *Note - Canonical or Not::. - - - Macro: tcflag_t ECHO - If this bit is set, echoing of input characters back to the - terminal is enabled. - - - Macro: tcflag_t ECHOE - If this bit is set, echoing indicates erasure of input with the - ERASE character by erasing the last character in the current line - from the screen. Otherwise, the character erased is re-echoed to - show what has happened (suitable for a printing terminal). - - This bit only controls the display behavior; the `ICANON' bit by - itself controls actual recognition of the ERASE character and - erasure of input, without which `ECHOE' is simply irrelevant. - - - Macro: tcflag_t ECHOPRT - This bit is like `ECHOE', enables display of the ERASE character in - a way that is geared to a hardcopy terminal. When you type the - ERASE character, a `\' character is printed followed by the first - character erased. Typing the ERASE character again just prints - the next character erased. Then, the next time you type a normal - character, a `/' character is printed before the character echoes. - - This is a BSD extension, and exists only in BSD systems and the - GNU system. - - - Macro: tcflag_t ECHOK - This bit enables special display of the KILL character by moving - to a new line after echoing the KILL character normally. The - behavior of `ECHOKE' (below) is nicer to look at. - - If this bit is not set, the KILL character echoes just as it would - if it were not the KILL character. Then it is up to the user to - remember that the KILL character has erased the preceding input; - there is no indication of this on the screen. - - This bit only controls the display behavior; the `ICANON' bit by - itself controls actual recognition of the KILL character and - erasure of input, without which `ECHOK' is simply irrelevant. - - - Macro: tcflag_t ECHOKE - This bit is similar to `ECHOK'. It enables special display of the - KILL character by erasing on the screen the entire line that has - been killed. This is a BSD extension, and exists only in BSD - systems and the GNU system. - - - Macro: tcflag_t ECHONL - If this bit is set and the `ICANON' bit is also set, then the - newline (`'\n'') character is echoed even if the `ECHO' bit is not - set. - - - Macro: tcflag_t ECHOCTL - If this bit is set and the `ECHO' bit is also set, echo control - characters with `^' followed by the corresponding text character. - Thus, control-A echoes as `^A'. This is usually the preferred mode - for interactive input, because echoing a control character back to - the terminal could have some undesired effect on the terminal. - - This is a BSD extension, and exists only in BSD systems and the - GNU system. - - - Macro: tcflag_t ISIG - This bit controls whether the INTR, QUIT, and SUSP characters are - recognized. The functions associated with these characters are - performed if and only if this bit is set. Being in canonical or - noncanonical input mode has no affect on the interpretation of - these characters. - - You should use caution when disabling recognition of these - characters. Programs that cannot be interrupted interactively are - very user-unfriendly. If you clear this bit, your program should - provide some alternate interface that allows the user to - interactively send the signals associated with these characters, - or to escape from the program. - - *Note Signal Characters::. - - - Macro: tcflag_t IEXTEN - POSIX.1 gives `IEXTEN' implementation-defined meaning, so you - cannot rely on this interpretation on all systems. - - On BSD systems and the GNU system, it enables the LNEXT and - DISCARD characters. *Note Other Special::. - - - Macro: tcflag_t NOFLSH - Normally, the INTR, QUIT, and SUSP characters cause input and - output queues for the terminal to be cleared. If this bit is set, - the queues are not cleared. - - - Macro: tcflag_t TOSTOP - If this bit is set and the system supports job control, then - `SIGTTOU' signals are generated by background processes that - attempt to write to the terminal. *Note Access to the Terminal::. - - The following bits are BSD extensions; they exist only in BSD systems -and the GNU system. - - - Macro: tcflag_t ALTWERASE - This bit determines how far the WERASE character should erase. The - WERASE character erases back to the beginning of a word; the - question is, where do words begin? - - If this bit is clear, then the beginning of a word is a - nonwhitespace character following a whitespace character. If the - bit is set, then the beginning of a word is an alphanumeric - character or underscore following a character which is none of - those. - - *Note Editing Characters::, for more information about the WERASE - character. - - - Macro: tcflag_t FLUSHO - This is the bit that toggles when the user types the DISCARD - character. While this bit is set, all output is discarded. *Note - Other Special::. - - - Macro: tcflag_t NOKERNINFO - Setting this bit disables handling of the STATUS character. *Note - Other Special::. - - - Macro: tcflag_t PENDIN - If this bit is set, it indicates that there is a line of input that - needs to be reprinted. Typing the REPRINT character sets this - bit; the bit remains set until reprinting is finished. *Note - Editing Characters::. - - -File: libc.info, Node: Line Speed, Next: Special Characters, Prev: Local Modes, Up: Terminal Modes - -Line Speed ----------- - - The terminal line speed tells the computer how fast to read and write -data on the terminal. - - If the terminal is connected to a real serial line, the terminal -speed you specify actually controls the line--if it doesn't match the -terminal's own idea of the speed, communication does not work. Real -serial ports accept only certain standard speeds. Also, particular -hardware may not support even all the standard speeds. Specifying a -speed of zero hangs up a dialup connection and turns off modem control -signals. - - If the terminal is not a real serial line (for example, if it is a -network connection), then the line speed won't really affect data -transmission speed, but some programs will use it to determine the -amount of padding needed. It's best to specify a line speed value that -matches the actual speed of the actual terminal, but you can safely -experiment with different values to vary the amount of padding. - - There are actually two line speeds for each terminal, one for input -and one for output. You can set them independently, but most often -terminals use the same speed for both directions. - - The speed values are stored in the `struct termios' structure, but -don't try to access them in the `struct termios' structure directly. -Instead, you should use the following functions to read and store them: - - - Function: speed_t cfgetospeed (const struct termios *TERMIOS-P) - This function returns the output line speed stored in the structure - `*TERMIOS-P'. - - - Function: speed_t cfgetispeed (const struct termios *TERMIOS-P) - This function returns the input line speed stored in the structure - `*TERMIOS-P'. - - - Function: int cfsetospeed (struct termios *TERMIOS-P, speed_t SPEED) - This function stores SPEED in `*TERMIOS-P' as the output speed. - The normal return value is `0'; a value of `-1' indicates an - error. If SPEED is not a speed, `cfsetospeed' returns `-1'. - - - Function: int cfsetispeed (struct termios *TERMIOS-P, speed_t SPEED) - This function stores SPEED in `*TERMIOS-P' as the input speed. - The normal return value is `0'; a value of `-1' indicates an - error. If SPEED is not a speed, `cfsetospeed' returns `-1'. - - - Function: int cfsetspeed (struct termios *TERMIOS-P, speed_t SPEED) - This function stores SPEED in `*TERMIOS-P' as both the input and - output speeds. The normal return value is `0'; a value of `-1' - indicates an error. If SPEED is not a speed, `cfsetspeed' returns - `-1'. This function is an extension in 4.4 BSD. - - - Data Type: speed_t - The `speed_t' type is an unsigned integer data type used to - represent line speeds. - - The functions `cfsetospeed' and `cfsetispeed' report errors only for -speed values that the system simply cannot handle. If you specify a -speed value that is basically acceptable, then those functions will -succeed. But they do not check that a particular hardware device can -actually support the specified speeds--in fact, they don't know which -device you plan to set the speed for. If you use `tcsetattr' to set -the speed of a particular device to a value that it cannot handle, -`tcsetattr' returns `-1'. - - *Portability note:* In the GNU library, the functions above accept -speeds measured in bits per second as input, and return speed values -measured in bits per second. Other libraries require speeds to be -indicated by special codes. For POSIX.1 portability, you must use one -of the following symbols to represent the speed; their precise numeric -values are system-dependent, but each name has a fixed meaning: `B110' -stands for 110 bps, `B300' for 300 bps, and so on. There is no -portable way to represent any speed but these, but these are the only -speeds that typical serial lines can support. - - B0 B50 B75 B110 B134 B150 B200 - B300 B600 B1200 B1800 B2400 B4800 - B9600 B19200 B38400 - - BSD defines two additional speed symbols as aliases: `EXTA' is an -alias for `B19200' and `EXTB' is an alias for `B38400'. These aliases -are obsolete. diff -durpN glibc-2.0.4/manual/libc.info-15 glibc-2.0.5/manual/libc.info-15 --- glibc-2.0.4/manual/libc.info-15 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-15 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,240 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Local Modes, Next: Line Speed, Prev: Control Modes, Up: Terminal Modes + +Local Modes +----------- + + This section describes the flags for the `c_lflag' member of the +`struct termios' structure. These flags generally control higher-level +aspects of input processing than the input modes flags described in +*Note Input Modes::, such as echoing, signals, and the choice of +canonical or noncanonical input. + + The `c_lflag' member itself is an integer, and you change the flags +and fields using the operators `&', `|', and `^'. Don't try to specify +the entire value for `c_lflag'--instead, change only specific flags and +leave the rest untouched (*note Setting Modes::.). + + - Macro: tcflag_t ICANON + This bit, if set, enables canonical input processing mode. + Otherwise, input is processed in noncanonical mode. *Note + Canonical or Not::. + + - Macro: tcflag_t ECHO + If this bit is set, echoing of input characters back to the + terminal is enabled. + + - Macro: tcflag_t ECHOE + If this bit is set, echoing indicates erasure of input with the + ERASE character by erasing the last character in the current line + from the screen. Otherwise, the character erased is re-echoed to + show what has happened (suitable for a printing terminal). + + This bit only controls the display behavior; the `ICANON' bit by + itself controls actual recognition of the ERASE character and + erasure of input, without which `ECHOE' is simply irrelevant. + + - Macro: tcflag_t ECHOPRT + This bit is like `ECHOE', enables display of the ERASE character in + a way that is geared to a hardcopy terminal. When you type the + ERASE character, a `\' character is printed followed by the first + character erased. Typing the ERASE character again just prints + the next character erased. Then, the next time you type a normal + character, a `/' character is printed before the character echoes. + + This is a BSD extension, and exists only in BSD systems and the + GNU system. + + - Macro: tcflag_t ECHOK + This bit enables special display of the KILL character by moving + to a new line after echoing the KILL character normally. The + behavior of `ECHOKE' (below) is nicer to look at. + + If this bit is not set, the KILL character echoes just as it would + if it were not the KILL character. Then it is up to the user to + remember that the KILL character has erased the preceding input; + there is no indication of this on the screen. + + This bit only controls the display behavior; the `ICANON' bit by + itself controls actual recognition of the KILL character and + erasure of input, without which `ECHOK' is simply irrelevant. + + - Macro: tcflag_t ECHOKE + This bit is similar to `ECHOK'. It enables special display of the + KILL character by erasing on the screen the entire line that has + been killed. This is a BSD extension, and exists only in BSD + systems and the GNU system. + + - Macro: tcflag_t ECHONL + If this bit is set and the `ICANON' bit is also set, then the + newline (`'\n'') character is echoed even if the `ECHO' bit is not + set. + + - Macro: tcflag_t ECHOCTL + If this bit is set and the `ECHO' bit is also set, echo control + characters with `^' followed by the corresponding text character. + Thus, control-A echoes as `^A'. This is usually the preferred mode + for interactive input, because echoing a control character back to + the terminal could have some undesired effect on the terminal. + + This is a BSD extension, and exists only in BSD systems and the + GNU system. + + - Macro: tcflag_t ISIG + This bit controls whether the INTR, QUIT, and SUSP characters are + recognized. The functions associated with these characters are + performed if and only if this bit is set. Being in canonical or + noncanonical input mode has no affect on the interpretation of + these characters. + + You should use caution when disabling recognition of these + characters. Programs that cannot be interrupted interactively are + very user-unfriendly. If you clear this bit, your program should + provide some alternate interface that allows the user to + interactively send the signals associated with these characters, + or to escape from the program. + + *Note Signal Characters::. + + - Macro: tcflag_t IEXTEN + POSIX.1 gives `IEXTEN' implementation-defined meaning, so you + cannot rely on this interpretation on all systems. + + On BSD systems and the GNU system, it enables the LNEXT and + DISCARD characters. *Note Other Special::. + + - Macro: tcflag_t NOFLSH + Normally, the INTR, QUIT, and SUSP characters cause input and + output queues for the terminal to be cleared. If this bit is set, + the queues are not cleared. + + - Macro: tcflag_t TOSTOP + If this bit is set and the system supports job control, then + `SIGTTOU' signals are generated by background processes that + attempt to write to the terminal. *Note Access to the Terminal::. + + The following bits are BSD extensions; they exist only in BSD systems +and the GNU system. + + - Macro: tcflag_t ALTWERASE + This bit determines how far the WERASE character should erase. The + WERASE character erases back to the beginning of a word; the + question is, where do words begin? + + If this bit is clear, then the beginning of a word is a + nonwhitespace character following a whitespace character. If the + bit is set, then the beginning of a word is an alphanumeric + character or underscore following a character which is none of + those. + + *Note Editing Characters::, for more information about the WERASE + character. + + - Macro: tcflag_t FLUSHO + This is the bit that toggles when the user types the DISCARD + character. While this bit is set, all output is discarded. *Note + Other Special::. + + - Macro: tcflag_t NOKERNINFO + Setting this bit disables handling of the STATUS character. *Note + Other Special::. + + - Macro: tcflag_t PENDIN + If this bit is set, it indicates that there is a line of input that + needs to be reprinted. Typing the REPRINT character sets this + bit; the bit remains set until reprinting is finished. *Note + Editing Characters::. + + +File: libc.info, Node: Line Speed, Next: Special Characters, Prev: Local Modes, Up: Terminal Modes + +Line Speed +---------- + + The terminal line speed tells the computer how fast to read and write +data on the terminal. + + If the terminal is connected to a real serial line, the terminal +speed you specify actually controls the line--if it doesn't match the +terminal's own idea of the speed, communication does not work. Real +serial ports accept only certain standard speeds. Also, particular +hardware may not support even all the standard speeds. Specifying a +speed of zero hangs up a dialup connection and turns off modem control +signals. + + If the terminal is not a real serial line (for example, if it is a +network connection), then the line speed won't really affect data +transmission speed, but some programs will use it to determine the +amount of padding needed. It's best to specify a line speed value that +matches the actual speed of the actual terminal, but you can safely +experiment with different values to vary the amount of padding. + + There are actually two line speeds for each terminal, one for input +and one for output. You can set them independently, but most often +terminals use the same speed for both directions. + + The speed values are stored in the `struct termios' structure, but +don't try to access them in the `struct termios' structure directly. +Instead, you should use the following functions to read and store them: + + - Function: speed_t cfgetospeed (const struct termios *TERMIOS-P) + This function returns the output line speed stored in the structure + `*TERMIOS-P'. + + - Function: speed_t cfgetispeed (const struct termios *TERMIOS-P) + This function returns the input line speed stored in the structure + `*TERMIOS-P'. + + - Function: int cfsetospeed (struct termios *TERMIOS-P, speed_t SPEED) + This function stores SPEED in `*TERMIOS-P' as the output speed. + The normal return value is `0'; a value of `-1' indicates an + error. If SPEED is not a speed, `cfsetospeed' returns `-1'. + + - Function: int cfsetispeed (struct termios *TERMIOS-P, speed_t SPEED) + This function stores SPEED in `*TERMIOS-P' as the input speed. + The normal return value is `0'; a value of `-1' indicates an + error. If SPEED is not a speed, `cfsetospeed' returns `-1'. + + - Function: int cfsetspeed (struct termios *TERMIOS-P, speed_t SPEED) + This function stores SPEED in `*TERMIOS-P' as both the input and + output speeds. The normal return value is `0'; a value of `-1' + indicates an error. If SPEED is not a speed, `cfsetspeed' returns + `-1'. This function is an extension in 4.4 BSD. + + - Data Type: speed_t + The `speed_t' type is an unsigned integer data type used to + represent line speeds. + + The functions `cfsetospeed' and `cfsetispeed' report errors only for +speed values that the system simply cannot handle. If you specify a +speed value that is basically acceptable, then those functions will +succeed. But they do not check that a particular hardware device can +actually support the specified speeds--in fact, they don't know which +device you plan to set the speed for. If you use `tcsetattr' to set +the speed of a particular device to a value that it cannot handle, +`tcsetattr' returns `-1'. + + *Portability note:* In the GNU library, the functions above accept +speeds measured in bits per second as input, and return speed values +measured in bits per second. Other libraries require speeds to be +indicated by special codes. For POSIX.1 portability, you must use one +of the following symbols to represent the speed; their precise numeric +values are system-dependent, but each name has a fixed meaning: `B110' +stands for 110 bps, `B300' for 300 bps, and so on. There is no +portable way to represent any speed but these, but these are the only +speeds that typical serial lines can support. + + B0 B50 B75 B110 B134 B150 B200 + B300 B600 B1200 B1800 B2400 B4800 + B9600 B19200 B38400 + + BSD defines two additional speed symbols as aliases: `EXTA' is an +alias for `B19200' and `EXTB' is an alias for `B38400'. These aliases +are obsolete. + + File: libc.info, Node: Special Characters, Next: Noncanonical Input, Prev: Line Speed, Up: Terminal Modes Special Characters @@ -977,283 +1216,4 @@ ones, `rand' and `srand'. * ISO Random:: `rand' and friends. * BSD Random:: `random' and friends. - - -File: libc.info, Node: ISO Random, Next: BSD Random, Up: Pseudo-Random Numbers - -ISO C Random Number Functions ------------------------------ - - This section describes the random number functions that are part of -the ISO C standard. - - To use these facilities, you should include the header file -`stdlib.h' in your program. - - - Macro: int RAND_MAX - The value of this macro is an integer constant expression that - represents the maximum possible value returned by the `rand' - function. In the GNU library, it is `037777777', which is the - largest signed integer representable in 32 bits. In other - libraries, it may be as low as `32767'. - - - Function: int rand () - The `rand' function returns the next pseudo-random number in the - series. The value is in the range from `0' to `RAND_MAX'. - - - Function: void srand (unsigned int SEED) - This function establishes SEED as the seed for a new series of - pseudo-random numbers. If you call `rand' before a seed has been - established with `srand', it uses the value `1' as a default seed. - - To produce truly random numbers (not just pseudo-random), do `srand - (time (0))'. - - -File: libc.info, Node: BSD Random, Prev: ISO Random, Up: Pseudo-Random Numbers - -BSD Random Number Functions ---------------------------- - - This section describes a set of random number generation functions -that are derived from BSD. There is no advantage to using these -functions with the GNU C library; we support them for BSD compatibility -only. - - The prototypes for these functions are in `stdlib.h'. - - - Function: long int random () - This function returns the next pseudo-random number in the - sequence. The range of values returned is from `0' to `RAND_MAX'. - - - Function: void srandom (unsigned int SEED) - The `srandom' function sets the seed for the current random number - state based on the integer SEED. If you supply a SEED value of - `1', this will cause `random' to reproduce the default set of - random numbers. - - To produce truly random numbers (not just pseudo-random), do - `srandom (time (0))'. - - - Function: void * initstate (unsigned int SEED, void *STATE, size_t - SIZE) - The `initstate' function is used to initialize the random number - generator state. The argument STATE is an array of SIZE bytes, - used to hold the state information. The size must be at least 8 - bytes, and optimal sizes are 8, 16, 32, 64, 128, and 256. The - bigger the STATE array, the better. - - The return value is the previous value of the state information - array. You can use this value later as an argument to `setstate' - to restore that state. - - - Function: void * setstate (void *STATE) - The `setstate' function restores the random number state - information STATE. The argument must have been the result of a - previous call to INITSTATE or SETSTATE. - - The return value is the previous value of the state information - array. You can use thise value later as an argument to `setstate' - to restore that state. - - -File: libc.info, Node: Arithmetic, Next: Date and Time, Prev: Mathematics, Up: Top - -Low-Level Arithmetic Functions -****************************** - - This chapter contains information about functions for doing basic -arithmetic operations, such as splitting a float into its integer and -fractional parts. These functions are declared in the header file -`math.h'. - -* Menu: - -* Not a Number:: Making NaNs and testing for NaNs. -* Predicates on Floats:: Testing for infinity and for NaNs. -* Absolute Value:: Absolute value 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. - - -File: libc.info, Node: Not a Number, Next: Predicates on Floats, Up: Arithmetic - -"Not a Number" Values -===================== - - The IEEE floating point format used by most modern computers supports -values that are "not a number". These values are called "NaNs". "Not -a number" values result from certain operations which have no -meaningful numeric result, such as zero divided by zero or infinity -divided by infinity. - - One noteworthy property of NaNs is that they are not equal to -themselves. Thus, `x == x' can be 0 if the value of `x' is a NaN. You -can use this to test whether a value is a NaN or not: if it is not -equal to itself, then it is a NaN. But the recommended way to test for -a NaN is with the `isnan' function (*note Predicates on Floats::.). - - Almost any arithmetic operation in which one argument is a NaN -returns a NaN. - - - Macro: double NAN - An expression representing a value which is "not a number". This - macro is a GNU extension, available only on machines that support - "not a number" values--that is to say, on all machines that - support IEEE floating point. - - You can use `#ifdef NAN' to test whether the machine supports - NaNs. (Of course, you must arrange for GNU extensions to be - visible, such as by defining `_GNU_SOURCE', and then you must - include `math.h'.) - - -File: libc.info, Node: Predicates on Floats, Next: Absolute Value, Prev: Not a Number, Up: Arithmetic - -Predicates on Floats -==================== - - This section describes some miscellaneous test functions on doubles. -Prototypes for these functions appear in `math.h'. These are BSD -functions, and thus are available if you define `_BSD_SOURCE' or -`_GNU_SOURCE'. - - - Function: int isinf (double X) - This function returns `-1' if X represents negative infinity, `1' - if X represents positive infinity, and `0' otherwise. - - - Function: int isnan (double X) - This function returns a nonzero value if X is a "not a number" - value, and zero otherwise. (You can just as well use `X != X' to - get the same result). - - - Function: int finite (double X) - This function returns a nonzero value if X is finite or a "not a - number" value, and zero otherwise. - - - Function: double infnan (int ERROR) - This function is provided for compatibility with BSD. The other - mathematical functions use `infnan' to decide what to return on - occasion of an error. Its argument is an error code, `EDOM' or - `ERANGE'; `infnan' returns a suitable value to indicate this with. - `-ERANGE' is also acceptable as an argument, and corresponds to - `-HUGE_VAL' as a value. - - In the BSD library, on certain machines, `infnan' raises a fatal - signal in all cases. The GNU library does not do likewise, - because that does not fit the ISO C specification. - - *Portability Note:* The functions listed in this section are BSD -extensions. - - -File: libc.info, Node: Absolute Value, Next: Normalization Functions, Prev: Predicates on Floats, Up: Arithmetic - -Absolute Value -============== - - These functions are provided for obtaining the "absolute value" (or -"magnitude") of a number. The absolute value of a real number X is X -is X is positive, -X if X is negative. For a complex number Z, whose -real part is X and whose imaginary part is Y, the absolute value is -`sqrt (X*X + Y*Y)'. - - Prototypes for `abs' and `labs' are in `stdlib.h'; `fabs' and `cabs' -are declared in `math.h'. - - - Function: int abs (int NUMBER) - This function returns the absolute value of NUMBER. - - Most computers use a two's complement integer representation, in - which the absolute value of `INT_MIN' (the smallest possible `int') - cannot be represented; thus, `abs (INT_MIN)' is not defined. - - - Function: long int labs (long int NUMBER) - This is similar to `abs', except that both the argument and result - are of type `long int' rather than `int'. - - - Function: double fabs (double NUMBER) - This function returns the absolute value of the floating-point - number NUMBER. - - - Function: double cabs (struct { double real, imag; } Z) - The `cabs' function returns the absolute value of the complex - number Z, whose real part is `Z.real' and whose imaginary part is - `Z.imag'. (See also the function `hypot' in *Note Exponents and - Logarithms::.) The value is: - - sqrt (Z.real*Z.real + Z.imag*Z.imag) - - -File: libc.info, Node: Normalization Functions, Next: Rounding and Remainders, Prev: Absolute Value, Up: Arithmetic - -Normalization Functions -======================= - - The functions described in this section are primarily provided as a -way to efficiently perform certain low-level manipulations on floating -point numbers that are represented internally using a binary radix; see -*Note Floating Point Concepts::. These functions are required to have -equivalent behavior even if the representation does not use a radix of -2, but of course they are unlikely to be particularly efficient in -those cases. - - All these functions are declared in `math.h'. - - - Function: double frexp (double VALUE, int *EXPONENT) - The `frexp' function is used to split the number VALUE into a - normalized fraction and an exponent. - - If the argument VALUE is not zero, the return value is VALUE times - a power of two, and is always in the range 1/2 (inclusive) to 1 - (exclusive). The corresponding exponent is stored in `*EXPONENT'; - the return value multiplied by 2 raised to this exponent equals - the original number VALUE. - - For example, `frexp (12.8, &exponent)' returns `0.8' and stores - `4' in `exponent'. - - If VALUE is zero, then the return value is zero and zero is stored - in `*EXPONENT'. - - - Function: double ldexp (double VALUE, int EXPONENT) - This function returns the result of multiplying the floating-point - number VALUE by 2 raised to the power EXPONENT. (It can be used - to reassemble floating-point numbers that were taken apart by - `frexp'.) - - For example, `ldexp (0.8, 4)' returns `12.8'. - - The following functions which come from BSD provide facilities -equivalent to those of `ldexp' and `frexp': - - - Function: double scalb (double VALUE, int EXPONENT) - The `scalb' function is the BSD name for `ldexp'. - - - Function: double logb (double X) - This BSD function returns the integer part of the base-2 logarithm - of X, an integer value represented in type `double'. This is the - highest integer power of `2' contained in X. The sign of X is - ignored. For example, `logb (3.5)' is `1.0' and `logb (4.0)' is - `2.0'. - - When `2' raised to this power is divided into X, it gives a - quotient between `1' (inclusive) and `2' (exclusive). - - If X is zero, the value is minus infinity (if the machine supports - such a value), or else a very small number. If X is infinity, the - value is infinity. - - The value returned by `logb' is one less than the value that - `frexp' would store into `*EXPONENT'. - - - Function: double copysign (double VALUE, double SIGN) - The `copysign' function returns a value whose absolute value is the - same as that of VALUE, and whose sign matches that of SIGN. This - is a BSD function. diff -durpN glibc-2.0.4/manual/libc.info-16 glibc-2.0.5/manual/libc.info-16 --- glibc-2.0.4/manual/libc.info-16 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-16 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,285 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: ISO Random, Next: BSD Random, Up: Pseudo-Random Numbers + +ISO C Random Number Functions +----------------------------- + + This section describes the random number functions that are part of +the ISO C standard. + + To use these facilities, you should include the header file +`stdlib.h' in your program. + + - Macro: int RAND_MAX + The value of this macro is an integer constant expression that + represents the maximum possible value returned by the `rand' + function. In the GNU library, it is `037777777', which is the + largest signed integer representable in 32 bits. In other + libraries, it may be as low as `32767'. + + - Function: int rand () + The `rand' function returns the next pseudo-random number in the + series. The value is in the range from `0' to `RAND_MAX'. + + - Function: void srand (unsigned int SEED) + This function establishes SEED as the seed for a new series of + pseudo-random numbers. If you call `rand' before a seed has been + established with `srand', it uses the value `1' as a default seed. + + To produce truly random numbers (not just pseudo-random), do `srand + (time (0))'. + + +File: libc.info, Node: BSD Random, Prev: ISO Random, Up: Pseudo-Random Numbers + +BSD Random Number Functions +--------------------------- + + This section describes a set of random number generation functions +that are derived from BSD. There is no advantage to using these +functions with the GNU C library; we support them for BSD compatibility +only. + + The prototypes for these functions are in `stdlib.h'. + + - Function: long int random () + This function returns the next pseudo-random number in the + sequence. The range of values returned is from `0' to `RAND_MAX'. + + - Function: void srandom (unsigned int SEED) + The `srandom' function sets the seed for the current random number + state based on the integer SEED. If you supply a SEED value of + `1', this will cause `random' to reproduce the default set of + random numbers. + + To produce truly random numbers (not just pseudo-random), do + `srandom (time (0))'. + + - Function: void * initstate (unsigned int SEED, void *STATE, size_t + SIZE) + The `initstate' function is used to initialize the random number + generator state. The argument STATE is an array of SIZE bytes, + used to hold the state information. The size must be at least 8 + bytes, and optimal sizes are 8, 16, 32, 64, 128, and 256. The + bigger the STATE array, the better. + + The return value is the previous value of the state information + array. You can use this value later as an argument to `setstate' + to restore that state. + + - Function: void * setstate (void *STATE) + The `setstate' function restores the random number state + information STATE. The argument must have been the result of a + previous call to INITSTATE or SETSTATE. + + The return value is the previous value of the state information + array. You can use thise value later as an argument to `setstate' + to restore that state. + + +File: libc.info, Node: Arithmetic, Next: Date and Time, Prev: Mathematics, Up: Top + +Low-Level Arithmetic Functions +****************************** + + This chapter contains information about functions for doing basic +arithmetic operations, such as splitting a float into its integer and +fractional parts. These functions are declared in the header file +`math.h'. + +* Menu: + +* Not a Number:: Making NaNs and testing for NaNs. +* Predicates on Floats:: Testing for infinity and for NaNs. +* Absolute Value:: Absolute value 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. + + +File: libc.info, Node: Not a Number, Next: Predicates on Floats, Up: Arithmetic + +"Not a Number" Values +===================== + + The IEEE floating point format used by most modern computers supports +values that are "not a number". These values are called "NaNs". "Not +a number" values result from certain operations which have no +meaningful numeric result, such as zero divided by zero or infinity +divided by infinity. + + One noteworthy property of NaNs is that they are not equal to +themselves. Thus, `x == x' can be 0 if the value of `x' is a NaN. You +can use this to test whether a value is a NaN or not: if it is not +equal to itself, then it is a NaN. But the recommended way to test for +a NaN is with the `isnan' function (*note Predicates on Floats::.). + + Almost any arithmetic operation in which one argument is a NaN +returns a NaN. + + - Macro: double NAN + An expression representing a value which is "not a number". This + macro is a GNU extension, available only on machines that support + "not a number" values--that is to say, on all machines that + support IEEE floating point. + + You can use `#ifdef NAN' to test whether the machine supports + NaNs. (Of course, you must arrange for GNU extensions to be + visible, such as by defining `_GNU_SOURCE', and then you must + include `math.h'.) + + +File: libc.info, Node: Predicates on Floats, Next: Absolute Value, Prev: Not a Number, Up: Arithmetic + +Predicates on Floats +==================== + + This section describes some miscellaneous test functions on doubles. +Prototypes for these functions appear in `math.h'. These are BSD +functions, and thus are available if you define `_BSD_SOURCE' or +`_GNU_SOURCE'. + + - Function: int isinf (double X) + This function returns `-1' if X represents negative infinity, `1' + if X represents positive infinity, and `0' otherwise. + + - Function: int isnan (double X) + This function returns a nonzero value if X is a "not a number" + value, and zero otherwise. (You can just as well use `X != X' to + get the same result). + + - Function: int finite (double X) + This function returns a nonzero value if X is finite or a "not a + number" value, and zero otherwise. + + - Function: double infnan (int ERROR) + This function is provided for compatibility with BSD. The other + mathematical functions use `infnan' to decide what to return on + occasion of an error. Its argument is an error code, `EDOM' or + `ERANGE'; `infnan' returns a suitable value to indicate this with. + `-ERANGE' is also acceptable as an argument, and corresponds to + `-HUGE_VAL' as a value. + + In the BSD library, on certain machines, `infnan' raises a fatal + signal in all cases. The GNU library does not do likewise, + because that does not fit the ISO C specification. + + *Portability Note:* The functions listed in this section are BSD +extensions. + + +File: libc.info, Node: Absolute Value, Next: Normalization Functions, Prev: Predicates on Floats, Up: Arithmetic + +Absolute Value +============== + + These functions are provided for obtaining the "absolute value" (or +"magnitude") of a number. The absolute value of a real number X is X +is X is positive, -X if X is negative. For a complex number Z, whose +real part is X and whose imaginary part is Y, the absolute value is +`sqrt (X*X + Y*Y)'. + + Prototypes for `abs' and `labs' are in `stdlib.h'; `fabs' and `cabs' +are declared in `math.h'. + + - Function: int abs (int NUMBER) + This function returns the absolute value of NUMBER. + + Most computers use a two's complement integer representation, in + which the absolute value of `INT_MIN' (the smallest possible `int') + cannot be represented; thus, `abs (INT_MIN)' is not defined. + + - Function: long int labs (long int NUMBER) + This is similar to `abs', except that both the argument and result + are of type `long int' rather than `int'. + + - Function: double fabs (double NUMBER) + This function returns the absolute value of the floating-point + number NUMBER. + + - Function: double cabs (struct { double real, imag; } Z) + The `cabs' function returns the absolute value of the complex + number Z, whose real part is `Z.real' and whose imaginary part is + `Z.imag'. (See also the function `hypot' in *Note Exponents and + Logarithms::.) The value is: + + sqrt (Z.real*Z.real + Z.imag*Z.imag) + + +File: libc.info, Node: Normalization Functions, Next: Rounding and Remainders, Prev: Absolute Value, Up: Arithmetic + +Normalization Functions +======================= + + The functions described in this section are primarily provided as a +way to efficiently perform certain low-level manipulations on floating +point numbers that are represented internally using a binary radix; see +*Note Floating Point Concepts::. These functions are required to have +equivalent behavior even if the representation does not use a radix of +2, but of course they are unlikely to be particularly efficient in +those cases. + + All these functions are declared in `math.h'. + + - Function: double frexp (double VALUE, int *EXPONENT) + The `frexp' function is used to split the number VALUE into a + normalized fraction and an exponent. + + If the argument VALUE is not zero, the return value is VALUE times + a power of two, and is always in the range 1/2 (inclusive) to 1 + (exclusive). The corresponding exponent is stored in `*EXPONENT'; + the return value multiplied by 2 raised to this exponent equals + the original number VALUE. + + For example, `frexp (12.8, &exponent)' returns `0.8' and stores + `4' in `exponent'. + + If VALUE is zero, then the return value is zero and zero is stored + in `*EXPONENT'. + + - Function: double ldexp (double VALUE, int EXPONENT) + This function returns the result of multiplying the floating-point + number VALUE by 2 raised to the power EXPONENT. (It can be used + to reassemble floating-point numbers that were taken apart by + `frexp'.) + + For example, `ldexp (0.8, 4)' returns `12.8'. + + The following functions which come from BSD provide facilities +equivalent to those of `ldexp' and `frexp': + + - Function: double scalb (double VALUE, int EXPONENT) + The `scalb' function is the BSD name for `ldexp'. + + - Function: double logb (double X) + This BSD function returns the integer part of the base-2 logarithm + of X, an integer value represented in type `double'. This is the + highest integer power of `2' contained in X. The sign of X is + ignored. For example, `logb (3.5)' is `1.0' and `logb (4.0)' is + `2.0'. + + When `2' raised to this power is divided into X, it gives a + quotient between `1' (inclusive) and `2' (exclusive). + + If X is zero, the value is minus infinity (if the machine supports + such a value), or else a very small number. If X is infinity, the + value is infinity. + + The value returned by `logb' is one less than the value that + `frexp' would store into `*EXPONENT'. + + - Function: double copysign (double VALUE, double SIGN) + The `copysign' function returns a value whose absolute value is the + same as that of VALUE, and whose sign matches that of SIGN. This + is a BSD function. + + File: libc.info, Node: Rounding and Remainders, Next: Integer Division, Prev: Normalization Functions, Up: Arithmetic Rounding and Remainder Functions @@ -995,263 +1279,4 @@ the C bitwise OR operator `|'. `glob' does its work by calling the function `fnmatch' repeatedly. It handles the flag `GLOB_NOESCAPE' by turning on the `FNM_NOESCAPE' flag in calls to `fnmatch'. - - -File: libc.info, Node: Regular Expressions, Next: Word Expansion, Prev: Globbing, Up: Pattern Matching - -Regular Expression Matching -=========================== - - The GNU C library supports two interfaces for matching regular -expressions. One is the standard POSIX.2 interface, and the other is -what the GNU system has had for many years. - - Both interfaces are declared in the header file `regex.h'. If you -define `_POSIX_C_SOURCE', then only the POSIX.2 functions, structures, -and constants are declared. - -* Menu: - -* POSIX Regexp Compilation:: Using `regcomp' to prepare to match. -* Flags for POSIX Regexps:: Syntax variations for `regcomp'. -* Matching POSIX Regexps:: Using `regexec' to match the compiled - pattern that you get from `regcomp'. -* Regexp Subexpressions:: Finding which parts of the string were matched. -* Subexpression Complications:: Find points of which parts were matched. -* Regexp Cleanup:: Freeing storage; reporting errors. - - -File: libc.info, Node: POSIX Regexp Compilation, Next: Flags for POSIX Regexps, Up: Regular Expressions - -POSIX Regular Expression Compilation ------------------------------------- - - Before you can actually match a regular expression, you must -"compile" it. This is not true compilation--it produces a special data -structure, not machine instructions. But it is like ordinary -compilation in that its purpose is to enable you to "execute" the -pattern fast. (*Note Matching POSIX Regexps::, for how to use the -compiled regular expression for matching.) - - There is a special data type for compiled regular expressions: - - - Data Type: regex_t - This type of object holds a compiled regular expression. It is - actually a structure. It has just one field that your programs - should look at: - - `re_nsub' - This field holds the number of parenthetical subexpressions - in the regular expression that was compiled. - - There are several other fields, but we don't describe them here, - because only the functions in the library should use them. - - After you create a `regex_t' object, you can compile a regular -expression into it by calling `regcomp'. - - - Function: int regcomp (regex_t *COMPILED, const char *PATTERN, int - CFLAGS) - The function `regcomp' "compiles" a regular expression into a data - structure that you can use with `regexec' to match against a - string. The compiled regular expression format is designed for - efficient matching. `regcomp' stores it into `*COMPILED'. - - It's up to you to allocate an object of type `regex_t' and pass its - address to `regcomp'. - - The argument CFLAGS lets you specify various options that control - the syntax and semantics of regular expressions. *Note Flags for - POSIX Regexps::. - - If you use the flag `REG_NOSUB', then `regcomp' omits from the - compiled regular expression the information necessary to record - how subexpressions actually match. In this case, you might as well - pass `0' for the MATCHPTR and NMATCH arguments when you call - `regexec'. - - If you don't use `REG_NOSUB', then the compiled regular expression - does have the capacity to record how subexpressions match. Also, - `regcomp' tells you how many subexpressions PATTERN has, by - storing the number in `COMPILED->re_nsub'. You can use that value - to decide how long an array to allocate to hold information about - subexpression matches. - - `regcomp' returns `0' if it succeeds in compiling the regular - expression; otherwise, it returns a nonzero error code (see the - table below). You can use `regerror' to produce an error message - string describing the reason for a nonzero value; see *Note Regexp - Cleanup::. - - - Here are the possible nonzero values that `regcomp' can return: - -`REG_BADBR' - There was an invalid `\{...\}' construct in the regular - expression. A valid `\{...\}' construct must contain either a - single number, or two numbers in increasing order separated by a - comma. - -`REG_BADPAT' - There was a syntax error in the regular expression. - -`REG_BADRPT' - A repetition operator such as `?' or `*' appeared in a bad - position (with no preceding subexpression to act on). - -`REG_ECOLLATE' - The regular expression referred to an invalid collating element - (one not defined in the current locale for string collation). - *Note Locale Categories::. - -`REG_ECTYPE' - The regular expression referred to an invalid character class name. - -`REG_EESCAPE' - The regular expression ended with `\'. - -`REG_ESUBREG' - There was an invalid number in the `\DIGIT' construct. - -`REG_EBRACK' - There were unbalanced square brackets in the regular expression. - -`REG_EPAREN' - An extended regular expression had unbalanced parentheses, or a - basic regular expression had unbalanced `\(' and `\)'. - -`REG_EBRACE' - The regular expression had unbalanced `\{' and `\}'. - -`REG_ERANGE' - One of the endpoints in a range expression was invalid. - -`REG_ESPACE' - `regcomp' ran out of memory. - - -File: libc.info, Node: Flags for POSIX Regexps, Next: Matching POSIX Regexps, Prev: POSIX Regexp Compilation, Up: Regular Expressions - -Flags for POSIX Regular Expressions ------------------------------------ - - These are the bit flags that you can use in the CFLAGS operand when -compiling a regular expression with `regcomp'. - -`REG_EXTENDED' - Treat the pattern as an extended regular expression, rather than - as a basic regular expression. - -`REG_ICASE' - Ignore case when matching letters. - -`REG_NOSUB' - Don't bother storing the contents of the MATCHES-PTR array. - -`REG_NEWLINE' - Treat a newline in STRING as dividing STRING into multiple lines, - so that `$' can match before the newline and `^' can match after. - Also, don't permit `.' to match a newline, and don't permit - `[^...]' to match a newline. - - Otherwise, newline acts like any other ordinary character. - - -File: libc.info, Node: Matching POSIX Regexps, Next: Regexp Subexpressions, Prev: Flags for POSIX Regexps, Up: Regular Expressions - -Matching a Compiled POSIX Regular Expression --------------------------------------------- - - Once you have compiled a regular expression, as described in *Note -POSIX Regexp Compilation::, you can match it against strings using -`regexec'. A match anywhere inside the string counts as success, -unless the regular expression contains anchor characters (`^' or `$'). - - - Function: int regexec (regex_t *COMPILED, char *STRING, size_t - NMATCH, regmatch_t MATCHPTR [], int EFLAGS) - This function tries to match the compiled regular expression - `*COMPILED' against STRING. - - `regexec' returns `0' if the regular expression matches; - otherwise, it returns a nonzero value. See the table below for - what nonzero values mean. You can use `regerror' to produce an - error message string describing the reason for a nonzero value; - see *Note Regexp Cleanup::. - - The argument EFLAGS is a word of bit flags that enable various - options. - - If you want to get information about what part of STRING actually - matched the regular expression or its subexpressions, use the - arguments MATCHPTR and NMATCH. Otherwise, pass `0' for NMATCH, - and `NULL' for MATCHPTR. *Note Regexp Subexpressions::. - - You must match the regular expression with the same set of current -locales that were in effect when you compiled the regular expression. - - The function `regexec' accepts the following flags in the EFLAGS -argument: - -`REG_NOTBOL' - Do not regard the beginning of the specified string as the - beginning of a line; more generally, don't make any assumptions - about what text might precede it. - -`REG_NOTEOL' - Do not regard the end of the specified string as the end of a - line; more generally, don't make any assumptions about what text - might follow it. - - Here are the possible nonzero values that `regexec' can return: - -`REG_NOMATCH' - The pattern didn't match the string. This isn't really an error. - -`REG_ESPACE' - `regexec' ran out of memory. - - -File: libc.info, Node: Regexp Subexpressions, Next: Subexpression Complications, Prev: Matching POSIX Regexps, Up: Regular Expressions - -Match Results with Subexpressions ---------------------------------- - - When `regexec' matches parenthetical subexpressions of PATTERN, it -records which parts of STRING they match. It returns that information -by storing the offsets into an array whose elements are structures of -type `regmatch_t'. The first element of the array (index `0') records -the part of the string that matched the entire regular expression. -Each other element of the array records the beginning and end of the -part that matched a single parenthetical subexpression. - - - Data Type: regmatch_t - This is the data type of the MATCHARRAY array that you pass to - `regexec'. It contains two structure fields, as follows: - - `rm_so' - The offset in STRING of the beginning of a substring. Add - this value to STRING to get the address of that part. - - `rm_eo' - The offset in STRING of the end of the substring. - - - Data Type: regoff_t - `regoff_t' is an alias for another signed integer type. The - fields of `regmatch_t' have type `regoff_t'. - - The `regmatch_t' elements correspond to subexpressions positionally; -the first element (index `1') records where the first subexpression -matched, the second element records the second subexpression, and so -on. The order of the subexpressions is the order in which they begin. - - When you call `regexec', you specify how long the MATCHPTR array is, -with the NMATCH argument. This tells `regexec' how many elements to -store. If the actual regular expression has more than NMATCH -subexpressions, then you won't get offset information about the rest of -them. But this doesn't alter whether the pattern matches a particular -string or not. - - If you don't want `regexec' to return any information about where -the subexpressions matched, you can either supply `0' for NMATCH, or -use the flag `REG_NOSUB' when you compile the pattern with `regcomp'. diff -durpN glibc-2.0.4/manual/libc.info-17 glibc-2.0.5/manual/libc.info-17 --- glibc-2.0.4/manual/libc.info-17 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-17 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,265 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Regular Expressions, Next: Word Expansion, Prev: Globbing, Up: Pattern Matching + +Regular Expression Matching +=========================== + + The GNU C library supports two interfaces for matching regular +expressions. One is the standard POSIX.2 interface, and the other is +what the GNU system has had for many years. + + Both interfaces are declared in the header file `regex.h'. If you +define `_POSIX_C_SOURCE', then only the POSIX.2 functions, structures, +and constants are declared. + +* Menu: + +* POSIX Regexp Compilation:: Using `regcomp' to prepare to match. +* Flags for POSIX Regexps:: Syntax variations for `regcomp'. +* Matching POSIX Regexps:: Using `regexec' to match the compiled + pattern that you get from `regcomp'. +* Regexp Subexpressions:: Finding which parts of the string were matched. +* Subexpression Complications:: Find points of which parts were matched. +* Regexp Cleanup:: Freeing storage; reporting errors. + + +File: libc.info, Node: POSIX Regexp Compilation, Next: Flags for POSIX Regexps, Up: Regular Expressions + +POSIX Regular Expression Compilation +------------------------------------ + + Before you can actually match a regular expression, you must +"compile" it. This is not true compilation--it produces a special data +structure, not machine instructions. But it is like ordinary +compilation in that its purpose is to enable you to "execute" the +pattern fast. (*Note Matching POSIX Regexps::, for how to use the +compiled regular expression for matching.) + + There is a special data type for compiled regular expressions: + + - Data Type: regex_t + This type of object holds a compiled regular expression. It is + actually a structure. It has just one field that your programs + should look at: + + `re_nsub' + This field holds the number of parenthetical subexpressions + in the regular expression that was compiled. + + There are several other fields, but we don't describe them here, + because only the functions in the library should use them. + + After you create a `regex_t' object, you can compile a regular +expression into it by calling `regcomp'. + + - Function: int regcomp (regex_t *COMPILED, const char *PATTERN, int + CFLAGS) + The function `regcomp' "compiles" a regular expression into a data + structure that you can use with `regexec' to match against a + string. The compiled regular expression format is designed for + efficient matching. `regcomp' stores it into `*COMPILED'. + + It's up to you to allocate an object of type `regex_t' and pass its + address to `regcomp'. + + The argument CFLAGS lets you specify various options that control + the syntax and semantics of regular expressions. *Note Flags for + POSIX Regexps::. + + If you use the flag `REG_NOSUB', then `regcomp' omits from the + compiled regular expression the information necessary to record + how subexpressions actually match. In this case, you might as well + pass `0' for the MATCHPTR and NMATCH arguments when you call + `regexec'. + + If you don't use `REG_NOSUB', then the compiled regular expression + does have the capacity to record how subexpressions match. Also, + `regcomp' tells you how many subexpressions PATTERN has, by + storing the number in `COMPILED->re_nsub'. You can use that value + to decide how long an array to allocate to hold information about + subexpression matches. + + `regcomp' returns `0' if it succeeds in compiling the regular + expression; otherwise, it returns a nonzero error code (see the + table below). You can use `regerror' to produce an error message + string describing the reason for a nonzero value; see *Note Regexp + Cleanup::. + + + Here are the possible nonzero values that `regcomp' can return: + +`REG_BADBR' + There was an invalid `\{...\}' construct in the regular + expression. A valid `\{...\}' construct must contain either a + single number, or two numbers in increasing order separated by a + comma. + +`REG_BADPAT' + There was a syntax error in the regular expression. + +`REG_BADRPT' + A repetition operator such as `?' or `*' appeared in a bad + position (with no preceding subexpression to act on). + +`REG_ECOLLATE' + The regular expression referred to an invalid collating element + (one not defined in the current locale for string collation). + *Note Locale Categories::. + +`REG_ECTYPE' + The regular expression referred to an invalid character class name. + +`REG_EESCAPE' + The regular expression ended with `\'. + +`REG_ESUBREG' + There was an invalid number in the `\DIGIT' construct. + +`REG_EBRACK' + There were unbalanced square brackets in the regular expression. + +`REG_EPAREN' + An extended regular expression had unbalanced parentheses, or a + basic regular expression had unbalanced `\(' and `\)'. + +`REG_EBRACE' + The regular expression had unbalanced `\{' and `\}'. + +`REG_ERANGE' + One of the endpoints in a range expression was invalid. + +`REG_ESPACE' + `regcomp' ran out of memory. + + +File: libc.info, Node: Flags for POSIX Regexps, Next: Matching POSIX Regexps, Prev: POSIX Regexp Compilation, Up: Regular Expressions + +Flags for POSIX Regular Expressions +----------------------------------- + + These are the bit flags that you can use in the CFLAGS operand when +compiling a regular expression with `regcomp'. + +`REG_EXTENDED' + Treat the pattern as an extended regular expression, rather than + as a basic regular expression. + +`REG_ICASE' + Ignore case when matching letters. + +`REG_NOSUB' + Don't bother storing the contents of the MATCHES-PTR array. + +`REG_NEWLINE' + Treat a newline in STRING as dividing STRING into multiple lines, + so that `$' can match before the newline and `^' can match after. + Also, don't permit `.' to match a newline, and don't permit + `[^...]' to match a newline. + + Otherwise, newline acts like any other ordinary character. + + +File: libc.info, Node: Matching POSIX Regexps, Next: Regexp Subexpressions, Prev: Flags for POSIX Regexps, Up: Regular Expressions + +Matching a Compiled POSIX Regular Expression +-------------------------------------------- + + Once you have compiled a regular expression, as described in *Note +POSIX Regexp Compilation::, you can match it against strings using +`regexec'. A match anywhere inside the string counts as success, +unless the regular expression contains anchor characters (`^' or `$'). + + - Function: int regexec (regex_t *COMPILED, char *STRING, size_t + NMATCH, regmatch_t MATCHPTR [], int EFLAGS) + This function tries to match the compiled regular expression + `*COMPILED' against STRING. + + `regexec' returns `0' if the regular expression matches; + otherwise, it returns a nonzero value. See the table below for + what nonzero values mean. You can use `regerror' to produce an + error message string describing the reason for a nonzero value; + see *Note Regexp Cleanup::. + + The argument EFLAGS is a word of bit flags that enable various + options. + + If you want to get information about what part of STRING actually + matched the regular expression or its subexpressions, use the + arguments MATCHPTR and NMATCH. Otherwise, pass `0' for NMATCH, + and `NULL' for MATCHPTR. *Note Regexp Subexpressions::. + + You must match the regular expression with the same set of current +locales that were in effect when you compiled the regular expression. + + The function `regexec' accepts the following flags in the EFLAGS +argument: + +`REG_NOTBOL' + Do not regard the beginning of the specified string as the + beginning of a line; more generally, don't make any assumptions + about what text might precede it. + +`REG_NOTEOL' + Do not regard the end of the specified string as the end of a + line; more generally, don't make any assumptions about what text + might follow it. + + Here are the possible nonzero values that `regexec' can return: + +`REG_NOMATCH' + The pattern didn't match the string. This isn't really an error. + +`REG_ESPACE' + `regexec' ran out of memory. + + +File: libc.info, Node: Regexp Subexpressions, Next: Subexpression Complications, Prev: Matching POSIX Regexps, Up: Regular Expressions + +Match Results with Subexpressions +--------------------------------- + + When `regexec' matches parenthetical subexpressions of PATTERN, it +records which parts of STRING they match. It returns that information +by storing the offsets into an array whose elements are structures of +type `regmatch_t'. The first element of the array (index `0') records +the part of the string that matched the entire regular expression. +Each other element of the array records the beginning and end of the +part that matched a single parenthetical subexpression. + + - Data Type: regmatch_t + This is the data type of the MATCHARRAY array that you pass to + `regexec'. It contains two structure fields, as follows: + + `rm_so' + The offset in STRING of the beginning of a substring. Add + this value to STRING to get the address of that part. + + `rm_eo' + The offset in STRING of the end of the substring. + + - Data Type: regoff_t + `regoff_t' is an alias for another signed integer type. The + fields of `regmatch_t' have type `regoff_t'. + + The `regmatch_t' elements correspond to subexpressions positionally; +the first element (index `1') records where the first subexpression +matched, the second element records the second subexpression, and so +on. The order of the subexpressions is the order in which they begin. + + When you call `regexec', you specify how long the MATCHPTR array is, +with the NMATCH argument. This tells `regexec' how many elements to +store. If the actual regular expression has more than NMATCH +subexpressions, then you won't get offset information about the rest of +them. But this doesn't alter whether the pattern matches a particular +string or not. + + If you don't want `regexec' to return any information about where +the subexpressions matched, you can either supply `0' for NMATCH, or +use the flag `REG_NOSUB' when you compile the pattern with `regcomp'. + + File: libc.info, Node: Subexpression Complications, Next: Regexp Cleanup, Prev: Regexp Subexpressions, Up: Regular Expressions Complications in Subexpression Matching @@ -905,323 +1169,4 @@ zone, and it also indicates which time z Calling `mktime' also sets the variable `tzname' with information about the current time zone. *Note Time Zone Functions::. - - -File: libc.info, Node: Formatting Date and Time, Next: TZ Variable, Prev: Broken-down Time, Up: Calendar Time - -Formatting Date and Time ------------------------- - - The functions described in this section format time values as -strings. These functions are declared in the header file `time.h'. - - - Function: char * asctime (const struct tm *BROKENTIME) - The `asctime' function converts the broken-down time value that - BROKENTIME points to into a string in a standard format: - - "Tue May 21 13:46:22 1991\n" - - The abbreviations for the days of week are: `Sun', `Mon', `Tue', - `Wed', `Thu', `Fri', and `Sat'. - - The abbreviations for the months are: `Jan', `Feb', `Mar', `Apr', - `May', `Jun', `Jul', `Aug', `Sep', `Oct', `Nov', and `Dec'. - - The return value points to a statically allocated string, which - might be overwritten by subsequent calls to `asctime' or `ctime'. - (But no other library function overwrites the contents of this - string.) - - - Function: char * ctime (const time_t *TIME) - The `ctime' function is similar to `asctime', except that the time - value is specified as a `time_t' calendar time value rather than - in broken-down local time format. It is equivalent to - - asctime (localtime (TIME)) - - `ctime' sets the variable `tzname', because `localtime' does so. - *Note Time Zone Functions::. - - - Function: size_t strftime (char *S, size_t SIZE, const char - *TEMPLATE, const struct tm *BROKENTIME) - This function is similar to the `sprintf' function (*note - Formatted Input::.), but the conversion specifications that can - appear in the format template TEMPLATE are specialized for - printing components of the date and time BROKENTIME according to - the locale currently specified for time conversion (*note - Locales::.). - - Ordinary characters appearing in the TEMPLATE are copied to the - output string S; this can include multibyte character sequences. - Conversion specifiers are introduced by a `%' character, followed - by an optional flag which can be one of the following. These - flags, which are GNU extensions, affect only the output of numbers: - - `_' - The number is padded with spaces. - - `-' - The number is not padded at all. - - `0' - The number is padded with zeros even if the format specifies - padding with spaces. - - `^' - The output uses uppercase characters, but only if this is - possible (*note Case Conversion::.). - - The default action is to pad the number with zeros to keep it a - constant width. Numbers that do not have a range indicated below - are never padded, since there is no natural width for them. - - Following the flag an optional specification of the width is - possible. This is specified in decimal notation. If the natural - size of the output is of the field has less than the specified - number of characters, the result is written right adjusted and - space padded to the given size. - - An optional modifier can follow the optional flag and width - specification. The modifiers, which are POSIX.2 extensions, are: - - `E' - Use the locale's alternate representation for date and time. - This modifier applies to the `%c', `%C', `%x', `%X', `%y' and - `%Y' format specifiers. In a Japanese locale, for example, - `%Ex' might yield a date format based on the Japanese - Emperors' reigns. - - `O' - Use the locale's alternate numeric symbols for numbers. This - modifier applies only to numeric format specifiers. - - If the format supports the modifier but no alternate representation - is available, it is ignored. - - The conversion specifier ends with a format specifier taken from - the following list. The whole `%' sequence is replaced in the - output string as follows: - - `%a' - The abbreviated weekday name according to the current locale. - - `%A' - The full weekday name according to the current locale. - - `%b' - The abbreviated month name according to the current locale. - - `%B' - The full month name according to the current locale. - - `%c' - The preferred date and time representation for the current - locale. - - `%C' - The century of the year. This is equivalent to the greatest - integer not greater than the year divided by 100. - - This format is a POSIX.2 extension. - - `%d' - The day of the month as a decimal number (range `01' through - `31'). - - `%D' - The date using the format `%m/%d/%y'. - - This format is a POSIX.2 extension. - - `%e' - The day of the month like with `%d', but padded with blank - (range ` 1' through `31'). - - This format is a POSIX.2 extension. - - `%g' - The year corresponding to the ISO week number, but without - the century (range `00' through `99'). This has the same - format and value as `%y', except that if the ISO week number - (see `%V') belongs to the previous or next year, that year is - used instead. - - This format is a GNU extension. - - `%G' - The year corresponding to the ISO week number. This has the - same format and value as `%Y', except that if the ISO week - number (see `%V') belongs to the previous or next year, that - year is used instead. - - This format is a GNU extension. - - `%h' - The abbreviated month name according to the current locale. - The action is the same as for `%b'. - - This format is a POSIX.2 extension. - - `%H' - The hour as a decimal number, using a 24-hour clock (range - `00' through `23'). - - `%I' - The hour as a decimal number, using a 12-hour clock (range - `01' through `12'). - - `%j' - The day of the year as a decimal number (range `001' through - `366'). - - `%k' - The hour as a decimal number, using a 24-hour clock like - `%H', but padded with blank (range ` 0' through `23'). - - This format is a GNU extension. - - `%l' - The hour as a decimal number, using a 12-hour clock like - `%I', but padded with blank (range ` 1' through `12'). - - This format is a GNU extension. - - `%m' - The month as a decimal number (range `01' through `12'). - - `%M' - The minute as a decimal number (range `00' through `59'). - - `%n' - A single `\n' (newline) character. - - This format is a POSIX.2 extension. - - `%p' - Either `AM' or `PM', according to the given time value; or the - corresponding strings for the current locale. Noon is - treated as `PM' and midnight as `AM'. - - `%P' - Either `am' or `pm', according to the given time value; or the - corresponding strings for the current locale, printed in - lowercase characters. Noon is treated as `pm' and midnight - as `am'. - - This format is a GNU extension. - - `%r' - The complete time using the AM/PM format of the current - locale. - - This format is a POSIX.2 extension. - - `%R' - The hour and minute in decimal numbers using the format - `%H:%M'. - - This format is a GNU extension. - - `%s' - The number of seconds since the epoch, i.e., since 1970-01-01 - 00:00:00 UTC. Leap seconds are not counted unless leap - second support is available. - - This format is a GNU extension. - - `%S' - The second as a decimal number (range `00' through `60'). - - `%t' - A single `\t' (tabulator) character. - - This format is a POSIX.2 extension. - - `%T' - The time using decimal numbers using the format `%H:%M:%S'. - - This format is a POSIX.2 extension. - - `%u' - The day of the week as a decimal number (range `1' through - `7'), Monday being `1'. - - This format is a POSIX.2 extension. - - `%U' - The week number of the current year as a decimal number - (range `00' through `53'), starting with the first Sunday as - the first day of the first week. Days preceding the first - Sunday in the year are considered to be in week `00'. - - `%V' - The ISO 8601:1988 week number as a decimal number (range `01' - through `53'). ISO weeks start with Monday and end with - Sunday. Week `01' of a year is the first week which has the - majority of its days in that year; this is equivalent to the - week containing the year's first Thursday, and it is also - equivalent to the week containing January 4. Week `01' of a - year can contain days from the previous year. The week - before week `01' of a year is the last week (`52' or `53') of - the previous year even if it contains days from the new year. - - This format is a POSIX.2 extension. - - `%w' - The day of the week as a decimal number (range `0' through - `6'), Sunday being `0'. - - `%W' - The week number of the current year as a decimal number - (range `00' through `53'), starting with the first Monday as - the first day of the first week. All days preceding the - first Monday in the year are considered to be in week `00'. - - `%x' - The preferred date representation for the current locale, but - without the time. - - `%X' - The preferred time representation for the current locale, but - with no date. - - `%y' - The year without a century as a decimal number (range `00' - through `99'). This is equivalent to the year modulo 100. - - `%Y' - The year as a decimal number, using the Gregorian calendar. - Years before the year `1' are numbered `0', `-1', and so on. - - `%z' - RFC 822/ISO 8601:1988 style numeric time zone (e.g., `-0600' - or `+0100'), or nothing if no time zone is determinable. - - This format is a GNU extension. - - `%Z' - The time zone abbreviation (empty if the time zone can't be - determined). - - `%%' - A literal `%' character. - - The SIZE parameter can be used to specify the maximum number of - characters to be stored in the array S, including the terminating - null character. If the formatted time requires more than SIZE - characters, the excess characters are discarded. The return value - from `strftime' is the number of characters placed in the array S, - not including the terminating null character. If the value equals - SIZE, it means that the array S was too small; you should repeat - the call, providing a bigger array. - - If S is a null pointer, `strftime' does not actually write - anything, but instead returns the number of characters it would - have written. - - According to POSIX.1 every call to `strftime' implies a call to - `tzset'. So the contents of the environment variable `TZ' is - examined before any output is produced. - - For an example of `strftime', see *Note Time Functions Example::. diff -durpN glibc-2.0.4/manual/libc.info-18 glibc-2.0.5/manual/libc.info-18 --- glibc-2.0.4/manual/libc.info-18 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-18 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,325 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Formatting Date and Time, Next: TZ Variable, Prev: Broken-down Time, Up: Calendar Time + +Formatting Date and Time +------------------------ + + The functions described in this section format time values as +strings. These functions are declared in the header file `time.h'. + + - Function: char * asctime (const struct tm *BROKENTIME) + The `asctime' function converts the broken-down time value that + BROKENTIME points to into a string in a standard format: + + "Tue May 21 13:46:22 1991\n" + + The abbreviations for the days of week are: `Sun', `Mon', `Tue', + `Wed', `Thu', `Fri', and `Sat'. + + The abbreviations for the months are: `Jan', `Feb', `Mar', `Apr', + `May', `Jun', `Jul', `Aug', `Sep', `Oct', `Nov', and `Dec'. + + The return value points to a statically allocated string, which + might be overwritten by subsequent calls to `asctime' or `ctime'. + (But no other library function overwrites the contents of this + string.) + + - Function: char * ctime (const time_t *TIME) + The `ctime' function is similar to `asctime', except that the time + value is specified as a `time_t' calendar time value rather than + in broken-down local time format. It is equivalent to + + asctime (localtime (TIME)) + + `ctime' sets the variable `tzname', because `localtime' does so. + *Note Time Zone Functions::. + + - Function: size_t strftime (char *S, size_t SIZE, const char + *TEMPLATE, const struct tm *BROKENTIME) + This function is similar to the `sprintf' function (*note + Formatted Input::.), but the conversion specifications that can + appear in the format template TEMPLATE are specialized for + printing components of the date and time BROKENTIME according to + the locale currently specified for time conversion (*note + Locales::.). + + Ordinary characters appearing in the TEMPLATE are copied to the + output string S; this can include multibyte character sequences. + Conversion specifiers are introduced by a `%' character, followed + by an optional flag which can be one of the following. These + flags, which are GNU extensions, affect only the output of numbers: + + `_' + The number is padded with spaces. + + `-' + The number is not padded at all. + + `0' + The number is padded with zeros even if the format specifies + padding with spaces. + + `^' + The output uses uppercase characters, but only if this is + possible (*note Case Conversion::.). + + The default action is to pad the number with zeros to keep it a + constant width. Numbers that do not have a range indicated below + are never padded, since there is no natural width for them. + + Following the flag an optional specification of the width is + possible. This is specified in decimal notation. If the natural + size of the output is of the field has less than the specified + number of characters, the result is written right adjusted and + space padded to the given size. + + An optional modifier can follow the optional flag and width + specification. The modifiers, which are POSIX.2 extensions, are: + + `E' + Use the locale's alternate representation for date and time. + This modifier applies to the `%c', `%C', `%x', `%X', `%y' and + `%Y' format specifiers. In a Japanese locale, for example, + `%Ex' might yield a date format based on the Japanese + Emperors' reigns. + + `O' + Use the locale's alternate numeric symbols for numbers. This + modifier applies only to numeric format specifiers. + + If the format supports the modifier but no alternate representation + is available, it is ignored. + + The conversion specifier ends with a format specifier taken from + the following list. The whole `%' sequence is replaced in the + output string as follows: + + `%a' + The abbreviated weekday name according to the current locale. + + `%A' + The full weekday name according to the current locale. + + `%b' + The abbreviated month name according to the current locale. + + `%B' + The full month name according to the current locale. + + `%c' + The preferred date and time representation for the current + locale. + + `%C' + The century of the year. This is equivalent to the greatest + integer not greater than the year divided by 100. + + This format is a POSIX.2 extension. + + `%d' + The day of the month as a decimal number (range `01' through + `31'). + + `%D' + The date using the format `%m/%d/%y'. + + This format is a POSIX.2 extension. + + `%e' + The day of the month like with `%d', but padded with blank + (range ` 1' through `31'). + + This format is a POSIX.2 extension. + + `%g' + The year corresponding to the ISO week number, but without + the century (range `00' through `99'). This has the same + format and value as `%y', except that if the ISO week number + (see `%V') belongs to the previous or next year, that year is + used instead. + + This format is a GNU extension. + + `%G' + The year corresponding to the ISO week number. This has the + same format and value as `%Y', except that if the ISO week + number (see `%V') belongs to the previous or next year, that + year is used instead. + + This format is a GNU extension. + + `%h' + The abbreviated month name according to the current locale. + The action is the same as for `%b'. + + This format is a POSIX.2 extension. + + `%H' + The hour as a decimal number, using a 24-hour clock (range + `00' through `23'). + + `%I' + The hour as a decimal number, using a 12-hour clock (range + `01' through `12'). + + `%j' + The day of the year as a decimal number (range `001' through + `366'). + + `%k' + The hour as a decimal number, using a 24-hour clock like + `%H', but padded with blank (range ` 0' through `23'). + + This format is a GNU extension. + + `%l' + The hour as a decimal number, using a 12-hour clock like + `%I', but padded with blank (range ` 1' through `12'). + + This format is a GNU extension. + + `%m' + The month as a decimal number (range `01' through `12'). + + `%M' + The minute as a decimal number (range `00' through `59'). + + `%n' + A single `\n' (newline) character. + + This format is a POSIX.2 extension. + + `%p' + Either `AM' or `PM', according to the given time value; or the + corresponding strings for the current locale. Noon is + treated as `PM' and midnight as `AM'. + + `%P' + Either `am' or `pm', according to the given time value; or the + corresponding strings for the current locale, printed in + lowercase characters. Noon is treated as `pm' and midnight + as `am'. + + This format is a GNU extension. + + `%r' + The complete time using the AM/PM format of the current + locale. + + This format is a POSIX.2 extension. + + `%R' + The hour and minute in decimal numbers using the format + `%H:%M'. + + This format is a GNU extension. + + `%s' + The number of seconds since the epoch, i.e., since 1970-01-01 + 00:00:00 UTC. Leap seconds are not counted unless leap + second support is available. + + This format is a GNU extension. + + `%S' + The second as a decimal number (range `00' through `60'). + + `%t' + A single `\t' (tabulator) character. + + This format is a POSIX.2 extension. + + `%T' + The time using decimal numbers using the format `%H:%M:%S'. + + This format is a POSIX.2 extension. + + `%u' + The day of the week as a decimal number (range `1' through + `7'), Monday being `1'. + + This format is a POSIX.2 extension. + + `%U' + The week number of the current year as a decimal number + (range `00' through `53'), starting with the first Sunday as + the first day of the first week. Days preceding the first + Sunday in the year are considered to be in week `00'. + + `%V' + The ISO 8601:1988 week number as a decimal number (range `01' + through `53'). ISO weeks start with Monday and end with + Sunday. Week `01' of a year is the first week which has the + majority of its days in that year; this is equivalent to the + week containing the year's first Thursday, and it is also + equivalent to the week containing January 4. Week `01' of a + year can contain days from the previous year. The week + before week `01' of a year is the last week (`52' or `53') of + the previous year even if it contains days from the new year. + + This format is a POSIX.2 extension. + + `%w' + The day of the week as a decimal number (range `0' through + `6'), Sunday being `0'. + + `%W' + The week number of the current year as a decimal number + (range `00' through `53'), starting with the first Monday as + the first day of the first week. All days preceding the + first Monday in the year are considered to be in week `00'. + + `%x' + The preferred date representation for the current locale, but + without the time. + + `%X' + The preferred time representation for the current locale, but + with no date. + + `%y' + The year without a century as a decimal number (range `00' + through `99'). This is equivalent to the year modulo 100. + + `%Y' + The year as a decimal number, using the Gregorian calendar. + Years before the year `1' are numbered `0', `-1', and so on. + + `%z' + RFC 822/ISO 8601:1988 style numeric time zone (e.g., `-0600' + or `+0100'), or nothing if no time zone is determinable. + + This format is a GNU extension. + + `%Z' + The time zone abbreviation (empty if the time zone can't be + determined). + + `%%' + A literal `%' character. + + The SIZE parameter can be used to specify the maximum number of + characters to be stored in the array S, including the terminating + null character. If the formatted time requires more than SIZE + characters, the excess characters are discarded. The return value + from `strftime' is the number of characters placed in the array S, + not including the terminating null character. If the value equals + SIZE, it means that the array S was too small; you should repeat + the call, providing a bigger array. + + If S is a null pointer, `strftime' does not actually write + anything, but instead returns the number of characters it would + have written. + + According to POSIX.1 every call to `strftime' implies a call to + `tzset'. So the contents of the environment variable `TZ' is + examined before any output is produced. + + For an example of `strftime', see *Note Time Functions Example::. + + File: libc.info, Node: TZ Variable, Next: Time Zone Functions, Prev: Formatting Date and Time, Up: Calendar Time Specifying the Time Zone with `TZ' @@ -853,313 +1177,4 @@ work, even though what they do is basica shift state maintained by these functions can become confused, so it's not a good idea to change the locale while you are in the middle of processing a string. - - -File: libc.info, Node: Multibyte Char Intro, Next: Wide Char Intro, Prev: Locales and Extended Chars, Up: Extended Characters - -Multibyte Characters -==================== - - In the ordinary ASCII code, a sequence of characters is a sequence of -bytes, and each character is one byte. This is very simple, but allows -for only 256 distinct characters. - - In a "multibyte character code", a sequence of characters is a -sequence of bytes, but each character may occupy one or more consecutive -bytes of the sequence. - - There are many different ways of designing a multibyte character -code; different systems use different codes. To specify a particular -code means designating the "basic" byte sequences--those which represent -a single character--and what characters they stand for. A code that a -computer can actually use must have a finite number of these basic -sequences, and typically none of them is more than a few characters -long. - - These sequences need not all have the same length. In fact, many of -them are just one byte long. Because the basic ASCII characters in the -range from `0' to `0177' are so important, they stand for themselves in -all multibyte character codes. That is to say, a byte whose value is -`0' through `0177' is always a character in itself. The characters -which are more than one byte must always start with a byte in the range -from `0200' through `0377'. - - The byte value `0' can be used to terminate a string, just as it is -often used in a string of ASCII characters. - - Specifying the basic byte sequences that represent single characters -automatically gives meanings to many longer byte sequences, as more than -one character. For example, if the two byte sequence `0205 049' stands -for the Greek letter alpha, then `0205 049 065' must stand for an alpha -followed by an `A' (ASCII code 065), and `0205 049 0205 049' must stand -for two alphas in a row. - - If any byte sequence can have more than one meaning as a sequence of -characters, then the multibyte code is ambiguous--and no good. The -codes that systems actually use are all unambiguous. - - In most codes, there are certain sequences of bytes that have no -meaning as a character or characters. These are called "invalid". - - The simplest possible multibyte code is a trivial one: - - The basic sequences consist of single bytes. - - This particular code is equivalent to not using multibyte characters -at all. It has no invalid sequences. But it can handle only 256 -different characters. - - Here is another possible code which can handle 9376 different -characters: - - The basic sequences consist of - - * single bytes with values in the range `0' through `0237'. - - * two-byte sequences, in which both of the bytes have values in - the range from `0240' through `0377'. - -This code or a similar one is used on some systems to represent Japanese -characters. The invalid sequences are those which consist of an odd -number of consecutive bytes in the range from `0240' through `0377'. - - Here is another multibyte code which can handle more distinct -extended characters--in fact, almost thirty million: - - The basic sequences consist of - - * single bytes with values in the range `0' through `0177'. - - * sequences of up to four bytes in which the first byte is in - the range from `0200' through `0237', and the remaining bytes - are in the range from `0240' through `0377'. - -In this code, any sequence that starts with a byte in the range from -`0240' through `0377' is invalid. - - And here is another variant which has the advantage that removing the -last byte or bytes from a valid character can never produce another -valid character. (This property is convenient when you want to search -strings for particular characters.) - - The basic sequences consist of - - * single bytes with values in the range `0' through `0177'. - - * two-byte sequences in which the first byte is in the range - from `0200' through `0207', and the second byte is in the - range from `0240' through `0377'. - - * three-byte sequences in which the first byte is in the range - from `0210' through `0217', and the other bytes are in the - range from `0240' through `0377'. - - * four-byte sequences in which the first byte is in the range - from `0220' through `0227', and the other bytes are in the - range from `0240' through `0377'. - -The list of invalid sequences for this code is long and not worth -stating in full; examples of invalid sequences include `0240' and `0220 -0300 065'. - - The number of *possible* multibyte codes is astronomical. But a -given computer system will support at most a few different codes. (One -of these codes may allow for thousands of different characters.) -Another computer system may support a completely different code. The -library facilities described in this chapter are helpful because they -package up the knowledge of the details of a particular computer -system's multibyte code, so your programs need not know them. - - You can use special standard macros to find out the maximum possible -number of bytes in a character in the currently selected multibyte code -with `MB_CUR_MAX', and the maximum for *any* multibyte code supported -on your computer with `MB_LEN_MAX'. - - - Macro: int MB_LEN_MAX - This is the maximum length of a multibyte character for any - supported locale. It is defined in `limits.h'. - - - Macro: int MB_CUR_MAX - This macro expands into a (possibly non-constant) positive integer - expression that is the maximum number of bytes in a multibyte - character in the current locale. The value is never greater than - `MB_LEN_MAX'. - - `MB_CUR_MAX' is defined in `stdlib.h'. - - Normally, each basic sequence in a particular character code stands -for one character, the same character regardless of context. Some -multibyte character codes have a concept of "shift state"; certain -codes, called "shift sequences", change to a different shift state, and -the meaning of some or all basic sequences varies according to the -current shift state. In fact, the set of basic sequences might even be -different depending on the current shift state. *Note Shift State::, -for more information on handling this sort of code. - - What happens if you try to pass a string containing multibyte -characters to a function that doesn't know about them? Normally, such -a function treats a string as a sequence of bytes, and interprets -certain byte values specially; all other byte values are "ordinary". -As long as a multibyte character doesn't contain any of the special -byte values, the function should pass it through as if it were several -ordinary characters. - - For example, let's figure out what happens if you use multibyte -characters in a file name. The functions such as `open' and `unlink' -that operate on file names treat the name as a sequence of byte values, -with `/' as the only special value. Any other byte values are copied, -or compared, in sequence, and all byte values are treated alike. Thus, -you may think of the file name as a sequence of bytes or as a string -containing multibyte characters; the same behavior makes sense equally -either way, provided no multibyte character contains a `/'. - - -File: libc.info, Node: Wide Char Intro, Next: Wide String Conversion, Prev: Multibyte Char Intro, Up: Extended Characters - -Wide Character Introduction -=========================== - - "Wide characters" are much simpler than multibyte characters. They -are simply characters with more than eight bits, so that they have room -for more than 256 distinct codes. The wide character data type, -`wchar_t', has a range large enough to hold extended character codes as -well as old-fashioned ASCII codes. - - An advantage of wide characters is that each character is a single -data object, just like ordinary ASCII characters. Wide characters also -have some disadvantages: - - * A program must be modified and recompiled in order to use wide - characters at all. - - * Files of wide characters cannot be read by programs that expect - ordinary characters. - - Wide character values `0' through `0177' are always identical in -meaning to the ASCII character codes. The wide character value zero is -often used to terminate a string of wide characters, just as a single -byte with value zero often terminates a string of ordinary characters. - - - Data Type: wchar_t - This is the "wide character" type, an integer type whose range is - large enough to represent all distinct values in any extended - character set in the supported locales. *Note Locales::, for more - information about locales. This type is defined in the header - file `stddef.h'. - - If your system supports extended characters, then each extended -character has both a wide character code and a corresponding multibyte -basic sequence. - - In this chapter, the term "code" is used to refer to a single -extended character object to emphasize the distinction from the `char' -data type. - - -File: libc.info, Node: Wide String Conversion, Next: Length of Char, Prev: Wide Char Intro, Up: Extended Characters - -Conversion of Extended Strings -============================== - - The `mbstowcs' function converts a string of multibyte characters to -a wide character array. The `wcstombs' function does the reverse. -These functions are declared in the header file `stdlib.h'. - - In most programs, these functions are the only ones you need for -conversion between wide strings and multibyte character strings. But -they have limitations. If your data is not null-terminated or is not -all in core at once, you probably need to use the low-level conversion -functions to convert one character at a time. *Note Converting One -Char::. - - - Function: size_t mbstowcs (wchar_t *WSTRING, const char *STRING, - size_t SIZE) - The `mbstowcs' ("multibyte string to wide character string") - function converts the null-terminated string of multibyte - characters STRING to an array of wide character codes, storing not - more than SIZE wide characters into the array beginning at WSTRING. - The terminating null character counts towards the size, so if SIZE - is less than the actual number of wide characters resulting from - STRING, no terminating null character is stored. - - The conversion of characters from STRING begins in the initial - shift state. - - If an invalid multibyte character sequence is found, this function - returns a value of `-1'. Otherwise, it returns the number of wide - characters stored in the array WSTRING. This number does not - include the terminating null character, which is present if the - number is less than SIZE. - - Here is an example showing how to convert a string of multibyte - characters, allocating enough space for the result. - - wchar_t * - mbstowcs_alloc (const char *string) - { - size_t size = strlen (string) + 1; - wchar_t *buf = xmalloc (size * sizeof (wchar_t)); - - size = mbstowcs (buf, string, size); - if (size == (size_t) -1) - return NULL; - buf = xrealloc (buf, (size + 1) * sizeof (wchar_t)); - return buf; - } - - - - Function: size_t wcstombs (char *STRING, const wchar_t WSTRING, - size_t SIZE) - The `wcstombs' ("wide character string to multibyte string") - function converts the null-terminated wide character array WSTRING - into a string containing multibyte characters, storing not more - than SIZE bytes starting at STRING, followed by a terminating null - character if there is room. The conversion of characters begins in - the initial shift state. - - The terminating null character counts towards the size, so if SIZE - is less than or equal to the number of bytes needed in WSTRING, no - terminating null character is stored. - - If a code that does not correspond to a valid multibyte character - is found, this function returns a value of `-1'. Otherwise, the - return value is the number of bytes stored in the array STRING. - This number does not include the terminating null character, which - is present if the number is less than SIZE. - - -File: libc.info, Node: Length of Char, Next: Converting One Char, Prev: Wide String Conversion, Up: Extended Characters - -Multibyte Character Length -========================== - - This section describes how to scan a string containing multibyte -characters, one character at a time. The difficulty in doing this is -to know how many bytes each character contains. Your program can use -`mblen' to find this out. - - - Function: int mblen (const char *STRING, size_t SIZE) - The `mblen' function with a non-null STRING argument returns the - number of bytes that make up the multibyte character beginning at - STRING, never examining more than SIZE bytes. (The idea is to - supply for SIZE the number of bytes of data you have in hand.) - - The return value of `mblen' distinguishes three possibilities: the - first SIZE bytes at STRING start with valid multibyte character, - they start with an invalid byte sequence or just part of a - character, or STRING points to an empty string (a null character). - - For a valid multibyte character, `mblen' returns the number of - bytes in that character (always at least `1', and never more than - SIZE). For an invalid byte sequence, `mblen' returns `-1'. For - an empty string, it returns `0'. - - If the multibyte character code uses shift characters, then `mblen' - maintains and updates a shift state as it scans. If you call - `mblen' with a null pointer for STRING, that initializes the shift - state to its standard initial value. It also returns nonzero if - the multibyte character code in use actually has a shift state. - *Note Shift State::. - - The function `mblen' is declared in `stdlib.h'. diff -durpN glibc-2.0.4/manual/libc.info-19 glibc-2.0.5/manual/libc.info-19 --- glibc-2.0.4/manual/libc.info-19 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-19 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,315 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Multibyte Char Intro, Next: Wide Char Intro, Prev: Locales and Extended Chars, Up: Extended Characters + +Multibyte Characters +==================== + + In the ordinary ASCII code, a sequence of characters is a sequence of +bytes, and each character is one byte. This is very simple, but allows +for only 256 distinct characters. + + In a "multibyte character code", a sequence of characters is a +sequence of bytes, but each character may occupy one or more consecutive +bytes of the sequence. + + There are many different ways of designing a multibyte character +code; different systems use different codes. To specify a particular +code means designating the "basic" byte sequences--those which represent +a single character--and what characters they stand for. A code that a +computer can actually use must have a finite number of these basic +sequences, and typically none of them is more than a few characters +long. + + These sequences need not all have the same length. In fact, many of +them are just one byte long. Because the basic ASCII characters in the +range from `0' to `0177' are so important, they stand for themselves in +all multibyte character codes. That is to say, a byte whose value is +`0' through `0177' is always a character in itself. The characters +which are more than one byte must always start with a byte in the range +from `0200' through `0377'. + + The byte value `0' can be used to terminate a string, just as it is +often used in a string of ASCII characters. + + Specifying the basic byte sequences that represent single characters +automatically gives meanings to many longer byte sequences, as more than +one character. For example, if the two byte sequence `0205 049' stands +for the Greek letter alpha, then `0205 049 065' must stand for an alpha +followed by an `A' (ASCII code 065), and `0205 049 0205 049' must stand +for two alphas in a row. + + If any byte sequence can have more than one meaning as a sequence of +characters, then the multibyte code is ambiguous--and no good. The +codes that systems actually use are all unambiguous. + + In most codes, there are certain sequences of bytes that have no +meaning as a character or characters. These are called "invalid". + + The simplest possible multibyte code is a trivial one: + + The basic sequences consist of single bytes. + + This particular code is equivalent to not using multibyte characters +at all. It has no invalid sequences. But it can handle only 256 +different characters. + + Here is another possible code which can handle 9376 different +characters: + + The basic sequences consist of + + * single bytes with values in the range `0' through `0237'. + + * two-byte sequences, in which both of the bytes have values in + the range from `0240' through `0377'. + +This code or a similar one is used on some systems to represent Japanese +characters. The invalid sequences are those which consist of an odd +number of consecutive bytes in the range from `0240' through `0377'. + + Here is another multibyte code which can handle more distinct +extended characters--in fact, almost thirty million: + + The basic sequences consist of + + * single bytes with values in the range `0' through `0177'. + + * sequences of up to four bytes in which the first byte is in + the range from `0200' through `0237', and the remaining bytes + are in the range from `0240' through `0377'. + +In this code, any sequence that starts with a byte in the range from +`0240' through `0377' is invalid. + + And here is another variant which has the advantage that removing the +last byte or bytes from a valid character can never produce another +valid character. (This property is convenient when you want to search +strings for particular characters.) + + The basic sequences consist of + + * single bytes with values in the range `0' through `0177'. + + * two-byte sequences in which the first byte is in the range + from `0200' through `0207', and the second byte is in the + range from `0240' through `0377'. + + * three-byte sequences in which the first byte is in the range + from `0210' through `0217', and the other bytes are in the + range from `0240' through `0377'. + + * four-byte sequences in which the first byte is in the range + from `0220' through `0227', and the other bytes are in the + range from `0240' through `0377'. + +The list of invalid sequences for this code is long and not worth +stating in full; examples of invalid sequences include `0240' and `0220 +0300 065'. + + The number of *possible* multibyte codes is astronomical. But a +given computer system will support at most a few different codes. (One +of these codes may allow for thousands of different characters.) +Another computer system may support a completely different code. The +library facilities described in this chapter are helpful because they +package up the knowledge of the details of a particular computer +system's multibyte code, so your programs need not know them. + + You can use special standard macros to find out the maximum possible +number of bytes in a character in the currently selected multibyte code +with `MB_CUR_MAX', and the maximum for *any* multibyte code supported +on your computer with `MB_LEN_MAX'. + + - Macro: int MB_LEN_MAX + This is the maximum length of a multibyte character for any + supported locale. It is defined in `limits.h'. + + - Macro: int MB_CUR_MAX + This macro expands into a (possibly non-constant) positive integer + expression that is the maximum number of bytes in a multibyte + character in the current locale. The value is never greater than + `MB_LEN_MAX'. + + `MB_CUR_MAX' is defined in `stdlib.h'. + + Normally, each basic sequence in a particular character code stands +for one character, the same character regardless of context. Some +multibyte character codes have a concept of "shift state"; certain +codes, called "shift sequences", change to a different shift state, and +the meaning of some or all basic sequences varies according to the +current shift state. In fact, the set of basic sequences might even be +different depending on the current shift state. *Note Shift State::, +for more information on handling this sort of code. + + What happens if you try to pass a string containing multibyte +characters to a function that doesn't know about them? Normally, such +a function treats a string as a sequence of bytes, and interprets +certain byte values specially; all other byte values are "ordinary". +As long as a multibyte character doesn't contain any of the special +byte values, the function should pass it through as if it were several +ordinary characters. + + For example, let's figure out what happens if you use multibyte +characters in a file name. The functions such as `open' and `unlink' +that operate on file names treat the name as a sequence of byte values, +with `/' as the only special value. Any other byte values are copied, +or compared, in sequence, and all byte values are treated alike. Thus, +you may think of the file name as a sequence of bytes or as a string +containing multibyte characters; the same behavior makes sense equally +either way, provided no multibyte character contains a `/'. + + +File: libc.info, Node: Wide Char Intro, Next: Wide String Conversion, Prev: Multibyte Char Intro, Up: Extended Characters + +Wide Character Introduction +=========================== + + "Wide characters" are much simpler than multibyte characters. They +are simply characters with more than eight bits, so that they have room +for more than 256 distinct codes. The wide character data type, +`wchar_t', has a range large enough to hold extended character codes as +well as old-fashioned ASCII codes. + + An advantage of wide characters is that each character is a single +data object, just like ordinary ASCII characters. Wide characters also +have some disadvantages: + + * A program must be modified and recompiled in order to use wide + characters at all. + + * Files of wide characters cannot be read by programs that expect + ordinary characters. + + Wide character values `0' through `0177' are always identical in +meaning to the ASCII character codes. The wide character value zero is +often used to terminate a string of wide characters, just as a single +byte with value zero often terminates a string of ordinary characters. + + - Data Type: wchar_t + This is the "wide character" type, an integer type whose range is + large enough to represent all distinct values in any extended + character set in the supported locales. *Note Locales::, for more + information about locales. This type is defined in the header + file `stddef.h'. + + If your system supports extended characters, then each extended +character has both a wide character code and a corresponding multibyte +basic sequence. + + In this chapter, the term "code" is used to refer to a single +extended character object to emphasize the distinction from the `char' +data type. + + +File: libc.info, Node: Wide String Conversion, Next: Length of Char, Prev: Wide Char Intro, Up: Extended Characters + +Conversion of Extended Strings +============================== + + The `mbstowcs' function converts a string of multibyte characters to +a wide character array. The `wcstombs' function does the reverse. +These functions are declared in the header file `stdlib.h'. + + In most programs, these functions are the only ones you need for +conversion between wide strings and multibyte character strings. But +they have limitations. If your data is not null-terminated or is not +all in core at once, you probably need to use the low-level conversion +functions to convert one character at a time. *Note Converting One +Char::. + + - Function: size_t mbstowcs (wchar_t *WSTRING, const char *STRING, + size_t SIZE) + The `mbstowcs' ("multibyte string to wide character string") + function converts the null-terminated string of multibyte + characters STRING to an array of wide character codes, storing not + more than SIZE wide characters into the array beginning at WSTRING. + The terminating null character counts towards the size, so if SIZE + is less than the actual number of wide characters resulting from + STRING, no terminating null character is stored. + + The conversion of characters from STRING begins in the initial + shift state. + + If an invalid multibyte character sequence is found, this function + returns a value of `-1'. Otherwise, it returns the number of wide + characters stored in the array WSTRING. This number does not + include the terminating null character, which is present if the + number is less than SIZE. + + Here is an example showing how to convert a string of multibyte + characters, allocating enough space for the result. + + wchar_t * + mbstowcs_alloc (const char *string) + { + size_t size = strlen (string) + 1; + wchar_t *buf = xmalloc (size * sizeof (wchar_t)); + + size = mbstowcs (buf, string, size); + if (size == (size_t) -1) + return NULL; + buf = xrealloc (buf, (size + 1) * sizeof (wchar_t)); + return buf; + } + + + - Function: size_t wcstombs (char *STRING, const wchar_t WSTRING, + size_t SIZE) + The `wcstombs' ("wide character string to multibyte string") + function converts the null-terminated wide character array WSTRING + into a string containing multibyte characters, storing not more + than SIZE bytes starting at STRING, followed by a terminating null + character if there is room. The conversion of characters begins in + the initial shift state. + + The terminating null character counts towards the size, so if SIZE + is less than or equal to the number of bytes needed in WSTRING, no + terminating null character is stored. + + If a code that does not correspond to a valid multibyte character + is found, this function returns a value of `-1'. Otherwise, the + return value is the number of bytes stored in the array STRING. + This number does not include the terminating null character, which + is present if the number is less than SIZE. + + +File: libc.info, Node: Length of Char, Next: Converting One Char, Prev: Wide String Conversion, Up: Extended Characters + +Multibyte Character Length +========================== + + This section describes how to scan a string containing multibyte +characters, one character at a time. The difficulty in doing this is +to know how many bytes each character contains. Your program can use +`mblen' to find this out. + + - Function: int mblen (const char *STRING, size_t SIZE) + The `mblen' function with a non-null STRING argument returns the + number of bytes that make up the multibyte character beginning at + STRING, never examining more than SIZE bytes. (The idea is to + supply for SIZE the number of bytes of data you have in hand.) + + The return value of `mblen' distinguishes three possibilities: the + first SIZE bytes at STRING start with valid multibyte character, + they start with an invalid byte sequence or just part of a + character, or STRING points to an empty string (a null character). + + For a valid multibyte character, `mblen' returns the number of + bytes in that character (always at least `1', and never more than + SIZE). For an invalid byte sequence, `mblen' returns `-1'. For + an empty string, it returns `0'. + + If the multibyte character code uses shift characters, then `mblen' + maintains and updates a shift state as it scans. If you call + `mblen' with a null pointer for STRING, that initializes the shift + state to its standard initial value. It also returns nonzero if + the multibyte character code in use actually has a shift state. + *Note Shift State::. + + The function `mblen' is declared in `stdlib.h'. + + File: libc.info, Node: Converting One Char, Next: Example of Conversion, Prev: Length of Char, Up: Extended Characters Conversion of Extended Characters One by One @@ -830,405 +1144,4 @@ describes how you can do such "non-local * 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. - - -File: libc.info, Node: Non-Local Intro, Next: Non-Local Details, Up: Non-Local Exits - -Introduction to Non-Local Exits -=============================== - - As an example of a situation where a non-local exit can be useful, -suppose you have an interactive program that has a "main loop" that -prompts for and executes commands. Suppose the "read" command reads -input from a file, doing some lexical analysis and parsing of the input -while processing it. If a low-level input error is detected, it would -be useful to be able to return immediately to the "main loop" instead -of having to make each of the lexical analysis, parsing, and processing -phases all have to explicitly deal with error situations initially -detected by nested calls. - - (On the other hand, if each of these phases has to do a substantial -amount of cleanup when it exits--such as closing files, deallocating -buffers or other data structures, and the like--then it can be more -appropriate to do a normal return and have each phase do its own -cleanup, because a non-local exit would bypass the intervening phases -and their associated cleanup code entirely. Alternatively, you could -use a non-local exit but do the cleanup explicitly either before or -after returning to the "main loop".) - - In some ways, a non-local exit is similar to using the `return' -statement to return from a function. But while `return' abandons only -a single function call, transferring control back to the point at which -it was called, a non-local exit can potentially abandon many levels of -nested function calls. - - You identify return points for non-local exits calling the function -`setjmp'. This function saves information about the execution -environment in which the call to `setjmp' appears in an object of type -`jmp_buf'. Execution of the program continues normally after the call -to `setjmp', but if a exit is later made to this return point by -calling `longjmp' with the corresponding `jmp_buf' object, control is -transferred back to the point where `setjmp' was called. The return -value from `setjmp' is used to distinguish between an ordinary return -and a return made by a call to `longjmp', so calls to `setjmp' usually -appear in an `if' statement. - - Here is how the example program described above might be set up: - - #include - #include - #include - - jmp_buf main_loop; - - void - abort_to_main_loop (int status) - { - longjmp (main_loop, status); - } - - int - main (void) - { - while (1) - if (setjmp (main_loop)) - puts ("Back at main loop...."); - else - do_command (); - } - - - void - do_command (void) - { - char buffer[128]; - if (fgets (buffer, 128, stdin) == NULL) - abort_to_main_loop (-1); - else - exit (EXIT_SUCCESS); - } - - The function `abort_to_main_loop' causes an immediate transfer of -control back to the main loop of the program, no matter where it is -called from. - - The flow of control inside the `main' function may appear a little -mysterious at first, but it is actually a common idiom with `setjmp'. -A normal call to `setjmp' returns zero, so the "else" clause of the -conditional is executed. If `abort_to_main_loop' is called somewhere -within the execution of `do_command', then it actually appears as if -the *same* call to `setjmp' in `main' were returning a second time with -a value of `-1'. - - So, the general pattern for using `setjmp' looks something like: - - if (setjmp (BUFFER)) - /* Code to clean up after premature return. */ - ... - else - /* Code to be executed normally after setting up the return point. */ - ... - - -File: libc.info, Node: Non-Local Details, Next: Non-Local Exits and Signals, Prev: Non-Local Intro, Up: Non-Local Exits - -Details of Non-Local Exits -========================== - - Here are the details on the functions and data structures used for -performing non-local exits. These facilities are declared in -`setjmp.h'. - - - Data Type: jmp_buf - Objects of type `jmp_buf' hold the state information to be - restored by a non-local exit. The contents of a `jmp_buf' - identify a specific place to return to. - - - Macro: int setjmp (jmp_buf STATE) - When called normally, `setjmp' stores information about the - execution state of the program in STATE and returns zero. If - `longjmp' is later used to perform a non-local exit to this STATE, - `setjmp' returns a nonzero value. - - - Function: void longjmp (jmp_buf STATE, int VALUE) - This function restores current execution to the state saved in - STATE, and continues execution from the call to `setjmp' that - established that return point. Returning from `setjmp' by means of - `longjmp' returns the VALUE argument that was passed to `longjmp', - rather than `0'. (But if VALUE is given as `0', `setjmp' returns - `1'). - - There are a lot of obscure but important restrictions on the use of -`setjmp' and `longjmp'. Most of these restrictions are present because -non-local exits require a fair amount of magic on the part of the C -compiler and can interact with other parts of the language in strange -ways. - - The `setjmp' function is actually a macro without an actual function -definition, so you shouldn't try to `#undef' it or take its address. -In addition, calls to `setjmp' are safe in only the following contexts: - - * As the test expression of a selection or iteration statement (such - as `if', `switch', or `while'). - - * As one operand of a equality or comparison operator that appears - as the test expression of a selection or iteration statement. The - other operand must be an integer constant expression. - - * As the operand of a unary `!' operator, that appears as the test - expression of a selection or iteration statement. - - * By itself as an expression statement. - - Return points are valid only during the dynamic extent of the -function that called `setjmp' to establish them. If you `longjmp' to a -return point that was established in a function that has already -returned, unpredictable and disastrous things are likely to happen. - - You should use a nonzero VALUE argument to `longjmp'. While -`longjmp' refuses to pass back a zero argument as the return value from -`setjmp', this is intended as a safety net against accidental misuse -and is not really good programming style. - - When you perform a non-local exit, accessible objects generally -retain whatever values they had at the time `longjmp' was called. The -exception is that the values of automatic variables local to the -function containing the `setjmp' call that have been changed since the -call to `setjmp' are indeterminate, unless you have declared them -`volatile'. - - -File: libc.info, Node: Non-Local Exits and Signals, Prev: Non-Local Details, Up: Non-Local Exits - -Non-Local Exits and Signals -=========================== - - In BSD Unix systems, `setjmp' and `longjmp' also save and restore -the set of blocked signals; see *Note Blocking Signals::. However, the -POSIX.1 standard requires `setjmp' and `longjmp' not to change the set -of blocked signals, and provides an additional pair of functions -(`sigsetjmp' and `sigsetjmp') to get the BSD behavior. - - The behavior of `setjmp' and `longjmp' in the GNU library is -controlled by feature test macros; see *Note Feature Test Macros::. The -default in the GNU system is the POSIX.1 behavior rather than the BSD -behavior. - - The facilities in this section are declared in the header file -`setjmp.h'. - - - Data Type: sigjmp_buf - This is similar to `jmp_buf', except that it can also store state - information about the set of blocked signals. - - - Function: int sigsetjmp (sigjmp_buf STATE, int SAVESIGS) - This is similar to `setjmp'. If SAVESIGS is nonzero, the set of - blocked signals is saved in STATE and will be restored if a - `siglongjmp' is later performed with this STATE. - - - Function: void siglongjmp (sigjmp_buf STATE, int VALUE) - This is similar to `longjmp' except for the type of its STATE - argument. If the `sigsetjmp' call that set this STATE used a - nonzero SAVESIGS flag, `siglongjmp' also restores the set of - blocked signals. - - -File: libc.info, Node: Signal Handling, Next: Process Startup, Prev: Non-Local Exits, Up: Top - -Signal Handling -*************** - - A "signal" is a software interrupt delivered to a process. The -operating system uses signals to report exceptional situations to an -executing program. Some signals report errors such as references to -invalid memory addresses; others report asynchronous events, such as -disconnection of a phone line. - - The GNU C library defines a variety of signal types, each for a -particular kind of event. Some kinds of events make it inadvisable or -impossible for the program to proceed as usual, and the corresponding -signals normally abort the program. Other kinds of signals that report -harmless events are ignored by default. - - If you anticipate an event that causes signals, you can define a -handler function and tell the operating system to run it when that -particular type of signal arrives. - - Finally, one process can send a signal to another process; this -allows a parent process to abort a child, or two related processes to -communicate and synchronize. - -* Menu: - -* 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 `open', - `read', `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. - - -File: libc.info, Node: Concepts of Signals, Next: Standard Signals, Up: Signal Handling - -Basic Concepts of Signals -========================= - - This section explains basic concepts of how signals are generated, -what happens after a signal is delivered, and how programs can handle -signals. - -* Menu: - -* 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. - - -File: libc.info, Node: Kinds of Signals, Next: Signal Generation, Up: Concepts of Signals - -Some Kinds of Signals ---------------------- - - A signal reports the occurrence of an exceptional event. These are -some of the events that can cause (or "generate", or "raise") a signal: - - * A program error such as dividing by zero or issuing an address - outside the valid range. - - * A user request to interrupt or terminate the program. Most - environments are set up to let a user suspend the program by - typing `C-z', or terminate it with `C-c'. Whatever key sequence - is used, the operating system sends the proper signal to interrupt - the process. - - * The termination of a child process. - - * Expiration of a timer or alarm. - - * A call to `kill' or `raise' by the same process. - - * A call to `kill' from another process. Signals are a limited but - useful form of interprocess communication. - - * An attempt to perform an I/O operation that cannot be done. - Examples are reading from a pipe that has no writer (*note Pipes - and FIFOs::.), and reading or writing to a terminal in certain - situations (*note Job Control::.). - - Each of these kinds of events (excepting explicit calls to `kill' -and `raise') generates its own particular kind of signal. The various -kinds of signals are listed and described in detail in *Note Standard -Signals::. - - -File: libc.info, Node: Signal Generation, Next: Delivery of Signal, Prev: Kinds of Signals, Up: Concepts of Signals - -Concepts of Signal Generation ------------------------------ - - In general, the events that generate signals fall into three major -categories: errors, external events, and explicit requests. - - An error means that a program has done something invalid and cannot -continue execution. But not all kinds of errors generate signals--in -fact, most do not. For example, opening a nonexistent file is an error, -but it does not raise a signal; instead, `open' returns `-1'. In -general, errors that are necessarily associated with certain library -functions are reported by returning a value that indicates an error. -The errors which raise signals are those which can happen anywhere in -the program, not just in library calls. These include division by zero -and invalid memory addresses. - - An external event generally has to do with I/O or other processes. -These include the arrival of input, the expiration of a timer, and the -termination of a child process. - - An explicit request means the use of a library function such as -`kill' whose purpose is specifically to generate a signal. - - Signals may be generated "synchronously" or "asynchronously". A -synchronous signal pertains to a specific action in the program, and is -delivered (unless blocked) during that action. Most errors generate -signals synchronously, and so do explicit requests by a process to -generate a signal for that same process. On some machines, certain -kinds of hardware errors (usually floating-point exceptions) are not -reported completely synchronously, but may arrive a few instructions -later. - - Asynchronous signals are generated by events outside the control of -the process that receives them. These signals arrive at unpredictable -times during execution. External events generate signals -asynchronously, and so do explicit requests that apply to some other -process. - - A given type of signal is either typically synchronous or typically -asynchronous. For example, signals for errors are typically synchronous -because errors generate signals synchronously. But any type of signal -can be generated synchronously or asynchronously with an explicit -request. - - -File: libc.info, Node: Delivery of Signal, Prev: Signal Generation, Up: Concepts of Signals - -How Signals Are Delivered -------------------------- - - When a signal is generated, it becomes "pending". Normally it -remains pending for just a short period of time and then is "delivered" -to the process that was signaled. However, if that kind of signal is -currently "blocked", it may remain pending indefinitely--until signals -of that kind are "unblocked". Once unblocked, it will be delivered -immediately. *Note Blocking Signals::. - - When the signal is delivered, whether right away or after a long -delay, the "specified action" for that signal is taken. For certain -signals, such as `SIGKILL' and `SIGSTOP', the action is fixed, but for -most signals, the program has a choice: ignore the signal, specify a -"handler function", or accept the "default action" for that kind of -signal. The program specifies its choice using functions such as -`signal' or `sigaction' (*note Signal Actions::.). We sometimes say -that a handler "catches" the signal. While the handler is running, -that particular signal is normally blocked. - - If the specified action for a kind of signal is to ignore it, then -any such signal which is generated is discarded immediately. This -happens even if the signal is also blocked at the time. A signal -discarded in this way will never be delivered, not even if the program -subsequently specifies a different action for that kind of signal and -then unblocks it. - - If a signal arrives which the program has neither handled nor -ignored, its "default action" takes place. Each kind of signal has its -own default action, documented below (*note Standard Signals::.). For -most kinds of signals, the default action is to terminate the process. -For certain kinds of signals that represent "harmless" events, the -default action is to do nothing. - - When a signal terminates a process, its parent process can determine -the cause of termination by examining the termination status code -reported by the `wait' or `waitpid' functions. (This is discussed in -more detail in *Note Process Completion::.) The information it can get -includes the fact that termination was due to a signal, and the kind of -signal involved. If a program you run from a shell is terminated by a -signal, the shell typically prints some kind of error message. - - The signals that normally represent program errors have a special -property: when one of these signals terminates the process, it also -writes a "core dump file" which records the state of the process at the -time of termination. You can examine the core dump with a debugger to -investigate what caused the error. - - If you raise a "program error" signal by explicit request, and this -terminates the process, it makes a core dump file just as if the signal -had been due directly to an error. diff -durpN glibc-2.0.4/manual/libc.info-2 glibc-2.0.5/manual/libc.info-2 --- glibc-2.0.4/manual/libc.info-2 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-2 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -192,11 +197,11 @@ declares them. There are several reason pleases on calls to these functions, without the possibility that they may have been redefined by the user. Some library facilities, such as those for dealing with variadic arguments - (*note Variadic Functions::.) and non-local exits (*note Non-Local - Exits::.), actually require a considerable amount of cooperation - on the part of the C compiler, and implementationally it might be - easier for the compiler to treat these as built-in parts of the - language. + (*note Variadic Functions::.) and non-local exits (*note + Non-Local Exits::.), actually require a considerable amount of + cooperation on the part of the C compiler, and implementationally + it might be easier for the compiler to treat these as built-in + parts of the language. In addition to the names documented in this manual, reserved names include all external identifiers (global functions and variables) that @@ -903,7 +908,7 @@ on other systems. - Macro: int EPROTONOSUPPORT The socket domain does not support the requested communications protocol (perhaps because the requested protocol is completely - invalid.) *Note Creating a Socket::. + invalid.) *Note Creating a Socket::. - Macro: int ESOCKTNOSUPPORT The socket type is not supported. @@ -1199,8 +1204,4 @@ They are not yet documented.* - Macro: int EISNAM - Macro: int EREMOTEIO - - - Macro: int ENOMEDIUM - - - Macro: int EMEDIUMTYPE diff -durpN glibc-2.0.4/manual/libc.info-20 glibc-2.0.5/manual/libc.info-20 --- glibc-2.0.4/manual/libc.info-20 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-20 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,407 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Non-Local Intro, Next: Non-Local Details, Up: Non-Local Exits + +Introduction to Non-Local Exits +=============================== + + As an example of a situation where a non-local exit can be useful, +suppose you have an interactive program that has a "main loop" that +prompts for and executes commands. Suppose the "read" command reads +input from a file, doing some lexical analysis and parsing of the input +while processing it. If a low-level input error is detected, it would +be useful to be able to return immediately to the "main loop" instead +of having to make each of the lexical analysis, parsing, and processing +phases all have to explicitly deal with error situations initially +detected by nested calls. + + (On the other hand, if each of these phases has to do a substantial +amount of cleanup when it exits--such as closing files, deallocating +buffers or other data structures, and the like--then it can be more +appropriate to do a normal return and have each phase do its own +cleanup, because a non-local exit would bypass the intervening phases +and their associated cleanup code entirely. Alternatively, you could +use a non-local exit but do the cleanup explicitly either before or +after returning to the "main loop".) + + In some ways, a non-local exit is similar to using the `return' +statement to return from a function. But while `return' abandons only +a single function call, transferring control back to the point at which +it was called, a non-local exit can potentially abandon many levels of +nested function calls. + + You identify return points for non-local exits calling the function +`setjmp'. This function saves information about the execution +environment in which the call to `setjmp' appears in an object of type +`jmp_buf'. Execution of the program continues normally after the call +to `setjmp', but if a exit is later made to this return point by +calling `longjmp' with the corresponding `jmp_buf' object, control is +transferred back to the point where `setjmp' was called. The return +value from `setjmp' is used to distinguish between an ordinary return +and a return made by a call to `longjmp', so calls to `setjmp' usually +appear in an `if' statement. + + Here is how the example program described above might be set up: + + #include + #include + #include + + jmp_buf main_loop; + + void + abort_to_main_loop (int status) + { + longjmp (main_loop, status); + } + + int + main (void) + { + while (1) + if (setjmp (main_loop)) + puts ("Back at main loop...."); + else + do_command (); + } + + + void + do_command (void) + { + char buffer[128]; + if (fgets (buffer, 128, stdin) == NULL) + abort_to_main_loop (-1); + else + exit (EXIT_SUCCESS); + } + + The function `abort_to_main_loop' causes an immediate transfer of +control back to the main loop of the program, no matter where it is +called from. + + The flow of control inside the `main' function may appear a little +mysterious at first, but it is actually a common idiom with `setjmp'. +A normal call to `setjmp' returns zero, so the "else" clause of the +conditional is executed. If `abort_to_main_loop' is called somewhere +within the execution of `do_command', then it actually appears as if +the *same* call to `setjmp' in `main' were returning a second time with +a value of `-1'. + + So, the general pattern for using `setjmp' looks something like: + + if (setjmp (BUFFER)) + /* Code to clean up after premature return. */ + ... + else + /* Code to be executed normally after setting up the return point. */ + ... + + +File: libc.info, Node: Non-Local Details, Next: Non-Local Exits and Signals, Prev: Non-Local Intro, Up: Non-Local Exits + +Details of Non-Local Exits +========================== + + Here are the details on the functions and data structures used for +performing non-local exits. These facilities are declared in +`setjmp.h'. + + - Data Type: jmp_buf + Objects of type `jmp_buf' hold the state information to be + restored by a non-local exit. The contents of a `jmp_buf' + identify a specific place to return to. + + - Macro: int setjmp (jmp_buf STATE) + When called normally, `setjmp' stores information about the + execution state of the program in STATE and returns zero. If + `longjmp' is later used to perform a non-local exit to this STATE, + `setjmp' returns a nonzero value. + + - Function: void longjmp (jmp_buf STATE, int VALUE) + This function restores current execution to the state saved in + STATE, and continues execution from the call to `setjmp' that + established that return point. Returning from `setjmp' by means of + `longjmp' returns the VALUE argument that was passed to `longjmp', + rather than `0'. (But if VALUE is given as `0', `setjmp' returns + `1'). + + There are a lot of obscure but important restrictions on the use of +`setjmp' and `longjmp'. Most of these restrictions are present because +non-local exits require a fair amount of magic on the part of the C +compiler and can interact with other parts of the language in strange +ways. + + The `setjmp' function is actually a macro without an actual function +definition, so you shouldn't try to `#undef' it or take its address. +In addition, calls to `setjmp' are safe in only the following contexts: + + * As the test expression of a selection or iteration statement (such + as `if', `switch', or `while'). + + * As one operand of a equality or comparison operator that appears + as the test expression of a selection or iteration statement. The + other operand must be an integer constant expression. + + * As the operand of a unary `!' operator, that appears as the test + expression of a selection or iteration statement. + + * By itself as an expression statement. + + Return points are valid only during the dynamic extent of the +function that called `setjmp' to establish them. If you `longjmp' to a +return point that was established in a function that has already +returned, unpredictable and disastrous things are likely to happen. + + You should use a nonzero VALUE argument to `longjmp'. While +`longjmp' refuses to pass back a zero argument as the return value from +`setjmp', this is intended as a safety net against accidental misuse +and is not really good programming style. + + When you perform a non-local exit, accessible objects generally +retain whatever values they had at the time `longjmp' was called. The +exception is that the values of automatic variables local to the +function containing the `setjmp' call that have been changed since the +call to `setjmp' are indeterminate, unless you have declared them +`volatile'. + + +File: libc.info, Node: Non-Local Exits and Signals, Prev: Non-Local Details, Up: Non-Local Exits + +Non-Local Exits and Signals +=========================== + + In BSD Unix systems, `setjmp' and `longjmp' also save and restore +the set of blocked signals; see *Note Blocking Signals::. However, the +POSIX.1 standard requires `setjmp' and `longjmp' not to change the set +of blocked signals, and provides an additional pair of functions +(`sigsetjmp' and `sigsetjmp') to get the BSD behavior. + + The behavior of `setjmp' and `longjmp' in the GNU library is +controlled by feature test macros; see *Note Feature Test Macros::. The +default in the GNU system is the POSIX.1 behavior rather than the BSD +behavior. + + The facilities in this section are declared in the header file +`setjmp.h'. + + - Data Type: sigjmp_buf + This is similar to `jmp_buf', except that it can also store state + information about the set of blocked signals. + + - Function: int sigsetjmp (sigjmp_buf STATE, int SAVESIGS) + This is similar to `setjmp'. If SAVESIGS is nonzero, the set of + blocked signals is saved in STATE and will be restored if a + `siglongjmp' is later performed with this STATE. + + - Function: void siglongjmp (sigjmp_buf STATE, int VALUE) + This is similar to `longjmp' except for the type of its STATE + argument. If the `sigsetjmp' call that set this STATE used a + nonzero SAVESIGS flag, `siglongjmp' also restores the set of + blocked signals. + + +File: libc.info, Node: Signal Handling, Next: Process Startup, Prev: Non-Local Exits, Up: Top + +Signal Handling +*************** + + A "signal" is a software interrupt delivered to a process. The +operating system uses signals to report exceptional situations to an +executing program. Some signals report errors such as references to +invalid memory addresses; others report asynchronous events, such as +disconnection of a phone line. + + The GNU C library defines a variety of signal types, each for a +particular kind of event. Some kinds of events make it inadvisable or +impossible for the program to proceed as usual, and the corresponding +signals normally abort the program. Other kinds of signals that report +harmless events are ignored by default. + + If you anticipate an event that causes signals, you can define a +handler function and tell the operating system to run it when that +particular type of signal arrives. + + Finally, one process can send a signal to another process; this +allows a parent process to abort a child, or two related processes to +communicate and synchronize. + +* Menu: + +* 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 `open', + `read', `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. + + +File: libc.info, Node: Concepts of Signals, Next: Standard Signals, Up: Signal Handling + +Basic Concepts of Signals +========================= + + This section explains basic concepts of how signals are generated, +what happens after a signal is delivered, and how programs can handle +signals. + +* Menu: + +* 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. + + +File: libc.info, Node: Kinds of Signals, Next: Signal Generation, Up: Concepts of Signals + +Some Kinds of Signals +--------------------- + + A signal reports the occurrence of an exceptional event. These are +some of the events that can cause (or "generate", or "raise") a signal: + + * A program error such as dividing by zero or issuing an address + outside the valid range. + + * A user request to interrupt or terminate the program. Most + environments are set up to let a user suspend the program by + typing `C-z', or terminate it with `C-c'. Whatever key sequence + is used, the operating system sends the proper signal to interrupt + the process. + + * The termination of a child process. + + * Expiration of a timer or alarm. + + * A call to `kill' or `raise' by the same process. + + * A call to `kill' from another process. Signals are a limited but + useful form of interprocess communication. + + * An attempt to perform an I/O operation that cannot be done. + Examples are reading from a pipe that has no writer (*note Pipes + and FIFOs::.), and reading or writing to a terminal in certain + situations (*note Job Control::.). + + Each of these kinds of events (excepting explicit calls to `kill' +and `raise') generates its own particular kind of signal. The various +kinds of signals are listed and described in detail in *Note Standard +Signals::. + + +File: libc.info, Node: Signal Generation, Next: Delivery of Signal, Prev: Kinds of Signals, Up: Concepts of Signals + +Concepts of Signal Generation +----------------------------- + + In general, the events that generate signals fall into three major +categories: errors, external events, and explicit requests. + + An error means that a program has done something invalid and cannot +continue execution. But not all kinds of errors generate signals--in +fact, most do not. For example, opening a nonexistent file is an error, +but it does not raise a signal; instead, `open' returns `-1'. In +general, errors that are necessarily associated with certain library +functions are reported by returning a value that indicates an error. +The errors which raise signals are those which can happen anywhere in +the program, not just in library calls. These include division by zero +and invalid memory addresses. + + An external event generally has to do with I/O or other processes. +These include the arrival of input, the expiration of a timer, and the +termination of a child process. + + An explicit request means the use of a library function such as +`kill' whose purpose is specifically to generate a signal. + + Signals may be generated "synchronously" or "asynchronously". A +synchronous signal pertains to a specific action in the program, and is +delivered (unless blocked) during that action. Most errors generate +signals synchronously, and so do explicit requests by a process to +generate a signal for that same process. On some machines, certain +kinds of hardware errors (usually floating-point exceptions) are not +reported completely synchronously, but may arrive a few instructions +later. + + Asynchronous signals are generated by events outside the control of +the process that receives them. These signals arrive at unpredictable +times during execution. External events generate signals +asynchronously, and so do explicit requests that apply to some other +process. + + A given type of signal is either typically synchronous or typically +asynchronous. For example, signals for errors are typically synchronous +because errors generate signals synchronously. But any type of signal +can be generated synchronously or asynchronously with an explicit +request. + + +File: libc.info, Node: Delivery of Signal, Prev: Signal Generation, Up: Concepts of Signals + +How Signals Are Delivered +------------------------- + + When a signal is generated, it becomes "pending". Normally it +remains pending for just a short period of time and then is "delivered" +to the process that was signaled. However, if that kind of signal is +currently "blocked", it may remain pending indefinitely--until signals +of that kind are "unblocked". Once unblocked, it will be delivered +immediately. *Note Blocking Signals::. + + When the signal is delivered, whether right away or after a long +delay, the "specified action" for that signal is taken. For certain +signals, such as `SIGKILL' and `SIGSTOP', the action is fixed, but for +most signals, the program has a choice: ignore the signal, specify a +"handler function", or accept the "default action" for that kind of +signal. The program specifies its choice using functions such as +`signal' or `sigaction' (*note Signal Actions::.). We sometimes say +that a handler "catches" the signal. While the handler is running, +that particular signal is normally blocked. + + If the specified action for a kind of signal is to ignore it, then +any such signal which is generated is discarded immediately. This +happens even if the signal is also blocked at the time. A signal +discarded in this way will never be delivered, not even if the program +subsequently specifies a different action for that kind of signal and +then unblocks it. + + If a signal arrives which the program has neither handled nor +ignored, its "default action" takes place. Each kind of signal has its +own default action, documented below (*note Standard Signals::.). For +most kinds of signals, the default action is to terminate the process. +For certain kinds of signals that represent "harmless" events, the +default action is to do nothing. + + When a signal terminates a process, its parent process can determine +the cause of termination by examining the termination status code +reported by the `wait' or `waitpid' functions. (This is discussed in +more detail in *Note Process Completion::.) The information it can get +includes the fact that termination was due to a signal, and the kind of +signal involved. If a program you run from a shell is terminated by a +signal, the shell typically prints some kind of error message. + + The signals that normally represent program errors have a special +property: when one of these signals terminates the process, it also +writes a "core dump file" which records the state of the process at the +time of termination. You can examine the core dump with a debugger to +investigate what caused the error. + + If you raise a "program error" signal by explicit request, and this +terminates the process, it makes a core dump file just as if the signal +had been due directly to an error. + + File: libc.info, Node: Standard Signals, Next: Signal Actions, Prev: Concepts of Signals, Up: Signal Handling Standard Signals @@ -739,482 +1145,4 @@ example because these are designed to pr - Macro: sighandler_t SIG_ERR The value of this macro is used as the return value from `signal' to indicate an error. - - -File: libc.info, Node: Advanced Signal Handling, Next: Signal and Sigaction, Prev: Basic Signal Handling, Up: Signal Actions - -Advanced Signal Handling ------------------------- - - The `sigaction' function has the same basic effect as `signal': to -specify how a signal should be handled by the process. However, -`sigaction' offers more control, at the expense of more complexity. In -particular, `sigaction' allows you to specify additional flags to -control when the signal is generated and how the handler is invoked. - - The `sigaction' function is declared in `signal.h'. - - - Data Type: struct sigaction - Structures of type `struct sigaction' are used in the `sigaction' - function to specify all the information about how to handle a - particular signal. This structure contains at least the following - members: - - `sighandler_t sa_handler' - This is used in the same way as the ACTION argument to the - `signal' function. The value can be `SIG_DFL', `SIG_IGN', or - a function pointer. *Note Basic Signal Handling::. - - `sigset_t sa_mask' - This specifies a set of signals to be blocked while the - handler runs. Blocking is explained in *Note Blocking for - Handler::. Note that the signal that was delivered is - automatically blocked by default before its handler is - started; this is true regardless of the value in `sa_mask'. - If you want that signal not to be blocked within its handler, - you must write code in the handler to unblock it. - - `int sa_flags' - This specifies various flags which can affect the behavior of - the signal. These are described in more detail in *Note - Flags for Sigaction::. - - - Function: int sigaction (int SIGNUM, const struct sigaction *ACTION, - struct sigaction *OLD-ACTION) - The ACTION argument is used to set up a new action for the signal - SIGNUM, while the OLD-ACTION argument is used to return - information about the action previously associated with this - symbol. (In other words, OLD-ACTION has the same purpose as the - `signal' function's return value--you can check to see what the - old action in effect for the signal was, and restore it later if - you want.) - - Either ACTION or OLD-ACTION can be a null pointer. If OLD-ACTION - is a null pointer, this simply suppresses the return of - information about the old action. If ACTION is a null pointer, - the action associated with the signal SIGNUM is unchanged; this - allows you to inquire about how a signal is being handled without - changing that handling. - - The return value from `sigaction' is zero if it succeeds, and `-1' - on failure. The following `errno' error conditions are defined - for this function: - - `EINVAL' - The SIGNUM argument is not valid, or you are trying to trap - or ignore `SIGKILL' or `SIGSTOP'. - - -File: libc.info, Node: Signal and Sigaction, Next: Sigaction Function Example, Prev: Advanced Signal Handling, Up: Signal Actions - -Interaction of `signal' and `sigaction' ---------------------------------------- - - It's possible to use both the `signal' and `sigaction' functions -within a single program, but you have to be careful because they can -interact in slightly strange ways. - - The `sigaction' function specifies more information than the -`signal' function, so the return value from `signal' cannot express the -full range of `sigaction' possibilities. Therefore, if you use -`signal' to save and later reestablish an action, it may not be able to -reestablish properly a handler that was established with `sigaction'. - - To avoid having problems as a result, always use `sigaction' to save -and restore a handler if your program uses `sigaction' at all. Since -`sigaction' is more general, it can properly save and reestablish any -action, regardless of whether it was established originally with -`signal' or `sigaction'. - - On some systems if you establish an action with `signal' and then -examine it with `sigaction', the handler address that you get may not -be the same as what you specified with `signal'. It may not even be -suitable for use as an action argument with `signal'. But you can rely -on using it as an argument to `sigaction'. This problem never happens -on the GNU system. - - So, you're better off using one or the other of the mechanisms -consistently within a single program. - - *Portability Note:* The basic `signal' function is a feature of -ISO C, while `sigaction' is part of the POSIX.1 standard. If you are -concerned about portability to non-POSIX systems, then you should use -the `signal' function instead. - - -File: libc.info, Node: Sigaction Function Example, Next: Flags for Sigaction, Prev: Signal and Sigaction, Up: Signal Actions - -`sigaction' Function Example ----------------------------- - - In *Note Basic Signal Handling::, we gave an example of establishing -a simple handler for termination signals using `signal'. Here is an -equivalent example using `sigaction': - - #include - - void - termination_handler (int signum) - { - struct temp_file *p; - - for (p = temp_file_list; p; p = p->next) - unlink (p->name); - } - - int - main (void) - { - ... - struct sigaction new_action, old_action; - - /* Set up the structure to specify the new action. */ - new_action.sa_handler = termination_handler; - sigemptyset (&new_action.sa_mask); - new_action.sa_flags = 0; - - sigaction (SIGINT, NULL, &old_action); - if (old_action.sa_handler != SIG_IGN) - sigaction (SIGINT, &new_action, NULL); - sigaction (SIGHUP, NULL, &old_action); - if (old_action.sa_handler != SIG_IGN) - sigaction (SIGHUP, &new_action, NULL); - sigaction (SIGTERM, NULL, &old_action); - if (old_action.sa_handler != SIG_IGN) - sigaction (SIGTERM, &new_action, NULL); - ... - } - - The program just loads the `new_action' structure with the desired -parameters and passes it in the `sigaction' call. The usage of -`sigemptyset' is described later; see *Note Blocking Signals::. - - As in the example using `signal', we avoid handling signals -previously set to be ignored. Here we can avoid altering the signal -handler even momentarily, by using the feature of `sigaction' that lets -us examine the current action without specifying a new one. - - Here is another example. It retrieves information about the current -action for `SIGINT' without changing that action. - - struct sigaction query_action; - - if (sigaction (SIGINT, NULL, &query_action) < 0) - /* `sigaction' returns -1 in case of error. */ - else if (query_action.sa_handler == SIG_DFL) - /* `SIGINT' is handled in the default, fatal manner. */ - else if (query_action.sa_handler == SIG_IGN) - /* `SIGINT' is ignored. */ - else - /* A programmer-defined signal handler is in effect. */ - - -File: libc.info, Node: Flags for Sigaction, Next: Initial Signal Actions, Prev: Sigaction Function Example, Up: Signal Actions - -Flags for `sigaction' ---------------------- - - The `sa_flags' member of the `sigaction' structure is a catch-all -for special features. Most of the time, `SA_RESTART' is a good value -to use for this field. - - The value of `sa_flags' is interpreted as a bit mask. Thus, you -should choose the flags you want to set, OR those flags together, and -store the result in the `sa_flags' member of your `sigaction' structure. - - Each signal number has its own set of flags. Each call to -`sigaction' affects one particular signal number, and the flags that -you specify apply only to that particular signal. - - In the GNU C library, establishing a handler with `signal' sets all -the flags to zero except for `SA_RESTART', whose value depends on the -settings you have made with `siginterrupt'. *Note Interrupted -Primitives::, to see what this is about. - - These macros are defined in the header file `signal.h'. - - - Macro: int SA_NOCLDSTOP - This flag is meaningful only for the `SIGCHLD' signal. When the - flag is set, the system delivers the signal for a terminated child - process but not for one that is stopped. By default, `SIGCHLD' is - delivered for both terminated children and stopped children. - - Setting this flag for a signal other than `SIGCHLD' has no effect. - - - Macro: int SA_ONSTACK - If this flag is set for a particular signal number, the system - uses the signal stack when delivering that kind of signal. *Note - Signal Stack::. If a signal with this flag arrives and you have - not set a signal stack, the system terminates the program with - `SIGILL'. - - - Macro: int SA_RESTART - This flag controls what happens when a signal is delivered during - certain primitives (such as `open', `read' or `write'), and the - signal handler returns normally. There are two alternatives: the - library function can resume, or it can return failure with error - code `EINTR'. - - The choice is controlled by the `SA_RESTART' flag for the - particular kind of signal that was delivered. If the flag is set, - returning from a handler resumes the library function. If the - flag is clear, returning from a handler makes the function fail. - *Note Interrupted Primitives::. - - -File: libc.info, Node: Initial Signal Actions, Prev: Flags for Sigaction, Up: Signal Actions - -Initial Signal Actions ----------------------- - - When a new process is created (*note Creating a Process::.), it -inherits handling of signals from its parent process. However, when -you load a new process image using the `exec' function (*note Executing -a File::.), any signals that you've defined your own handlers for -revert to their `SIG_DFL' handling. (If you think about it a little, -this makes sense; the handler functions from the old program are -specific to that program, and aren't even present in the address space -of the new program image.) Of course, the new program can establish -its own handlers. - - When a program is run by a shell, the shell normally sets the initial -actions for the child process to `SIG_DFL' or `SIG_IGN', as -appropriate. It's a good idea to check to make sure that the shell has -not set up an initial action of `SIG_IGN' before you establish your own -signal handlers. - - Here is an example of how to establish a handler for `SIGHUP', but -not if `SIGHUP' is currently ignored: - - ... - struct sigaction temp; - - sigaction (SIGHUP, NULL, &temp); - - if (temp.sa_handler != SIG_IGN) - { - temp.sa_handler = handle_sighup; - sigemptyset (&temp.sa_mask); - sigaction (SIGHUP, &temp, NULL); - } - - -File: libc.info, Node: Defining Handlers, Next: Interrupted Primitives, Prev: Signal Actions, Up: Signal Handling - -Defining Signal Handlers -======================== - - This section describes how to write a signal handler function that -can be established with the `signal' or `sigaction' functions. - - A signal handler is just a function that you compile together with -the rest of the program. Instead of directly invoking the function, -you use `signal' or `sigaction' to tell the operating system to call it -when a signal arrives. This is known as "establishing" the handler. -*Note Signal Actions::. - - There are two basic strategies you can use in signal handler -functions: - - * You can have the handler function note that the signal arrived by - tweaking some global data structures, and then return normally. - - * You can have the handler function terminate the program or transfer - control to a point where it can recover from the situation that - caused the signal. - - You need to take special care in writing handler functions because -they can be called asynchronously. That is, a handler might be called -at any point in the program, unpredictably. If two signals arrive -during a very short interval, one handler can run within another. This -section describes what your handler should do, and what you should -avoid. - -* Menu: - -* Handler Returns:: Handlers that return normally, and what - this means. -* Termination in Handler:: How handler functions terminate a program. -* Longjmp in Handler:: Nonlocal transfer of control out of a - signal handler. -* Signals in Handler:: What happens when signals arrive while - the handler is already occupied. -* Merged Signals:: When a second signal arrives before the - first is handled. -* Nonreentrancy:: Do not call any functions unless you know they - are reentrant with respect to signals. -* Atomic Data Access:: A single handler can run in the middle of - reading or writing a single object. - - -File: libc.info, Node: Handler Returns, Next: Termination in Handler, Up: Defining Handlers - -Signal Handlers that Return ---------------------------- - - Handlers which return normally are usually used for signals such as -`SIGALRM' and the I/O and interprocess communication signals. But a -handler for `SIGINT' might also return normally after setting a flag -that tells the program to exit at a convenient time. - - It is not safe to return normally from the handler for a program -error signal, because the behavior of the program when the handler -function returns is not defined after a program error. *Note Program -Error Signals::. - - Handlers that return normally must modify some global variable in -order to have any effect. Typically, the variable is one that is -examined periodically by the program during normal operation. Its data -type should be `sig_atomic_t' for reasons described in *Note Atomic -Data Access::. - - Here is a simple example of such a program. It executes the body of -the loop until it has noticed that a `SIGALRM' signal has arrived. -This technique is useful because it allows the iteration in progress -when the signal arrives to complete before the loop exits. - - #include - #include - #include - - /* This flag controls termination of the main loop. */ - volatile sig_atomic_t keep_going = 1; - - /* The signal handler just clears the flag and re-enables itself. */ - void - catch_alarm (int sig) - { - keep_going = 0; - signal (sig, catch_alarm); - } - - void - do_stuff (void) - { - puts ("Doing stuff while waiting for alarm...."); - } - - int - main (void) - { - /* Establish a handler for SIGALRM signals. */ - signal (SIGALRM, catch_alarm); - - /* Set an alarm to go off in a little while. */ - alarm (2); - - /* Check the flag once in a while to see when to quit. */ - while (keep_going) - do_stuff (); - - return EXIT_SUCCESS; - } - - -File: libc.info, Node: Termination in Handler, Next: Longjmp in Handler, Prev: Handler Returns, Up: Defining Handlers - -Handlers That Terminate the Process ------------------------------------ - - Handler functions that terminate the program are typically used to -cause orderly cleanup or recovery from program error signals and -interactive interrupts. - - The cleanest way for a handler to terminate the process is to raise -the same signal that ran the handler in the first place. Here is how -to do this: - - volatile sig_atomic_t fatal_error_in_progress = 0; - - void - fatal_error_signal (int sig) - { - /* Since this handler is established for more than one kind of signal, - it might still get invoked recursively by delivery of some other kind - of signal. Use a static variable to keep track of that. */ - if (fatal_error_in_progress) - raise (sig); - fatal_error_in_progress = 1; - - /* Now do the clean up actions: - - reset terminal modes - - kill child processes - - remove lock files */ - ... - - /* Now reraise the signal. Since the signal is blocked, - it will receive its default handling, which is - to terminate the process. We could just call - `exit' or `abort', but reraising the signal - sets the return status from the process correctly. */ - raise (sig); - } - - -File: libc.info, Node: Longjmp in Handler, Next: Signals in Handler, Prev: Termination in Handler, Up: Defining Handlers - -Nonlocal Control Transfer in Handlers -------------------------------------- - - You can do a nonlocal transfer of control out of a signal handler -using the `setjmp' and `longjmp' facilities (*note Non-Local Exits::.). - - When the handler does a nonlocal control transfer, the part of the -program that was running will not continue. If this part of the program -was in the middle of updating an important data structure, the data -structure will remain inconsistent. Since the program does not -terminate, the inconsistency is likely to be noticed later on. - - There are two ways to avoid this problem. One is to block the signal -for the parts of the program that update important data structures. -Blocking the signal delays its delivery until it is unblocked, once the -critical updating is finished. *Note Blocking Signals::. - - The other way to re-initialize the crucial data structures in the -signal handler, or make their values consistent. - - Here is a rather schematic example showing the reinitialization of -one global variable. - - #include - #include - - jmp_buf return_to_top_level; - - volatile sig_atomic_t waiting_for_input; - - void - handle_sigint (int signum) - { - /* We may have been waiting for input when the signal arrived, - but we are no longer waiting once we transfer control. */ - waiting_for_input = 0; - longjmp (return_to_top_level, 1); - } - - int - main (void) - { - ... - signal (SIGINT, sigint_handler); - ... - while (1) { - prepare_for_command (); - if (setjmp (return_to_top_level) == 0) - read_and_execute_command (); - } - } - - /* Imagine this is a subroutine used by various commands. */ - char * - read_data () - { - if (input_from_terminal) { - waiting_for_input = 1; - ... - waiting_for_input = 0; - } else { - ... - } - } diff -durpN glibc-2.0.4/manual/libc.info-21 glibc-2.0.5/manual/libc.info-21 --- glibc-2.0.4/manual/libc.info-21 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-21 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,484 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Advanced Signal Handling, Next: Signal and Sigaction, Prev: Basic Signal Handling, Up: Signal Actions + +Advanced Signal Handling +------------------------ + + The `sigaction' function has the same basic effect as `signal': to +specify how a signal should be handled by the process. However, +`sigaction' offers more control, at the expense of more complexity. In +particular, `sigaction' allows you to specify additional flags to +control when the signal is generated and how the handler is invoked. + + The `sigaction' function is declared in `signal.h'. + + - Data Type: struct sigaction + Structures of type `struct sigaction' are used in the `sigaction' + function to specify all the information about how to handle a + particular signal. This structure contains at least the following + members: + + `sighandler_t sa_handler' + This is used in the same way as the ACTION argument to the + `signal' function. The value can be `SIG_DFL', `SIG_IGN', or + a function pointer. *Note Basic Signal Handling::. + + `sigset_t sa_mask' + This specifies a set of signals to be blocked while the + handler runs. Blocking is explained in *Note Blocking for + Handler::. Note that the signal that was delivered is + automatically blocked by default before its handler is + started; this is true regardless of the value in `sa_mask'. + If you want that signal not to be blocked within its handler, + you must write code in the handler to unblock it. + + `int sa_flags' + This specifies various flags which can affect the behavior of + the signal. These are described in more detail in *Note + Flags for Sigaction::. + + - Function: int sigaction (int SIGNUM, const struct sigaction *ACTION, + struct sigaction *OLD-ACTION) + The ACTION argument is used to set up a new action for the signal + SIGNUM, while the OLD-ACTION argument is used to return + information about the action previously associated with this + symbol. (In other words, OLD-ACTION has the same purpose as the + `signal' function's return value--you can check to see what the + old action in effect for the signal was, and restore it later if + you want.) + + Either ACTION or OLD-ACTION can be a null pointer. If OLD-ACTION + is a null pointer, this simply suppresses the return of + information about the old action. If ACTION is a null pointer, + the action associated with the signal SIGNUM is unchanged; this + allows you to inquire about how a signal is being handled without + changing that handling. + + The return value from `sigaction' is zero if it succeeds, and `-1' + on failure. The following `errno' error conditions are defined + for this function: + + `EINVAL' + The SIGNUM argument is not valid, or you are trying to trap + or ignore `SIGKILL' or `SIGSTOP'. + + +File: libc.info, Node: Signal and Sigaction, Next: Sigaction Function Example, Prev: Advanced Signal Handling, Up: Signal Actions + +Interaction of `signal' and `sigaction' +--------------------------------------- + + It's possible to use both the `signal' and `sigaction' functions +within a single program, but you have to be careful because they can +interact in slightly strange ways. + + The `sigaction' function specifies more information than the +`signal' function, so the return value from `signal' cannot express the +full range of `sigaction' possibilities. Therefore, if you use +`signal' to save and later reestablish an action, it may not be able to +reestablish properly a handler that was established with `sigaction'. + + To avoid having problems as a result, always use `sigaction' to save +and restore a handler if your program uses `sigaction' at all. Since +`sigaction' is more general, it can properly save and reestablish any +action, regardless of whether it was established originally with +`signal' or `sigaction'. + + On some systems if you establish an action with `signal' and then +examine it with `sigaction', the handler address that you get may not +be the same as what you specified with `signal'. It may not even be +suitable for use as an action argument with `signal'. But you can rely +on using it as an argument to `sigaction'. This problem never happens +on the GNU system. + + So, you're better off using one or the other of the mechanisms +consistently within a single program. + + *Portability Note:* The basic `signal' function is a feature of +ISO C, while `sigaction' is part of the POSIX.1 standard. If you are +concerned about portability to non-POSIX systems, then you should use +the `signal' function instead. + + +File: libc.info, Node: Sigaction Function Example, Next: Flags for Sigaction, Prev: Signal and Sigaction, Up: Signal Actions + +`sigaction' Function Example +---------------------------- + + In *Note Basic Signal Handling::, we gave an example of establishing +a simple handler for termination signals using `signal'. Here is an +equivalent example using `sigaction': + + #include + + void + termination_handler (int signum) + { + struct temp_file *p; + + for (p = temp_file_list; p; p = p->next) + unlink (p->name); + } + + int + main (void) + { + ... + struct sigaction new_action, old_action; + + /* Set up the structure to specify the new action. */ + new_action.sa_handler = termination_handler; + sigemptyset (&new_action.sa_mask); + new_action.sa_flags = 0; + + sigaction (SIGINT, NULL, &old_action); + if (old_action.sa_handler != SIG_IGN) + sigaction (SIGINT, &new_action, NULL); + sigaction (SIGHUP, NULL, &old_action); + if (old_action.sa_handler != SIG_IGN) + sigaction (SIGHUP, &new_action, NULL); + sigaction (SIGTERM, NULL, &old_action); + if (old_action.sa_handler != SIG_IGN) + sigaction (SIGTERM, &new_action, NULL); + ... + } + + The program just loads the `new_action' structure with the desired +parameters and passes it in the `sigaction' call. The usage of +`sigemptyset' is described later; see *Note Blocking Signals::. + + As in the example using `signal', we avoid handling signals +previously set to be ignored. Here we can avoid altering the signal +handler even momentarily, by using the feature of `sigaction' that lets +us examine the current action without specifying a new one. + + Here is another example. It retrieves information about the current +action for `SIGINT' without changing that action. + + struct sigaction query_action; + + if (sigaction (SIGINT, NULL, &query_action) < 0) + /* `sigaction' returns -1 in case of error. */ + else if (query_action.sa_handler == SIG_DFL) + /* `SIGINT' is handled in the default, fatal manner. */ + else if (query_action.sa_handler == SIG_IGN) + /* `SIGINT' is ignored. */ + else + /* A programmer-defined signal handler is in effect. */ + + +File: libc.info, Node: Flags for Sigaction, Next: Initial Signal Actions, Prev: Sigaction Function Example, Up: Signal Actions + +Flags for `sigaction' +--------------------- + + The `sa_flags' member of the `sigaction' structure is a catch-all +for special features. Most of the time, `SA_RESTART' is a good value +to use for this field. + + The value of `sa_flags' is interpreted as a bit mask. Thus, you +should choose the flags you want to set, OR those flags together, and +store the result in the `sa_flags' member of your `sigaction' structure. + + Each signal number has its own set of flags. Each call to +`sigaction' affects one particular signal number, and the flags that +you specify apply only to that particular signal. + + In the GNU C library, establishing a handler with `signal' sets all +the flags to zero except for `SA_RESTART', whose value depends on the +settings you have made with `siginterrupt'. *Note Interrupted +Primitives::, to see what this is about. + + These macros are defined in the header file `signal.h'. + + - Macro: int SA_NOCLDSTOP + This flag is meaningful only for the `SIGCHLD' signal. When the + flag is set, the system delivers the signal for a terminated child + process but not for one that is stopped. By default, `SIGCHLD' is + delivered for both terminated children and stopped children. + + Setting this flag for a signal other than `SIGCHLD' has no effect. + + - Macro: int SA_ONSTACK + If this flag is set for a particular signal number, the system + uses the signal stack when delivering that kind of signal. *Note + Signal Stack::. If a signal with this flag arrives and you have + not set a signal stack, the system terminates the program with + `SIGILL'. + + - Macro: int SA_RESTART + This flag controls what happens when a signal is delivered during + certain primitives (such as `open', `read' or `write'), and the + signal handler returns normally. There are two alternatives: the + library function can resume, or it can return failure with error + code `EINTR'. + + The choice is controlled by the `SA_RESTART' flag for the + particular kind of signal that was delivered. If the flag is set, + returning from a handler resumes the library function. If the + flag is clear, returning from a handler makes the function fail. + *Note Interrupted Primitives::. + + +File: libc.info, Node: Initial Signal Actions, Prev: Flags for Sigaction, Up: Signal Actions + +Initial Signal Actions +---------------------- + + When a new process is created (*note Creating a Process::.), it +inherits handling of signals from its parent process. However, when +you load a new process image using the `exec' function (*note Executing +a File::.), any signals that you've defined your own handlers for +revert to their `SIG_DFL' handling. (If you think about it a little, +this makes sense; the handler functions from the old program are +specific to that program, and aren't even present in the address space +of the new program image.) Of course, the new program can establish +its own handlers. + + When a program is run by a shell, the shell normally sets the initial +actions for the child process to `SIG_DFL' or `SIG_IGN', as +appropriate. It's a good idea to check to make sure that the shell has +not set up an initial action of `SIG_IGN' before you establish your own +signal handlers. + + Here is an example of how to establish a handler for `SIGHUP', but +not if `SIGHUP' is currently ignored: + + ... + struct sigaction temp; + + sigaction (SIGHUP, NULL, &temp); + + if (temp.sa_handler != SIG_IGN) + { + temp.sa_handler = handle_sighup; + sigemptyset (&temp.sa_mask); + sigaction (SIGHUP, &temp, NULL); + } + + +File: libc.info, Node: Defining Handlers, Next: Interrupted Primitives, Prev: Signal Actions, Up: Signal Handling + +Defining Signal Handlers +======================== + + This section describes how to write a signal handler function that +can be established with the `signal' or `sigaction' functions. + + A signal handler is just a function that you compile together with +the rest of the program. Instead of directly invoking the function, +you use `signal' or `sigaction' to tell the operating system to call it +when a signal arrives. This is known as "establishing" the handler. +*Note Signal Actions::. + + There are two basic strategies you can use in signal handler +functions: + + * You can have the handler function note that the signal arrived by + tweaking some global data structures, and then return normally. + + * You can have the handler function terminate the program or transfer + control to a point where it can recover from the situation that + caused the signal. + + You need to take special care in writing handler functions because +they can be called asynchronously. That is, a handler might be called +at any point in the program, unpredictably. If two signals arrive +during a very short interval, one handler can run within another. This +section describes what your handler should do, and what you should +avoid. + +* Menu: + +* Handler Returns:: Handlers that return normally, and what + this means. +* Termination in Handler:: How handler functions terminate a program. +* Longjmp in Handler:: Nonlocal transfer of control out of a + signal handler. +* Signals in Handler:: What happens when signals arrive while + the handler is already occupied. +* Merged Signals:: When a second signal arrives before the + first is handled. +* Nonreentrancy:: Do not call any functions unless you know they + are reentrant with respect to signals. +* Atomic Data Access:: A single handler can run in the middle of + reading or writing a single object. + + +File: libc.info, Node: Handler Returns, Next: Termination in Handler, Up: Defining Handlers + +Signal Handlers that Return +--------------------------- + + Handlers which return normally are usually used for signals such as +`SIGALRM' and the I/O and interprocess communication signals. But a +handler for `SIGINT' might also return normally after setting a flag +that tells the program to exit at a convenient time. + + It is not safe to return normally from the handler for a program +error signal, because the behavior of the program when the handler +function returns is not defined after a program error. *Note Program +Error Signals::. + + Handlers that return normally must modify some global variable in +order to have any effect. Typically, the variable is one that is +examined periodically by the program during normal operation. Its data +type should be `sig_atomic_t' for reasons described in *Note Atomic +Data Access::. + + Here is a simple example of such a program. It executes the body of +the loop until it has noticed that a `SIGALRM' signal has arrived. +This technique is useful because it allows the iteration in progress +when the signal arrives to complete before the loop exits. + + #include + #include + #include + + /* This flag controls termination of the main loop. */ + volatile sig_atomic_t keep_going = 1; + + /* The signal handler just clears the flag and re-enables itself. */ + void + catch_alarm (int sig) + { + keep_going = 0; + signal (sig, catch_alarm); + } + + void + do_stuff (void) + { + puts ("Doing stuff while waiting for alarm...."); + } + + int + main (void) + { + /* Establish a handler for SIGALRM signals. */ + signal (SIGALRM, catch_alarm); + + /* Set an alarm to go off in a little while. */ + alarm (2); + + /* Check the flag once in a while to see when to quit. */ + while (keep_going) + do_stuff (); + + return EXIT_SUCCESS; + } + + +File: libc.info, Node: Termination in Handler, Next: Longjmp in Handler, Prev: Handler Returns, Up: Defining Handlers + +Handlers That Terminate the Process +----------------------------------- + + Handler functions that terminate the program are typically used to +cause orderly cleanup or recovery from program error signals and +interactive interrupts. + + The cleanest way for a handler to terminate the process is to raise +the same signal that ran the handler in the first place. Here is how +to do this: + + volatile sig_atomic_t fatal_error_in_progress = 0; + + void + fatal_error_signal (int sig) + { + /* Since this handler is established for more than one kind of signal, + it might still get invoked recursively by delivery of some other kind + of signal. Use a static variable to keep track of that. */ + if (fatal_error_in_progress) + raise (sig); + fatal_error_in_progress = 1; + + /* Now do the clean up actions: + - reset terminal modes + - kill child processes + - remove lock files */ + ... + + /* Now reraise the signal. Since the signal is blocked, + it will receive its default handling, which is + to terminate the process. We could just call + `exit' or `abort', but reraising the signal + sets the return status from the process correctly. */ + raise (sig); + } + + +File: libc.info, Node: Longjmp in Handler, Next: Signals in Handler, Prev: Termination in Handler, Up: Defining Handlers + +Nonlocal Control Transfer in Handlers +------------------------------------- + + You can do a nonlocal transfer of control out of a signal handler +using the `setjmp' and `longjmp' facilities (*note Non-Local Exits::.). + + When the handler does a nonlocal control transfer, the part of the +program that was running will not continue. If this part of the program +was in the middle of updating an important data structure, the data +structure will remain inconsistent. Since the program does not +terminate, the inconsistency is likely to be noticed later on. + + There are two ways to avoid this problem. One is to block the signal +for the parts of the program that update important data structures. +Blocking the signal delays its delivery until it is unblocked, once the +critical updating is finished. *Note Blocking Signals::. + + The other way to re-initialize the crucial data structures in the +signal handler, or make their values consistent. + + Here is a rather schematic example showing the reinitialization of +one global variable. + + #include + #include + + jmp_buf return_to_top_level; + + volatile sig_atomic_t waiting_for_input; + + void + handle_sigint (int signum) + { + /* We may have been waiting for input when the signal arrived, + but we are no longer waiting once we transfer control. */ + waiting_for_input = 0; + longjmp (return_to_top_level, 1); + } + + int + main (void) + { + ... + signal (SIGINT, sigint_handler); + ... + while (1) { + prepare_for_command (); + if (setjmp (return_to_top_level) == 0) + read_and_execute_command (); + } + } + + /* Imagine this is a subroutine used by various commands. */ + char * + read_data () + { + if (input_from_terminal) { + waiting_for_input = 1; + ... + waiting_for_input = 0; + } else { + ... + } + } + + File: libc.info, Node: Signals in Handler, Next: Merged Signals, Prev: Longjmp in Handler, Up: Defining Handlers Signals Arriving While a Handler Runs @@ -728,451 +1211,4 @@ implementations might enforce other rest The `SIGCONT' signal is a special case. It can be sent if the sender is part of the same session as the receiver, regardless of user IDs. - - -File: libc.info, Node: Kill Example, Prev: Permission for kill, Up: Generating Signals - -Using `kill' for Communication ------------------------------- - - Here is a longer example showing how signals can be used for -interprocess communication. This is what the `SIGUSR1' and `SIGUSR2' -signals are provided for. Since these signals are fatal by default, -the process that is supposed to receive them must trap them through -`signal' or `sigaction'. - - In this example, a parent process forks a child process and then -waits for the child to complete its initialization. The child process -tells the parent when it is ready by sending it a `SIGUSR1' signal, -using the `kill' function. - - #include - #include - #include - #include - - /* When a `SIGUSR1' signal arrives, set this variable. */ - volatile sig_atomic_t usr_interrupt = 0; - - void - synch_signal (int sig) - { - usr_interrupt = 1; - } - - /* The child process executes this function. */ - void - child_function (void) - { - /* Perform initialization. */ - printf ("I'm here!!! My pid is %d.\n", (int) getpid ()); - - /* Let parent know you're done. */ - kill (getppid (), SIGUSR1); - - /* Continue with execution. */ - puts ("Bye, now...."); - exit (0); - } - - int - main (void) - { - struct sigaction usr_action; - sigset_t block_mask; - pid_t child_id; - - /* Establish the signal handler. */ - sigfillset (&block_mask); - usr_action.sa_handler = synch_signal; - usr_action.sa_mask = block_mask; - usr_action.sa_flags = 0; - sigaction (SIGUSR1, &usr_action, NULL); - - /* Create the child process. */ - child_id = fork (); - if (child_id == 0) - child_function (); /* Does not return. */ - /* Busy wait for the child to send a signal. */ - while (!usr_interrupt) - ; - - /* Now continue execution. */ - puts ("That's all, folks!"); - - return 0; - } - - This example uses a busy wait, which is bad, because it wastes CPU -cycles that other programs could otherwise use. It is better to ask the -system to wait until the signal arrives. See the example in *Note -Waiting for a Signal::. - - -File: libc.info, Node: Blocking Signals, Next: Waiting for a Signal, Prev: Generating Signals, Up: Signal Handling - -Blocking Signals -================ - - Blocking a signal means telling the operating system to hold it and -deliver it later. Generally, a program does not block signals -indefinitely--it might as well ignore them by setting their actions to -`SIG_IGN'. But it is useful to block signals briefly, to prevent them -from interrupting sensitive operations. For instance: - - * You can use the `sigprocmask' function to block signals while you - modify global variables that are also modified by the handlers for - these signals. - - * You can set `sa_mask' in your `sigaction' call to block certain - signals while a particular signal handler runs. This way, the - signal handler can run without being interrupted itself by signals. - -* Menu: - -* 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. - - -File: libc.info, Node: Why Block, Next: Signal Sets, Up: Blocking Signals - -Why Blocking Signals is Useful ------------------------------- - - Temporary blocking of signals with `sigprocmask' gives you a way to -prevent interrupts during critical parts of your code. If signals -arrive in that part of the program, they are delivered later, after you -unblock them. - - One example where this is useful is for sharing data between a signal -handler and the rest of the program. If the type of the data is not -`sig_atomic_t' (*note Atomic Data Access::.), then the signal handler -could run when the rest of the program has only half finished reading -or writing the data. This would lead to confusing consequences. - - To make the program reliable, you can prevent the signal handler from -running while the rest of the program is examining or modifying that -data--by blocking the appropriate signal around the parts of the -program that touch the data. - - Blocking signals is also necessary when you want to perform a certain -action only if a signal has not arrived. Suppose that the handler for -the signal sets a flag of type `sig_atomic_t'; you would like to test -the flag and perform the action if the flag is not set. This is -unreliable. Suppose the signal is delivered immediately after you test -the flag, but before the consequent action: then the program will -perform the action even though the signal has arrived. - - The only way to test reliably for whether a signal has yet arrived -is to test while the signal is blocked. - - -File: libc.info, Node: Signal Sets, Next: Process Signal Mask, Prev: Why Block, Up: Blocking Signals - -Signal Sets ------------ - - All of the signal blocking functions use a data structure called a -"signal set" to specify what signals are affected. Thus, every -activity involves two stages: creating the signal set, and then passing -it as an argument to a library function. - - These facilities are declared in the header file `signal.h'. - - - Data Type: sigset_t - The `sigset_t' data type is used to represent a signal set. - Internally, it may be implemented as either an integer or structure - type. - - For portability, use only the functions described in this section - to initialize, change, and retrieve information from `sigset_t' - objects--don't try to manipulate them directly. - - There are two ways to initialize a signal set. You can initially -specify it to be empty with `sigemptyset' and then add specified -signals individually. Or you can specify it to be full with -`sigfillset' and then delete specified signals individually. - - You must always initialize the signal set with one of these two -functions before using it in any other way. Don't try to set all the -signals explicitly because the `sigset_t' object might include some -other information (like a version field) that needs to be initialized as -well. (In addition, it's not wise to put into your program an -assumption that the system has no signals aside from the ones you know -about.) - - - Function: int sigemptyset (sigset_t *SET) - This function initializes the signal set SET to exclude all of the - defined signals. It always returns `0'. - - - Function: int sigfillset (sigset_t *SET) - This function initializes the signal set SET to include all of the - defined signals. Again, the return value is `0'. - - - Function: int sigaddset (sigset_t *SET, int SIGNUM) - This function adds the signal SIGNUM to the signal set SET. All - `sigaddset' does is modify SET; it does not block or unblock any - signals. - - The return value is `0' on success and `-1' on failure. The - following `errno' error condition is defined for this function: - - `EINVAL' - The SIGNUM argument doesn't specify a valid signal. - - - Function: int sigdelset (sigset_t *SET, int SIGNUM) - This function removes the signal SIGNUM from the signal set SET. - All `sigdelset' does is modify SET; it does not block or unblock - any signals. The return value and error conditions are the same - as for `sigaddset'. - - Finally, there is a function to test what signals are in a signal -set: - - - Function: int sigismember (const sigset_t *SET, int SIGNUM) - The `sigismember' function tests whether the signal SIGNUM is a - member of the signal set SET. It returns `1' if the signal is in - the set, `0' if not, and `-1' if there is an error. - - The following `errno' error condition is defined for this function: - - `EINVAL' - The SIGNUM argument doesn't specify a valid signal. - - -File: libc.info, Node: Process Signal Mask, Next: Testing for Delivery, Prev: Signal Sets, Up: Blocking Signals - -Process Signal Mask -------------------- - - The collection of signals that are currently blocked is called the -"signal mask". Each process has its own signal mask. When you create -a new process (*note Creating a Process::.), it inherits its parent's -mask. You can block or unblock signals with total flexibility by -modifying the signal mask. - - The prototype for the `sigprocmask' function is in `signal.h'. - - - Function: int sigprocmask (int HOW, const sigset_t *SET, sigset_t - *OLDSET) - The `sigprocmask' function is used to examine or change the calling - process's signal mask. The HOW argument determines how the signal - mask is changed, and must be one of the following values: - - `SIG_BLOCK' - Block the signals in `set'--add them to the existing mask. In - other words, the new mask is the union of the existing mask - and SET. - - `SIG_UNBLOCK' - Unblock the signals in SET--remove them from the existing - mask. - - `SIG_SETMASK' - Use SET for the mask; ignore the previous value of the mask. - - The last argument, OLDSET, is used to return information about the - old process signal mask. If you just want to change the mask - without looking at it, pass a null pointer as the OLDSET argument. - Similarly, if you want to know what's in the mask without changing - it, pass a null pointer for SET (in this case the HOW argument is - not significant). The OLDSET argument is often used to remember - the previous signal mask in order to restore it later. (Since the - signal mask is inherited over `fork' and `exec' calls, you can't - predict what its contents are when your program starts running.) - - If invoking `sigprocmask' causes any pending signals to be - unblocked, at least one of those signals is delivered to the - process before `sigprocmask' returns. The order in which pending - signals are delivered is not specified, but you can control the - order explicitly by making multiple `sigprocmask' calls to unblock - various signals one at a time. - - The `sigprocmask' function returns `0' if successful, and `-1' to - indicate an error. The following `errno' error conditions are - defined for this function: - - `EINVAL' - The HOW argument is invalid. - - You can't block the `SIGKILL' and `SIGSTOP' signals, but if the - signal set includes these, `sigprocmask' just ignores them instead - of returning an error status. - - Remember, too, that blocking program error signals such as `SIGFPE' - leads to undesirable results for signals generated by an actual - program error (as opposed to signals sent with `raise' or `kill'). - This is because your program may be too broken to be able to - continue executing to a point where the signal is unblocked again. - *Note Program Error Signals::. - - -File: libc.info, Node: Testing for Delivery, Next: Blocking for Handler, Prev: Process Signal Mask, Up: Blocking Signals - -Blocking to Test for Delivery of a Signal ------------------------------------------ - - Now for a simple example. Suppose you establish a handler for -`SIGALRM' signals that sets a flag whenever a signal arrives, and your -main program checks this flag from time to time and then resets it. -You can prevent additional `SIGALRM' signals from arriving in the -meantime by wrapping the critical part of the code with calls to -`sigprocmask', like this: - - /* This variable is set by the SIGALRM signal handler. */ - volatile sig_atomic_t flag = 0; - - int - main (void) - { - sigset_t block_alarm; - - ... - - /* Initialize the signal mask. */ - sigemptyset (&block_alarm); - sigaddset (&block_alarm, SIGALRM); - while (1) - { - /* Check if a signal has arrived; if so, reset the flag. */ - sigprocmask (SIG_BLOCK, &block_alarm, NULL); - if (flag) - { - ACTIONS-IF-NOT-ARRIVED - flag = 0; - } - sigprocmask (SIG_UNBLOCK, &block_alarm, NULL); - - ... - } - } - - -File: libc.info, Node: Blocking for Handler, Next: Checking for Pending Signals, Prev: Testing for Delivery, Up: Blocking Signals - -Blocking Signals for a Handler ------------------------------- - - When a signal handler is invoked, you usually want it to be able to -finish without being interrupted by another signal. From the moment the -handler starts until the moment it finishes, you must block signals that -might confuse it or corrupt its data. - - When a handler function is invoked on a signal, that signal is -automatically blocked (in addition to any other signals that are already -in the process's signal mask) during the time the handler is running. -If you set up a handler for `SIGTSTP', for instance, then the arrival -of that signal forces further `SIGTSTP' signals to wait during the -execution of the handler. - - However, by default, other kinds of signals are not blocked; they can -arrive during handler execution. - - The reliable way to block other kinds of signals during the -execution of the handler is to use the `sa_mask' member of the -`sigaction' structure. - - Here is an example: - - #include - #include - - void catch_stop (); - - void - install_handler (void) - { - struct sigaction setup_action; - sigset_t block_mask; - - sigemptyset (&block_mask); - /* Block other terminal-generated signals while handler runs. */ - sigaddset (&block_mask, SIGINT); - sigaddset (&block_mask, SIGQUIT); - setup_action.sa_handler = catch_stop; - setup_action.sa_mask = block_mask; - setup_action.sa_flags = 0; - sigaction (SIGTSTP, &setup_action, NULL); - } - - This is more reliable than blocking the other signals explicitly in -the code for the handler. If you block signals explicitly in the -handler, you can't avoid at least a short interval at the beginning of -the handler where they are not yet blocked. - - You cannot remove signals from the process's current mask using this -mechanism. However, you can make calls to `sigprocmask' within your -handler to block or unblock signals as you wish. - - In any case, when the handler returns, the system restores the mask -that was in place before the handler was entered. If any signals that -become unblocked by this restoration are pending, the process will -receive those signals immediately, before returning to the code that was -interrupted. - - -File: libc.info, Node: Checking for Pending Signals, Next: Remembering a Signal, Prev: Blocking for Handler, Up: Blocking Signals - -Checking for Pending Signals ----------------------------- - - You can find out which signals are pending at any time by calling -`sigpending'. This function is declared in `signal.h'. - - - Function: int sigpending (sigset_t *SET) - The `sigpending' function stores information about pending signals - in SET. If there is a pending signal that is blocked from - delivery, then that signal is a member of the returned set. (You - can test whether a particular signal is a member of this set using - `sigismember'; see *Note Signal Sets::.) - - The return value is `0' if successful, and `-1' on failure. - - Testing whether a signal is pending is not often useful. Testing -when that signal is not blocked is almost certainly bad design. - - Here is an example. - - #include - #include - - sigset_t base_mask, waiting_mask; - - sigemptyset (&base_mask); - sigaddset (&base_mask, SIGINT); - sigaddset (&base_mask, SIGTSTP); - - /* Block user interrupts while doing other processing. */ - sigprocmask (SIG_SETMASK, &base_mask, NULL); - ... - - /* After a while, check to see whether any signals are pending. */ - sigpending (&waiting_mask); - if (sigismember (&waiting_mask, SIGINT)) { - /* User has tried to kill the process. */ - } - else if (sigismember (&waiting_mask, SIGTSTP)) { - /* User has tried to stop the process. */ - } - - Remember that if there is a particular signal pending for your -process, additional signals of that same type that arrive in the -meantime might be discarded. For example, if a `SIGINT' signal is -pending when another `SIGINT' signal arrives, your program will -probably only see one of them when you unblock this signal. - - *Portability Note:* The `sigpending' function is new in POSIX.1. -Older systems have no equivalent facility. diff -durpN glibc-2.0.4/manual/libc.info-22 glibc-2.0.5/manual/libc.info-22 --- glibc-2.0.4/manual/libc.info-22 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-22 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,453 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Kill Example, Prev: Permission for kill, Up: Generating Signals + +Using `kill' for Communication +------------------------------ + + Here is a longer example showing how signals can be used for +interprocess communication. This is what the `SIGUSR1' and `SIGUSR2' +signals are provided for. Since these signals are fatal by default, +the process that is supposed to receive them must trap them through +`signal' or `sigaction'. + + In this example, a parent process forks a child process and then +waits for the child to complete its initialization. The child process +tells the parent when it is ready by sending it a `SIGUSR1' signal, +using the `kill' function. + + #include + #include + #include + #include + + /* When a `SIGUSR1' signal arrives, set this variable. */ + volatile sig_atomic_t usr_interrupt = 0; + + void + synch_signal (int sig) + { + usr_interrupt = 1; + } + + /* The child process executes this function. */ + void + child_function (void) + { + /* Perform initialization. */ + printf ("I'm here!!! My pid is %d.\n", (int) getpid ()); + + /* Let parent know you're done. */ + kill (getppid (), SIGUSR1); + + /* Continue with execution. */ + puts ("Bye, now...."); + exit (0); + } + + int + main (void) + { + struct sigaction usr_action; + sigset_t block_mask; + pid_t child_id; + + /* Establish the signal handler. */ + sigfillset (&block_mask); + usr_action.sa_handler = synch_signal; + usr_action.sa_mask = block_mask; + usr_action.sa_flags = 0; + sigaction (SIGUSR1, &usr_action, NULL); + + /* Create the child process. */ + child_id = fork (); + if (child_id == 0) + child_function (); /* Does not return. */ + /* Busy wait for the child to send a signal. */ + while (!usr_interrupt) + ; + + /* Now continue execution. */ + puts ("That's all, folks!"); + + return 0; + } + + This example uses a busy wait, which is bad, because it wastes CPU +cycles that other programs could otherwise use. It is better to ask the +system to wait until the signal arrives. See the example in *Note +Waiting for a Signal::. + + +File: libc.info, Node: Blocking Signals, Next: Waiting for a Signal, Prev: Generating Signals, Up: Signal Handling + +Blocking Signals +================ + + Blocking a signal means telling the operating system to hold it and +deliver it later. Generally, a program does not block signals +indefinitely--it might as well ignore them by setting their actions to +`SIG_IGN'. But it is useful to block signals briefly, to prevent them +from interrupting sensitive operations. For instance: + + * You can use the `sigprocmask' function to block signals while you + modify global variables that are also modified by the handlers for + these signals. + + * You can set `sa_mask' in your `sigaction' call to block certain + signals while a particular signal handler runs. This way, the + signal handler can run without being interrupted itself by signals. + +* Menu: + +* 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. + + +File: libc.info, Node: Why Block, Next: Signal Sets, Up: Blocking Signals + +Why Blocking Signals is Useful +------------------------------ + + Temporary blocking of signals with `sigprocmask' gives you a way to +prevent interrupts during critical parts of your code. If signals +arrive in that part of the program, they are delivered later, after you +unblock them. + + One example where this is useful is for sharing data between a signal +handler and the rest of the program. If the type of the data is not +`sig_atomic_t' (*note Atomic Data Access::.), then the signal handler +could run when the rest of the program has only half finished reading +or writing the data. This would lead to confusing consequences. + + To make the program reliable, you can prevent the signal handler from +running while the rest of the program is examining or modifying that +data--by blocking the appropriate signal around the parts of the +program that touch the data. + + Blocking signals is also necessary when you want to perform a certain +action only if a signal has not arrived. Suppose that the handler for +the signal sets a flag of type `sig_atomic_t'; you would like to test +the flag and perform the action if the flag is not set. This is +unreliable. Suppose the signal is delivered immediately after you test +the flag, but before the consequent action: then the program will +perform the action even though the signal has arrived. + + The only way to test reliably for whether a signal has yet arrived +is to test while the signal is blocked. + + +File: libc.info, Node: Signal Sets, Next: Process Signal Mask, Prev: Why Block, Up: Blocking Signals + +Signal Sets +----------- + + All of the signal blocking functions use a data structure called a +"signal set" to specify what signals are affected. Thus, every +activity involves two stages: creating the signal set, and then passing +it as an argument to a library function. + + These facilities are declared in the header file `signal.h'. + + - Data Type: sigset_t + The `sigset_t' data type is used to represent a signal set. + Internally, it may be implemented as either an integer or structure + type. + + For portability, use only the functions described in this section + to initialize, change, and retrieve information from `sigset_t' + objects--don't try to manipulate them directly. + + There are two ways to initialize a signal set. You can initially +specify it to be empty with `sigemptyset' and then add specified +signals individually. Or you can specify it to be full with +`sigfillset' and then delete specified signals individually. + + You must always initialize the signal set with one of these two +functions before using it in any other way. Don't try to set all the +signals explicitly because the `sigset_t' object might include some +other information (like a version field) that needs to be initialized as +well. (In addition, it's not wise to put into your program an +assumption that the system has no signals aside from the ones you know +about.) + + - Function: int sigemptyset (sigset_t *SET) + This function initializes the signal set SET to exclude all of the + defined signals. It always returns `0'. + + - Function: int sigfillset (sigset_t *SET) + This function initializes the signal set SET to include all of the + defined signals. Again, the return value is `0'. + + - Function: int sigaddset (sigset_t *SET, int SIGNUM) + This function adds the signal SIGNUM to the signal set SET. All + `sigaddset' does is modify SET; it does not block or unblock any + signals. + + The return value is `0' on success and `-1' on failure. The + following `errno' error condition is defined for this function: + + `EINVAL' + The SIGNUM argument doesn't specify a valid signal. + + - Function: int sigdelset (sigset_t *SET, int SIGNUM) + This function removes the signal SIGNUM from the signal set SET. + All `sigdelset' does is modify SET; it does not block or unblock + any signals. The return value and error conditions are the same + as for `sigaddset'. + + Finally, there is a function to test what signals are in a signal +set: + + - Function: int sigismember (const sigset_t *SET, int SIGNUM) + The `sigismember' function tests whether the signal SIGNUM is a + member of the signal set SET. It returns `1' if the signal is in + the set, `0' if not, and `-1' if there is an error. + + The following `errno' error condition is defined for this function: + + `EINVAL' + The SIGNUM argument doesn't specify a valid signal. + + +File: libc.info, Node: Process Signal Mask, Next: Testing for Delivery, Prev: Signal Sets, Up: Blocking Signals + +Process Signal Mask +------------------- + + The collection of signals that are currently blocked is called the +"signal mask". Each process has its own signal mask. When you create +a new process (*note Creating a Process::.), it inherits its parent's +mask. You can block or unblock signals with total flexibility by +modifying the signal mask. + + The prototype for the `sigprocmask' function is in `signal.h'. + + - Function: int sigprocmask (int HOW, const sigset_t *SET, sigset_t + *OLDSET) + The `sigprocmask' function is used to examine or change the calling + process's signal mask. The HOW argument determines how the signal + mask is changed, and must be one of the following values: + + `SIG_BLOCK' + Block the signals in `set'--add them to the existing mask. In + other words, the new mask is the union of the existing mask + and SET. + + `SIG_UNBLOCK' + Unblock the signals in SET--remove them from the existing + mask. + + `SIG_SETMASK' + Use SET for the mask; ignore the previous value of the mask. + + The last argument, OLDSET, is used to return information about the + old process signal mask. If you just want to change the mask + without looking at it, pass a null pointer as the OLDSET argument. + Similarly, if you want to know what's in the mask without changing + it, pass a null pointer for SET (in this case the HOW argument is + not significant). The OLDSET argument is often used to remember + the previous signal mask in order to restore it later. (Since the + signal mask is inherited over `fork' and `exec' calls, you can't + predict what its contents are when your program starts running.) + + If invoking `sigprocmask' causes any pending signals to be + unblocked, at least one of those signals is delivered to the + process before `sigprocmask' returns. The order in which pending + signals are delivered is not specified, but you can control the + order explicitly by making multiple `sigprocmask' calls to unblock + various signals one at a time. + + The `sigprocmask' function returns `0' if successful, and `-1' to + indicate an error. The following `errno' error conditions are + defined for this function: + + `EINVAL' + The HOW argument is invalid. + + You can't block the `SIGKILL' and `SIGSTOP' signals, but if the + signal set includes these, `sigprocmask' just ignores them instead + of returning an error status. + + Remember, too, that blocking program error signals such as `SIGFPE' + leads to undesirable results for signals generated by an actual + program error (as opposed to signals sent with `raise' or `kill'). + This is because your program may be too broken to be able to + continue executing to a point where the signal is unblocked again. + *Note Program Error Signals::. + + +File: libc.info, Node: Testing for Delivery, Next: Blocking for Handler, Prev: Process Signal Mask, Up: Blocking Signals + +Blocking to Test for Delivery of a Signal +----------------------------------------- + + Now for a simple example. Suppose you establish a handler for +`SIGALRM' signals that sets a flag whenever a signal arrives, and your +main program checks this flag from time to time and then resets it. +You can prevent additional `SIGALRM' signals from arriving in the +meantime by wrapping the critical part of the code with calls to +`sigprocmask', like this: + + /* This variable is set by the SIGALRM signal handler. */ + volatile sig_atomic_t flag = 0; + + int + main (void) + { + sigset_t block_alarm; + + ... + + /* Initialize the signal mask. */ + sigemptyset (&block_alarm); + sigaddset (&block_alarm, SIGALRM); + while (1) + { + /* Check if a signal has arrived; if so, reset the flag. */ + sigprocmask (SIG_BLOCK, &block_alarm, NULL); + if (flag) + { + ACTIONS-IF-NOT-ARRIVED + flag = 0; + } + sigprocmask (SIG_UNBLOCK, &block_alarm, NULL); + + ... + } + } + + +File: libc.info, Node: Blocking for Handler, Next: Checking for Pending Signals, Prev: Testing for Delivery, Up: Blocking Signals + +Blocking Signals for a Handler +------------------------------ + + When a signal handler is invoked, you usually want it to be able to +finish without being interrupted by another signal. From the moment the +handler starts until the moment it finishes, you must block signals that +might confuse it or corrupt its data. + + When a handler function is invoked on a signal, that signal is +automatically blocked (in addition to any other signals that are already +in the process's signal mask) during the time the handler is running. +If you set up a handler for `SIGTSTP', for instance, then the arrival +of that signal forces further `SIGTSTP' signals to wait during the +execution of the handler. + + However, by default, other kinds of signals are not blocked; they can +arrive during handler execution. + + The reliable way to block other kinds of signals during the +execution of the handler is to use the `sa_mask' member of the +`sigaction' structure. + + Here is an example: + + #include + #include + + void catch_stop (); + + void + install_handler (void) + { + struct sigaction setup_action; + sigset_t block_mask; + + sigemptyset (&block_mask); + /* Block other terminal-generated signals while handler runs. */ + sigaddset (&block_mask, SIGINT); + sigaddset (&block_mask, SIGQUIT); + setup_action.sa_handler = catch_stop; + setup_action.sa_mask = block_mask; + setup_action.sa_flags = 0; + sigaction (SIGTSTP, &setup_action, NULL); + } + + This is more reliable than blocking the other signals explicitly in +the code for the handler. If you block signals explicitly in the +handler, you can't avoid at least a short interval at the beginning of +the handler where they are not yet blocked. + + You cannot remove signals from the process's current mask using this +mechanism. However, you can make calls to `sigprocmask' within your +handler to block or unblock signals as you wish. + + In any case, when the handler returns, the system restores the mask +that was in place before the handler was entered. If any signals that +become unblocked by this restoration are pending, the process will +receive those signals immediately, before returning to the code that was +interrupted. + + +File: libc.info, Node: Checking for Pending Signals, Next: Remembering a Signal, Prev: Blocking for Handler, Up: Blocking Signals + +Checking for Pending Signals +---------------------------- + + You can find out which signals are pending at any time by calling +`sigpending'. This function is declared in `signal.h'. + + - Function: int sigpending (sigset_t *SET) + The `sigpending' function stores information about pending signals + in SET. If there is a pending signal that is blocked from + delivery, then that signal is a member of the returned set. (You + can test whether a particular signal is a member of this set using + `sigismember'; see *Note Signal Sets::.) + + The return value is `0' if successful, and `-1' on failure. + + Testing whether a signal is pending is not often useful. Testing +when that signal is not blocked is almost certainly bad design. + + Here is an example. + + #include + #include + + sigset_t base_mask, waiting_mask; + + sigemptyset (&base_mask); + sigaddset (&base_mask, SIGINT); + sigaddset (&base_mask, SIGTSTP); + + /* Block user interrupts while doing other processing. */ + sigprocmask (SIG_SETMASK, &base_mask, NULL); + ... + + /* After a while, check to see whether any signals are pending. */ + sigpending (&waiting_mask); + if (sigismember (&waiting_mask, SIGINT)) { + /* User has tried to kill the process. */ + } + else if (sigismember (&waiting_mask, SIGTSTP)) { + /* User has tried to stop the process. */ + } + + Remember that if there is a particular signal pending for your +process, additional signals of that same type that arrive in the +meantime might be discarded. For example, if a `SIGINT' signal is +pending when another `SIGINT' signal arrives, your program will +probably only see one of them when you unblock this signal. + + *Portability Note:* The `sigpending' function is new in POSIX.1. +Older systems have no equivalent facility. + + File: libc.info, Node: Remembering a Signal, Prev: Checking for Pending Signals, Up: Blocking Signals Remembering a Signal to Act On Later @@ -360,6 +812,7 @@ the specific machine and operating syste `sigaltstack' fails, it sets `errno' to one of these values: `' + `EINVAL' You tried to disable a stack that was in fact currently in use. @@ -686,7 +1139,7 @@ use this facility, your program must inc unknown option character or an option with a missing required argument. This is the default behavior. If you set this variable to zero, `getopt' does not print any messages, but it still - returns the character `?' to indicate an error. + returns the character `?' to indicate an error. - Variable: int optopt When `getopt' encounters an unknown option character or an option @@ -738,510 +1191,4 @@ use this facility, your program must inc option argument. In addition, if the external variable `opterr' is nonzero (which is the default), `getopt' prints an error message. - - -File: libc.info, Node: Example of Getopt, Next: Long Options, Prev: Parsing Options, Up: Program Arguments - -Example of Parsing Arguments with `getopt' ------------------------------------------- - - Here is an example showing how `getopt' is typically used. The key -points to notice are: - - * Normally, `getopt' is called in a loop. When `getopt' returns - `-1', indicating no more options are present, the loop terminates. - - * A `switch' statement is used to dispatch on the return value from - `getopt'. In typical use, each case just sets a variable that is - used later in the program. - - * A second loop is used to process the remaining non-option - arguments. - - #include - #include - - int - main (int argc, char **argv) - { - int aflag = 0; - int bflag = 0; - char *cvalue = NULL; - int index; - int c; - - opterr = 0; - - while ((c = getopt (argc, argv, "abc:")) != -1) - switch (c) - { - case 'a': - aflag = 1; - break; - case 'b': - bflag = 1; - break; - case 'c': - cvalue = optarg; - break; - case '?': - if (isprint (optopt)) - fprintf (stderr, "Unknown option `-%c'.\n", optopt); - else - fprintf (stderr, - "Unknown option character `\\x%x'.\n", - optopt); - return 1; - default: - abort (); - } - - printf ("aflag = %d, bflag = %d, cvalue = %s\n", aflag, bflag, cvalue); - - for (index = optind; index < argc; index++) - printf ("Non-option argument %s\n", argv[index]); - return 0; - } - - Here are some examples showing what this program prints with -different combinations of arguments: - - % testopt - aflag = 0, bflag = 0, cvalue = (null) - - % testopt -a -b - aflag = 1, bflag = 1, cvalue = (null) - - % testopt -ab - aflag = 1, bflag = 1, cvalue = (null) - - % testopt -c foo - aflag = 0, bflag = 0, cvalue = foo - - % testopt -cfoo - aflag = 0, bflag = 0, cvalue = foo - - % testopt arg1 - aflag = 0, bflag = 0, cvalue = (null) - Non-option argument arg1 - - % testopt -a arg1 - aflag = 1, bflag = 0, cvalue = (null) - Non-option argument arg1 - - % testopt -c foo arg1 - aflag = 0, bflag = 0, cvalue = foo - Non-option argument arg1 - - % testopt -a -- -b - aflag = 1, bflag = 0, cvalue = (null) - Non-option argument -b - - % testopt -a - - aflag = 1, bflag = 0, cvalue = (null) - Non-option argument - - - -File: libc.info, Node: Long Options, Next: Long Option Example, Prev: Example of Getopt, Up: Program Arguments - -Parsing Long Options --------------------- - - To accept GNU-style long options as well as single-character options, -use `getopt_long' instead of `getopt'. This function is declared in -`getopt.h', not `unistd.h'. You should make every program accept long -options if it uses any options, for this takes little extra work and -helps beginners remember how to use the program. - - - Data Type: struct option - This structure describes a single long option name for the sake of - `getopt_long'. The argument LONGOPTS must be an array of these - structures, one for each long option. Terminate the array with an - element containing all zeros. - - The `struct option' structure has these fields: - - `const char *name' - This field is the name of the option. It is a string. - - `int has_arg' - This field says whether the option takes an argument. It is - an integer, and there are three legitimate values: - `no_argument', `required_argument' and `optional_argument'. - - `int *flag' - `int val' - These fields control how to report or act on the option when - it occurs. - - If `flag' is a null pointer, then the `val' is a value which - identifies this option. Often these values are chosen to - uniquely identify particular long options. - - If `flag' is not a null pointer, it should be the address of - an `int' variable which is the flag for this option. The - value in `val' is the value to store in the flag to indicate - that the option was seen. - - - Function: int getopt_long (int ARGC, char **ARGV, const char - *SHORTOPTS, struct option *LONGOPTS, int *INDEXPTR) - Decode options from the vector ARGV (whose length is ARGC). The - argument SHORTOPTS describes the short options to accept, just as - it does in `getopt'. The argument LONGOPTS describes the long - options to accept (see above). - - When `getopt_long' encounters a short option, it does the same - thing that `getopt' would do: it returns the character code for the - option, and stores the options argument (if it has one) in - `optarg'. - - When `getopt_long' encounters a long option, it takes actions based - on the `flag' and `val' fields of the definition of that option. - - If `flag' is a null pointer, then `getopt_long' returns the - contents of `val' to indicate which option it found. You should - arrange distinct values in the `val' field for options with - different meanings, so you can decode these values after - `getopt_long' returns. If the long option is equivalent to a short - option, you can use the short option's character code in `val'. - - If `flag' is not a null pointer, that means this option should just - set a flag in the program. The flag is a variable of type `int' - that you define. Put the address of the flag in the `flag' field. - Put in the `val' field the value you would like this option to - store in the flag. In this case, `getopt_long' returns `0'. - - For any long option, `getopt_long' tells you the index in the array - LONGOPTS of the options definition, by storing it into - `*INDEXPTR'. You can get the name of the option with - `LONGOPTS[*INDEXPTR].name'. So you can distinguish among long - options either by the values in their `val' fields or by their - indices. You can also distinguish in this way among long options - that set flags. - - When a long option has an argument, `getopt_long' puts the argument - value in the variable `optarg' before returning. When the option - has no argument, the value in `optarg' is a null pointer. This is - how you can tell whether an optional argument was supplied. - - When `getopt_long' has no more options to handle, it returns `-1', - and leaves in the variable `optind' the index in ARGV of the next - remaining argument. - - -File: libc.info, Node: Long Option Example, Next: Suboptions, Prev: Long Options, Up: Program Arguments - -Example of Parsing Long Options -------------------------------- - - #include - #include - #include - - /* Flag set by `--verbose'. */ - static int verbose_flag; - - int - main (argc, argv) - int argc; - char **argv; - { - int c; - - while (1) - { - static struct option long_options[] = - { - /* These options set a flag. */ - {"verbose", 0, &verbose_flag, 1}, - {"brief", 0, &verbose_flag, 0}, - /* These options don't set a flag. - We distinguish them by their indices. */ - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - /* `getopt_long' stores the option index here. */ - int option_index = 0; - - c = getopt_long (argc, argv, "abc:d:", - long_options, &option_index); - - /* Detect the end of the options. */ - if (c == -1) - break; - - switch (c) - { - case 0: - /* If this option set a flag, do nothing else now. */ - if (long_options[option_index].flag != 0) - break; - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case 'a': - puts ("option -a\n"); - break; - - case 'b': - puts ("option -b\n"); - break; - - case 'c': - printf ("option -c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option -d with value `%s'\n", optarg); - break; - - case '?': - /* `getopt_long' already printed an error message. */ - break; - - default: - abort (); - } - } - - /* Instead of reporting `--verbose' - and `--brief' as they are encountered, - we report the final status resulting from them. */ - if (verbose_flag) - puts ("verbose flag is set"); - - /* Print any remaining command line arguments (not options). */ - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - putchar ('\n'); - } - - exit (0); - } - - -File: libc.info, Node: Suboptions, Next: Suboptions Example, Prev: Long Option Example, Up: Program Arguments - -Parsing of Suboptions ---------------------- - - Having a single level of options is sometimes not enough. There -might be too many options which have to be available or a set of -options is closely related. - - For this case some programs use suboptions. One of the most -prominent programs is certainly `mount'(8). The `-o' option take one -argument which itself is a comma separated list of options. To ease the -programming of code like this the function `getsubopt' is available. - - - Function: int getsubopt (char **OPTIONP, const char* const *TOKENS, - char **VALUEP) - The OPTIONP parameter must be a pointer to a variable containing - the address of the string to process. When the function returns - the reference is updated to point to the next suboption or to the - terminating `\0' character if there is no more suboption available. - - The TOKENS parameter references an array of strings containing the - known suboptions. All strings must be `\0' terminated and to mark - the end a null pointer must be stored. When `getsubopt' finds a - possible legal suboption it compares it with all strings available - in the TOKENS array and returns the index in the string as the - indicator. - - In case the suboption has an associated value introduced by a `=' - character, a pointer to the value is returned in VALUEP. The - string is `\0' terminated. If no argument is available VALUEP is - set to the null pointer. By doing this the caller can check - whether a necessary value is given or whether no unexpected value - is present. - - In case the next suboption in the string is not mentioned in the - TOKENS array the starting address of the suboption including a - possible value is returned in VALUEP and the return value of the - function is `-1'. - - -File: libc.info, Node: Suboptions Example, Prev: Suboptions, Up: Program Arguments - -Parsing of Suboptions Example ------------------------------ - - The code which might appear in the `mount'(8) program is a perfect -example of the use of `getsubopt': - - #include - #include - - int do_all; - const char *type; - int read_size; - int write_size; - int read_only; - - enum - { - RO_OPTION = 0, - RW_OPTION, - READ_SIZE_OPTION, - WRITE_SIZE_OPTION - }; - - const char *mount_opts[] = - { - [RO_OPTION] = "ro", - [RW_OPTION] = "rw", - [READ_SIZE_OPTION] = "rsize", - [WRITE_SIZE_OPTION] = "wsize" - }; - - int - main (int argc, char *argv[]) - { - char *subopts, *value; - int opt; - - while ((opt = getopt (argc, argv, "at:o:")) != -1) - switch (opt) - { - case 'a': - do_all = 1; - break; - case 't': - type = optarg; - break; - case 'o': - subopts = optarg; - while (*subopts != '\0') - switch (getsubopt (&subopts, mount_opts, &value)) - { - case RO_OPTION: - read_only = 1; - break; - case RW_OPTION: - read_only = 0; - break; - case READ_SIZE_OPTION: - if (value == NULL) - abort (); - read_size = atoi (value); - break; - case WRITE_SIZE_OPTION: - if (value == NULL) - abort (); - write_size = atoi (value); - break; - default: - /* Unknown suboption. */ - printf ("Unknown suboption `%s'\n", value); - break; - } - break; - default: - abort (); - } - - /* Do the real work. */ - - return 0; - } - - -File: libc.info, Node: Environment Variables, Next: Program Termination, Prev: Program Arguments, Up: Process Startup - -Environment Variables -===================== - - When a program is executed, it receives information about the -context in which it was invoked in two ways. The first mechanism uses -the ARGV and ARGC arguments to its `main' function, and is discussed in -*Note Program Arguments::. The second mechanism uses "environment -variables" and is discussed in this section. - - The ARGV mechanism is typically used to pass command-line arguments -specific to the particular program being invoked. The environment, on -the other hand, keeps track of information that is shared by many -programs, changes infrequently, and that is less frequently used. - - The environment variables discussed in this section are the same -environment variables that you set using assignments and the `export' -command in the shell. Programs executed from the shell inherit all of -the environment variables from the shell. - - Standard environment variables are used for information about the -user's home directory, terminal type, current locale, and so on; you -can define additional variables for other purposes. The set of all -environment variables that have values is collectively known as the -"environment". - - Names of environment variables are case-sensitive and must not -contain the character `='. System-defined environment variables are -invariably uppercase. - - The values of environment variables can be anything that can be -represented as a string. A value must not contain an embedded null -character, since this is assumed to terminate the string. - -* Menu: - -* Environment Access:: How to get and set the values of - environment variables. -* Standard Environment:: These environment variables have - standard interpretations. - - -File: libc.info, Node: Environment Access, Next: Standard Environment, Up: Environment Variables - -Environment Access ------------------- - - The value of an environment variable can be accessed with the -`getenv' function. This is declared in the header file `stdlib.h'. - - - Function: char * getenv (const char *NAME) - This function returns a string that is the value of the environment - variable NAME. You must not modify this string. In some non-Unix - systems not using the GNU library, it might be overwritten by - subsequent calls to `getenv' (but not by any other library - function). If the environment variable NAME is not defined, the - value is a null pointer. - - - Function: int putenv (const char *STRING) - The `putenv' function adds or removes definitions from the - environment. If the STRING is of the form `NAME=VALUE', the - definition is added to the environment. Otherwise, the STRING is - interpreted as the name of an environment variable, and any - definition for this variable in the environment is removed. - - The GNU library provides this function for compatibility with - SVID; it may not be available in other systems. - - You can deal directly with the underlying representation of -environment objects to add more variables to the environment (for -example, to communicate with another program you are about to execute; -see *Note Executing a File::). - - - Variable: char ** environ - The environment is represented as an array of strings. Each - string is of the format `NAME=VALUE'. The order in which strings - appear in the environment is not significant, but the same NAME - must not appear more than once. The last element of the array is - a null pointer. - - This variable is declared in the header file `unistd.h'. - - If you just want to get the value of an environment variable, use - `getenv'. - - Unix systems, and the GNU system, pass the initial value of -`environ' as the third argument to `main'. *Note Program Arguments::. diff -durpN glibc-2.0.4/manual/libc.info-23 glibc-2.0.5/manual/libc.info-23 --- glibc-2.0.4/manual/libc.info-23 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-23 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,512 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Example of Getopt, Next: Long Options, Prev: Parsing Options, Up: Program Arguments + +Example of Parsing Arguments with `getopt' +------------------------------------------ + + Here is an example showing how `getopt' is typically used. The key +points to notice are: + + * Normally, `getopt' is called in a loop. When `getopt' returns + `-1', indicating no more options are present, the loop terminates. + + * A `switch' statement is used to dispatch on the return value from + `getopt'. In typical use, each case just sets a variable that is + used later in the program. + + * A second loop is used to process the remaining non-option + arguments. + + #include + #include + + int + main (int argc, char **argv) + { + int aflag = 0; + int bflag = 0; + char *cvalue = NULL; + int index; + int c; + + opterr = 0; + + while ((c = getopt (argc, argv, "abc:")) != -1) + switch (c) + { + case 'a': + aflag = 1; + break; + case 'b': + bflag = 1; + break; + case 'c': + cvalue = optarg; + break; + case '?': + if (isprint (optopt)) + fprintf (stderr, "Unknown option `-%c'.\n", optopt); + else + fprintf (stderr, + "Unknown option character `\\x%x'.\n", + optopt); + return 1; + default: + abort (); + } + + printf ("aflag = %d, bflag = %d, cvalue = %s\n", aflag, bflag, cvalue); + + for (index = optind; index < argc; index++) + printf ("Non-option argument %s\n", argv[index]); + return 0; + } + + Here are some examples showing what this program prints with +different combinations of arguments: + + % testopt + aflag = 0, bflag = 0, cvalue = (null) + + % testopt -a -b + aflag = 1, bflag = 1, cvalue = (null) + + % testopt -ab + aflag = 1, bflag = 1, cvalue = (null) + + % testopt -c foo + aflag = 0, bflag = 0, cvalue = foo + + % testopt -cfoo + aflag = 0, bflag = 0, cvalue = foo + + % testopt arg1 + aflag = 0, bflag = 0, cvalue = (null) + Non-option argument arg1 + + % testopt -a arg1 + aflag = 1, bflag = 0, cvalue = (null) + Non-option argument arg1 + + % testopt -c foo arg1 + aflag = 0, bflag = 0, cvalue = foo + Non-option argument arg1 + + % testopt -a -- -b + aflag = 1, bflag = 0, cvalue = (null) + Non-option argument -b + + % testopt -a - + aflag = 1, bflag = 0, cvalue = (null) + Non-option argument - + + +File: libc.info, Node: Long Options, Next: Long Option Example, Prev: Example of Getopt, Up: Program Arguments + +Parsing Long Options +-------------------- + + To accept GNU-style long options as well as single-character options, +use `getopt_long' instead of `getopt'. This function is declared in +`getopt.h', not `unistd.h'. You should make every program accept long +options if it uses any options, for this takes little extra work and +helps beginners remember how to use the program. + + - Data Type: struct option + This structure describes a single long option name for the sake of + `getopt_long'. The argument LONGOPTS must be an array of these + structures, one for each long option. Terminate the array with an + element containing all zeros. + + The `struct option' structure has these fields: + + `const char *name' + This field is the name of the option. It is a string. + + `int has_arg' + This field says whether the option takes an argument. It is + an integer, and there are three legitimate values: + `no_argument', `required_argument' and `optional_argument'. + + `int *flag' + `int val' + These fields control how to report or act on the option when + it occurs. + + If `flag' is a null pointer, then the `val' is a value which + identifies this option. Often these values are chosen to + uniquely identify particular long options. + + If `flag' is not a null pointer, it should be the address of + an `int' variable which is the flag for this option. The + value in `val' is the value to store in the flag to indicate + that the option was seen. + + - Function: int getopt_long (int ARGC, char **ARGV, const char + *SHORTOPTS, struct option *LONGOPTS, int *INDEXPTR) + Decode options from the vector ARGV (whose length is ARGC). The + argument SHORTOPTS describes the short options to accept, just as + it does in `getopt'. The argument LONGOPTS describes the long + options to accept (see above). + + When `getopt_long' encounters a short option, it does the same + thing that `getopt' would do: it returns the character code for the + option, and stores the options argument (if it has one) in + `optarg'. + + When `getopt_long' encounters a long option, it takes actions based + on the `flag' and `val' fields of the definition of that option. + + If `flag' is a null pointer, then `getopt_long' returns the + contents of `val' to indicate which option it found. You should + arrange distinct values in the `val' field for options with + different meanings, so you can decode these values after + `getopt_long' returns. If the long option is equivalent to a short + option, you can use the short option's character code in `val'. + + If `flag' is not a null pointer, that means this option should just + set a flag in the program. The flag is a variable of type `int' + that you define. Put the address of the flag in the `flag' field. + Put in the `val' field the value you would like this option to + store in the flag. In this case, `getopt_long' returns `0'. + + For any long option, `getopt_long' tells you the index in the array + LONGOPTS of the options definition, by storing it into + `*INDEXPTR'. You can get the name of the option with + `LONGOPTS[*INDEXPTR].name'. So you can distinguish among long + options either by the values in their `val' fields or by their + indices. You can also distinguish in this way among long options + that set flags. + + When a long option has an argument, `getopt_long' puts the argument + value in the variable `optarg' before returning. When the option + has no argument, the value in `optarg' is a null pointer. This is + how you can tell whether an optional argument was supplied. + + When `getopt_long' has no more options to handle, it returns `-1', + and leaves in the variable `optind' the index in ARGV of the next + remaining argument. + + +File: libc.info, Node: Long Option Example, Next: Suboptions, Prev: Long Options, Up: Program Arguments + +Example of Parsing Long Options +------------------------------- + + #include + #include + #include + + /* Flag set by `--verbose'. */ + static int verbose_flag; + + int + main (argc, argv) + int argc; + char **argv; + { + int c; + + while (1) + { + static struct option long_options[] = + { + /* These options set a flag. */ + {"verbose", 0, &verbose_flag, 1}, + {"brief", 0, &verbose_flag, 0}, + /* These options don't set a flag. + We distinguish them by their indices. */ + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + /* `getopt_long' stores the option index here. */ + int option_index = 0; + + c = getopt_long (argc, argv, "abc:d:", + long_options, &option_index); + + /* Detect the end of the options. */ + if (c == -1) + break; + + switch (c) + { + case 0: + /* If this option set a flag, do nothing else now. */ + if (long_options[option_index].flag != 0) + break; + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case 'a': + puts ("option -a\n"); + break; + + case 'b': + puts ("option -b\n"); + break; + + case 'c': + printf ("option -c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option -d with value `%s'\n", optarg); + break; + + case '?': + /* `getopt_long' already printed an error message. */ + break; + + default: + abort (); + } + } + + /* Instead of reporting `--verbose' + and `--brief' as they are encountered, + we report the final status resulting from them. */ + if (verbose_flag) + puts ("verbose flag is set"); + + /* Print any remaining command line arguments (not options). */ + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + putchar ('\n'); + } + + exit (0); + } + + +File: libc.info, Node: Suboptions, Next: Suboptions Example, Prev: Long Option Example, Up: Program Arguments + +Parsing of Suboptions +--------------------- + + Having a single level of options is sometimes not enough. There +might be too many options which have to be available or a set of +options is closely related. + + For this case some programs use suboptions. One of the most +prominent programs is certainly `mount'(8). The `-o' option take one +argument which itself is a comma separated list of options. To ease the +programming of code like this the function `getsubopt' is available. + + - Function: int getsubopt (char **OPTIONP, const char* const *TOKENS, + char **VALUEP) + The OPTIONP parameter must be a pointer to a variable containing + the address of the string to process. When the function returns + the reference is updated to point to the next suboption or to the + terminating `\0' character if there is no more suboption available. + + The TOKENS parameter references an array of strings containing the + known suboptions. All strings must be `\0' terminated and to mark + the end a null pointer must be stored. When `getsubopt' finds a + possible legal suboption it compares it with all strings available + in the TOKENS array and returns the index in the string as the + indicator. + + In case the suboption has an associated value introduced by a `=' + character, a pointer to the value is returned in VALUEP. The + string is `\0' terminated. If no argument is available VALUEP is + set to the null pointer. By doing this the caller can check + whether a necessary value is given or whether no unexpected value + is present. + + In case the next suboption in the string is not mentioned in the + TOKENS array the starting address of the suboption including a + possible value is returned in VALUEP and the return value of the + function is `-1'. + + +File: libc.info, Node: Suboptions Example, Prev: Suboptions, Up: Program Arguments + +Parsing of Suboptions Example +----------------------------- + + The code which might appear in the `mount'(8) program is a perfect +example of the use of `getsubopt': + + #include + #include + + int do_all; + const char *type; + int read_size; + int write_size; + int read_only; + + enum + { + RO_OPTION = 0, + RW_OPTION, + READ_SIZE_OPTION, + WRITE_SIZE_OPTION + }; + + const char *mount_opts[] = + { + [RO_OPTION] = "ro", + [RW_OPTION] = "rw", + [READ_SIZE_OPTION] = "rsize", + [WRITE_SIZE_OPTION] = "wsize" + }; + + int + main (int argc, char *argv[]) + { + char *subopts, *value; + int opt; + + while ((opt = getopt (argc, argv, "at:o:")) != -1) + switch (opt) + { + case 'a': + do_all = 1; + break; + case 't': + type = optarg; + break; + case 'o': + subopts = optarg; + while (*subopts != '\0') + switch (getsubopt (&subopts, mount_opts, &value)) + { + case RO_OPTION: + read_only = 1; + break; + case RW_OPTION: + read_only = 0; + break; + case READ_SIZE_OPTION: + if (value == NULL) + abort (); + read_size = atoi (value); + break; + case WRITE_SIZE_OPTION: + if (value == NULL) + abort (); + write_size = atoi (value); + break; + default: + /* Unknown suboption. */ + printf ("Unknown suboption `%s'\n", value); + break; + } + break; + default: + abort (); + } + + /* Do the real work. */ + + return 0; + } + + +File: libc.info, Node: Environment Variables, Next: Program Termination, Prev: Program Arguments, Up: Process Startup + +Environment Variables +===================== + + When a program is executed, it receives information about the +context in which it was invoked in two ways. The first mechanism uses +the ARGV and ARGC arguments to its `main' function, and is discussed in +*Note Program Arguments::. The second mechanism uses "environment +variables" and is discussed in this section. + + The ARGV mechanism is typically used to pass command-line arguments +specific to the particular program being invoked. The environment, on +the other hand, keeps track of information that is shared by many +programs, changes infrequently, and that is less frequently used. + + The environment variables discussed in this section are the same +environment variables that you set using assignments and the `export' +command in the shell. Programs executed from the shell inherit all of +the environment variables from the shell. + + Standard environment variables are used for information about the +user's home directory, terminal type, current locale, and so on; you +can define additional variables for other purposes. The set of all +environment variables that have values is collectively known as the +"environment". + + Names of environment variables are case-sensitive and must not +contain the character `='. System-defined environment variables are +invariably uppercase. + + The values of environment variables can be anything that can be +represented as a string. A value must not contain an embedded null +character, since this is assumed to terminate the string. + +* Menu: + +* Environment Access:: How to get and set the values of + environment variables. +* Standard Environment:: These environment variables have + standard interpretations. + + +File: libc.info, Node: Environment Access, Next: Standard Environment, Up: Environment Variables + +Environment Access +------------------ + + The value of an environment variable can be accessed with the +`getenv' function. This is declared in the header file `stdlib.h'. + + - Function: char * getenv (const char *NAME) + This function returns a string that is the value of the environment + variable NAME. You must not modify this string. In some non-Unix + systems not using the GNU library, it might be overwritten by + subsequent calls to `getenv' (but not by any other library + function). If the environment variable NAME is not defined, the + value is a null pointer. + + - Function: int putenv (const char *STRING) + The `putenv' function adds or removes definitions from the + environment. If the STRING is of the form `NAME=VALUE', the + definition is added to the environment. Otherwise, the STRING is + interpreted as the name of an environment variable, and any + definition for this variable in the environment is removed. + + The GNU library provides this function for compatibility with + SVID; it may not be available in other systems. + + You can deal directly with the underlying representation of +environment objects to add more variables to the environment (for +example, to communicate with another program you are about to execute; +see *Note Executing a File::). + + - Variable: char ** environ + The environment is represented as an array of strings. Each + string is of the format `NAME=VALUE'. The order in which strings + appear in the environment is not significant, but the same NAME + must not appear more than once. The last element of the array is + a null pointer. + + This variable is declared in the header file `unistd.h'. + + If you just want to get the value of an environment variable, use + `getenv'. + + Unix systems, and the GNU system, pass the initial value of +`environ' as the third argument to `main'. *Note Program Arguments::. + + File: libc.info, Node: Standard Environment, Prev: Environment Access, Up: Environment Variables Standard Environment Variables @@ -740,463 +1251,4 @@ the streams in the pre-`exec' process im and these descriptors do survive through `exec' (provided that they do not have `FD_CLOEXEC' set). The new process image can reconnect these to new streams using `fdopen' (*note Descriptors and Streams::.). - - -File: libc.info, Node: Process Completion, Next: Process Completion Status, Prev: Executing a File, Up: Processes - -Process Completion -================== - - The functions described in this section are used to wait for a child -process to terminate or stop, and determine its status. These functions -are declared in the header file `sys/wait.h'. - - - Function: pid_t waitpid (pid_t PID, int *STATUS-PTR, int OPTIONS) - The `waitpid' function is used to request status information from a - child process whose process ID is PID. Normally, the calling - process is suspended until the child process makes status - information available by terminating. - - Other values for the PID argument have special interpretations. A - value of `-1' or `WAIT_ANY' requests status information for any - child process; a value of `0' or `WAIT_MYPGRP' requests - information for any child process in the same process group as the - calling process; and any other negative value - PGID requests - information for any child process whose process group ID is PGID. - - If status information for a child process is available - immediately, this function returns immediately without waiting. - If more than one eligible child process has status information - available, one of them is chosen randomly, and its status is - returned immediately. To get the status from the other eligible - child processes, you need to call `waitpid' again. - - The OPTIONS argument is a bit mask. Its value should be the - bitwise OR (that is, the `|' operator) of zero or more of the - `WNOHANG' and `WUNTRACED' flags. You can use the `WNOHANG' flag - to indicate that the parent process shouldn't wait; and the - `WUNTRACED' flag to request status information from stopped - processes as well as processes that have terminated. - - The status information from the child process is stored in the - object that STATUS-PTR points to, unless STATUS-PTR is a null - pointer. - - The return value is normally the process ID of the child process - whose status is reported. If the `WNOHANG' option was specified - and no child process is waiting to be noticed, the value is zero. - A value of `-1' is returned in case of error. The following - `errno' error conditions are defined for this function: - - `EINTR' - The function was interrupted by delivery of a signal to the - calling process. *Note Interrupted Primitives::. - - `ECHILD' - There are no child processes to wait for, or the specified PID - is not a child of the calling process. - - `EINVAL' - An invalid value was provided for the OPTIONS argument. - - These symbolic constants are defined as values for the PID argument -to the `waitpid' function. - -`WAIT_ANY' - This constant macro (whose value is `-1') specifies that `waitpid' - should return status information about any child process. - -`WAIT_MYPGRP' - This constant (with value `0') specifies that `waitpid' should - return status information about any child process in the same - process group as the calling process. - - These symbolic constants are defined as flags for the OPTIONS -argument to the `waitpid' function. You can bitwise-OR the flags -together to obtain a value to use as the argument. - -`WNOHANG' - This flag specifies that `waitpid' should return immediately - instead of waiting, if there is no child process ready to be - noticed. - -`WUNTRACED' - This flag specifies that `waitpid' should report the status of any - child processes that have been stopped as well as those that have - terminated. - - - Function: pid_t wait (int *STATUS-PTR) - This is a simplified version of `waitpid', and is used to wait - until any one child process terminates. The call: - - wait (&status) - - is exactly equivalent to: - - waitpid (-1, &status, 0) - - - Function: pid_t wait4 (pid_t PID, int *STATUS-PTR, int OPTIONS, - struct rusage *USAGE) - If USAGE is a null pointer, `wait4' is equivalent to `waitpid - (PID, STATUS-PTR, OPTIONS)'. - - If USAGE is not null, `wait4' stores usage figures for the child - process in `*RUSAGE' (but only if the child has terminated, not if - it has stopped). *Note Resource Usage::. - - This function is a BSD extension. - - Here's an example of how to use `waitpid' to get the status from all -child processes that have terminated, without ever waiting. This -function is designed to be a handler for `SIGCHLD', the signal that -indicates that at least one child process has terminated. - - void - sigchld_handler (int signum) - { - int pid; - int status; - while (1) - { - pid = waitpid (WAIT_ANY, &status, WNOHANG); - if (pid < 0) - { - perror ("waitpid"); - break; - } - if (pid == 0) - break; - notice_termination (pid, status); - } - } - - -File: libc.info, Node: Process Completion Status, Next: BSD Wait Functions, Prev: Process Completion, Up: Processes - -Process Completion Status -========================= - - If the exit status value (*note Program Termination::.) of the child -process is zero, then the status value reported by `waitpid' or `wait' -is also zero. You can test for other kinds of information encoded in -the returned status value using the following macros. These macros are -defined in the header file `sys/wait.h'. - - - Macro: int WIFEXITED (int STATUS) - This macro returns a nonzero value if the child process terminated - normally with `exit' or `_exit'. - - - Macro: int WEXITSTATUS (int STATUS) - If `WIFEXITED' is true of STATUS, this macro returns the low-order - 8 bits of the exit status value from the child process. *Note - Exit Status::. - - - Macro: int WIFSIGNALED (int STATUS) - This macro returns a nonzero value if the child process terminated - because it received a signal that was not handled. *Note Signal - Handling::. - - - Macro: int WTERMSIG (int STATUS) - If `WIFSIGNALED' is true of STATUS, this macro returns the signal - number of the signal that terminated the child process. - - - Macro: int WCOREDUMP (int STATUS) - This macro returns a nonzero value if the child process terminated - and produced a core dump. - - - Macro: int WIFSTOPPED (int STATUS) - This macro returns a nonzero value if the child process is stopped. - - - Macro: int WSTOPSIG (int STATUS) - If `WIFSTOPPED' is true of STATUS, this macro returns the signal - number of the signal that caused the child process to stop. - - -File: libc.info, Node: BSD Wait Functions, Next: Process Creation Example, Prev: Process Completion Status, Up: Processes - -BSD Process Wait Functions -========================== - - The GNU library also provides these related facilities for -compatibility with BSD Unix. BSD uses the `union wait' data type to -represent status values rather than an `int'. The two representations -are actually interchangeable; they describe the same bit patterns. The -GNU C Library defines macros such as `WEXITSTATUS' so that they will -work on either kind of object, and the `wait' function is defined to -accept either type of pointer as its STATUS-PTR argument. - - These functions are declared in `sys/wait.h'. - - - Data Type: union wait - This data type represents program termination status values. It - has the following members: - - `int w_termsig' - The value of this member is the same as the result of the - `WTERMSIG' macro. - - `int w_coredump' - The value of this member is the same as the result of the - `WCOREDUMP' macro. - - `int w_retcode' - The value of this member is the same as the result of the - `WEXITSTATUS' macro. - - `int w_stopsig' - The value of this member is the same as the result of the - `WSTOPSIG' macro. - - Instead of accessing these members directly, you should use the - equivalent macros. - - The `wait3' function is the predecessor to `wait4', which is more -flexible. `wait3' is now obsolete. - - - Function: pid_t wait3 (union wait *STATUS-PTR, int OPTIONS, struct - rusage *USAGE) - If USAGE is a null pointer, `wait3' is equivalent to `waitpid (-1, - STATUS-PTR, OPTIONS)'. - - If USAGE is not null, `wait3' stores usage figures for the child - process in `*RUSAGE' (but only if the child has terminated, not if - it has stopped). *Note Resource Usage::. - - -File: libc.info, Node: Process Creation Example, Prev: BSD Wait Functions, Up: Processes - -Process Creation Example -======================== - - Here is an example program showing how you might write a function -similar to the built-in `system'. It executes its COMMAND argument -using the equivalent of `sh -c COMMAND'. - - #include - #include - #include - #include - #include - - /* Execute the command using this shell program. */ - #define SHELL "/bin/sh" - int - my_system (const char *command) - { - int status; - pid_t pid; - - pid = fork (); - if (pid == 0) - { - /* This is the child process. Execute the shell command. */ - execl (SHELL, SHELL, "-c", command, NULL); - _exit (EXIT_FAILURE); - } - else if (pid < 0) - /* The fork failed. Report failure. */ - status = -1; - else - /* This is the parent process. Wait for the child to complete. */ - if (waitpid (pid, &status, 0) != pid) - status = -1; - return status; - } - - There are a couple of things you should pay attention to in this -example. - - Remember that the first `argv' argument supplied to the program -represents the name of the program being executed. That is why, in the -call to `execl', `SHELL' is supplied once to name the program to -execute and a second time to supply a value for `argv[0]'. - - The `execl' call in the child process doesn't return if it is -successful. If it fails, you must do something to make the child -process terminate. Just returning a bad status code with `return' -would leave two processes running the original program. Instead, the -right behavior is for the child process to report failure to its parent -process. - - Call `_exit' to accomplish this. The reason for using `_exit' -instead of `exit' is to avoid flushing fully buffered streams such as -`stdout'. The buffers of these streams probably contain data that was -copied from the parent process by the `fork', data that will be output -eventually by the parent process. Calling `exit' in the child would -output the data twice. *Note Termination Internals::. - - -File: libc.info, Node: Job Control, Next: Name Service Switch, Prev: Processes, Up: Top - -Job Control -*********** - - "Job control" refers to the protocol for allowing a user to move -between multiple "process groups" (or "jobs") within a single "login -session". The job control facilities are set up so that appropriate -behavior for most programs happens automatically and they need not do -anything special about job control. So you can probably ignore the -material in this chapter unless you are writing a shell or login -program. - - You need to be familiar with concepts relating to process creation -(*note Process Creation Concepts::.) and signal handling (*note Signal -Handling::.) in order to understand this material presented in this -chapter. - -* Menu: - -* 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. - - -File: libc.info, Node: Concepts of Job Control, Next: Job Control is Optional, Up: Job Control - -Concepts of Job Control -======================= - - The fundamental purpose of an interactive shell is to read commands -from the user's terminal and create processes to execute the programs -specified by those commands. It can do this using the `fork' (*note -Creating a Process::.) and `exec' (*note Executing a File::.) functions. - - A single command may run just one process--but often one command uses -several processes. If you use the `|' operator in a shell command, you -explicitly request several programs in their own processes. But even -if you run just one program, it can use multiple processes internally. -For example, a single compilation command such as `cc -c foo.c' -typically uses four processes (though normally only two at any given -time). If you run `make', its job is to run other programs in separate -processes. - - The processes belonging to a single command are called a "process -group" or "job". This is so that you can operate on all of them at -once. For example, typing `C-c' sends the signal `SIGINT' to terminate -all the processes in the foreground process group. - - A "session" is a larger group of processes. Normally all the -processes that stem from a single login belong to the same session. - - Every process belongs to a process group. When a process is -created, it becomes a member of the same process group and session as -its parent process. You can put it in another process group using the -`setpgid' function, provided the process group belongs to the same -session. - - The only way to put a process in a different session is to make it -the initial process of a new session, or a "session leader", using the -`setsid' function. This also puts the session leader into a new -process group, and you can't move it out of that process group again. - - Usually, new sessions are created by the system login program, and -the session leader is the process running the user's login shell. - - A shell that supports job control must arrange to control which job -can use the terminal at any time. Otherwise there might be multiple -jobs trying to read from the terminal at once, and confusion about which -process should receive the input typed by the user. To prevent this, -the shell must cooperate with the terminal driver using the protocol -described in this chapter. - - The shell can give unlimited access to the controlling terminal to -only one process group at a time. This is called the "foreground job" -on that controlling terminal. Other process groups managed by the shell -that are executing without such access to the terminal are called -"background jobs". - - If a background job needs to read from its controlling terminal, it -is "stopped" by the terminal driver; if the `TOSTOP' mode is set, -likewise for writing. The user can stop a foreground job by typing the -SUSP character (*note Special Characters::.) and a program can stop any -job by sending it a `SIGSTOP' signal. It's the responsibility of the -shell to notice when jobs stop, to notify the user about them, and to -provide mechanisms for allowing the user to interactively continue -stopped jobs and switch jobs between foreground and background. - - *Note Access to the Terminal::, for more information about I/O to the -controlling terminal, - - -File: libc.info, Node: Job Control is Optional, Next: Controlling Terminal, Prev: Concepts of Job Control, Up: Job Control - -Job Control is Optional -======================= - - Not all operating systems support job control. The GNU system does -support job control, but if you are using the GNU library on some other -system, that system may not support job control itself. - - You can use the `_POSIX_JOB_CONTROL' macro to test at compile-time -whether the system supports job control. *Note System Options::. - - If job control is not supported, then there can be only one process -group per session, which behaves as if it were always in the foreground. -The functions for creating additional process groups simply fail with -the error code `ENOSYS'. - - The macros naming the various job control signals (*note Job Control -Signals::.) are defined even if job control is not supported. However, -the system never generates these signals, and attempts to send a job -control signal or examine or specify their actions report errors or do -nothing. - - -File: libc.info, Node: Controlling Terminal, Next: Access to the Terminal, Prev: Job Control is Optional, Up: Job Control - -Controlling Terminal of a Process -================================= - - One of the attributes of a process is its controlling terminal. -Child processes created with `fork' inherit the controlling terminal -from their parent process. In this way, all the processes in a session -inherit the controlling terminal from the session leader. A session -leader that has control of a terminal is called the "controlling -process" of that terminal. - - You generally do not need to worry about the exact mechanism used to -allocate a controlling terminal to a session, since it is done for you -by the system when you log in. - - An individual process disconnects from its controlling terminal when -it calls `setsid' to become the leader of a new session. *Note Process -Group Functions::. - - -File: libc.info, Node: Access to the Terminal, Next: Orphaned Process Groups, Prev: Controlling Terminal, Up: Job Control - -Access to the Controlling Terminal -================================== - - Processes in the foreground job of a controlling terminal have -unrestricted access to that terminal; background processes do not. This -section describes in more detail what happens when a process in a -background job tries to access its controlling terminal. - - When a process in a background job tries to read from its controlling -terminal, the process group is usually sent a `SIGTTIN' signal. This -normally causes all of the processes in that group to stop (unless they -handle the signal and don't stop themselves). However, if the reading -process is ignoring or blocking this signal, then `read' fails with an -`EIO' error instead. - - Similarly, when a process in a background job tries to write to its -controlling terminal, the default behavior is to send a `SIGTTOU' -signal to the process group. However, the behavior is modified by the -`TOSTOP' bit of the local modes flags (*note Local Modes::.). If this -bit is not set (which is the default), then writing to the controlling -terminal is always permitted without sending a signal. Writing is also -permitted if the `SIGTTOU' signal is being ignored or blocked by the -writing process. - - Most other terminal operations that a program can do are treated as -reading or as writing. (The description of each operation should say -which.) - - For more information about the primitive `read' and `write' -functions, see *Note I/O Primitives::. diff -durpN glibc-2.0.4/manual/libc.info-24 glibc-2.0.5/manual/libc.info-24 --- glibc-2.0.4/manual/libc.info-24 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-24 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,465 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Process Completion, Next: Process Completion Status, Prev: Executing a File, Up: Processes + +Process Completion +================== + + The functions described in this section are used to wait for a child +process to terminate or stop, and determine its status. These functions +are declared in the header file `sys/wait.h'. + + - Function: pid_t waitpid (pid_t PID, int *STATUS-PTR, int OPTIONS) + The `waitpid' function is used to request status information from a + child process whose process ID is PID. Normally, the calling + process is suspended until the child process makes status + information available by terminating. + + Other values for the PID argument have special interpretations. A + value of `-1' or `WAIT_ANY' requests status information for any + child process; a value of `0' or `WAIT_MYPGRP' requests + information for any child process in the same process group as the + calling process; and any other negative value - PGID requests + information for any child process whose process group ID is PGID. + + If status information for a child process is available + immediately, this function returns immediately without waiting. + If more than one eligible child process has status information + available, one of them is chosen randomly, and its status is + returned immediately. To get the status from the other eligible + child processes, you need to call `waitpid' again. + + The OPTIONS argument is a bit mask. Its value should be the + bitwise OR (that is, the `|' operator) of zero or more of the + `WNOHANG' and `WUNTRACED' flags. You can use the `WNOHANG' flag + to indicate that the parent process shouldn't wait; and the + `WUNTRACED' flag to request status information from stopped + processes as well as processes that have terminated. + + The status information from the child process is stored in the + object that STATUS-PTR points to, unless STATUS-PTR is a null + pointer. + + The return value is normally the process ID of the child process + whose status is reported. If the `WNOHANG' option was specified + and no child process is waiting to be noticed, the value is zero. + A value of `-1' is returned in case of error. The following + `errno' error conditions are defined for this function: + + `EINTR' + The function was interrupted by delivery of a signal to the + calling process. *Note Interrupted Primitives::. + + `ECHILD' + There are no child processes to wait for, or the specified PID + is not a child of the calling process. + + `EINVAL' + An invalid value was provided for the OPTIONS argument. + + These symbolic constants are defined as values for the PID argument +to the `waitpid' function. + +`WAIT_ANY' + This constant macro (whose value is `-1') specifies that `waitpid' + should return status information about any child process. + +`WAIT_MYPGRP' + This constant (with value `0') specifies that `waitpid' should + return status information about any child process in the same + process group as the calling process. + + These symbolic constants are defined as flags for the OPTIONS +argument to the `waitpid' function. You can bitwise-OR the flags +together to obtain a value to use as the argument. + +`WNOHANG' + This flag specifies that `waitpid' should return immediately + instead of waiting, if there is no child process ready to be + noticed. + +`WUNTRACED' + This flag specifies that `waitpid' should report the status of any + child processes that have been stopped as well as those that have + terminated. + + - Function: pid_t wait (int *STATUS-PTR) + This is a simplified version of `waitpid', and is used to wait + until any one child process terminates. The call: + + wait (&status) + + is exactly equivalent to: + + waitpid (-1, &status, 0) + + - Function: pid_t wait4 (pid_t PID, int *STATUS-PTR, int OPTIONS, + struct rusage *USAGE) + If USAGE is a null pointer, `wait4' is equivalent to `waitpid + (PID, STATUS-PTR, OPTIONS)'. + + If USAGE is not null, `wait4' stores usage figures for the child + process in `*RUSAGE' (but only if the child has terminated, not if + it has stopped). *Note Resource Usage::. + + This function is a BSD extension. + + Here's an example of how to use `waitpid' to get the status from all +child processes that have terminated, without ever waiting. This +function is designed to be a handler for `SIGCHLD', the signal that +indicates that at least one child process has terminated. + + void + sigchld_handler (int signum) + { + int pid; + int status; + while (1) + { + pid = waitpid (WAIT_ANY, &status, WNOHANG); + if (pid < 0) + { + perror ("waitpid"); + break; + } + if (pid == 0) + break; + notice_termination (pid, status); + } + } + + +File: libc.info, Node: Process Completion Status, Next: BSD Wait Functions, Prev: Process Completion, Up: Processes + +Process Completion Status +========================= + + If the exit status value (*note Program Termination::.) of the child +process is zero, then the status value reported by `waitpid' or `wait' +is also zero. You can test for other kinds of information encoded in +the returned status value using the following macros. These macros are +defined in the header file `sys/wait.h'. + + - Macro: int WIFEXITED (int STATUS) + This macro returns a nonzero value if the child process terminated + normally with `exit' or `_exit'. + + - Macro: int WEXITSTATUS (int STATUS) + If `WIFEXITED' is true of STATUS, this macro returns the low-order + 8 bits of the exit status value from the child process. *Note + Exit Status::. + + - Macro: int WIFSIGNALED (int STATUS) + This macro returns a nonzero value if the child process terminated + because it received a signal that was not handled. *Note Signal + Handling::. + + - Macro: int WTERMSIG (int STATUS) + If `WIFSIGNALED' is true of STATUS, this macro returns the signal + number of the signal that terminated the child process. + + - Macro: int WCOREDUMP (int STATUS) + This macro returns a nonzero value if the child process terminated + and produced a core dump. + + - Macro: int WIFSTOPPED (int STATUS) + This macro returns a nonzero value if the child process is stopped. + + - Macro: int WSTOPSIG (int STATUS) + If `WIFSTOPPED' is true of STATUS, this macro returns the signal + number of the signal that caused the child process to stop. + + +File: libc.info, Node: BSD Wait Functions, Next: Process Creation Example, Prev: Process Completion Status, Up: Processes + +BSD Process Wait Functions +========================== + + The GNU library also provides these related facilities for +compatibility with BSD Unix. BSD uses the `union wait' data type to +represent status values rather than an `int'. The two representations +are actually interchangeable; they describe the same bit patterns. The +GNU C Library defines macros such as `WEXITSTATUS' so that they will +work on either kind of object, and the `wait' function is defined to +accept either type of pointer as its STATUS-PTR argument. + + These functions are declared in `sys/wait.h'. + + - Data Type: union wait + This data type represents program termination status values. It + has the following members: + + `int w_termsig' + The value of this member is the same as the result of the + `WTERMSIG' macro. + + `int w_coredump' + The value of this member is the same as the result of the + `WCOREDUMP' macro. + + `int w_retcode' + The value of this member is the same as the result of the + `WEXITSTATUS' macro. + + `int w_stopsig' + The value of this member is the same as the result of the + `WSTOPSIG' macro. + + Instead of accessing these members directly, you should use the + equivalent macros. + + The `wait3' function is the predecessor to `wait4', which is more +flexible. `wait3' is now obsolete. + + - Function: pid_t wait3 (union wait *STATUS-PTR, int OPTIONS, struct + rusage *USAGE) + If USAGE is a null pointer, `wait3' is equivalent to `waitpid (-1, + STATUS-PTR, OPTIONS)'. + + If USAGE is not null, `wait3' stores usage figures for the child + process in `*RUSAGE' (but only if the child has terminated, not if + it has stopped). *Note Resource Usage::. + + +File: libc.info, Node: Process Creation Example, Prev: BSD Wait Functions, Up: Processes + +Process Creation Example +======================== + + Here is an example program showing how you might write a function +similar to the built-in `system'. It executes its COMMAND argument +using the equivalent of `sh -c COMMAND'. + + #include + #include + #include + #include + #include + + /* Execute the command using this shell program. */ + #define SHELL "/bin/sh" + int + my_system (const char *command) + { + int status; + pid_t pid; + + pid = fork (); + if (pid == 0) + { + /* This is the child process. Execute the shell command. */ + execl (SHELL, SHELL, "-c", command, NULL); + _exit (EXIT_FAILURE); + } + else if (pid < 0) + /* The fork failed. Report failure. */ + status = -1; + else + /* This is the parent process. Wait for the child to complete. */ + if (waitpid (pid, &status, 0) != pid) + status = -1; + return status; + } + + There are a couple of things you should pay attention to in this +example. + + Remember that the first `argv' argument supplied to the program +represents the name of the program being executed. That is why, in the +call to `execl', `SHELL' is supplied once to name the program to +execute and a second time to supply a value for `argv[0]'. + + The `execl' call in the child process doesn't return if it is +successful. If it fails, you must do something to make the child +process terminate. Just returning a bad status code with `return' +would leave two processes running the original program. Instead, the +right behavior is for the child process to report failure to its parent +process. + + Call `_exit' to accomplish this. The reason for using `_exit' +instead of `exit' is to avoid flushing fully buffered streams such as +`stdout'. The buffers of these streams probably contain data that was +copied from the parent process by the `fork', data that will be output +eventually by the parent process. Calling `exit' in the child would +output the data twice. *Note Termination Internals::. + + +File: libc.info, Node: Job Control, Next: Name Service Switch, Prev: Processes, Up: Top + +Job Control +*********** + + "Job control" refers to the protocol for allowing a user to move +between multiple "process groups" (or "jobs") within a single "login +session". The job control facilities are set up so that appropriate +behavior for most programs happens automatically and they need not do +anything special about job control. So you can probably ignore the +material in this chapter unless you are writing a shell or login +program. + + You need to be familiar with concepts relating to process creation +(*note Process Creation Concepts::.) and signal handling (*note Signal +Handling::.) in order to understand this material presented in this +chapter. + +* Menu: + +* 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. + + +File: libc.info, Node: Concepts of Job Control, Next: Job Control is Optional, Up: Job Control + +Concepts of Job Control +======================= + + The fundamental purpose of an interactive shell is to read commands +from the user's terminal and create processes to execute the programs +specified by those commands. It can do this using the `fork' (*note +Creating a Process::.) and `exec' (*note Executing a File::.) functions. + + A single command may run just one process--but often one command uses +several processes. If you use the `|' operator in a shell command, you +explicitly request several programs in their own processes. But even +if you run just one program, it can use multiple processes internally. +For example, a single compilation command such as `cc -c foo.c' +typically uses four processes (though normally only two at any given +time). If you run `make', its job is to run other programs in separate +processes. + + The processes belonging to a single command are called a "process +group" or "job". This is so that you can operate on all of them at +once. For example, typing `C-c' sends the signal `SIGINT' to terminate +all the processes in the foreground process group. + + A "session" is a larger group of processes. Normally all the +processes that stem from a single login belong to the same session. + + Every process belongs to a process group. When a process is +created, it becomes a member of the same process group and session as +its parent process. You can put it in another process group using the +`setpgid' function, provided the process group belongs to the same +session. + + The only way to put a process in a different session is to make it +the initial process of a new session, or a "session leader", using the +`setsid' function. This also puts the session leader into a new +process group, and you can't move it out of that process group again. + + Usually, new sessions are created by the system login program, and +the session leader is the process running the user's login shell. + + A shell that supports job control must arrange to control which job +can use the terminal at any time. Otherwise there might be multiple +jobs trying to read from the terminal at once, and confusion about which +process should receive the input typed by the user. To prevent this, +the shell must cooperate with the terminal driver using the protocol +described in this chapter. + + The shell can give unlimited access to the controlling terminal to +only one process group at a time. This is called the "foreground job" +on that controlling terminal. Other process groups managed by the shell +that are executing without such access to the terminal are called +"background jobs". + + If a background job needs to read from its controlling terminal, it +is "stopped" by the terminal driver; if the `TOSTOP' mode is set, +likewise for writing. The user can stop a foreground job by typing the +SUSP character (*note Special Characters::.) and a program can stop any +job by sending it a `SIGSTOP' signal. It's the responsibility of the +shell to notice when jobs stop, to notify the user about them, and to +provide mechanisms for allowing the user to interactively continue +stopped jobs and switch jobs between foreground and background. + + *Note Access to the Terminal::, for more information about I/O to the +controlling terminal, + + +File: libc.info, Node: Job Control is Optional, Next: Controlling Terminal, Prev: Concepts of Job Control, Up: Job Control + +Job Control is Optional +======================= + + Not all operating systems support job control. The GNU system does +support job control, but if you are using the GNU library on some other +system, that system may not support job control itself. + + You can use the `_POSIX_JOB_CONTROL' macro to test at compile-time +whether the system supports job control. *Note System Options::. + + If job control is not supported, then there can be only one process +group per session, which behaves as if it were always in the foreground. +The functions for creating additional process groups simply fail with +the error code `ENOSYS'. + + The macros naming the various job control signals (*note Job Control +Signals::.) are defined even if job control is not supported. However, +the system never generates these signals, and attempts to send a job +control signal or examine or specify their actions report errors or do +nothing. + + +File: libc.info, Node: Controlling Terminal, Next: Access to the Terminal, Prev: Job Control is Optional, Up: Job Control + +Controlling Terminal of a Process +================================= + + One of the attributes of a process is its controlling terminal. +Child processes created with `fork' inherit the controlling terminal +from their parent process. In this way, all the processes in a session +inherit the controlling terminal from the session leader. A session +leader that has control of a terminal is called the "controlling +process" of that terminal. + + You generally do not need to worry about the exact mechanism used to +allocate a controlling terminal to a session, since it is done for you +by the system when you log in. + + An individual process disconnects from its controlling terminal when +it calls `setsid' to become the leader of a new session. *Note Process +Group Functions::. + + +File: libc.info, Node: Access to the Terminal, Next: Orphaned Process Groups, Prev: Controlling Terminal, Up: Job Control + +Access to the Controlling Terminal +================================== + + Processes in the foreground job of a controlling terminal have +unrestricted access to that terminal; background processes do not. This +section describes in more detail what happens when a process in a +background job tries to access its controlling terminal. + + When a process in a background job tries to read from its controlling +terminal, the process group is usually sent a `SIGTTIN' signal. This +normally causes all of the processes in that group to stop (unless they +handle the signal and don't stop themselves). However, if the reading +process is ignoring or blocking this signal, then `read' fails with an +`EIO' error instead. + + Similarly, when a process in a background job tries to write to its +controlling terminal, the default behavior is to send a `SIGTTOU' +signal to the process group. However, the behavior is modified by the +`TOSTOP' bit of the local modes flags (*note Local Modes::.). If this +bit is not set (which is the default), then writing to the controlling +terminal is always permitted without sending a signal. Writing is also +permitted if the `SIGTTOU' signal is being ignored or blocked by the +writing process. + + Most other terminal operations that a program can do are treated as +reading or as writing. (The description of each operation should say +which.) + + For more information about the primitive `read' and `write' +functions, see *Note I/O Primitives::. + + File: libc.info, Node: Orphaned Process Groups, Next: Implementing a Shell, Prev: Access to the Terminal, Up: Job Control Orphaned Process Groups @@ -816,520 +1280,4 @@ device, use `ttyname'; *note Is It a Ter See also the `isatty' and `ttyname' functions, in *Note Is It a Terminal::. - - -File: libc.info, Node: Process Group Functions, Next: Terminal Access Functions, Prev: Identifying the Terminal, Up: Functions for Job Control - -Process Group Functions ------------------------ - - Here are descriptions of the functions for manipulating process -groups. Your program should include the header files `sys/types.h' and -`unistd.h' to use these functions. - - - Function: pid_t setsid (void) - The `setsid' function creates a new session. The calling process - becomes the session leader, and is put in a new process group whose - process group ID is the same as the process ID of that process. - There are initially no other processes in the new process group, - and no other process groups in the new session. - - This function also makes the calling process have no controlling - terminal. - - The `setsid' function returns the new process group ID of the - calling process if successful. A return value of `-1' indicates an - error. The following `errno' error conditions are defined for this - function: - - `EPERM' - The calling process is already a process group leader, or - there is already another process group around that has the - same process group ID. - - The `getpgrp' function has two definitions: one derived from BSD -Unix, and one from the POSIX.1 standard. The feature test macros you -have selected (*note Feature Test Macros::.) determine which definition -you get. Specifically, you get the BSD version if you define -`_BSD_SOURCE'; otherwise, you get the POSIX version if you define -`_POSIX_SOURCE' or `_GNU_SOURCE'. Programs written for old BSD systems -will not include `unistd.h', which defines `getpgrp' specially under -`_BSD_SOURCE'. You must link such programs with the `-lbsd-compat' -option to get the BSD definition. - - - POSIX.1 Function: pid_t getpgrp (void) - The POSIX.1 definition of `getpgrp' returns the process group ID of - the calling process. - - - BSD Function: pid_t getpgrp (pid_t PID) - The BSD definition of `getpgrp' returns the process group ID of the - process PID. You can supply a value of `0' for the PID argument - to get information about the calling process. - - - Function: int setpgid (pid_t PID, pid_t PGID) - The `setpgid' function puts the process PID into the process group - PGID. As a special case, either PID or PGID can be zero to - indicate the process ID of the calling process. - - This function fails on a system that does not support job control. - *Note Job Control is Optional::, for more information. - - If the operation is successful, `setpgid' returns zero. Otherwise - it returns `-1'. The following `errno' error conditions are - defined for this function: - - `EACCES' - The child process named by PID has executed an `exec' - function since it was forked. - - `EINVAL' - The value of the PGID is not valid. - - `ENOSYS' - The system doesn't support job control. - - `EPERM' - The process indicated by the PID argument is a session leader, - or is not in the same session as the calling process, or the - value of the PGID argument doesn't match a process group ID - in the same session as the calling process. - - `ESRCH' - The process indicated by the PID argument is not the calling - process or a child of the calling process. - - - Function: int setpgrp (pid_t PID, pid_t PGID) - This is the BSD Unix name for `setpgid'. Both functions do exactly - the same thing. - - -File: libc.info, Node: Terminal Access Functions, Prev: Process Group Functions, Up: Functions for Job Control - -Functions for Controlling Terminal Access ------------------------------------------ - - These are the functions for reading or setting the foreground -process group of a terminal. You should include the header files -`sys/types.h' and `unistd.h' in your application to use these functions. - - Although these functions take a file descriptor argument to specify -the terminal device, the foreground job is associated with the terminal -file itself and not a particular open file descriptor. - - - Function: pid_t tcgetpgrp (int FILEDES) - This function returns the process group ID of the foreground - process group associated with the terminal open on descriptor - FILEDES. - - If there is no foreground process group, the return value is a - number greater than `1' that does not match the process group ID - of any existing process group. This can happen if all of the - processes in the job that was formerly the foreground job have - terminated, and no other job has yet been moved into the - foreground. - - In case of an error, a value of `-1' is returned. The following - `errno' error conditions are defined for this function: - - `EBADF' - The FILEDES argument is not a valid file descriptor. - - `ENOSYS' - The system doesn't support job control. - - `ENOTTY' - The terminal file associated with the FILEDES argument isn't - the controlling terminal of the calling process. - - - Function: int tcsetpgrp (int FILEDES, pid_t PGID) - This function is used to set a terminal's foreground process group - ID. The argument FILEDES is a descriptor which specifies the - terminal; PGID specifies the process group. The calling process - must be a member of the same session as PGID and must have the same - controlling terminal. - - For terminal access purposes, this function is treated as output. - If it is called from a background process on its controlling - terminal, normally all processes in the process group are sent a - `SIGTTOU' signal. The exception is if the calling process itself - is ignoring or blocking `SIGTTOU' signals, in which case the - operation is performed and no signal is sent. - - If successful, `tcsetpgrp' returns `0'. A return value of `-1' - indicates an error. The following `errno' error conditions are - defined for this function: - - `EBADF' - The FILEDES argument is not a valid file descriptor. - - `EINVAL' - The PGID argument is not valid. - - `ENOSYS' - The system doesn't support job control. - - `ENOTTY' - The FILEDES isn't the controlling terminal of the calling - process. - - `EPERM' - The PGID isn't a process group in the same session as the - calling process. - - -File: libc.info, Node: Name Service Switch, Next: Users and Groups, Prev: Job Control, Up: Top - -System Databases and Name Service Switch -**************************************** - - 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., `/etc/passwd'), but other nameservices (like the -Network Information Service (NIS) and the Domain Name Service (DNS)) -became popular, and were hacked into the C library, usually with a fixed -search order (*note frobnicate: (jargon)frobnicate.). - - The GNU C Library contains a cleaner solution of this problem. It is -designed after a method used by Sun Microsystems in the C library of -Solaris 2. GNU C Library follows their name and calls this scheme -"Name Service Switch" (NSS). - - Though the interface might be similar to Sun's version there is no -common code. We never saw any source code of Sun's implementation and -so the internal interface is incompatible. This also manifests in the -file names we use as we will see later. - -* Menu: - -* 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. - - -File: libc.info, Node: NSS Basics, Next: NSS Configuration File, Prev: Name Service Switch, Up: Name Service Switch - -NSS Basics -========== - - The basic idea is to put the implementation of the different services -offered to access the databases in separate modules. This has some -advantages: - - 1. Contributors can add new services without adding them to GNU C - Library. - - 2. The modules can be updated separately. - - 3. The C library image is smaller. - - To fulfill the first goal above the ABI of the modules will be -described below. For getting the implementation of a new service right -it is important to understand how the functions in the modules get -called. They are in no way designed to be used by the programmer -directly. Instead the programmer should only use the documented and -standardized functions to access the databases. - -The databases available in the NSS are - -`aliases' - Mail aliases - -`ethers' - Ethernet numbers, - -`group' - Groups of users, *note Group Database::.. - -`hosts' - Host names and numbers, *note Host Names::.. - -`netgroup' - Network wide list of host and users, *note Netgroup Database::.. - -`network' - Network names and numbers, *note Networks Database::.. - -`protocols' - Network protocols, *note Protocols Database::.. - -`passwd' - User passwords, *note User Database::.. - -`rpc' - Remote procedure call names and numbers, - -`services' - Network services, *note Services Database::.. - -`shadow' - Shadow user passwords, - -There will be some more added later (`automount', `bootparams', -`netmasks', and `publickey'). - - -File: libc.info, Node: NSS Configuration File, Next: NSS Module Internals, Prev: NSS Basics, Up: Name Service Switch - -The NSS Configuration File -========================== - - Somehow the NSS code must be told about the wishes of the user. For -this reason there is the file `/etc/nsswitch.conf'. For each database -this file contain a specification how the lookup process should work. -The file could look like this: - - # /etc/nsswitch.conf - # - # Name Service Switch configuration file. - # - - passwd: db files nis - shadow: files - group: db files nis - - hosts: files nisplus nis dns - networks: nisplus [NOTFOUND=return] files - - ethers: nisplus [NOTFOUND=return] db files - protocols: nisplus [NOTFOUND=return] db files - rpc: nisplus [NOTFOUND=return] db files - services: nisplus [NOTFOUND=return] db files - - The first column is the database as you can guess from the table -above. The rest of the line specifies how the lookup process works. -Please note that you specify the way it works for each database -individually. This cannot be done with the old way of a monolithic -implementation. - - The configuration specification for each database can contain two -different items: - - * the service specification like `files', `db', or `nis'. - - * the reaction on lookup result like `[NOTFOUND=return]'. - -* Menu: - -* Services in the NSS configuration:: Service names in the NSS configuration. -* Actions in the NSS configuration:: React appropriately to the lookup result. -* Notes on NSS Configuration File:: Things to take care about while - configuring NSS. - - -File: libc.info, Node: Services in the NSS configuration, Next: Actions in the NSS configuration, Prev: NSS Configuration File, Up: NSS Configuration File - -Services in the NSS configuration File --------------------------------------- - - The above example file mentions four different services: `files', -`db', `nis', and `nisplus'. This does not mean these services are -available on all sites and it does also not mean these are all the -services which will ever be available. - - In fact, these names are simply strings which the NSS code uses to -find the implicitly addressed functions. The internal interface will be -described later. Visible to the user are the modules which implement an -individual service. - - Assume the service NAME shall be used for a lookup. The code for -this service is implemented in a module called `libnss_NAME'. On a -system supporting shared libraries this is in fact a shared library -with the name (for example) `libnss_NAME.so.1'. The number at the end -is the currently used version of the interface which will not change -frequently. Normally the user should not have to be cognizant of these -files since they should be placed in a directory where they are found -automatically. Only the names of all available services are important. - - -File: libc.info, Node: Actions in the NSS configuration, Next: Notes on NSS Configuration File, Prev: Services in the NSS configuration, Up: NSS Configuration File - -Actions in the NSS configuration --------------------------------- - - The second item in the specification gives the user much finer -control on the lookup process. Action items are placed between two -service names and are written within brackets. The general form is - - `[' ( `!'? STATUS `=' ACTION )+ `]' - -where - - STATUS => success | notfound | unavail | tryagain - ACTION => return | continue - - The case of the keywords is insignificant. The STATUS values are -the results of a call to a lookup function of a specific service. They -mean - -`success' - No error occurred and the wanted entry is returned. The default - action for this is `return'. - -`notfound' - The lookup process works ok but the needed value was not found. - The default action is `continue'. - -`unavail' - The service is permanently unavailable. This can either mean the - needed file is not available, or, for DNS, the server is not - available or does not allow queries. The default action is - `continue'. - -`tryagain' - The service is temporarily unavailable. This could mean a file is - locked or a server currently cannot accept more connections. The - default action is `continue'. - -If we have a line like - - ethers: nisplus [NOTFOUND=return] db files - -this is equivalent to - - ethers: nisplus [SUCCESS=return NOTFOUND=return UNAVAIL=continue - TRYAGAIN=continue] - db [SUCCESS=return NOTFOUND=continue UNAVAIL=continue - TRYAGAIN=continue] - files - -(except that it would have to be written on one line). The default -value for the actions are normally what you want, and only need to be -changed in exceptional cases. - - If the optional `!' is placed before the STATUS this means the -following action is used for all statii but STATUS itself. I.e., `!' -is negation as in the C language (and others). - - Before we explain the exception which makes this action item -necessary one more remark: obviously it makes no sense to add another -action item after the `files' service. Since there is no other service -following the action *always* is `return'. - - Now, why is this `[NOTFOUND=return]' action useful? To understand -this we should know that the `nisplus' service is often complete; i.e., -if an entry is not available in the NIS+ tables it is not available -anywhere else. This is what is expressed by this action item: it is -useless to examine further services since they will not give us a -result. - - The situation would be different if the NIS+ service is not available -because the machine is booting. In this case the return value of the -lookup function is not `notfound' but instead `unavail'. And as you -can see in the complete form above: in this situation the `db' and -`files' services are used. Neat, isn't it? The system administrator -need not pay special care for the time the system is not completely -ready to work (while booting or shutdown or network problems). - - -File: libc.info, Node: Notes on NSS Configuration File, Prev: Actions in the NSS configuration, Up: NSS Configuration File - -Notes on the NSS Configuration File ------------------------------------ - - Finally a few more hints. The NSS implementation is not completely -helpless if `/etc/nsswitch.conf' does not exist. For all supported -databases there is a default value so it should normally be possible to -get the system running even if the file is corrupted or missing. - - For the `hosts' and `network' databases the default value is `dns -[!UNAVAIL=return] files'. I.e., the system is prepared for the DNS -service not to be available but if it is available the answer it -returns is ultimative. - - The `passwd', `group', and `shadow' databases are traditionally -handled in a special way. The appropriate files in the `/etc' -directory are read but if an entry with a name starting with a `+' -character is found NIS is used. This kind of lookup remains possible -by using the special lookup service `compat' and the default value for -the three databases above is `compat [NOTFOUND=return] files'. - - For all other databases the default value is `nis [NOTFOUND=return] -files'. This solution give the best chance to be correct since NIS and -file based lookup is used. - - A second point is that the user should try to optimize the lookup -process. The different service have different response times. A -simple file look up on a local file could be fast, but if the file is -long and the needed entry is near the end of the file this may take -quite some time. In this case it might be better to use the `db' -service which allows fast local access to large data sets. - - Often the situation is that some global information like NIS must be -used. So it is unavoidable to use service entries like `nis' etc. But -one should avoid slow services like this if possible. - - -File: libc.info, Node: NSS Module Internals, Next: Extending NSS, Prev: NSS Configuration File, Up: Name Service Switch - -NSS Module Internals -==================== - - Now it is time to described how the modules look like. The functions -contained in a module are identified by their names. I.e., there is no -jump table or the like. How this is done is of no interest here; those -interested in this topic should read about Dynamic Linking. - -* Menu: - -* NSS Module Names:: Construction of the interface function of - the NSS modules. -* NSS Modules Interface:: Programming interface in the NSS module - functions. - - -File: libc.info, Node: NSS Module Names, Next: NSS Modules Interface, Prev: NSS Module Internals, Up: NSS Module Internals - -The Naming Scheme of the NSS Modules ------------------------------------- - -The name of each function consist of various parts: - - _nss_SERVICE_FUNCTION - - SERVICE of course corresponds to the name of the module this -function is found in.(1) The FUNCTION part is derived from the -interface function in the C library itself. If the user calls the -function `gethostbyname' and the service used is `files' the function - - _nss_files_gethostbyname_r - -in the module - - libnss_files.so.1 - -is used. You see, what is explained above in not the whole truth. In -fact the NSS modules only contain reentrant versions of the lookup -functions. I.e., if the user would call the `gethostbyname_r' function -this also would end in the above function. For all user interface -functions the C library maps this call to a call to the reentrant -function. For reentrant functions this is trivial since the interface -is (nearly) the same. For the non-reentrant version The library keeps -internal buffers which are used to replace the user supplied buffer. - - I.e., the reentrant functions *can* have counterparts. No service -module is forced to have functions for all databases and all kinds to -access them. If a function is not available it is simply treated as if -the function would return `unavail' (*note Actions in the NSS -configuration::.). - - The file name `libnss_files.so.1' would be on a Solaris 2 system -`nss_files.so.1'. This is the difference mentioned above. Sun's NSS -modules are usable as modules which get indirectly loaded only. - - The NSS modules in the GNU C Library are prepared to be used as -normal libraries itself. This is *not* true in the moment, though. -But the different organization of the name space in the modules does -not make it impossible like it is for Solaris. Now you can see why the -modules are still libraries.(2) - - ---------- Footnotes ---------- - - (1) Now you might ask why to duplicate this information. The -answer is that we want to keep the possibility to link directly with -these shared objects. - - (2) There is a second explanation: we were too lazy to change the -Makefiles to allow the generation of shared objects not starting with -`lib' but do not tell this anybody. diff -durpN glibc-2.0.4/manual/libc.info-25 glibc-2.0.5/manual/libc.info-25 --- glibc-2.0.4/manual/libc.info-25 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-25 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,522 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Process Group Functions, Next: Terminal Access Functions, Prev: Identifying the Terminal, Up: Functions for Job Control + +Process Group Functions +----------------------- + + Here are descriptions of the functions for manipulating process +groups. Your program should include the header files `sys/types.h' and +`unistd.h' to use these functions. + + - Function: pid_t setsid (void) + The `setsid' function creates a new session. The calling process + becomes the session leader, and is put in a new process group whose + process group ID is the same as the process ID of that process. + There are initially no other processes in the new process group, + and no other process groups in the new session. + + This function also makes the calling process have no controlling + terminal. + + The `setsid' function returns the new process group ID of the + calling process if successful. A return value of `-1' indicates an + error. The following `errno' error conditions are defined for this + function: + + `EPERM' + The calling process is already a process group leader, or + there is already another process group around that has the + same process group ID. + + The `getpgrp' function has two definitions: one derived from BSD +Unix, and one from the POSIX.1 standard. The feature test macros you +have selected (*note Feature Test Macros::.) determine which definition +you get. Specifically, you get the BSD version if you define +`_BSD_SOURCE'; otherwise, you get the POSIX version if you define +`_POSIX_SOURCE' or `_GNU_SOURCE'. Programs written for old BSD systems +will not include `unistd.h', which defines `getpgrp' specially under +`_BSD_SOURCE'. You must link such programs with the `-lbsd-compat' +option to get the BSD definition. + + - POSIX.1 Function: pid_t getpgrp (void) + The POSIX.1 definition of `getpgrp' returns the process group ID of + the calling process. + + - BSD Function: pid_t getpgrp (pid_t PID) + The BSD definition of `getpgrp' returns the process group ID of the + process PID. You can supply a value of `0' for the PID argument + to get information about the calling process. + + - Function: int setpgid (pid_t PID, pid_t PGID) + The `setpgid' function puts the process PID into the process group + PGID. As a special case, either PID or PGID can be zero to + indicate the process ID of the calling process. + + This function fails on a system that does not support job control. + *Note Job Control is Optional::, for more information. + + If the operation is successful, `setpgid' returns zero. Otherwise + it returns `-1'. The following `errno' error conditions are + defined for this function: + + `EACCES' + The child process named by PID has executed an `exec' + function since it was forked. + + `EINVAL' + The value of the PGID is not valid. + + `ENOSYS' + The system doesn't support job control. + + `EPERM' + The process indicated by the PID argument is a session leader, + or is not in the same session as the calling process, or the + value of the PGID argument doesn't match a process group ID + in the same session as the calling process. + + `ESRCH' + The process indicated by the PID argument is not the calling + process or a child of the calling process. + + - Function: int setpgrp (pid_t PID, pid_t PGID) + This is the BSD Unix name for `setpgid'. Both functions do exactly + the same thing. + + +File: libc.info, Node: Terminal Access Functions, Prev: Process Group Functions, Up: Functions for Job Control + +Functions for Controlling Terminal Access +----------------------------------------- + + These are the functions for reading or setting the foreground +process group of a terminal. You should include the header files +`sys/types.h' and `unistd.h' in your application to use these functions. + + Although these functions take a file descriptor argument to specify +the terminal device, the foreground job is associated with the terminal +file itself and not a particular open file descriptor. + + - Function: pid_t tcgetpgrp (int FILEDES) + This function returns the process group ID of the foreground + process group associated with the terminal open on descriptor + FILEDES. + + If there is no foreground process group, the return value is a + number greater than `1' that does not match the process group ID + of any existing process group. This can happen if all of the + processes in the job that was formerly the foreground job have + terminated, and no other job has yet been moved into the + foreground. + + In case of an error, a value of `-1' is returned. The following + `errno' error conditions are defined for this function: + + `EBADF' + The FILEDES argument is not a valid file descriptor. + + `ENOSYS' + The system doesn't support job control. + + `ENOTTY' + The terminal file associated with the FILEDES argument isn't + the controlling terminal of the calling process. + + - Function: int tcsetpgrp (int FILEDES, pid_t PGID) + This function is used to set a terminal's foreground process group + ID. The argument FILEDES is a descriptor which specifies the + terminal; PGID specifies the process group. The calling process + must be a member of the same session as PGID and must have the same + controlling terminal. + + For terminal access purposes, this function is treated as output. + If it is called from a background process on its controlling + terminal, normally all processes in the process group are sent a + `SIGTTOU' signal. The exception is if the calling process itself + is ignoring or blocking `SIGTTOU' signals, in which case the + operation is performed and no signal is sent. + + If successful, `tcsetpgrp' returns `0'. A return value of `-1' + indicates an error. The following `errno' error conditions are + defined for this function: + + `EBADF' + The FILEDES argument is not a valid file descriptor. + + `EINVAL' + The PGID argument is not valid. + + `ENOSYS' + The system doesn't support job control. + + `ENOTTY' + The FILEDES isn't the controlling terminal of the calling + process. + + `EPERM' + The PGID isn't a process group in the same session as the + calling process. + + +File: libc.info, Node: Name Service Switch, Next: Users and Groups, Prev: Job Control, Up: Top + +System Databases and Name Service Switch +**************************************** + + 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., `/etc/passwd'), but other nameservices (like the +Network Information Service (NIS) and the Domain Name Service (DNS)) +became popular, and were hacked into the C library, usually with a fixed +search order (*note frobnicate: (jargon)frobnicate.). + + The GNU C Library contains a cleaner solution of this problem. It is +designed after a method used by Sun Microsystems in the C library of +Solaris 2. GNU C Library follows their name and calls this scheme +"Name Service Switch" (NSS). + + Though the interface might be similar to Sun's version there is no +common code. We never saw any source code of Sun's implementation and +so the internal interface is incompatible. This also manifests in the +file names we use as we will see later. + +* Menu: + +* 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. + + +File: libc.info, Node: NSS Basics, Next: NSS Configuration File, Prev: Name Service Switch, Up: Name Service Switch + +NSS Basics +========== + + The basic idea is to put the implementation of the different services +offered to access the databases in separate modules. This has some +advantages: + + 1. Contributors can add new services without adding them to GNU C + Library. + + 2. The modules can be updated separately. + + 3. The C library image is smaller. + + To fulfill the first goal above the ABI of the modules will be +described below. For getting the implementation of a new service right +it is important to understand how the functions in the modules get +called. They are in no way designed to be used by the programmer +directly. Instead the programmer should only use the documented and +standardized functions to access the databases. + +The databases available in the NSS are + +`aliases' + Mail aliases + +`ethers' + Ethernet numbers, + +`group' + Groups of users, *note Group Database::.. + +`hosts' + Host names and numbers, *note Host Names::.. + +`netgroup' + Network wide list of host and users, *note Netgroup Database::.. + +`network' + Network names and numbers, *note Networks Database::.. + +`protocols' + Network protocols, *note Protocols Database::.. + +`passwd' + User passwords, *note User Database::.. + +`rpc' + Remote procedure call names and numbers, + +`services' + Network services, *note Services Database::.. + +`shadow' + Shadow user passwords, + +There will be some more added later (`automount', `bootparams', +`netmasks', and `publickey'). + + +File: libc.info, Node: NSS Configuration File, Next: NSS Module Internals, Prev: NSS Basics, Up: Name Service Switch + +The NSS Configuration File +========================== + + Somehow the NSS code must be told about the wishes of the user. For +this reason there is the file `/etc/nsswitch.conf'. For each database +this file contain a specification how the lookup process should work. +The file could look like this: + + # /etc/nsswitch.conf + # + # Name Service Switch configuration file. + # + + passwd: db files nis + shadow: files + group: db files nis + + hosts: files nisplus nis dns + networks: nisplus [NOTFOUND=return] files + + ethers: nisplus [NOTFOUND=return] db files + protocols: nisplus [NOTFOUND=return] db files + rpc: nisplus [NOTFOUND=return] db files + services: nisplus [NOTFOUND=return] db files + + The first column is the database as you can guess from the table +above. The rest of the line specifies how the lookup process works. +Please note that you specify the way it works for each database +individually. This cannot be done with the old way of a monolithic +implementation. + + The configuration specification for each database can contain two +different items: + + * the service specification like `files', `db', or `nis'. + + * the reaction on lookup result like `[NOTFOUND=return]'. + +* Menu: + +* Services in the NSS configuration:: Service names in the NSS configuration. +* Actions in the NSS configuration:: React appropriately to the lookup result. +* Notes on NSS Configuration File:: Things to take care about while + configuring NSS. + + +File: libc.info, Node: Services in the NSS configuration, Next: Actions in the NSS configuration, Prev: NSS Configuration File, Up: NSS Configuration File + +Services in the NSS configuration File +-------------------------------------- + + The above example file mentions four different services: `files', +`db', `nis', and `nisplus'. This does not mean these services are +available on all sites and it does also not mean these are all the +services which will ever be available. + + In fact, these names are simply strings which the NSS code uses to +find the implicitly addressed functions. The internal interface will be +described later. Visible to the user are the modules which implement an +individual service. + + Assume the service NAME shall be used for a lookup. The code for +this service is implemented in a module called `libnss_NAME'. On a +system supporting shared libraries this is in fact a shared library +with the name (for example) `libnss_NAME.so.1'. The number at the end +is the currently used version of the interface which will not change +frequently. Normally the user should not have to be cognizant of these +files since they should be placed in a directory where they are found +automatically. Only the names of all available services are important. + + +File: libc.info, Node: Actions in the NSS configuration, Next: Notes on NSS Configuration File, Prev: Services in the NSS configuration, Up: NSS Configuration File + +Actions in the NSS configuration +-------------------------------- + + The second item in the specification gives the user much finer +control on the lookup process. Action items are placed between two +service names and are written within brackets. The general form is + + `[' ( `!'? STATUS `=' ACTION )+ `]' + +where + + STATUS => success | notfound | unavail | tryagain + ACTION => return | continue + + The case of the keywords is insignificant. The STATUS values are +the results of a call to a lookup function of a specific service. They +mean + +`success' + No error occurred and the wanted entry is returned. The default + action for this is `return'. + +`notfound' + The lookup process works ok but the needed value was not found. + The default action is `continue'. + +`unavail' + The service is permanently unavailable. This can either mean the + needed file is not available, or, for DNS, the server is not + available or does not allow queries. The default action is + `continue'. + +`tryagain' + The service is temporarily unavailable. This could mean a file is + locked or a server currently cannot accept more connections. The + default action is `continue'. + +If we have a line like + + ethers: nisplus [NOTFOUND=return] db files + +this is equivalent to + + ethers: nisplus [SUCCESS=return NOTFOUND=return UNAVAIL=continue + TRYAGAIN=continue] + db [SUCCESS=return NOTFOUND=continue UNAVAIL=continue + TRYAGAIN=continue] + files + +(except that it would have to be written on one line). The default +value for the actions are normally what you want, and only need to be +changed in exceptional cases. + + If the optional `!' is placed before the STATUS this means the +following action is used for all statii but STATUS itself. I.e., `!' +is negation as in the C language (and others). + + Before we explain the exception which makes this action item +necessary one more remark: obviously it makes no sense to add another +action item after the `files' service. Since there is no other service +following the action *always* is `return'. + + Now, why is this `[NOTFOUND=return]' action useful? To understand +this we should know that the `nisplus' service is often complete; i.e., +if an entry is not available in the NIS+ tables it is not available +anywhere else. This is what is expressed by this action item: it is +useless to examine further services since they will not give us a +result. + + The situation would be different if the NIS+ service is not available +because the machine is booting. In this case the return value of the +lookup function is not `notfound' but instead `unavail'. And as you +can see in the complete form above: in this situation the `db' and +`files' services are used. Neat, isn't it? The system administrator +need not pay special care for the time the system is not completely +ready to work (while booting or shutdown or network problems). + + +File: libc.info, Node: Notes on NSS Configuration File, Prev: Actions in the NSS configuration, Up: NSS Configuration File + +Notes on the NSS Configuration File +----------------------------------- + + Finally a few more hints. The NSS implementation is not completely +helpless if `/etc/nsswitch.conf' does not exist. For all supported +databases there is a default value so it should normally be possible to +get the system running even if the file is corrupted or missing. + + For the `hosts' and `network' databases the default value is `dns +[!UNAVAIL=return] files'. I.e., the system is prepared for the DNS +service not to be available but if it is available the answer it +returns is ultimative. + + The `passwd', `group', and `shadow' databases are traditionally +handled in a special way. The appropriate files in the `/etc' +directory are read but if an entry with a name starting with a `+' +character is found NIS is used. This kind of lookup remains possible +by using the special lookup service `compat' and the default value for +the three databases above is `compat [NOTFOUND=return] files'. + + For all other databases the default value is `nis [NOTFOUND=return] +files'. This solution give the best chance to be correct since NIS and +file based lookup is used. + + A second point is that the user should try to optimize the lookup +process. The different service have different response times. A +simple file look up on a local file could be fast, but if the file is +long and the needed entry is near the end of the file this may take +quite some time. In this case it might be better to use the `db' +service which allows fast local access to large data sets. + + Often the situation is that some global information like NIS must be +used. So it is unavoidable to use service entries like `nis' etc. But +one should avoid slow services like this if possible. + + +File: libc.info, Node: NSS Module Internals, Next: Extending NSS, Prev: NSS Configuration File, Up: Name Service Switch + +NSS Module Internals +==================== + + Now it is time to described how the modules look like. The functions +contained in a module are identified by their names. I.e., there is no +jump table or the like. How this is done is of no interest here; those +interested in this topic should read about Dynamic Linking. + +* Menu: + +* NSS Module Names:: Construction of the interface function of + the NSS modules. +* NSS Modules Interface:: Programming interface in the NSS module + functions. + + +File: libc.info, Node: NSS Module Names, Next: NSS Modules Interface, Prev: NSS Module Internals, Up: NSS Module Internals + +The Naming Scheme of the NSS Modules +------------------------------------ + +The name of each function consist of various parts: + + _nss_SERVICE_FUNCTION + + SERVICE of course corresponds to the name of the module this +function is found in.(1) The FUNCTION part is derived from the +interface function in the C library itself. If the user calls the +function `gethostbyname' and the service used is `files' the function + + _nss_files_gethostbyname_r + +in the module + + libnss_files.so.1 + +is used. You see, what is explained above in not the whole truth. In +fact the NSS modules only contain reentrant versions of the lookup +functions. I.e., if the user would call the `gethostbyname_r' function +this also would end in the above function. For all user interface +functions the C library maps this call to a call to the reentrant +function. For reentrant functions this is trivial since the interface +is (nearly) the same. For the non-reentrant version The library keeps +internal buffers which are used to replace the user supplied buffer. + + I.e., the reentrant functions *can* have counterparts. No service +module is forced to have functions for all databases and all kinds to +access them. If a function is not available it is simply treated as if +the function would return `unavail' (*note Actions in the NSS +configuration::.). + + The file name `libnss_files.so.1' would be on a Solaris 2 system +`nss_files.so.1'. This is the difference mentioned above. Sun's NSS +modules are usable as modules which get indirectly loaded only. + + The NSS modules in the GNU C Library are prepared to be used as +normal libraries itself. This is *not* true in the moment, though. +But the different organization of the name space in the modules does +not make it impossible like it is for Solaris. Now you can see why the +modules are still libraries.(2) + + ---------- Footnotes ---------- + + (1) Now you might ask why to duplicate this information. The answer +is that we want to keep the possibility to link directly with these +shared objects. + + (2) There is a second explanation: we were too lazy to change the +Makefiles to allow the generation of shared objects not starting with +`lib' but do not tell this anybody. + + File: libc.info, Node: NSS Modules Interface, Prev: NSS Module Names, Up: NSS Module Internals The Interface of the Function in NSS Modules @@ -677,541 +1198,4 @@ feature with a preprocessor conditional, #else setreuid (geteuid (), getuid ()); #endif - - -File: libc.info, Node: Setuid Program Example, Next: Tips for Setuid, Prev: Enable/Disable Setuid, Up: Users and Groups - -Setuid Program Example -====================== - - Here's an example showing how to set up a program that changes its -effective user ID. - - This is part of a game program called `caber-toss' that manipulates -a file `scores' that should be writable only by the game program -itself. The program assumes that its executable file will be installed -with the set-user-ID bit set and owned by the same user as the `scores' -file. Typically, a system administrator will set up an account like -`games' for this purpose. - - The executable file is given mode `4755', so that doing an `ls -l' -on it produces output like: - - -rwsr-xr-x 1 games 184422 Jul 30 15:17 caber-toss - -The set-user-ID bit shows up in the file modes as the `s'. - - The scores file is given mode `644', and doing an `ls -l' on it -shows: - - -rw-r--r-- 1 games 0 Jul 31 15:33 scores - - Here are the parts of the program that show how to set up the changed -user ID. This program is conditionalized so that it makes use of the -saved IDs feature if it is supported, and otherwise uses `setreuid' to -swap the effective and real user IDs. - - #include - #include - #include - #include - - - /* Save the effective and real UIDs. */ - - static uid_t euid, ruid; - - - /* Restore the effective UID to its original value. */ - - void - do_setuid (void) - { - int status; - - #ifdef _POSIX_SAVED_IDS - status = setuid (euid); - #else - status = setreuid (ruid, euid); - #endif - if (status < 0) { - fprintf (stderr, "Couldn't set uid.\n"); - exit (status); - } - } - /* Set the effective UID to the real UID. */ - - void - undo_setuid (void) - { - int status; - - #ifdef _POSIX_SAVED_IDS - status = setuid (ruid); - #else - status = setreuid (euid, ruid); - #endif - if (status < 0) { - fprintf (stderr, "Couldn't set uid.\n"); - exit (status); - } - } - - /* Main program. */ - - int - main (void) - { - /* Save the real and effective user IDs. */ - ruid = getuid (); - euid = geteuid (); - undo_setuid (); - - /* Do the game and record the score. */ - ... - } - - Notice how the first thing the `main' function does is to set the -effective user ID back to the real user ID. This is so that any other -file accesses that are performed while the user is playing the game use -the real user ID for determining permissions. Only when the program -needs to open the scores file does it switch back to the original -effective user ID, like this: - - /* Record the score. */ - - int - record_score (int score) - { - FILE *stream; - char *myname; - - /* Open the scores file. */ - do_setuid (); - stream = fopen (SCORES_FILE, "a"); - undo_setuid (); - /* Write the score to the file. */ - if (stream) - { - myname = cuserid (NULL); - if (score < 0) - fprintf (stream, "%10s: Couldn't lift the caber.\n", myname); - else - fprintf (stream, "%10s: %d feet.\n", myname, score); - fclose (stream); - return 0; - } - else - return -1; - } - - -File: libc.info, Node: Tips for Setuid, Next: Who Logged In, Prev: Setuid Program Example, Up: Users and Groups - -Tips for Writing Setuid Programs -================================ - - It is easy for setuid programs to give the user access that isn't -intended--in fact, if you want to avoid this, you need to be careful. -Here are some guidelines for preventing unintended access and -minimizing its consequences when it does occur: - - * Don't have `setuid' programs with privileged user IDs such as - `root' unless it is absolutely necessary. If the resource is - specific to your particular program, it's better to define a new, - nonprivileged user ID or group ID just to manage that resource. - - * Be cautious about using the `system' and `exec' functions in - combination with changing the effective user ID. Don't let users - of your program execute arbitrary programs under a changed user ID. - Executing a shell is especially bad news. Less obviously, the - `execlp' and `execvp' functions are a potential risk (since the - program they execute depends on the user's `PATH' environment - variable). - - If you must `exec' another program under a changed ID, specify an - absolute file name (*note File Name Resolution::.) for the - executable, and make sure that the protections on that executable - and *all* containing directories are such that ordinary users - cannot replace it with some other program. - - * Only use the user ID controlling the resource in the part of the - program that actually uses that resource. When you're finished - with it, restore the effective user ID back to the actual user's - user ID. *Note Enable/Disable Setuid::. - - * If the `setuid' part of your program needs to access other files - besides the controlled resource, it should verify that the real - user would ordinarily have permission to access those files. You - can use the `access' function (*note Access Permission::.) to - check this; it uses the real user and group IDs, rather than the - effective IDs. - - -File: libc.info, Node: Who Logged In, Next: User Database, Prev: Tips for Setuid, Up: Users and Groups - -Identifying Who Logged In -========================= - - You can use the functions listed in this section to determine the -login name of the user who is running a process, and the name of the -user who logged in the current session. See also the function `getuid' -and friends (*note Reading Persona::.). - - The `getlogin' function is declared in `unistd.h', while `cuserid' -and `L_cuserid' are declared in `stdio.h'. - - - Function: char * getlogin (void) - The `getlogin' function returns a pointer to a string containing - the name of the user logged in on the controlling terminal of the - process, or a null pointer if this information cannot be - determined. The string is statically allocated and might be - overwritten on subsequent calls to this function or to `cuserid'. - - - Function: char * cuserid (char *STRING) - The `cuserid' function returns a pointer to a string containing a - user name associated with the effective ID of the process. If - STRING is not a null pointer, it should be an array that can hold - at least `L_cuserid' characters; the string is returned in this - array. Otherwise, a pointer to a string in a static area is - returned. This string is statically allocated and might be - overwritten on subsequent calls to this function or to `getlogin'. - - The use of this function is deprecated since it is marked to be - withdrawn in XPG4.2 and it is already removed in POSIX.1. - - - Macro: int L_cuserid - An integer constant that indicates how long an array you might - need to store a user name. - - These functions let your program identify positively the user who is -running or the user who logged in this session. (These can differ when -setuid programs are involved; *Note Process Persona::.) The user cannot -do anything to fool these functions. - - For most purposes, it is more useful to use the environment variable -`LOGNAME' to find out who the user is. This is more flexible precisely -because the user can set `LOGNAME' arbitrarily. *Note Standard -Environment::. - - -File: libc.info, Node: User Database, Next: Group Database, Prev: Who Logged In, Up: Users and Groups - -User Database -============= - - This section describes all about how to search and scan the database -of registered users. The database itself is kept in the file -`/etc/passwd' on most systems, but on some systems a special network -server gives access to it. - -* Menu: - -* User Data Structure:: What each user record contains. -* Lookup User:: How to look for a particular user. -* Scanning All Users:: Scanning the list of all users, one by one. -* Writing a User Entry:: How a program can rewrite a user's record. - - -File: libc.info, Node: User Data Structure, Next: Lookup User, Prev: User Database, Up: User Database - -The Data Structure that Describes a User ----------------------------------------- - - The functions and data structures for accessing the system user -database are declared in the header file `pwd.h'. - - - Data Type: struct passwd - The `passwd' data structure is used to hold information about - entries in the system user data base. It has at least the - following members: - - `char *pw_name' - The user's login name. - - `char *pw_passwd.' - The encrypted password string. - - `uid_t pw_uid' - The user ID number. - - `gid_t pw_gid' - The user's default group ID number. - - `char *pw_gecos' - A string typically containing the user's real name, and - possibly other information such as a phone number. - - `char *pw_dir' - The user's home directory, or initial working directory. - This might be a null pointer, in which case the - interpretation is system-dependent. - - `char *pw_shell' - The user's default shell, or the initial program run when the - user logs in. This might be a null pointer, indicating that - the system default should be used. - - -File: libc.info, Node: Lookup User, Next: Scanning All Users, Prev: User Data Structure, Up: User Database - -Looking Up One User -------------------- - - You can search the system user database for information about a -specific user using `getpwuid' or `getpwnam'. These functions are -declared in `pwd.h'. - - - Function: struct passwd * getpwuid (uid_t UID) - This function returns a pointer to a statically-allocated structure - containing information about the user whose user ID is UID. This - structure may be overwritten on subsequent calls to `getpwuid'. - - A null pointer value indicates there is no user in the data base - with user ID UID. - - - Function: int getpwuid_r (uid_t UID, struct passwd *RESULT_BUF, char - *BUFFER, size_t BUFLEN, struct passwd **RESULT) - This function is similar to `getpwuid' in that is returns - information about the user whose user ID is UID. But the result - is not placed in a static buffer. Instead the user supplied - structure pointed to by RESULT_BUF is filled with the information. - The first BUFLEN bytes of the additional buffer pointed to by - BUFFER are used to contain additional information, normally - strings which are pointed to by the elements of the result - structure. - - If the return value is `0' the pointer returned in RESULT points - to the record which contains the wanted data (i.e., RESULT - contains the value RESULT_BUF). In case the return value is non - null there is no user in the data base with user ID UID or the - buffer BUFFER is too small to contain all the needed information. - In the later case the global ERRNO variable is set to `ERANGE'. - - - Function: struct passwd * getpwnam (const char *NAME) - This function returns a pointer to a statically-allocated structure - containing information about the user whose user name is NAME. - This structure may be overwritten on subsequent calls to - `getpwnam'. - - A null pointer value indicates there is no user named NAME. - - - Function: int getpwnam_r (const char *NAME, struct passwd - *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd - **RESULT) - This function is similar to `getpwnam' in that is returns - information about the user whose user name is NAME. But the result - is not placed in a static buffer. Instead the user supplied - structure pointed to by RESULT_BUF is filled with the information. - The first BUFLEN bytes of the additional buffer pointed to by - BUFFER are used to contain additional information, normally - strings which are pointed to by the elements of the result - structure. - - If the return value is `0' the pointer returned in RESULT points - to the record which contains the wanted data (i.e., RESULT - contains the value RESULT_BUF). In case the return value is non - null there is no user in the data base with user name NAME or the - buffer BUFFER is too small to contain all the needed information. - In the later case the global ERRNO variable is set to `ERANGE'. - - -File: libc.info, Node: Scanning All Users, Next: Writing a User Entry, Prev: Lookup User, Up: User Database - -Scanning the List of All Users ------------------------------- - - This section explains how a program can read the list of all users in -the system, one user at a time. The functions described here are -declared in `pwd.h'. - - You can use the `fgetpwent' function to read user entries from a -particular file. - - - Function: struct passwd * fgetpwent (FILE *STREAM) - This function reads the next user entry from STREAM and returns a - pointer to the entry. The structure is statically allocated and is - rewritten on subsequent calls to `fgetpwent'. You must copy the - contents of the structure if you wish to save the information. - - This stream must correspond to a file in the same format as the - standard password database file. This function comes from System - V. - - - Function: int fgetpwent_r (FILE *STREAM, struct passwd *RESULT_BUF, - char *BUFFER, size_t BUFLEN, struct passwd **RESULT) - This function is similar to `fgetpwent' in that it reads the next - user entry from STREAM. But the result is returned in the - structure pointed to by RESULT_BUF. The first BUFLEN bytes of the - additional buffer pointed to by BUFFER are used to contain - additional information, normally strings which are pointed to by - the elements of the result structure. - - This stream must correspond to a file in the same format as the - standard password database file. - - If the function returns null RESULT points to the structure with - the wanted data (normally this is in RESULT_BUF). If errors - occurred the return value is non-null and RESULT contains a null - pointer. - - The way to scan all the entries in the user database is with -`setpwent', `getpwent', and `endpwent'. - - - Function: void setpwent (void) - This function initializes a stream which `getpwent' and - `getpwent_r' use to read the user database. - - - Function: struct passwd * getpwent (void) - The `getpwent' function reads the next entry from the stream - initialized by `setpwent'. It returns a pointer to the entry. The - structure is statically allocated and is rewritten on subsequent - calls to `getpwent'. You must copy the contents of the structure - if you wish to save the information. - - A null pointer is returned in case no further entry is available. - - - Function: int getpwent_r (struct passwd *RESULT_BUF, char *BUFFER, - int BUFLEN, struct passwd **RESULT) - This function is similar to `getpwent' in that it returns the next - entry from the stream initialized by `setpwent'. But in contrast - to the `getpwent' function this function is reentrant since the - result is placed in the user supplied structure pointed to by - RESULT_BUF. Additional data, normally the strings pointed to by - the elements of the result structure, are placed in the additional - buffer or length BUFLEN starting at BUFFER. - - If the function returns zero RESULT points to the structure with - the wanted data (normally this is in RESULT_BUF). If errors - occurred the return value is non-zero and RESULT contains a null - pointer. - - - Function: void endpwent (void) - This function closes the internal stream used by `getpwent' or - `getpwent_r'. - - -File: libc.info, Node: Writing a User Entry, Prev: Scanning All Users, Up: User Database - -Writing a User Entry --------------------- - - - Function: int putpwent (const struct passwd *P, FILE *STREAM) - This function writes the user entry `*P' to the stream STREAM, in - the format used for the standard user database file. The return - value is zero on success and nonzero on failure. - - This function exists for compatibility with SVID. We recommend - that you avoid using it, because it makes sense only on the - assumption that the `struct passwd' structure has no members - except the standard ones; on a system which merges the traditional - Unix data base with other extended information about users, adding - an entry using this function would inevitably leave out much of - the important information. - - The function `putpwent' is declared in `pwd.h'. - - -File: libc.info, Node: Group Database, Next: Netgroup Database, Prev: User Database, Up: Users and Groups - -Group Database -============== - - This section describes all about how to search and scan the database -of registered groups. The database itself is kept in the file -`/etc/group' on most systems, but on some systems a special network -service provides access to it. - -* Menu: - -* Group Data Structure:: What each group record contains. -* Lookup Group:: How to look for a particular group. -* Scanning All Groups:: Scanning the list of all groups. - - -File: libc.info, Node: Group Data Structure, Next: Lookup Group, Prev: Group Database, Up: Group Database - -The Data Structure for a Group ------------------------------- - - The functions and data structures for accessing the system group -database are declared in the header file `grp.h'. - - - Data Type: struct group - The `group' structure is used to hold information about an entry in - the system group database. It has at least the following members: - - `char *gr_name' - The name of the group. - - `gid_t gr_gid' - The group ID of the group. - - `char **gr_mem' - A vector of pointers to the names of users in the group. - Each user name is a null-terminated string, and the vector - itself is terminated by a null pointer. - - -File: libc.info, Node: Lookup Group, Next: Scanning All Groups, Prev: Group Data Structure, Up: Group Database - -Looking Up One Group --------------------- - - You can search the group database for information about a specific -group using `getgrgid' or `getgrnam'. These functions are declared in -`grp.h'. - - - Function: struct group * getgrgid (gid_t GID) - This function returns a pointer to a statically-allocated structure - containing information about the group whose group ID is GID. - This structure may be overwritten by subsequent calls to - `getgrgid'. - - A null pointer indicates there is no group with ID GID. - - - Function: int getgrgid_r (gid_t GID, struct group *RESULT_BUF, char - *BUFFER, size_t BUFLEN, struct group **RESULT) - This function is similar to `getgrgid' in that is returns - information about the group whose group ID is GID. But the result - is not placed in a static buffer. Instead the user supplied - structure pointed to by RESULT_BUF is filled with the information. - The first BUFLEN bytes of the additional buffer pointed to by - BUFFER are used to contain additional information, normally - strings which are pointed to by the elements of the result - structure. - - If the return value is `0' the pointer returned in RESULT points - to the record which contains the wanted data (i.e., RESULT - contains the value RESULT_BUF). If the return value is non-zero - there is no group in the data base with group ID GID or the buffer - BUFFER is too small to contain all the needed information. In the - later case the global ERRNO variable is set to `ERANGE'. - - - Function: struct group * getgrnam (const char *NAME) - This function returns a pointer to a statically-allocated structure - containing information about the group whose group name is NAME. - This structure may be overwritten by subsequent calls to - `getgrnam'. - - A null pointer indicates there is no group named NAME. - - - Function: int getgrnam_r (const char *NAME, struct group - *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group - **RESULT) - This function is similar to `getgrnam' in that is returns - information about the group whose group name is NAME. But the - result is not placed in a static buffer. Instead the user - supplied structure pointed to by RESULT_BUF is filled with the - information. The first BUFLEN bytes of the additional buffer - pointed to by BUFFER are used to contain additional information, - normally strings which are pointed to by the elements of the - result structure. - - If the return value is `0' the pointer returned in RESULT points - to the record which contains the wanted data (i.e., RESULT - contains the value RESULT_BUF). If the return value is non-zero - there is no group in the data base with group name NAME or the - buffer BUFFER is too small to contain all the needed information. - In the later case the global ERRNO variable is set to `ERANGE'. diff -durpN glibc-2.0.4/manual/libc.info-26 glibc-2.0.5/manual/libc.info-26 --- glibc-2.0.4/manual/libc.info-26 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-26 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,543 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Setuid Program Example, Next: Tips for Setuid, Prev: Enable/Disable Setuid, Up: Users and Groups + +Setuid Program Example +====================== + + Here's an example showing how to set up a program that changes its +effective user ID. + + This is part of a game program called `caber-toss' that manipulates +a file `scores' that should be writable only by the game program +itself. The program assumes that its executable file will be installed +with the set-user-ID bit set and owned by the same user as the `scores' +file. Typically, a system administrator will set up an account like +`games' for this purpose. + + The executable file is given mode `4755', so that doing an `ls -l' +on it produces output like: + + -rwsr-xr-x 1 games 184422 Jul 30 15:17 caber-toss + +The set-user-ID bit shows up in the file modes as the `s'. + + The scores file is given mode `644', and doing an `ls -l' on it +shows: + + -rw-r--r-- 1 games 0 Jul 31 15:33 scores + + Here are the parts of the program that show how to set up the changed +user ID. This program is conditionalized so that it makes use of the +saved IDs feature if it is supported, and otherwise uses `setreuid' to +swap the effective and real user IDs. + + #include + #include + #include + #include + + + /* Save the effective and real UIDs. */ + + static uid_t euid, ruid; + + + /* Restore the effective UID to its original value. */ + + void + do_setuid (void) + { + int status; + + #ifdef _POSIX_SAVED_IDS + status = setuid (euid); + #else + status = setreuid (ruid, euid); + #endif + if (status < 0) { + fprintf (stderr, "Couldn't set uid.\n"); + exit (status); + } + } + /* Set the effective UID to the real UID. */ + + void + undo_setuid (void) + { + int status; + + #ifdef _POSIX_SAVED_IDS + status = setuid (ruid); + #else + status = setreuid (euid, ruid); + #endif + if (status < 0) { + fprintf (stderr, "Couldn't set uid.\n"); + exit (status); + } + } + + /* Main program. */ + + int + main (void) + { + /* Save the real and effective user IDs. */ + ruid = getuid (); + euid = geteuid (); + undo_setuid (); + + /* Do the game and record the score. */ + ... + } + + Notice how the first thing the `main' function does is to set the +effective user ID back to the real user ID. This is so that any other +file accesses that are performed while the user is playing the game use +the real user ID for determining permissions. Only when the program +needs to open the scores file does it switch back to the original +effective user ID, like this: + + /* Record the score. */ + + int + record_score (int score) + { + FILE *stream; + char *myname; + + /* Open the scores file. */ + do_setuid (); + stream = fopen (SCORES_FILE, "a"); + undo_setuid (); + /* Write the score to the file. */ + if (stream) + { + myname = cuserid (NULL); + if (score < 0) + fprintf (stream, "%10s: Couldn't lift the caber.\n", myname); + else + fprintf (stream, "%10s: %d feet.\n", myname, score); + fclose (stream); + return 0; + } + else + return -1; + } + + +File: libc.info, Node: Tips for Setuid, Next: Who Logged In, Prev: Setuid Program Example, Up: Users and Groups + +Tips for Writing Setuid Programs +================================ + + It is easy for setuid programs to give the user access that isn't +intended--in fact, if you want to avoid this, you need to be careful. +Here are some guidelines for preventing unintended access and +minimizing its consequences when it does occur: + + * Don't have `setuid' programs with privileged user IDs such as + `root' unless it is absolutely necessary. If the resource is + specific to your particular program, it's better to define a new, + nonprivileged user ID or group ID just to manage that resource. + + * Be cautious about using the `system' and `exec' functions in + combination with changing the effective user ID. Don't let users + of your program execute arbitrary programs under a changed user ID. + Executing a shell is especially bad news. Less obviously, the + `execlp' and `execvp' functions are a potential risk (since the + program they execute depends on the user's `PATH' environment + variable). + + If you must `exec' another program under a changed ID, specify an + absolute file name (*note File Name Resolution::.) for the + executable, and make sure that the protections on that executable + and *all* containing directories are such that ordinary users + cannot replace it with some other program. + + * Only use the user ID controlling the resource in the part of the + program that actually uses that resource. When you're finished + with it, restore the effective user ID back to the actual user's + user ID. *Note Enable/Disable Setuid::. + + * If the `setuid' part of your program needs to access other files + besides the controlled resource, it should verify that the real + user would ordinarily have permission to access those files. You + can use the `access' function (*note Access Permission::.) to + check this; it uses the real user and group IDs, rather than the + effective IDs. + + +File: libc.info, Node: Who Logged In, Next: User Database, Prev: Tips for Setuid, Up: Users and Groups + +Identifying Who Logged In +========================= + + You can use the functions listed in this section to determine the +login name of the user who is running a process, and the name of the +user who logged in the current session. See also the function `getuid' +and friends (*note Reading Persona::.). + + The `getlogin' function is declared in `unistd.h', while `cuserid' +and `L_cuserid' are declared in `stdio.h'. + + - Function: char * getlogin (void) + The `getlogin' function returns a pointer to a string containing + the name of the user logged in on the controlling terminal of the + process, or a null pointer if this information cannot be + determined. The string is statically allocated and might be + overwritten on subsequent calls to this function or to `cuserid'. + + - Function: char * cuserid (char *STRING) + The `cuserid' function returns a pointer to a string containing a + user name associated with the effective ID of the process. If + STRING is not a null pointer, it should be an array that can hold + at least `L_cuserid' characters; the string is returned in this + array. Otherwise, a pointer to a string in a static area is + returned. This string is statically allocated and might be + overwritten on subsequent calls to this function or to `getlogin'. + + The use of this function is deprecated since it is marked to be + withdrawn in XPG4.2 and it is already removed in POSIX.1. + + - Macro: int L_cuserid + An integer constant that indicates how long an array you might + need to store a user name. + + These functions let your program identify positively the user who is +running or the user who logged in this session. (These can differ when +setuid programs are involved; *Note Process Persona::.) The user cannot +do anything to fool these functions. + + For most purposes, it is more useful to use the environment variable +`LOGNAME' to find out who the user is. This is more flexible precisely +because the user can set `LOGNAME' arbitrarily. *Note Standard +Environment::. + + +File: libc.info, Node: User Database, Next: Group Database, Prev: Who Logged In, Up: Users and Groups + +User Database +============= + + This section describes all about how to search and scan the database +of registered users. The database itself is kept in the file +`/etc/passwd' on most systems, but on some systems a special network +server gives access to it. + +* Menu: + +* User Data Structure:: What each user record contains. +* Lookup User:: How to look for a particular user. +* Scanning All Users:: Scanning the list of all users, one by one. +* Writing a User Entry:: How a program can rewrite a user's record. + + +File: libc.info, Node: User Data Structure, Next: Lookup User, Prev: User Database, Up: User Database + +The Data Structure that Describes a User +---------------------------------------- + + The functions and data structures for accessing the system user +database are declared in the header file `pwd.h'. + + - Data Type: struct passwd + The `passwd' data structure is used to hold information about + entries in the system user data base. It has at least the + following members: + + `char *pw_name' + The user's login name. + + `char *pw_passwd.' + The encrypted password string. + + `uid_t pw_uid' + The user ID number. + + `gid_t pw_gid' + The user's default group ID number. + + `char *pw_gecos' + A string typically containing the user's real name, and + possibly other information such as a phone number. + + `char *pw_dir' + The user's home directory, or initial working directory. + This might be a null pointer, in which case the + interpretation is system-dependent. + + `char *pw_shell' + The user's default shell, or the initial program run when the + user logs in. This might be a null pointer, indicating that + the system default should be used. + + +File: libc.info, Node: Lookup User, Next: Scanning All Users, Prev: User Data Structure, Up: User Database + +Looking Up One User +------------------- + + You can search the system user database for information about a +specific user using `getpwuid' or `getpwnam'. These functions are +declared in `pwd.h'. + + - Function: struct passwd * getpwuid (uid_t UID) + This function returns a pointer to a statically-allocated structure + containing information about the user whose user ID is UID. This + structure may be overwritten on subsequent calls to `getpwuid'. + + A null pointer value indicates there is no user in the data base + with user ID UID. + + - Function: int getpwuid_r (uid_t UID, struct passwd *RESULT_BUF, char + *BUFFER, size_t BUFLEN, struct passwd **RESULT) + This function is similar to `getpwuid' in that is returns + information about the user whose user ID is UID. But the result + is not placed in a static buffer. Instead the user supplied + structure pointed to by RESULT_BUF is filled with the information. + The first BUFLEN bytes of the additional buffer pointed to by + BUFFER are used to contain additional information, normally + strings which are pointed to by the elements of the result + structure. + + If the return value is `0' the pointer returned in RESULT points + to the record which contains the wanted data (i.e., RESULT + contains the value RESULT_BUF). In case the return value is non + null there is no user in the data base with user ID UID or the + buffer BUFFER is too small to contain all the needed information. + In the later case the global ERRNO variable is set to `ERANGE'. + + - Function: struct passwd * getpwnam (const char *NAME) + This function returns a pointer to a statically-allocated structure + containing information about the user whose user name is NAME. + This structure may be overwritten on subsequent calls to + `getpwnam'. + + A null pointer value indicates there is no user named NAME. + + - Function: int getpwnam_r (const char *NAME, struct passwd + *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd + **RESULT) + This function is similar to `getpwnam' in that is returns + information about the user whose user name is NAME. But the result + is not placed in a static buffer. Instead the user supplied + structure pointed to by RESULT_BUF is filled with the information. + The first BUFLEN bytes of the additional buffer pointed to by + BUFFER are used to contain additional information, normally + strings which are pointed to by the elements of the result + structure. + + If the return value is `0' the pointer returned in RESULT points + to the record which contains the wanted data (i.e., RESULT + contains the value RESULT_BUF). In case the return value is non + null there is no user in the data base with user name NAME or the + buffer BUFFER is too small to contain all the needed information. + In the later case the global ERRNO variable is set to `ERANGE'. + + +File: libc.info, Node: Scanning All Users, Next: Writing a User Entry, Prev: Lookup User, Up: User Database + +Scanning the List of All Users +------------------------------ + + This section explains how a program can read the list of all users in +the system, one user at a time. The functions described here are +declared in `pwd.h'. + + You can use the `fgetpwent' function to read user entries from a +particular file. + + - Function: struct passwd * fgetpwent (FILE *STREAM) + This function reads the next user entry from STREAM and returns a + pointer to the entry. The structure is statically allocated and is + rewritten on subsequent calls to `fgetpwent'. You must copy the + contents of the structure if you wish to save the information. + + This stream must correspond to a file in the same format as the + standard password database file. This function comes from System + V. + + - Function: int fgetpwent_r (FILE *STREAM, struct passwd *RESULT_BUF, + char *BUFFER, size_t BUFLEN, struct passwd **RESULT) + This function is similar to `fgetpwent' in that it reads the next + user entry from STREAM. But the result is returned in the + structure pointed to by RESULT_BUF. The first BUFLEN bytes of the + additional buffer pointed to by BUFFER are used to contain + additional information, normally strings which are pointed to by + the elements of the result structure. + + This stream must correspond to a file in the same format as the + standard password database file. + + If the function returns null RESULT points to the structure with + the wanted data (normally this is in RESULT_BUF). If errors + occurred the return value is non-null and RESULT contains a null + pointer. + + The way to scan all the entries in the user database is with +`setpwent', `getpwent', and `endpwent'. + + - Function: void setpwent (void) + This function initializes a stream which `getpwent' and + `getpwent_r' use to read the user database. + + - Function: struct passwd * getpwent (void) + The `getpwent' function reads the next entry from the stream + initialized by `setpwent'. It returns a pointer to the entry. The + structure is statically allocated and is rewritten on subsequent + calls to `getpwent'. You must copy the contents of the structure + if you wish to save the information. + + A null pointer is returned in case no further entry is available. + + - Function: int getpwent_r (struct passwd *RESULT_BUF, char *BUFFER, + int BUFLEN, struct passwd **RESULT) + This function is similar to `getpwent' in that it returns the next + entry from the stream initialized by `setpwent'. But in contrast + to the `getpwent' function this function is reentrant since the + result is placed in the user supplied structure pointed to by + RESULT_BUF. Additional data, normally the strings pointed to by + the elements of the result structure, are placed in the additional + buffer or length BUFLEN starting at BUFFER. + + If the function returns zero RESULT points to the structure with + the wanted data (normally this is in RESULT_BUF). If errors + occurred the return value is non-zero and RESULT contains a null + pointer. + + - Function: void endpwent (void) + This function closes the internal stream used by `getpwent' or + `getpwent_r'. + + +File: libc.info, Node: Writing a User Entry, Prev: Scanning All Users, Up: User Database + +Writing a User Entry +-------------------- + + - Function: int putpwent (const struct passwd *P, FILE *STREAM) + This function writes the user entry `*P' to the stream STREAM, in + the format used for the standard user database file. The return + value is zero on success and nonzero on failure. + + This function exists for compatibility with SVID. We recommend + that you avoid using it, because it makes sense only on the + assumption that the `struct passwd' structure has no members + except the standard ones; on a system which merges the traditional + Unix data base with other extended information about users, adding + an entry using this function would inevitably leave out much of + the important information. + + The function `putpwent' is declared in `pwd.h'. + + +File: libc.info, Node: Group Database, Next: Netgroup Database, Prev: User Database, Up: Users and Groups + +Group Database +============== + + This section describes all about how to search and scan the database +of registered groups. The database itself is kept in the file +`/etc/group' on most systems, but on some systems a special network +service provides access to it. + +* Menu: + +* Group Data Structure:: What each group record contains. +* Lookup Group:: How to look for a particular group. +* Scanning All Groups:: Scanning the list of all groups. + + +File: libc.info, Node: Group Data Structure, Next: Lookup Group, Prev: Group Database, Up: Group Database + +The Data Structure for a Group +------------------------------ + + The functions and data structures for accessing the system group +database are declared in the header file `grp.h'. + + - Data Type: struct group + The `group' structure is used to hold information about an entry in + the system group database. It has at least the following members: + + `char *gr_name' + The name of the group. + + `gid_t gr_gid' + The group ID of the group. + + `char **gr_mem' + A vector of pointers to the names of users in the group. + Each user name is a null-terminated string, and the vector + itself is terminated by a null pointer. + + +File: libc.info, Node: Lookup Group, Next: Scanning All Groups, Prev: Group Data Structure, Up: Group Database + +Looking Up One Group +-------------------- + + You can search the group database for information about a specific +group using `getgrgid' or `getgrnam'. These functions are declared in +`grp.h'. + + - Function: struct group * getgrgid (gid_t GID) + This function returns a pointer to a statically-allocated structure + containing information about the group whose group ID is GID. + This structure may be overwritten by subsequent calls to + `getgrgid'. + + A null pointer indicates there is no group with ID GID. + + - Function: int getgrgid_r (gid_t GID, struct group *RESULT_BUF, char + *BUFFER, size_t BUFLEN, struct group **RESULT) + This function is similar to `getgrgid' in that is returns + information about the group whose group ID is GID. But the result + is not placed in a static buffer. Instead the user supplied + structure pointed to by RESULT_BUF is filled with the information. + The first BUFLEN bytes of the additional buffer pointed to by + BUFFER are used to contain additional information, normally + strings which are pointed to by the elements of the result + structure. + + If the return value is `0' the pointer returned in RESULT points + to the record which contains the wanted data (i.e., RESULT + contains the value RESULT_BUF). If the return value is non-zero + there is no group in the data base with group ID GID or the buffer + BUFFER is too small to contain all the needed information. In the + later case the global ERRNO variable is set to `ERANGE'. + + - Function: struct group * getgrnam (const char *NAME) + This function returns a pointer to a statically-allocated structure + containing information about the group whose group name is NAME. + This structure may be overwritten by subsequent calls to + `getgrnam'. + + A null pointer indicates there is no group named NAME. + + - Function: int getgrnam_r (const char *NAME, struct group + *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group + **RESULT) + This function is similar to `getgrnam' in that is returns + information about the group whose group name is NAME. But the + result is not placed in a static buffer. Instead the user + supplied structure pointed to by RESULT_BUF is filled with the + information. The first BUFLEN bytes of the additional buffer + pointed to by BUFFER are used to contain additional information, + normally strings which are pointed to by the elements of the + result structure. + + If the return value is `0' the pointer returned in RESULT points + to the record which contains the wanted data (i.e., RESULT + contains the value RESULT_BUF). If the return value is non-zero + there is no group in the data base with group name NAME or the + buffer BUFFER is too small to contain all the needed information. + In the later case the global ERRNO variable is set to `ERANGE'. + + File: libc.info, Node: Scanning All Groups, Prev: Lookup Group, Up: Group Database Scanning the List of All Groups @@ -664,577 +1206,4 @@ find out. *Note Sysconf::. always defines this as `1', on the assumption that you had to have `ar' and `make' to install the library, and it's unlikely that `strip' would be absent when those are present. - - -File: libc.info, Node: Version Supported, Next: Sysconf, Prev: System Options, Up: System Configuration - -Which Version of POSIX is Supported -=================================== - - - Macro: long int _POSIX_VERSION - This constant represents the version of the POSIX.1 standard to - which the implementation conforms. For an implementation - conforming to the 1990 POSIX.1 standard, the value is the integer - `199009L'. - - `_POSIX_VERSION' is always defined (in `unistd.h') in any POSIX - system. - - *Usage Note:* Don't try to test whether the system supports POSIX - by including `unistd.h' and then checking whether `_POSIX_VERSION' - is defined. On a non-POSIX system, this will probably fail - because there is no `unistd.h'. We do not know of *any* way you - can reliably test at compilation time whether your target system - supports POSIX or whether `unistd.h' exists. - - The GNU C compiler predefines the symbol `__POSIX__' if the target - system is a POSIX system. Provided you do not use any other - compilers on POSIX systems, testing `defined (__POSIX__)' will - reliably detect such systems. - - - Macro: long int _POSIX2_C_VERSION - This constant represents the version of the POSIX.2 standard which - the library and system kernel support. We don't know what value - this will be for the first version of the POSIX.2 standard, - because the value is based on the year and month in which the - standard is officially adopted. - - The value of this symbol says nothing about the utilities - installed on the system. - - *Usage Note:* You can use this macro to tell whether a POSIX.1 - system library supports POSIX.2 as well. Any POSIX.1 system - contains `unistd.h', so include that file and then test `defined - (_POSIX2_C_VERSION)'. - - -File: libc.info, Node: Sysconf, Next: Minimums, Prev: Version Supported, Up: System Configuration - -Using `sysconf' -=============== - - When your system has configurable system limits, you can use the -`sysconf' function to find out the value that applies to any particular -machine. The function and the associated PARAMETER constants are -declared in the header file `unistd.h'. - -* Menu: - -* Sysconf Definition:: Detailed specifications of `sysconf'. -* Constants for Sysconf:: The list of parameters `sysconf' can read. -* Examples of Sysconf:: How to use `sysconf' and the parameter - macros properly together. - - -File: libc.info, Node: Sysconf Definition, Next: Constants for Sysconf, Up: Sysconf - -Definition of `sysconf' ------------------------ - - - Function: long int sysconf (int PARAMETER) - This function is used to inquire about runtime system parameters. - The PARAMETER argument should be one of the `_SC_' symbols listed - below. - - The normal return value from `sysconf' is the value you requested. - A value of `-1' is returned both if the implementation does not - impose a limit, and in case of an error. - - The following `errno' error conditions are defined for this - function: - - `EINVAL' - The value of the PARAMETER is invalid. - - -File: libc.info, Node: Constants for Sysconf, Next: Examples of Sysconf, Prev: Sysconf Definition, Up: Sysconf - -Constants for `sysconf' Parameters ----------------------------------- - - Here are the symbolic constants for use as the PARAMETER argument to -`sysconf'. The values are all integer constants (more specifically, -enumeration type values). - -`_SC_ARG_MAX' - Inquire about the parameter corresponding to `ARG_MAX'. - -`_SC_CHILD_MAX' - Inquire about the parameter corresponding to `CHILD_MAX'. - -`_SC_OPEN_MAX' - Inquire about the parameter corresponding to `OPEN_MAX'. - -`_SC_STREAM_MAX' - Inquire about the parameter corresponding to `STREAM_MAX'. - -`_SC_TZNAME_MAX' - Inquire about the parameter corresponding to `TZNAME_MAX'. - -`_SC_NGROUPS_MAX' - Inquire about the parameter corresponding to `NGROUPS_MAX'. - -`_SC_JOB_CONTROL' - Inquire about the parameter corresponding to `_POSIX_JOB_CONTROL'. - -`_SC_SAVED_IDS' - Inquire about the parameter corresponding to `_POSIX_SAVED_IDS'. - -`_SC_VERSION' - Inquire about the parameter corresponding to `_POSIX_VERSION'. - -`_SC_CLK_TCK' - Inquire about the parameter corresponding to `CLOCKS_PER_SEC'; - *note Basic CPU Time::.. - -`_SC_2_C_DEV' - Inquire about whether the system has the POSIX.2 C compiler - command, `c89'. - -`_SC_2_FORT_DEV' - Inquire about whether the system has the POSIX.2 Fortran compiler - command, `fort77'. - -`_SC_2_FORT_RUN' - Inquire about whether the system has the POSIX.2 `asa' command to - interpret Fortran carriage control. - -`_SC_2_LOCALEDEF' - Inquire about whether the system has the POSIX.2 `localedef' - command. - -`_SC_2_SW_DEV' - Inquire about whether the system has the POSIX.2 commands `ar', - `make', and `strip'. - -`_SC_BC_BASE_MAX' - Inquire about the maximum value of `obase' in the `bc' utility. - -`_SC_BC_DIM_MAX' - Inquire about the maximum size of an array in the `bc' utility. - -`_SC_BC_SCALE_MAX' - Inquire about the maximum value of `scale' in the `bc' utility. - -`_SC_BC_STRING_MAX' - Inquire about the maximum size of a string constant in the `bc' - utility. - -`_SC_COLL_WEIGHTS_MAX' - Inquire about the maximum number of weights that can necessarily - be used in defining the collating sequence for a locale. - -`_SC_EXPR_NEST_MAX' - Inquire about the maximum number of expressions nested within - parentheses when using the `expr' utility. - -`_SC_LINE_MAX' - Inquire about the maximum size of a text line that the POSIX.2 text - utilities can handle. - -`_SC_EQUIV_CLASS_MAX' - Inquire about the maximum number of weights that can be assigned - to an entry of the `LC_COLLATE' category `order' keyword in a - locale definition. The GNU C library does not presently support - locale definitions. - -`_SC_VERSION' - Inquire about the version number of POSIX.1 that the library and - kernel support. - -`_SC_2_VERSION' - Inquire about the version number of POSIX.2 that the system - utilities support. - -`_SC_PAGESIZE' - Inquire about the virtual memory page size of the machine. - `getpagesize' returns the same value. - - -File: libc.info, Node: Examples of Sysconf, Prev: Constants for Sysconf, Up: Sysconf - -Examples of `sysconf' ---------------------- - - We recommend that you first test for a macro definition for the -parameter you are interested in, and call `sysconf' only if the macro -is not defined. For example, here is how to test whether job control -is supported: - - int - have_job_control (void) - { - #ifdef _POSIX_JOB_CONTROL - return 1; - #else - int value = sysconf (_SC_JOB_CONTROL); - if (value < 0) - /* If the system is that badly wedged, - there's no use trying to go on. */ - fatal (strerror (errno)); - return value; - #endif - } - - Here is how to get the value of a numeric limit: - - int - get_child_max () - { - #ifdef CHILD_MAX - return CHILD_MAX; - #else - int value = sysconf (_SC_CHILD_MAX); - if (value < 0) - fatal (strerror (errno)); - return value; - #endif - } - - -File: libc.info, Node: Minimums, Next: Limits for Files, Prev: Sysconf, Up: System Configuration - -Minimum Values for General Capacity Limits -========================================== - - Here are the names for the POSIX minimum upper bounds for the system -limit parameters. The significance of these values is that you can -safely push to these limits without checking whether the particular -system you are using can go that far. - -`_POSIX_ARG_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the maximum combined length of the ARGV and ENVIRON - arguments that can be passed to the `exec' functions. Its value - is `4096'. - -`_POSIX_CHILD_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the maximum number of simultaneous processes per real - user ID. Its value is `6'. - -`_POSIX_NGROUPS_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the maximum number of supplementary group IDs per - process. Its value is `0'. - -`_POSIX_OPEN_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the maximum number of files that a single process can - have open simultaneously. Its value is `16'. - -`_POSIX_SSIZE_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the maximum value that can be stored in an object of type - `ssize_t'. Its value is `32767'. - -`_POSIX_STREAM_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the maximum number of streams that a single process can - have open simultaneously. Its value is `8'. - -`_POSIX_TZNAME_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the maximum length of a time zone name. Its value is - `3'. - -`_POSIX2_RE_DUP_MAX' - The value of this macro is the most restrictive limit permitted by - POSIX for the numbers used in the `\{MIN,MAX\}' construct in a - regular expression. Its value is `255'. - - -File: libc.info, Node: Limits for Files, Next: Options for Files, Prev: Minimums, Up: System Configuration - -Limits on File System Capacity -============================== - - The POSIX.1 standard specifies a number of parameters that describe -the limitations of the file system. It's possible for the system to -have a fixed, uniform limit for a parameter, but this isn't the usual -case. On most systems, it's possible for different file systems (and, -for some parameters, even different files) to have different maximum -limits. For example, this is very likely if you use NFS to mount some -of the file systems from other machines. - - Each of the following macros is defined in `limits.h' only if the -system has a fixed, uniform limit for the parameter in question. If the -system allows different file systems or files to have different limits, -then the macro is undefined; use `pathconf' or `fpathconf' to find out -the limit that applies to a particular file. *Note Pathconf::. - - Each parameter also has another macro, with a name starting with -`_POSIX', which gives the lowest value that the limit is allowed to -have on *any* POSIX system. *Note File Minimums::. - - - Macro: int LINK_MAX - The uniform system limit (if any) for the number of names for a - given file. *Note Hard Links::. - - - Macro: int MAX_CANON - The uniform system limit (if any) for the amount of text in a line - of input when input editing is enabled. *Note Canonical or Not::. - - - Macro: int MAX_INPUT - The uniform system limit (if any) for the total number of - characters typed ahead as input. *Note I/O Queues::. - - - Macro: int NAME_MAX - The uniform system limit (if any) for the length of a file name - component. - - - Macro: int PATH_MAX - The uniform system limit (if any) for the length of an entire file - name (that is, the argument given to system calls such as `open'). - - - Macro: int PIPE_BUF - The uniform system limit (if any) for the number of bytes that can - be written atomically to a pipe. If multiple processes are - writing to the same pipe simultaneously, output from different - processes might be interleaved in chunks of this size. *Note - Pipes and FIFOs::. - - These are alternative macro names for some of the same information. - - - Macro: int MAXNAMLEN - This is the BSD name for `NAME_MAX'. It is defined in `dirent.h'. - - - Macro: int FILENAME_MAX - The value of this macro is an integer constant expression that - represents the maximum length of a file name string. It is - defined in `stdio.h'. - - Unlike `PATH_MAX', this macro is defined even if there is no actual - limit imposed. In such a case, its value is typically a very large - number. *This is always the case on the GNU system.* - - *Usage Note:* Don't use `FILENAME_MAX' as the size of an array in - which to store a file name! You can't possibly make an array that - big! Use dynamic allocation (*note Memory Allocation::.) instead. - - -File: libc.info, Node: Options for Files, Next: File Minimums, Prev: Limits for Files, Up: System Configuration - -Optional Features in File Support -================================= - - POSIX defines certain system-specific options in the system calls for -operating on files. Some systems support these options and others do -not. Since these options are provided in the kernel, not in the -library, simply using the GNU C library does not guarantee any of these -features is supported; it depends on the system you are using. They can -also vary between file systems on a single machine. - - This section describes the macros you can test to determine whether a -particular option is supported on your machine. If a given macro is -defined in `unistd.h', then its value says whether the corresponding -feature is supported. (A value of `-1' indicates no; any other value -indicates yes.) If the macro is undefined, it means particular files -may or may not support the feature. - - Since all the machines that support the GNU C library also support -NFS, one can never make a general statement about whether all file -systems support the `_POSIX_CHOWN_RESTRICTED' and `_POSIX_NO_TRUNC' -features. So these names are never defined as macros in the GNU C -library. - - - Macro: int _POSIX_CHOWN_RESTRICTED - If this option is in effect, the `chown' function is restricted so - that the only changes permitted to nonprivileged processes is to - change the group owner of a file to either be the effective group - ID of the process, or one of its supplementary group IDs. *Note - File Owner::. - - - Macro: int _POSIX_NO_TRUNC - If this option is in effect, file name components longer than - `NAME_MAX' generate an `ENAMETOOLONG' error. Otherwise, file name - components that are too long are silently truncated. - - - Macro: unsigned char _POSIX_VDISABLE - This option is only meaningful for files that are terminal devices. - If it is enabled, then handling for special control characters can - be disabled individually. *Note Special Characters::. - - If one of these macros is undefined, that means that the option -might be in effect for some files and not for others. To inquire about -a particular file, call `pathconf' or `fpathconf'. *Note Pathconf::. - - -File: libc.info, Node: File Minimums, Next: Pathconf, Prev: Options for Files, Up: System Configuration - -Minimum Values for File System Limits -===================================== - - Here are the names for the POSIX minimum upper bounds for some of the -above parameters. The significance of these values is that you can -safely push to these limits without checking whether the particular -system you are using can go that far. - -`_POSIX_LINK_MAX' - The most restrictive limit permitted by POSIX for the maximum - value of a file's link count. The value of this constant is `8'; - thus, you can always make up to eight names for a file without - running into a system limit. - -`_POSIX_MAX_CANON' - The most restrictive limit permitted by POSIX for the maximum - number of bytes in a canonical input line from a terminal device. - The value of this constant is `255'. - -`_POSIX_MAX_INPUT' - The most restrictive limit permitted by POSIX for the maximum - number of bytes in a terminal device input queue (or typeahead - buffer). *Note Input Modes::. The value of this constant is - `255'. - -`_POSIX_NAME_MAX' - The most restrictive limit permitted by POSIX for the maximum - number of bytes in a file name component. The value of this - constant is `14'. - -`_POSIX_PATH_MAX' - The most restrictive limit permitted by POSIX for the maximum - number of bytes in a file name. The value of this constant is - `255'. - -`_POSIX_PIPE_BUF' - The most restrictive limit permitted by POSIX for the maximum - number of bytes that can be written atomically to a pipe. The - value of this constant is `512'. - - -File: libc.info, Node: Pathconf, Next: Utility Limits, Prev: File Minimums, Up: System Configuration - -Using `pathconf' -================ - - When your machine allows different files to have different values -for a file system parameter, you can use the functions in this section -to find out the value that applies to any particular file. - - These functions and the associated constants for the PARAMETER -argument are declared in the header file `unistd.h'. - - - Function: long int pathconf (const char *FILENAME, int PARAMETER) - This function is used to inquire about the limits that apply to - the file named FILENAME. - - The PARAMETER argument should be one of the `_PC_' constants - listed below. - - The normal return value from `pathconf' is the value you requested. - A value of `-1' is returned both if the implementation does not - impose a limit, and in case of an error. In the former case, - `errno' is not set, while in the latter case, `errno' is set to - indicate the cause of the problem. So the only way to use this - function robustly is to store `0' into `errno' just before calling - it. - - Besides the usual file name errors (*note File Name Errors::.), - the following error condition is defined for this function: - - `EINVAL' - The value of PARAMETER is invalid, or the implementation - doesn't support the PARAMETER for the specific file. - - - Function: long int fpathconf (int FILEDES, int PARAMETER) - This is just like `pathconf' except that an open file descriptor - is used to specify the file for which information is requested, - instead of a file name. - - The following `errno' error conditions are defined for this - function: - - `EBADF' - The FILEDES argument is not a valid file descriptor. - - `EINVAL' - The value of PARAMETER is invalid, or the implementation - doesn't support the PARAMETER for the specific file. - - Here are the symbolic constants that you can use as the PARAMETER -argument to `pathconf' and `fpathconf'. The values are all integer -constants. - -`_PC_LINK_MAX' - Inquire about the value of `LINK_MAX'. - -`_PC_MAX_CANON' - Inquire about the value of `MAX_CANON'. - -`_PC_MAX_INPUT' - Inquire about the value of `MAX_INPUT'. - -`_PC_NAME_MAX' - Inquire about the value of `NAME_MAX'. - -`_PC_PATH_MAX' - Inquire about the value of `PATH_MAX'. - -`_PC_PIPE_BUF' - Inquire about the value of `PIPE_BUF'. - -`_PC_CHOWN_RESTRICTED' - Inquire about the value of `_POSIX_CHOWN_RESTRICTED'. - -`_PC_NO_TRUNC' - Inquire about the value of `_POSIX_NO_TRUNC'. - -`_PC_VDISABLE' - Inquire about the value of `_POSIX_VDISABLE'. - - -File: libc.info, Node: Utility Limits, Next: Utility Minimums, Prev: Pathconf, Up: System Configuration - -Utility Program Capacity Limits -=============================== - - The POSIX.2 standard specifies certain system limits that you can -access through `sysconf' that apply to utility behavior rather than the -behavior of the library or the operating system. - - The GNU C library defines macros for these limits, and `sysconf' -returns values for them if you ask; but these values convey no -meaningful information. They are simply the smallest values that -POSIX.2 permits. - - - Macro: int BC_BASE_MAX - The largest value of `obase' that the `bc' utility is guaranteed - to support. - - - Macro: int BC_SCALE_MAX - The largest value of `scale' that the `bc' utility is guaranteed - to support. - - - Macro: int BC_DIM_MAX - The largest number of elements in one array that the `bc' utility - is guaranteed to support. - - - Macro: int BC_STRING_MAX - The largest number of characters in one string constant that the - `bc' utility is guaranteed to support. - - - Macro: int BC_DIM_MAX - The largest number of elements in one array that the `bc' utility - is guaranteed to support. - - - Macro: int COLL_WEIGHTS_MAX - The largest number of weights that can necessarily be used in - defining the collating sequence for a locale. - - - Macro: int EXPR_NEST_MAX - The maximum number of expressions that can be nested within - parenthesis by the `expr' utility. - - - Macro: int LINE_MAX - The largest text line that the text-oriented POSIX.2 utilities can - support. (If you are using the GNU versions of these utilities, - then there is no actual limit except that imposed by the available - virtual memory, but there is no way that the library can tell you - this.) - - - Macro: int EQUIV_CLASS_MAX - The maximum number of weights that can be assigned to an entry of - the `LC_COLLATE' category `order' keyword in a locale definition. - The GNU C library does not presently support locale definitions. diff -durpN glibc-2.0.4/manual/libc.info-27 glibc-2.0.5/manual/libc.info-27 --- glibc-2.0.4/manual/libc.info-27 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-27 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,6 +31,579 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  +File: libc.info, Node: Version Supported, Next: Sysconf, Prev: System Options, Up: System Configuration + +Which Version of POSIX is Supported +=================================== + + - Macro: long int _POSIX_VERSION + This constant represents the version of the POSIX.1 standard to + which the implementation conforms. For an implementation + conforming to the 1990 POSIX.1 standard, the value is the integer + `199009L'. + + `_POSIX_VERSION' is always defined (in `unistd.h') in any POSIX + system. + + *Usage Note:* Don't try to test whether the system supports POSIX + by including `unistd.h' and then checking whether `_POSIX_VERSION' + is defined. On a non-POSIX system, this will probably fail + because there is no `unistd.h'. We do not know of *any* way you + can reliably test at compilation time whether your target system + supports POSIX or whether `unistd.h' exists. + + The GNU C compiler predefines the symbol `__POSIX__' if the target + system is a POSIX system. Provided you do not use any other + compilers on POSIX systems, testing `defined (__POSIX__)' will + reliably detect such systems. + + - Macro: long int _POSIX2_C_VERSION + This constant represents the version of the POSIX.2 standard which + the library and system kernel support. We don't know what value + this will be for the first version of the POSIX.2 standard, + because the value is based on the year and month in which the + standard is officially adopted. + + The value of this symbol says nothing about the utilities + installed on the system. + + *Usage Note:* You can use this macro to tell whether a POSIX.1 + system library supports POSIX.2 as well. Any POSIX.1 system + contains `unistd.h', so include that file and then test `defined + (_POSIX2_C_VERSION)'. + + +File: libc.info, Node: Sysconf, Next: Minimums, Prev: Version Supported, Up: System Configuration + +Using `sysconf' +=============== + + When your system has configurable system limits, you can use the +`sysconf' function to find out the value that applies to any particular +machine. The function and the associated PARAMETER constants are +declared in the header file `unistd.h'. + +* Menu: + +* Sysconf Definition:: Detailed specifications of `sysconf'. +* Constants for Sysconf:: The list of parameters `sysconf' can read. +* Examples of Sysconf:: How to use `sysconf' and the parameter + macros properly together. + + +File: libc.info, Node: Sysconf Definition, Next: Constants for Sysconf, Up: Sysconf + +Definition of `sysconf' +----------------------- + + - Function: long int sysconf (int PARAMETER) + This function is used to inquire about runtime system parameters. + The PARAMETER argument should be one of the `_SC_' symbols listed + below. + + The normal return value from `sysconf' is the value you requested. + A value of `-1' is returned both if the implementation does not + impose a limit, and in case of an error. + + The following `errno' error conditions are defined for this + function: + + `EINVAL' + The value of the PARAMETER is invalid. + + +File: libc.info, Node: Constants for Sysconf, Next: Examples of Sysconf, Prev: Sysconf Definition, Up: Sysconf + +Constants for `sysconf' Parameters +---------------------------------- + + Here are the symbolic constants for use as the PARAMETER argument to +`sysconf'. The values are all integer constants (more specifically, +enumeration type values). + +`_SC_ARG_MAX' + Inquire about the parameter corresponding to `ARG_MAX'. + +`_SC_CHILD_MAX' + Inquire about the parameter corresponding to `CHILD_MAX'. + +`_SC_OPEN_MAX' + Inquire about the parameter corresponding to `OPEN_MAX'. + +`_SC_STREAM_MAX' + Inquire about the parameter corresponding to `STREAM_MAX'. + +`_SC_TZNAME_MAX' + Inquire about the parameter corresponding to `TZNAME_MAX'. + +`_SC_NGROUPS_MAX' + Inquire about the parameter corresponding to `NGROUPS_MAX'. + +`_SC_JOB_CONTROL' + Inquire about the parameter corresponding to `_POSIX_JOB_CONTROL'. + +`_SC_SAVED_IDS' + Inquire about the parameter corresponding to `_POSIX_SAVED_IDS'. + +`_SC_VERSION' + Inquire about the parameter corresponding to `_POSIX_VERSION'. + +`_SC_CLK_TCK' + Inquire about the parameter corresponding to `CLOCKS_PER_SEC'; + *note Basic CPU Time::.. + +`_SC_2_C_DEV' + Inquire about whether the system has the POSIX.2 C compiler + command, `c89'. + +`_SC_2_FORT_DEV' + Inquire about whether the system has the POSIX.2 Fortran compiler + command, `fort77'. + +`_SC_2_FORT_RUN' + Inquire about whether the system has the POSIX.2 `asa' command to + interpret Fortran carriage control. + +`_SC_2_LOCALEDEF' + Inquire about whether the system has the POSIX.2 `localedef' + command. + +`_SC_2_SW_DEV' + Inquire about whether the system has the POSIX.2 commands `ar', + `make', and `strip'. + +`_SC_BC_BASE_MAX' + Inquire about the maximum value of `obase' in the `bc' utility. + +`_SC_BC_DIM_MAX' + Inquire about the maximum size of an array in the `bc' utility. + +`_SC_BC_SCALE_MAX' + Inquire about the maximum value of `scale' in the `bc' utility. + +`_SC_BC_STRING_MAX' + Inquire about the maximum size of a string constant in the `bc' + utility. + +`_SC_COLL_WEIGHTS_MAX' + Inquire about the maximum number of weights that can necessarily + be used in defining the collating sequence for a locale. + +`_SC_EXPR_NEST_MAX' + Inquire about the maximum number of expressions nested within + parentheses when using the `expr' utility. + +`_SC_LINE_MAX' + Inquire about the maximum size of a text line that the POSIX.2 text + utilities can handle. + +`_SC_EQUIV_CLASS_MAX' + Inquire about the maximum number of weights that can be assigned + to an entry of the `LC_COLLATE' category `order' keyword in a + locale definition. The GNU C library does not presently support + locale definitions. + +`_SC_VERSION' + Inquire about the version number of POSIX.1 that the library and + kernel support. + +`_SC_2_VERSION' + Inquire about the version number of POSIX.2 that the system + utilities support. + +`_SC_PAGESIZE' + Inquire about the virtual memory page size of the machine. + `getpagesize' returns the same value. + + +File: libc.info, Node: Examples of Sysconf, Prev: Constants for Sysconf, Up: Sysconf + +Examples of `sysconf' +--------------------- + + We recommend that you first test for a macro definition for the +parameter you are interested in, and call `sysconf' only if the macro +is not defined. For example, here is how to test whether job control +is supported: + + int + have_job_control (void) + { + #ifdef _POSIX_JOB_CONTROL + return 1; + #else + int value = sysconf (_SC_JOB_CONTROL); + if (value < 0) + /* If the system is that badly wedged, + there's no use trying to go on. */ + fatal (strerror (errno)); + return value; + #endif + } + + Here is how to get the value of a numeric limit: + + int + get_child_max () + { + #ifdef CHILD_MAX + return CHILD_MAX; + #else + int value = sysconf (_SC_CHILD_MAX); + if (value < 0) + fatal (strerror (errno)); + return value; + #endif + } + + +File: libc.info, Node: Minimums, Next: Limits for Files, Prev: Sysconf, Up: System Configuration + +Minimum Values for General Capacity Limits +========================================== + + Here are the names for the POSIX minimum upper bounds for the system +limit parameters. The significance of these values is that you can +safely push to these limits without checking whether the particular +system you are using can go that far. + +`_POSIX_ARG_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the maximum combined length of the ARGV and ENVIRON + arguments that can be passed to the `exec' functions. Its value + is `4096'. + +`_POSIX_CHILD_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the maximum number of simultaneous processes per real + user ID. Its value is `6'. + +`_POSIX_NGROUPS_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the maximum number of supplementary group IDs per + process. Its value is `0'. + +`_POSIX_OPEN_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the maximum number of files that a single process can + have open simultaneously. Its value is `16'. + +`_POSIX_SSIZE_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the maximum value that can be stored in an object of type + `ssize_t'. Its value is `32767'. + +`_POSIX_STREAM_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the maximum number of streams that a single process can + have open simultaneously. Its value is `8'. + +`_POSIX_TZNAME_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the maximum length of a time zone name. Its value is + `3'. + +`_POSIX2_RE_DUP_MAX' + The value of this macro is the most restrictive limit permitted by + POSIX for the numbers used in the `\{MIN,MAX\}' construct in a + regular expression. Its value is `255'. + + +File: libc.info, Node: Limits for Files, Next: Options for Files, Prev: Minimums, Up: System Configuration + +Limits on File System Capacity +============================== + + The POSIX.1 standard specifies a number of parameters that describe +the limitations of the file system. It's possible for the system to +have a fixed, uniform limit for a parameter, but this isn't the usual +case. On most systems, it's possible for different file systems (and, +for some parameters, even different files) to have different maximum +limits. For example, this is very likely if you use NFS to mount some +of the file systems from other machines. + + Each of the following macros is defined in `limits.h' only if the +system has a fixed, uniform limit for the parameter in question. If the +system allows different file systems or files to have different limits, +then the macro is undefined; use `pathconf' or `fpathconf' to find out +the limit that applies to a particular file. *Note Pathconf::. + + Each parameter also has another macro, with a name starting with +`_POSIX', which gives the lowest value that the limit is allowed to +have on *any* POSIX system. *Note File Minimums::. + + - Macro: int LINK_MAX + The uniform system limit (if any) for the number of names for a + given file. *Note Hard Links::. + + - Macro: int MAX_CANON + The uniform system limit (if any) for the amount of text in a line + of input when input editing is enabled. *Note Canonical or Not::. + + - Macro: int MAX_INPUT + The uniform system limit (if any) for the total number of + characters typed ahead as input. *Note I/O Queues::. + + - Macro: int NAME_MAX + The uniform system limit (if any) for the length of a file name + component. + + - Macro: int PATH_MAX + The uniform system limit (if any) for the length of an entire file + name (that is, the argument given to system calls such as `open'). + + - Macro: int PIPE_BUF + The uniform system limit (if any) for the number of bytes that can + be written atomically to a pipe. If multiple processes are + writing to the same pipe simultaneously, output from different + processes might be interleaved in chunks of this size. *Note + Pipes and FIFOs::. + + These are alternative macro names for some of the same information. + + - Macro: int MAXNAMLEN + This is the BSD name for `NAME_MAX'. It is defined in `dirent.h'. + + - Macro: int FILENAME_MAX + The value of this macro is an integer constant expression that + represents the maximum length of a file name string. It is + defined in `stdio.h'. + + Unlike `PATH_MAX', this macro is defined even if there is no actual + limit imposed. In such a case, its value is typically a very large + number. *This is always the case on the GNU system.* + + *Usage Note:* Don't use `FILENAME_MAX' as the size of an array in + which to store a file name! You can't possibly make an array that + big! Use dynamic allocation (*note Memory Allocation::.) instead. + + +File: libc.info, Node: Options for Files, Next: File Minimums, Prev: Limits for Files, Up: System Configuration + +Optional Features in File Support +================================= + + POSIX defines certain system-specific options in the system calls for +operating on files. Some systems support these options and others do +not. Since these options are provided in the kernel, not in the +library, simply using the GNU C library does not guarantee any of these +features is supported; it depends on the system you are using. They can +also vary between file systems on a single machine. + + This section describes the macros you can test to determine whether a +particular option is supported on your machine. If a given macro is +defined in `unistd.h', then its value says whether the corresponding +feature is supported. (A value of `-1' indicates no; any other value +indicates yes.) If the macro is undefined, it means particular files +may or may not support the feature. + + Since all the machines that support the GNU C library also support +NFS, one can never make a general statement about whether all file +systems support the `_POSIX_CHOWN_RESTRICTED' and `_POSIX_NO_TRUNC' +features. So these names are never defined as macros in the GNU C +library. + + - Macro: int _POSIX_CHOWN_RESTRICTED + If this option is in effect, the `chown' function is restricted so + that the only changes permitted to nonprivileged processes is to + change the group owner of a file to either be the effective group + ID of the process, or one of its supplementary group IDs. *Note + File Owner::. + + - Macro: int _POSIX_NO_TRUNC + If this option is in effect, file name components longer than + `NAME_MAX' generate an `ENAMETOOLONG' error. Otherwise, file name + components that are too long are silently truncated. + + - Macro: unsigned char _POSIX_VDISABLE + This option is only meaningful for files that are terminal devices. + If it is enabled, then handling for special control characters can + be disabled individually. *Note Special Characters::. + + If one of these macros is undefined, that means that the option +might be in effect for some files and not for others. To inquire about +a particular file, call `pathconf' or `fpathconf'. *Note Pathconf::. + + +File: libc.info, Node: File Minimums, Next: Pathconf, Prev: Options for Files, Up: System Configuration + +Minimum Values for File System Limits +===================================== + + Here are the names for the POSIX minimum upper bounds for some of the +above parameters. The significance of these values is that you can +safely push to these limits without checking whether the particular +system you are using can go that far. + +`_POSIX_LINK_MAX' + The most restrictive limit permitted by POSIX for the maximum + value of a file's link count. The value of this constant is `8'; + thus, you can always make up to eight names for a file without + running into a system limit. + +`_POSIX_MAX_CANON' + The most restrictive limit permitted by POSIX for the maximum + number of bytes in a canonical input line from a terminal device. + The value of this constant is `255'. + +`_POSIX_MAX_INPUT' + The most restrictive limit permitted by POSIX for the maximum + number of bytes in a terminal device input queue (or typeahead + buffer). *Note Input Modes::. The value of this constant is + `255'. + +`_POSIX_NAME_MAX' + The most restrictive limit permitted by POSIX for the maximum + number of bytes in a file name component. The value of this + constant is `14'. + +`_POSIX_PATH_MAX' + The most restrictive limit permitted by POSIX for the maximum + number of bytes in a file name. The value of this constant is + `255'. + +`_POSIX_PIPE_BUF' + The most restrictive limit permitted by POSIX for the maximum + number of bytes that can be written atomically to a pipe. The + value of this constant is `512'. + + +File: libc.info, Node: Pathconf, Next: Utility Limits, Prev: File Minimums, Up: System Configuration + +Using `pathconf' +================ + + When your machine allows different files to have different values +for a file system parameter, you can use the functions in this section +to find out the value that applies to any particular file. + + These functions and the associated constants for the PARAMETER +argument are declared in the header file `unistd.h'. + + - Function: long int pathconf (const char *FILENAME, int PARAMETER) + This function is used to inquire about the limits that apply to + the file named FILENAME. + + The PARAMETER argument should be one of the `_PC_' constants + listed below. + + The normal return value from `pathconf' is the value you requested. + A value of `-1' is returned both if the implementation does not + impose a limit, and in case of an error. In the former case, + `errno' is not set, while in the latter case, `errno' is set to + indicate the cause of the problem. So the only way to use this + function robustly is to store `0' into `errno' just before calling + it. + + Besides the usual file name errors (*note File Name Errors::.), + the following error condition is defined for this function: + + `EINVAL' + The value of PARAMETER is invalid, or the implementation + doesn't support the PARAMETER for the specific file. + + - Function: long int fpathconf (int FILEDES, int PARAMETER) + This is just like `pathconf' except that an open file descriptor + is used to specify the file for which information is requested, + instead of a file name. + + The following `errno' error conditions are defined for this + function: + + `EBADF' + The FILEDES argument is not a valid file descriptor. + + `EINVAL' + The value of PARAMETER is invalid, or the implementation + doesn't support the PARAMETER for the specific file. + + Here are the symbolic constants that you can use as the PARAMETER +argument to `pathconf' and `fpathconf'. The values are all integer +constants. + +`_PC_LINK_MAX' + Inquire about the value of `LINK_MAX'. + +`_PC_MAX_CANON' + Inquire about the value of `MAX_CANON'. + +`_PC_MAX_INPUT' + Inquire about the value of `MAX_INPUT'. + +`_PC_NAME_MAX' + Inquire about the value of `NAME_MAX'. + +`_PC_PATH_MAX' + Inquire about the value of `PATH_MAX'. + +`_PC_PIPE_BUF' + Inquire about the value of `PIPE_BUF'. + +`_PC_CHOWN_RESTRICTED' + Inquire about the value of `_POSIX_CHOWN_RESTRICTED'. + +`_PC_NO_TRUNC' + Inquire about the value of `_POSIX_NO_TRUNC'. + +`_PC_VDISABLE' + Inquire about the value of `_POSIX_VDISABLE'. + + +File: libc.info, Node: Utility Limits, Next: Utility Minimums, Prev: Pathconf, Up: System Configuration + +Utility Program Capacity Limits +=============================== + + The POSIX.2 standard specifies certain system limits that you can +access through `sysconf' that apply to utility behavior rather than the +behavior of the library or the operating system. + + The GNU C library defines macros for these limits, and `sysconf' +returns values for them if you ask; but these values convey no +meaningful information. They are simply the smallest values that +POSIX.2 permits. + + - Macro: int BC_BASE_MAX + The largest value of `obase' that the `bc' utility is guaranteed + to support. + + - Macro: int BC_SCALE_MAX + The largest value of `scale' that the `bc' utility is guaranteed + to support. + + - Macro: int BC_DIM_MAX + The largest number of elements in one array that the `bc' utility + is guaranteed to support. + + - Macro: int BC_STRING_MAX + The largest number of characters in one string constant that the + `bc' utility is guaranteed to support. + + - Macro: int BC_DIM_MAX + The largest number of elements in one array that the `bc' utility + is guaranteed to support. + + - Macro: int COLL_WEIGHTS_MAX + The largest number of weights that can necessarily be used in + defining the collating sequence for a locale. + + - Macro: int EXPR_NEST_MAX + The maximum number of expressions that can be nested within + parenthesis by the `expr' utility. + + - Macro: int LINE_MAX + The largest text line that the text-oriented POSIX.2 utilities can + support. (If you are using the GNU versions of these utilities, + then there is no actual limit except that imposed by the available + virtual memory, but there is no way that the library can tell you + this.) + + - Macro: int EQUIV_CLASS_MAX + The maximum number of weights that can be assigned to an entry of + the `LC_COLLATE' category `order' keyword in a locale definition. + The GNU C library does not presently support locale definitions. + + File: libc.info, Node: Utility Minimums, Next: String Parameters, Prev: Utility Limits, Up: System Configuration Minimum Values for Utility Limits @@ -672,543 +1250,4 @@ different pointer representations, the c representation to use for that argument. You can avoid the problem by explicitly casting the constant to the proper pointer type, but we recommend instead adding a prototype for the function you are calling. - - -File: libc.info, Node: Important Data Types, Next: Data Type Measurements, Prev: Null Pointer Constant, Up: Language Features - -Important Data Types -==================== - - The result of subtracting two pointers in C is always an integer, -but the precise data type varies from C compiler to C compiler. -Likewise, the data type of the result of `sizeof' also varies between -compilers. ISO defines standard aliases for these two types, so you -can refer to them in a portable fashion. They are defined in the -header file `stddef.h'. - - - Data Type: ptrdiff_t - This is the signed integer type of the result of subtracting two - pointers. For example, with the declaration `char *p1, *p2;', the - expression `p2 - p1' is of type `ptrdiff_t'. This will probably - be one of the standard signed integer types (`short int', `int' or - `long int'), but might be a nonstandard type that exists only for - this purpose. - - - Data Type: size_t - This is an unsigned integer type used to represent the sizes of - objects. The result of the `sizeof' operator is of this type, and - functions such as `malloc' (*note Unconstrained Allocation::.) and - `memcpy' (*note Copying and Concatenation::.) accept arguments of - this type to specify object sizes. - - *Usage Note:* `size_t' is the preferred way to declare any - arguments or variables that hold the size of an object. - - In the GNU system `size_t' is equivalent to either `unsigned int' or -`unsigned long int'. These types have identical properties on the GNU -system, and for most purposes, you can use them interchangeably. -However, they are distinct as data types, which makes a difference in -certain contexts. - - For example, when you specify the type of a function argument in a -function prototype, it makes a difference which one you use. If the -system header files declare `malloc' with an argument of type `size_t' -and you declare `malloc' with an argument of type `unsigned int', you -will get a compilation error if `size_t' happens to be `unsigned long -int' on your system. To avoid any possibility of error, when a -function argument or value is supposed to have type `size_t', never -declare its type in any other way. - - *Compatibility Note:* Implementations of C before the advent of -ISO C generally used `unsigned int' for representing object sizes and -`int' for pointer subtraction results. They did not necessarily define -either `size_t' or `ptrdiff_t'. Unix systems did define `size_t', in -`sys/types.h', but the definition was usually a signed type. - - -File: libc.info, Node: Data Type Measurements, Prev: Important Data Types, Up: Language Features - -Data Type Measurements -====================== - - Most of the time, if you choose the proper C data type for each -object in your program, you need not be concerned with just how it is -represented or how many bits it uses. When you do need such -information, the C language itself does not provide a way to get it. -The header files `limits.h' and `float.h' contain macros which give you -this information in full detail. - -* Menu: - -* 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 the floating point types. -* Structure Measurement:: Getting measurements on structure types. - - -File: libc.info, Node: Width of Type, Next: Range of Type, Up: Data Type Measurements - -Computing the Width of an Integer Data Type -------------------------------------------- - - The most common reason that a program needs to know how many bits -are in an integer type is for using an array of `long int' as a bit -vector. You can access the bit at index N with - - vector[N / LONGBITS] & (1 << (N % LONGBITS)) - -provided you define `LONGBITS' as the number of bits in a `long int'. - - There is no operator in the C language that can give you the number -of bits in an integer data type. But you can compute it from the macro -`CHAR_BIT', defined in the header file `limits.h'. - -`CHAR_BIT' - This is the number of bits in a `char'--eight, on most systems. - The value has type `int'. - - You can compute the number of bits in any data type TYPE like this: - - sizeof (TYPE) * CHAR_BIT - - -File: libc.info, Node: Range of Type, Next: Floating Type Macros, Prev: Width of Type, Up: Data Type Measurements - -Range of an Integer Type ------------------------- - - Suppose you need to store an integer value which can range from zero -to one million. Which is the smallest type you can use? There is no -general rule; it depends on the C compiler and target machine. You can -use the `MIN' and `MAX' macros in `limits.h' to determine which type -will work. - - Each signed integer type has a pair of macros which give the smallest -and largest values that it can hold. Each unsigned integer type has one -such macro, for the maximum value; the minimum value is, of course, -zero. - - The values of these macros are all integer constant expressions. The -`MAX' and `MIN' macros for `char' and `short int' types have values of -type `int'. The `MAX' and `MIN' macros for the other types have values -of the same type described by the macro--thus, `ULONG_MAX' has type -`unsigned long int'. - -`SCHAR_MIN' - This is the minimum value that can be represented by a - `signed char'. - -`SCHAR_MAX' -`UCHAR_MAX' - These are the maximum values that can be represented by a - `signed char' and `unsigned char', respectively. - -`CHAR_MIN' - This is the minimum value that can be represented by a `char'. - It's equal to `SCHAR_MIN' if `char' is signed, or zero otherwise. - -`CHAR_MAX' - This is the maximum value that can be represented by a `char'. - It's equal to `SCHAR_MAX' if `char' is signed, or `UCHAR_MAX' - otherwise. - -`SHRT_MIN' - This is the minimum value that can be represented by a - `signed short int'. On most machines that the GNU C library runs - on, `short' integers are 16-bit quantities. - -`SHRT_MAX' -`USHRT_MAX' - These are the maximum values that can be represented by a - `signed short int' and `unsigned short int', respectively. - -`INT_MIN' - This is the minimum value that can be represented by a - `signed int'. On most machines that the GNU C system runs on, an - `int' is a 32-bit quantity. - -`INT_MAX' -`UINT_MAX' - These are the maximum values that can be represented by, - respectively, the type `signed int' and the type `unsigned int'. - -`LONG_MIN' - This is the minimum value that can be represented by a - `signed long int'. On most machines that the GNU C system runs - on, `long' integers are 32-bit quantities, the same size as `int'. - -`LONG_MAX' -`ULONG_MAX' - These are the maximum values that can be represented by a - `signed long int' and `unsigned long int', respectively. - -`LONG_LONG_MIN' - This is the minimum value that can be represented by a - `signed long long int'. On most machines that the GNU C system - runs on, `long long' integers are 64-bit quantities. - -`LONG_LONG_MAX' -`ULONG_LONG_MAX' - These are the maximum values that can be represented by a `signed - long long int' and `unsigned long long int', respectively. - -`WCHAR_MAX' - This is the maximum value that can be represented by a `wchar_t'. - *Note Wide Char Intro::. - - The header file `limits.h' also defines some additional constants -that parameterize various operating system and file system limits. -These constants are described in *Note System Configuration::. - - -File: libc.info, Node: Floating Type Macros, Next: Structure Measurement, Prev: Range of Type, Up: Data Type Measurements - -Floating Type Macros --------------------- - - The specific representation of floating point numbers varies from -machine to machine. Because floating point numbers are represented -internally as approximate quantities, algorithms for manipulating -floating point data often need to take account of the precise details of -the machine's floating point representation. - - Some of the functions in the C library itself need this information; -for example, the algorithms for printing and reading floating point -numbers (*note I/O on Streams::.) and for calculating trigonometric and -irrational functions (*note Mathematics::.) use it to avoid round-off -error and loss of accuracy. User programs that implement numerical -analysis techniques also often need this information in order to -minimize or compute error bounds. - - The header file `float.h' describes the format used by your machine. - -* Menu: - -* Floating Point Concepts:: Definitions of terminology. -* Floating Point Parameters:: Details of specific macros. -* IEEE Floating Point:: The measurements for one common - representation. - - -File: libc.info, Node: Floating Point Concepts, Next: Floating Point Parameters, Up: Floating Type Macros - -Floating Point Representation Concepts -...................................... - - This section introduces the terminology for describing floating point -representations. - - You are probably already familiar with most of these concepts in -terms of scientific or exponential notation for floating point numbers. -For example, the number `123456.0' could be expressed in exponential -notation as `1.23456e+05', a shorthand notation indicating that the -mantissa `1.23456' is multiplied by the base `10' raised to power `5'. - - More formally, the internal representation of a floating point number -can be characterized in terms of the following parameters: - - * The "sign" is either `-1' or `1'. - - * The "base" or "radix" for exponentiation, an integer greater than - `1'. This is a constant for a particular representation. - - * The "exponent" to which the base is raised. The upper and lower - bounds of the exponent value are constants for a particular - representation. - - Sometimes, in the actual bits representing the floating point - number, the exponent is "biased" by adding a constant to it, to - make it always be represented as an unsigned quantity. This is - only important if you have some reason to pick apart the bit - fields making up the floating point number by hand, which is - something for which the GNU library provides no support. So this - is ignored in the discussion that follows. - - * The "mantissa" or "significand", an unsigned integer which is a - part of each floating point number. - - * The "precision" of the mantissa. If the base of the representation - is B, then the precision is the number of base-B digits in the - mantissa. This is a constant for a particular representation. - - Many floating point representations have an implicit "hidden bit" - in the mantissa. This is a bit which is present virtually in the - mantissa, but not stored in memory because its value is always 1 - in a normalized number. The precision figure (see above) includes - any hidden bits. - - Again, the GNU library provides no facilities for dealing with such - low-level aspects of the representation. - - The mantissa of a floating point number actually represents an -implicit fraction whose denominator is the base raised to the power of -the precision. Since the largest representable mantissa is one less -than this denominator, the value of the fraction is always strictly -less than `1'. The mathematical value of a floating point number is -then the product of this fraction, the sign, and the base raised to the -exponent. - - We say that the floating point number is "normalized" if the -fraction is at least `1/B', where B is the base. In other words, the -mantissa would be too large to fit if it were multiplied by the base. -Non-normalized numbers are sometimes called "denormal"; they contain -less precision than the representation normally can hold. - - If the number is not normalized, then you can subtract `1' from the -exponent while multiplying the mantissa by the base, and get another -floating point number with the same value. "Normalization" consists of -doing this repeatedly until the number is normalized. Two distinct -normalized floating point numbers cannot be equal in value. - - (There is an exception to this rule: if the mantissa is zero, it is -considered normalized. Another exception happens on certain machines -where the exponent is as small as the representation can hold. Then it -is impossible to subtract `1' from the exponent, so a number may be -normalized even if its fraction is less than `1/B'.) - - -File: libc.info, Node: Floating Point Parameters, Next: IEEE Floating Point, Prev: Floating Point Concepts, Up: Floating Type Macros - -Floating Point Parameters -......................... - - These macro definitions can be accessed by including the header file -`float.h' in your program. - - Macro names starting with `FLT_' refer to the `float' type, while -names beginning with `DBL_' refer to the `double' type and names -beginning with `LDBL_' refer to the `long double' type. (Currently GCC -does not support `long double' as a distinct data type, so the values -for the `LDBL_' constants are equal to the corresponding constants for -the `double' type.) - - Of these macros, only `FLT_RADIX' is guaranteed to be a constant -expression. The other macros listed here cannot be reliably used in -places that require constant expressions, such as `#if' preprocessing -directives or in the dimensions of static arrays. - - Although the ISO C standard specifies minimum and maximum values for -most of these parameters, the GNU C implementation uses whatever values -describe the floating point representation of the target machine. So in -principle GNU C actually satisfies the ISO C requirements only if the -target machine is suitable. In practice, all the machines currently -supported are suitable. - -`FLT_ROUNDS' - This value characterizes the rounding mode for floating point - addition. The following values indicate standard rounding modes: - - `-1' - The mode is indeterminable. - - `0' - Rounding is towards zero. - - `1' - Rounding is to the nearest number. - - `2' - Rounding is towards positive infinity. - - `3' - Rounding is towards negative infinity. - - Any other value represents a machine-dependent nonstandard rounding - mode. - - On most machines, the value is `1', in accordance with the IEEE - standard for floating point. - - Here is a table showing how certain values round for each possible - value of `FLT_ROUNDS', if the other aspects of the representation - match the IEEE single-precision standard. - - 0 1 2 3 - 1.00000003 1.0 1.0 1.00000012 1.0 - 1.00000007 1.0 1.00000012 1.00000012 1.0 - -1.00000003 -1.0 -1.0 -1.0 -1.00000012 - -1.00000007 -1.0 -1.00000012 -1.0 -1.00000012 - -`FLT_RADIX' - This is the value of the base, or radix, of exponent - representation. This is guaranteed to be a constant expression, - unlike the other macros described in this section. The value is 2 - on all machines we know of except the IBM 360 and derivatives. - -`FLT_MANT_DIG' - This is the number of base-`FLT_RADIX' digits in the floating point - mantissa for the `float' data type. The following expression - yields `1.0' (even though mathematically it should not) due to the - limited number of mantissa digits: - - float radix = FLT_RADIX; - - 1.0f + 1.0f / radix / radix / ... / radix - - where `radix' appears `FLT_MANT_DIG' times. - -`DBL_MANT_DIG' -`LDBL_MANT_DIG' - This is the number of base-`FLT_RADIX' digits in the floating point - mantissa for the data types `double' and `long double', - respectively. - -`FLT_DIG' - This is the number of decimal digits of precision for the `float' - data type. Technically, if P and B are the precision and base - (respectively) for the representation, then the decimal precision - Q is the maximum number of decimal digits such that any floating - point number with Q base 10 digits can be rounded to a floating - point number with P base B digits and back again, without change - to the Q decimal digits. - - The value of this macro is supposed to be at least `6', to satisfy - ISO C. - -`DBL_DIG' -`LDBL_DIG' - These are similar to `FLT_DIG', but for the data types `double' - and `long double', respectively. The values of these macros are - supposed to be at least `10'. - -`FLT_MIN_EXP' - This is the smallest possible exponent value for type `float'. - More precisely, is the minimum negative integer such that the value - `FLT_RADIX' raised to this power minus 1 can be represented as a - normalized floating point number of type `float'. - -`DBL_MIN_EXP' -`LDBL_MIN_EXP' - These are similar to `FLT_MIN_EXP', but for the data types - `double' and `long double', respectively. - -`FLT_MIN_10_EXP' - This is the minimum negative integer such that `10' raised to this - power minus 1 can be represented as a normalized floating point - number of type `float'. This is supposed to be `-37' or even less. - -`DBL_MIN_10_EXP' -`LDBL_MIN_10_EXP' - These are similar to `FLT_MIN_10_EXP', but for the data types - `double' and `long double', respectively. - -`FLT_MAX_EXP' - This is the largest possible exponent value for type `float'. More - precisely, this is the maximum positive integer such that value - `FLT_RADIX' raised to this power minus 1 can be represented as a - floating point number of type `float'. - -`DBL_MAX_EXP' -`LDBL_MAX_EXP' - These are similar to `FLT_MAX_EXP', but for the data types - `double' and `long double', respectively. - -`FLT_MAX_10_EXP' - This is the maximum positive integer such that `10' raised to this - power minus 1 can be represented as a normalized floating point - number of type `float'. This is supposed to be at least `37'. - -`DBL_MAX_10_EXP' -`LDBL_MAX_10_EXP' - These are similar to `FLT_MAX_10_EXP', but for the data types - `double' and `long double', respectively. - -`FLT_MAX' - The value of this macro is the maximum number representable in type - `float'. It is supposed to be at least `1E+37'. The value has - type `float'. - - The smallest representable number is `- FLT_MAX'. - -`DBL_MAX' -`LDBL_MAX' - These are similar to `FLT_MAX', but for the data types `double' - and `long double', respectively. The type of the macro's value is - the same as the type it describes. - -`FLT_MIN' - The value of this macro is the minimum normalized positive floating - point number that is representable in type `float'. It is supposed - to be no more than `1E-37'. - -`DBL_MIN' -`LDBL_MIN' - These are similar to `FLT_MIN', but for the data types `double' - and `long double', respectively. The type of the macro's value is - the same as the type it describes. - -`FLT_EPSILON' - This is the minimum positive floating point number of type `float' - such that `1.0 + FLT_EPSILON != 1.0' is true. It's supposed to be - no greater than `1E-5'. - -`DBL_EPSILON' -`LDBL_EPSILON' - These are similar to `FLT_EPSILON', but for the data types - `double' and `long double', respectively. The type of the macro's - value is the same as the type it describes. The values are not - supposed to be greater than `1E-9'. - - -File: libc.info, Node: IEEE Floating Point, Prev: Floating Point Parameters, Up: Floating Type Macros - -IEEE Floating Point -................... - - Here is an example showing how the floating type measurements come -out for the most common floating point representation, specified by the -`IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE Std -754-1985)'. Nearly all computers designed since the 1980s use this -format. - - The IEEE single-precision float representation uses a base of 2. -There is a sign bit, a mantissa with 23 bits plus one hidden bit (so -the total precision is 24 base-2 digits), and an 8-bit exponent that -can represent values in the range -125 to 128, inclusive. - - So, for an implementation that uses this representation for the -`float' data type, appropriate values for the corresponding parameters -are: - - FLT_RADIX 2 - FLT_MANT_DIG 24 - FLT_DIG 6 - FLT_MIN_EXP -125 - FLT_MIN_10_EXP -37 - FLT_MAX_EXP 128 - FLT_MAX_10_EXP +38 - FLT_MIN 1.17549435E-38F - FLT_MAX 3.40282347E+38F - FLT_EPSILON 1.19209290E-07F - - Here are the values for the `double' data type: - - DBL_MANT_DIG 53 - DBL_DIG 15 - DBL_MIN_EXP -1021 - DBL_MIN_10_EXP -307 - DBL_MAX_EXP 1024 - DBL_MAX_10_EXP 308 - DBL_MAX 1.7976931348623157E+308 - DBL_MIN 2.2250738585072014E-308 - DBL_EPSILON 2.2204460492503131E-016 - - -File: libc.info, Node: Structure Measurement, Prev: Floating Type Macros, Up: Data Type Measurements - -Structure Field Offset Measurement ----------------------------------- - - You can use `offsetof' to measure the location within a structure -type of a particular structure member. - - - Macro: size_t offsetof (TYPE, MEMBER) - This expands to a integer constant expression that is the offset - of the structure member named MEMBER in a the structure type TYPE. - For example, `offsetof (struct s, elem)' is the offset, in bytes, - of the member `elem' in a `struct s'. - - This macro won't work if MEMBER is a bit field; you get an error - from the C compiler in that case. diff -durpN glibc-2.0.4/manual/libc.info-28 glibc-2.0.5/manual/libc.info-28 --- glibc-2.0.4/manual/libc.info-28 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-28 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,3828 +31,541 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  -File: libc.info, Node: Library Summary, Next: Maintenance, Prev: Language Features, Up: Top - -Summary of Library Facilities -***************************** - - This appendix is a complete list of the facilities declared within -the header files supplied with the GNU C library. Each entry also -lists the standard or other source from which each facility is derived, -and tells you where in the manual you can find more information about -how to use it. - -`void abort (void)' - `stdlib.h' (ISO): *Note Aborting a Program::. - -`int abs (int NUMBER)' - `stdlib.h' (ISO): *Note Absolute Value::. - -`int accept (int SOCKET, struct sockaddr *ADDR, size_t *LENGTH-PTR)' - `sys/socket.h' (BSD): *Note Accepting Connections::. - -`int access (const char *FILENAME, int HOW)' - `unistd.h' (POSIX.1): *Note Testing File Access::. - -`double acosh (double X)' - `math.h' (BSD): *Note Hyperbolic Functions::. - -`double acos (double X)' - `math.h' (ISO): *Note Inverse Trig Functions::. - -`int adjtime (const struct timeval *DELTA, struct timeval *OLDDELTA)' - `sys/time.h' (BSD): *Note High-Resolution Calendar::. - -`AF_FILE' - `sys/socket.h' (GNU): *Note Address Formats::. - -`AF_INET' - `sys/socket.h' (BSD): *Note Address Formats::. - -`AF_UNIX' - `sys/socket.h' (BSD): *Note Address Formats::. - -`AF_UNSPEC' - `sys/socket.h' (BSD): *Note Address Formats::. - -`unsigned int alarm (unsigned int SECONDS)' - `unistd.h' (POSIX.1): *Note Setting an Alarm::. - -`void * alloca (size_t SIZE);' - `stdlib.h' (GNU, BSD): *Note Variable Size Automatic::. - -`tcflag_t ALTWERASE' - `termios.h' (BSD): *Note Local Modes::. - -`int ARG_MAX' - `limits.h' (POSIX.1): *Note General Limits::. - -`char * asctime (const struct tm *BROKENTIME)' - `time.h' (ISO): *Note Formatting Date and Time::. - -`double asinh (double X)' - `math.h' (BSD): *Note Hyperbolic Functions::. - -`double asin (double X)' - `math.h' (ISO): *Note Inverse Trig Functions::. - -`int asprintf (char **PTR, const char *TEMPLATE, ...)' - `stdio.h' (GNU): *Note Dynamic Output::. - -`void assert (int EXPRESSION)' - `assert.h' (ISO): *Note Consistency Checking::. - -`void assert_perror (int ERRNUM)' - `assert.h' (GNU): *Note Consistency Checking::. - -`double atan2 (double Y, double X)' - `math.h' (ISO): *Note Inverse Trig Functions::. - -`double atanh (double X)' - `math.h' (BSD): *Note Hyperbolic Functions::. - -`double atan (double X)' - `math.h' (ISO): *Note Inverse Trig Functions::. - -`int atexit (void (*FUNCTION) (void))' - `stdlib.h' (ISO): *Note Cleanups on Exit::. - -`double atof (const char *STRING)' - `stdlib.h' (ISO): *Note Parsing of Floats::. - -`int atoi (const char *STRING)' - `stdlib.h' (ISO): *Note Parsing of Integers::. - -`long int atol (const char *STRING)' - `stdlib.h' (ISO): *Note Parsing of Integers::. +File: libc.info, Node: Important Data Types, Next: Data Type Measurements, Prev: Null Pointer Constant, Up: Language Features -`B0' - `termios.h' (POSIX.1): *Note Line Speed::. +Important Data Types +==================== -`B110' - `termios.h' (POSIX.1): *Note Line Speed::. + The result of subtracting two pointers in C is always an integer, +but the precise data type varies from C compiler to C compiler. +Likewise, the data type of the result of `sizeof' also varies between +compilers. ISO defines standard aliases for these two types, so you +can refer to them in a portable fashion. They are defined in the +header file `stddef.h'. -`B1200' - `termios.h' (POSIX.1): *Note Line Speed::. + - Data Type: ptrdiff_t + This is the signed integer type of the result of subtracting two + pointers. For example, with the declaration `char *p1, *p2;', the + expression `p2 - p1' is of type `ptrdiff_t'. This will probably + be one of the standard signed integer types (`short int', `int' or + `long int'), but might be a nonstandard type that exists only for + this purpose. -`B134' - `termios.h' (POSIX.1): *Note Line Speed::. + - Data Type: size_t + This is an unsigned integer type used to represent the sizes of + objects. The result of the `sizeof' operator is of this type, and + functions such as `malloc' (*note Unconstrained Allocation::.) and + `memcpy' (*note Copying and Concatenation::.) accept arguments of + this type to specify object sizes. -`B150' - `termios.h' (POSIX.1): *Note Line Speed::. + *Usage Note:* `size_t' is the preferred way to declare any + arguments or variables that hold the size of an object. -`B1800' - `termios.h' (POSIX.1): *Note Line Speed::. + In the GNU system `size_t' is equivalent to either `unsigned int' or +`unsigned long int'. These types have identical properties on the GNU +system, and for most purposes, you can use them interchangeably. +However, they are distinct as data types, which makes a difference in +certain contexts. -`B19200' - `termios.h' (POSIX.1): *Note Line Speed::. + For example, when you specify the type of a function argument in a +function prototype, it makes a difference which one you use. If the +system header files declare `malloc' with an argument of type `size_t' +and you declare `malloc' with an argument of type `unsigned int', you +will get a compilation error if `size_t' happens to be `unsigned long +int' on your system. To avoid any possibility of error, when a +function argument or value is supposed to have type `size_t', never +declare its type in any other way. -`B200' - `termios.h' (POSIX.1): *Note Line Speed::. + *Compatibility Note:* Implementations of C before the advent of +ISO C generally used `unsigned int' for representing object sizes and +`int' for pointer subtraction results. They did not necessarily define +either `size_t' or `ptrdiff_t'. Unix systems did define `size_t', in +`sys/types.h', but the definition was usually a signed type. -`B2400' - `termios.h' (POSIX.1): *Note Line Speed::. + +File: libc.info, Node: Data Type Measurements, Prev: Important Data Types, Up: Language Features -`B300' - `termios.h' (POSIX.1): *Note Line Speed::. +Data Type Measurements +====================== -`B38400' - `termios.h' (POSIX.1): *Note Line Speed::. + Most of the time, if you choose the proper C data type for each +object in your program, you need not be concerned with just how it is +represented or how many bits it uses. When you do need such +information, the C language itself does not provide a way to get it. +The header files `limits.h' and `float.h' contain macros which give you +this information in full detail. -`B4800' - `termios.h' (POSIX.1): *Note Line Speed::. +* Menu: -`B50' - `termios.h' (POSIX.1): *Note Line Speed::. +* 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 the floating point types. +* Structure Measurement:: Getting measurements on structure types. -`B600' - `termios.h' (POSIX.1): *Note Line Speed::. + +File: libc.info, Node: Width of Type, Next: Range of Type, Up: Data Type Measurements -`B75' - `termios.h' (POSIX.1): *Note Line Speed::. +Computing the Width of an Integer Data Type +------------------------------------------- -`B9600' - `termios.h' (POSIX.1): *Note Line Speed::. + The most common reason that a program needs to know how many bits +are in an integer type is for using an array of `long int' as a bit +vector. You can access the bit at index N with -`int BC_BASE_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. + vector[N / LONGBITS] & (1 << (N % LONGBITS)) -`int BC_DIM_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. +provided you define `LONGBITS' as the number of bits in a `long int'. -`int BC_DIM_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. + There is no operator in the C language that can give you the number +of bits in an integer data type. But you can compute it from the macro +`CHAR_BIT', defined in the header file `limits.h'. -`int bcmp (const void *A1, const void *A2, size_t SIZE)' - `string.h' (BSD): *Note String/Array Comparison::. +`CHAR_BIT' + This is the number of bits in a `char'--eight, on most systems. + The value has type `int'. -`void * bcopy (void *FROM, const void *TO, size_t SIZE)' - `string.h' (BSD): *Note Copying and Concatenation::. + You can compute the number of bits in any data type TYPE like this: -`int BC_SCALE_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. + sizeof (TYPE) * CHAR_BIT -`int BC_STRING_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. + +File: libc.info, Node: Range of Type, Next: Floating Type Macros, Prev: Width of Type, Up: Data Type Measurements -`int bind (int SOCKET, struct sockaddr *ADDR, size_t LENGTH)' - `sys/socket.h' (BSD): *Note Setting Address::. +Range of an Integer Type +------------------------ -`tcflag_t BRKINT' - `termios.h' (POSIX.1): *Note Input Modes::. + Suppose you need to store an integer value which can range from zero +to one million. Which is the smallest type you can use? There is no +general rule; it depends on the C compiler and target machine. You can +use the `MIN' and `MAX' macros in `limits.h' to determine which type +will work. -`_BSD_SOURCE' - (GNU): *Note Feature Test Macros::. + Each signed integer type has a pair of macros which give the smallest +and largest values that it can hold. Each unsigned integer type has one +such macro, for the maximum value; the minimum value is, of course, +zero. -`void * bsearch (const void *KEY, const void *ARRAY, size_t COUNT, size_t SIZE, comparison_fn_t COMPARE)' - `stdlib.h' (ISO): *Note Array Search Function::. + The values of these macros are all integer constant expressions. The +`MAX' and `MIN' macros for `char' and `short int' types have values of +type `int'. The `MAX' and `MIN' macros for the other types have values +of the same type described by the macro--thus, `ULONG_MAX' has type +`unsigned long int'. -`int BUFSIZ' - `stdio.h' (ISO): *Note Controlling Buffering::. +`SCHAR_MIN' + This is the minimum value that can be represented by a + `signed char'. -`void * bzero (void *BLOCK, size_t SIZE)' - `string.h' (BSD): *Note Copying and Concatenation::. +`SCHAR_MAX' +`UCHAR_MAX' + These are the maximum values that can be represented by a + `signed char' and `unsigned char', respectively. -`double cabs (struct { double real, imag; } Z)' - `math.h' (BSD): *Note Absolute Value::. +`CHAR_MIN' + This is the minimum value that can be represented by a `char'. + It's equal to `SCHAR_MIN' if `char' is signed, or zero otherwise. -`void * calloc (size_t COUNT, size_t ELTSIZE)' - `malloc.h', `stdlib.h' (ISO): *Note Allocating Cleared Space::. +`CHAR_MAX' + This is the maximum value that can be represented by a `char'. + It's equal to `SCHAR_MAX' if `char' is signed, or `UCHAR_MAX' + otherwise. -`double cbrt (double X)' - `math.h' (BSD): *Note Exponents and Logarithms::. +`SHRT_MIN' + This is the minimum value that can be represented by a + `signed short int'. On most machines that the GNU C library runs + on, `short' integers are 16-bit quantities. -`cc_t' - `termios.h' (POSIX.1): *Note Mode Data Types::. +`SHRT_MAX' +`USHRT_MAX' + These are the maximum values that can be represented by a + `signed short int' and `unsigned short int', respectively. -`tcflag_t CCTS_OFLOW' - `termios.h' (BSD): *Note Control Modes::. +`INT_MIN' + This is the minimum value that can be represented by a + `signed int'. On most machines that the GNU C system runs on, an + `int' is a 32-bit quantity. -`double ceil (double X)' - `math.h' (ISO): *Note Rounding and Remainders::. +`INT_MAX' +`UINT_MAX' + These are the maximum values that can be represented by, + respectively, the type `signed int' and the type `unsigned int'. -`speed_t cfgetispeed (const struct termios *TERMIOS-P)' - `termios.h' (POSIX.1): *Note Line Speed::. +`LONG_MIN' + This is the minimum value that can be represented by a + `signed long int'. On most machines that the GNU C system runs + on, `long' integers are 32-bit quantities, the same size as `int'. -`speed_t cfgetospeed (const struct termios *TERMIOS-P)' - `termios.h' (POSIX.1): *Note Line Speed::. +`LONG_MAX' +`ULONG_MAX' + These are the maximum values that can be represented by a + `signed long int' and `unsigned long int', respectively. -`int cfmakeraw (struct termios *TERMIOS-P)' - `termios.h' (BSD): *Note Noncanonical Input::. +`LONG_LONG_MIN' + This is the minimum value that can be represented by a + `signed long long int'. On most machines that the GNU C system + runs on, `long long' integers are 64-bit quantities. -`void cfree (void *PTR)' - `stdlib.h' (Sun): *Note Freeing after Malloc::. +`LONG_LONG_MAX' +`ULONG_LONG_MAX' + These are the maximum values that can be represented by a `signed + long long int' and `unsigned long long int', respectively. -`int cfsetispeed (struct termios *TERMIOS-P, speed_t SPEED)' - `termios.h' (POSIX.1): *Note Line Speed::. +`WCHAR_MAX' + This is the maximum value that can be represented by a `wchar_t'. + *Note Wide Char Intro::. -`int cfsetospeed (struct termios *TERMIOS-P, speed_t SPEED)' - `termios.h' (POSIX.1): *Note Line Speed::. + The header file `limits.h' also defines some additional constants +that parameterize various operating system and file system limits. +These constants are described in *Note System Configuration::. -`int cfsetspeed (struct termios *TERMIOS-P, speed_t SPEED)' - `termios.h' (BSD): *Note Line Speed::. + +File: libc.info, Node: Floating Type Macros, Next: Structure Measurement, Prev: Range of Type, Up: Data Type Measurements -`CHAR_BIT' - `limits.h' (ISO): *Note Width of Type::. +Floating Type Macros +-------------------- -`CHAR_MAX' - `limits.h' (ISO): *Note Range of Type::. + The specific representation of floating point numbers varies from +machine to machine. Because floating point numbers are represented +internally as approximate quantities, algorithms for manipulating +floating point data often need to take account of the precise details of +the machine's floating point representation. -`CHAR_MIN' - `limits.h' (ISO): *Note Range of Type::. + Some of the functions in the C library itself need this information; +for example, the algorithms for printing and reading floating point +numbers (*note I/O on Streams::.) and for calculating trigonometric and +irrational functions (*note Mathematics::.) use it to avoid round-off +error and loss of accuracy. User programs that implement numerical +analysis techniques also often need this information in order to +minimize or compute error bounds. -`int chdir (const char *FILENAME)' - `unistd.h' (POSIX.1): *Note Working Directory::. + The header file `float.h' describes the format used by your machine. -`int CHILD_MAX' - `limits.h' (POSIX.1): *Note General Limits::. +* Menu: -`int chmod (const char *FILENAME, mode_t MODE)' - `sys/stat.h' (POSIX.1): *Note Setting Permissions::. +* Floating Point Concepts:: Definitions of terminology. +* Floating Point Parameters:: Details of specific macros. +* IEEE Floating Point:: The measurements for one common + representation. -`int chown (const char *FILENAME, uid_t OWNER, gid_t GROUP)' - `unistd.h' (POSIX.1): *Note File Owner::. + +File: libc.info, Node: Floating Point Concepts, Next: Floating Point Parameters, Up: Floating Type Macros -`tcflag_t CIGNORE' - `termios.h' (BSD): *Note Control Modes::. +Floating Point Representation Concepts +...................................... -`void clearerr (FILE *STREAM)' - `stdio.h' (ISO): *Note EOF and Errors::. + This section introduces the terminology for describing floating point +representations. -`int CLK_TCK' - `time.h' (POSIX.1): *Note Basic CPU Time::. + You are probably already familiar with most of these concepts in +terms of scientific or exponential notation for floating point numbers. +For example, the number `123456.0' could be expressed in exponential +notation as `1.23456e+05', a shorthand notation indicating that the +mantissa `1.23456' is multiplied by the base `10' raised to power `5'. -`tcflag_t CLOCAL' - `termios.h' (POSIX.1): *Note Control Modes::. + More formally, the internal representation of a floating point number +can be characterized in terms of the following parameters: -`clock_t clock (void)' - `time.h' (ISO): *Note Basic CPU Time::. + * The "sign" is either `-1' or `1'. -`int CLOCKS_PER_SEC' - `time.h' (ISO): *Note Basic CPU Time::. + * The "base" or "radix" for exponentiation, an integer greater than + `1'. This is a constant for a particular representation. -`clock_t' - `time.h' (ISO): *Note Basic CPU Time::. + * The "exponent" to which the base is raised. The upper and lower + bounds of the exponent value are constants for a particular + representation. -`int closedir (DIR *DIRSTREAM)' - `dirent.h' (POSIX.1): *Note Reading/Closing Directory::. + Sometimes, in the actual bits representing the floating point + number, the exponent is "biased" by adding a constant to it, to + make it always be represented as an unsigned quantity. This is + only important if you have some reason to pick apart the bit + fields making up the floating point number by hand, which is + something for which the GNU library provides no support. So this + is ignored in the discussion that follows. -`int close (int FILEDES)' - `unistd.h' (POSIX.1): *Note Opening and Closing Files::. + * The "mantissa" or "significand", an unsigned integer which is a + part of each floating point number. -`int COLL_WEIGHTS_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. + * The "precision" of the mantissa. If the base of the representation + is B, then the precision is the number of base-B digits in the + mantissa. This is a constant for a particular representation. -`size_t confstr (int PARAMETER, char *BUF, size_t LEN)' - `unistd.h' (POSIX.2): *Note String Parameters::. + Many floating point representations have an implicit "hidden bit" + in the mantissa. This is a bit which is present virtually in the + mantissa, but not stored in memory because its value is always 1 + in a normalized number. The precision figure (see above) includes + any hidden bits. -`int connect (int SOCKET, struct sockaddr *ADDR, size_t LENGTH)' - `sys/socket.h' (BSD): *Note Connecting::. + Again, the GNU library provides no facilities for dealing with such + low-level aspects of the representation. -`cookie_close_function' - `stdio.h' (GNU): *Note Hook Functions::. + The mantissa of a floating point number actually represents an +implicit fraction whose denominator is the base raised to the power of +the precision. Since the largest representable mantissa is one less +than this denominator, the value of the fraction is always strictly +less than `1'. The mathematical value of a floating point number is +then the product of this fraction, the sign, and the base raised to the +exponent. -`cookie_io_functions_t' - `stdio.h' (GNU): *Note Streams and Cookies::. + We say that the floating point number is "normalized" if the +fraction is at least `1/B', where B is the base. In other words, the +mantissa would be too large to fit if it were multiplied by the base. +Non-normalized numbers are sometimes called "denormal"; they contain +less precision than the representation normally can hold. -`cookie_read_function' - `stdio.h' (GNU): *Note Hook Functions::. + If the number is not normalized, then you can subtract `1' from the +exponent while multiplying the mantissa by the base, and get another +floating point number with the same value. "Normalization" consists of +doing this repeatedly until the number is normalized. Two distinct +normalized floating point numbers cannot be equal in value. -`cookie_seek_function' - `stdio.h' (GNU): *Note Hook Functions::. + (There is an exception to this rule: if the mantissa is zero, it is +considered normalized. Another exception happens on certain machines +where the exponent is as small as the representation can hold. Then it +is impossible to subtract `1' from the exponent, so a number may be +normalized even if its fraction is less than `1/B'.) -`cookie_write_function' - `stdio.h' (GNU): *Note Hook Functions::. + +File: libc.info, Node: Floating Point Parameters, Next: IEEE Floating Point, Prev: Floating Point Concepts, Up: Floating Type Macros -`double copysign (double VALUE, double SIGN)' - `math.h' (BSD): *Note Normalization Functions::. +Floating Point Parameters +......................... -`double cosh (double X)' - `math.h' (ISO): *Note Hyperbolic Functions::. + These macro definitions can be accessed by including the header file +`float.h' in your program. -`double cos (double X)' - `math.h' (ISO): *Note Trig Functions::. + Macro names starting with `FLT_' refer to the `float' type, while +names beginning with `DBL_' refer to the `double' type and names +beginning with `LDBL_' refer to the `long double' type. (Currently GCC +does not support `long double' as a distinct data type, so the values +for the `LDBL_' constants are equal to the corresponding constants for +the `double' type.) -`tcflag_t CREAD' - `termios.h' (POSIX.1): *Note Control Modes::. + Of these macros, only `FLT_RADIX' is guaranteed to be a constant +expression. The other macros listed here cannot be reliably used in +places that require constant expressions, such as `#if' preprocessing +directives or in the dimensions of static arrays. -`int creat (const char *FILENAME, mode_t MODE)' - `fcntl.h' (POSIX.1): *Note Opening and Closing Files::. + Although the ISO C standard specifies minimum and maximum values for +most of these parameters, the GNU C implementation uses whatever values +describe the floating point representation of the target machine. So in +principle GNU C actually satisfies the ISO C requirements only if the +target machine is suitable. In practice, all the machines currently +supported are suitable. -`tcflag_t CRTS_IFLOW' - `termios.h' (BSD): *Note Control Modes::. +`FLT_ROUNDS' + This value characterizes the rounding mode for floating point + addition. The following values indicate standard rounding modes: -`tcflag_t CS5' - `termios.h' (POSIX.1): *Note Control Modes::. + `-1' + The mode is indeterminable. -`tcflag_t CS6' - `termios.h' (POSIX.1): *Note Control Modes::. + `0' + Rounding is towards zero. -`tcflag_t CS7' - `termios.h' (POSIX.1): *Note Control Modes::. + `1' + Rounding is to the nearest number. -`tcflag_t CS8' - `termios.h' (POSIX.1): *Note Control Modes::. + `2' + Rounding is towards positive infinity. -`tcflag_t CSIZE' - `termios.h' (POSIX.1): *Note Control Modes::. + `3' + Rounding is towards negative infinity. -`_CS_PATH' - `unistd.h' (POSIX.2): *Note String Parameters::. + Any other value represents a machine-dependent nonstandard rounding + mode. -`tcflag_t CSTOPB' - `termios.h' (POSIX.1): *Note Control Modes::. + On most machines, the value is `1', in accordance with the IEEE + standard for floating point. -`char * ctermid (char *STRING)' - `stdio.h' (POSIX.1): *Note Identifying the Terminal::. + Here is a table showing how certain values round for each possible + value of `FLT_ROUNDS', if the other aspects of the representation + match the IEEE single-precision standard. -`char * ctime (const time_t *TIME)' - `time.h' (ISO): *Note Formatting Date and Time::. + 0 1 2 3 + 1.00000003 1.0 1.0 1.00000012 1.0 + 1.00000007 1.0 1.00000012 1.00000012 1.0 + -1.00000003 -1.0 -1.0 -1.0 -1.00000012 + -1.00000007 -1.0 -1.00000012 -1.0 -1.00000012 -`char * cuserid (char *STRING)' - `stdio.h' (POSIX.1): *Note Who Logged In::. +`FLT_RADIX' + This is the value of the base, or radix, of exponent + representation. This is guaranteed to be a constant expression, + unlike the other macros described in this section. The value is 2 + on all machines we know of except the IBM 360 and derivatives. -`int daylight' - `time.h' (SVID): *Note Time Zone Functions::. +`FLT_MANT_DIG' + This is the number of base-`FLT_RADIX' digits in the floating point + mantissa for the `float' data type. The following expression + yields `1.0' (even though mathematically it should not) due to the + limited number of mantissa digits: -`DBL_DIG' - `float.h' (ISO): *Note Floating Point Parameters::. + float radix = FLT_RADIX; + + 1.0f + 1.0f / radix / radix / ... / radix -`DBL_EPSILON' - `float.h' (ISO): *Note Floating Point Parameters::. + where `radix' appears `FLT_MANT_DIG' times. `DBL_MANT_DIG' - `float.h' (ISO): *Note Floating Point Parameters::. +`LDBL_MANT_DIG' + This is the number of base-`FLT_RADIX' digits in the floating point + mantissa for the data types `double' and `long double', + respectively. -`DBL_MAX_10_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. +`FLT_DIG' + This is the number of decimal digits of precision for the `float' + data type. Technically, if P and B are the precision and base + (respectively) for the representation, then the decimal precision + Q is the maximum number of decimal digits such that any floating + point number with Q base 10 digits can be rounded to a floating + point number with P base B digits and back again, without change + to the Q decimal digits. -`DBL_MAX_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. + The value of this macro is supposed to be at least `6', to satisfy + ISO C. -`DBL_MAX' - `float.h' (ISO): *Note Floating Point Parameters::. +`DBL_DIG' +`LDBL_DIG' + These are similar to `FLT_DIG', but for the data types `double' + and `long double', respectively. The values of these macros are + supposed to be at least `10'. -`DBL_MIN_10_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. +`FLT_MIN_EXP' + This is the smallest possible exponent value for type `float'. + More precisely, is the minimum negative integer such that the value + `FLT_RADIX' raised to this power minus 1 can be represented as a + normalized floating point number of type `float'. `DBL_MIN_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. - -`DBL_MIN' - `float.h' (ISO): *Note Floating Point Parameters::. - -`dev_t' - `sys/types.h' (POSIX.1): *Note Attribute Meanings::. - -`double difftime (time_t TIME1, time_t TIME0)' - `time.h' (ISO): *Note Simple Calendar Time::. - -`DIR' - `dirent.h' (POSIX.1): *Note Opening a Directory::. - -`div_t div (int NUMERATOR, int DENOMINATOR)' - `stdlib.h' (ISO): *Note Integer Division::. - -`div_t' - `stdlib.h' (ISO): *Note Integer Division::. - -`double drem (double NUMERATOR, double DENOMINATOR)' - `math.h' (BSD): *Note Rounding and Remainders::. - -`int dup2 (int OLD, int NEW)' - `unistd.h' (POSIX.1): *Note Duplicating Descriptors::. - -`int dup (int OLD)' - `unistd.h' (POSIX.1): *Note Duplicating Descriptors::. - -`int E2BIG' - `errno.h' (POSIX.1: Argument list too long): *Note Error Codes::. - -`int EACCES' - `errno.h' (POSIX.1: Permission denied): *Note Error Codes::. - -`int EADDRINUSE' - `errno.h' (BSD: Address already in use): *Note Error Codes::. - -`int EADDRNOTAVAIL' - `errno.h' (BSD: Cannot assign requested address): *Note Error - Codes::. - -`int EADV' - `errno.h' (Linux???: Advertise error): *Note Error Codes::. - -`int EAFNOSUPPORT' - `errno.h' (BSD: Address family not supported by protocol): *Note - Error Codes::. - -`int EAGAIN' - `errno.h' (POSIX.1: Resource temporarily unavailable): *Note - Error Codes::. - -`int EALREADY' - `errno.h' (BSD: Operation already in progress): *Note Error - Codes::. - -`int EAUTH' - `errno.h' (BSD: Authentication error): *Note Error Codes::. - -`int EBACKGROUND' - `errno.h' (GNU: Inappropriate operation for background process): - *Note Error Codes::. - -`int EBADE' - `errno.h' (Linux???: Invalid exchange): *Note Error Codes::. - -`int EBADFD' - `errno.h' (Linux???: File descriptor in bad state): *Note Error - Codes::. - -`int EBADF' - `errno.h' (POSIX.1: Bad file descriptor): *Note Error Codes::. - -`int EBADMSG' - `errno.h' (XOPEN: Bad message): *Note Error Codes::. - -`int EBADR' - `errno.h' (Linux???: Invalid request descriptor): *Note Error - Codes::. - -`int EBADRPC' - `errno.h' (BSD: RPC struct is bad): *Note Error Codes::. - -`int EBADRQC' - `errno.h' (Linux???: Invalid request code): *Note Error Codes::. - -`int EBADSLT' - `errno.h' (Linux???: Invalid slot): *Note Error Codes::. - -`int EBFONT' - `errno.h' (Linux???: Bad font file format): *Note Error Codes::. - -`int EBUSY' - `errno.h' (POSIX.1: Device or resource busy): *Note Error Codes::. - -`int ECHILD' - `errno.h' (POSIX.1: No child processes): *Note Error Codes::. - -`tcflag_t ECHOCTL' - `termios.h' (BSD): *Note Local Modes::. - -`tcflag_t ECHOE' - `termios.h' (POSIX.1): *Note Local Modes::. - -`tcflag_t ECHO' - `termios.h' (POSIX.1): *Note Local Modes::. - -`tcflag_t ECHOKE' - `termios.h' (BSD): *Note Local Modes::. - -`tcflag_t ECHOK' - `termios.h' (POSIX.1): *Note Local Modes::. - -`tcflag_t ECHONL' - `termios.h' (POSIX.1): *Note Local Modes::. - -`tcflag_t ECHOPRT' - `termios.h' (BSD): *Note Local Modes::. - -`int ECHRNG' - `errno.h' (Linux???: Channel number out of range): *Note Error - Codes::. - -`int ECOMM' - `errno.h' (Linux???: Communication error on send): *Note Error - Codes::. - -`int ECONNABORTED' - `errno.h' (BSD: Software caused connection abort): *Note Error - Codes::. - -`int ECONNREFUSED' - `errno.h' (BSD: Connection refused): *Note Error Codes::. - -`int ECONNRESET' - `errno.h' (BSD: Connection reset by peer): *Note Error Codes::. - -`int EDEADLK' - `errno.h' (POSIX.1: Resource deadlock avoided): *Note Error - Codes::. - -`int EDEADLOCK' - `errno.h' (Linux???: File locking deadlock error): *Note Error - Codes::. - -`int EDESTADDRREQ' - `errno.h' (BSD: Destination address required): *Note Error - Codes::. - -`int EDIED' - `errno.h' (GNU: Translator died): *Note Error Codes::. - -`int ED' - `errno.h' (GNU: ?): *Note Error Codes::. - -`int EDOM' - `errno.h' (ISO: Numerical argument out of domain): *Note Error - Codes::. - -`int EDOTDOT' - `errno.h' (Linux???: RFS specific error): *Note Error Codes::. - -`int EDQUOT' - `errno.h' (BSD: Disc quota exceeded): *Note Error Codes::. - -`int EEXIST' - `errno.h' (POSIX.1: File exists): *Note Error Codes::. - -`int EFAULT' - `errno.h' (POSIX.1: Bad address): *Note Error Codes::. - -`int EFBIG' - `errno.h' (POSIX.1: File too large): *Note Error Codes::. - -`int EFTYPE' - `errno.h' (BSD: Inappropriate file type or format): *Note Error - Codes::. - -`int EGRATUITOUS' - `errno.h' (GNU: Gratuitous error): *Note Error Codes::. - -`int EGREGIOUS' - `errno.h' (GNU: You really blew it this time): *Note Error - Codes::. - -`int EHOSTDOWN' - `errno.h' (BSD: Host is down): *Note Error Codes::. - -`int EHOSTUNREACH' - `errno.h' (BSD: No route to host): *Note Error Codes::. - -`int EIDRM' - `errno.h' (XOPEN: Identifier removed): *Note Error Codes::. - -`int EIEIO' - `errno.h' (GNU: Computer bought the farm): *Note Error Codes::. - -`int EILSEQ' - `errno.h' (ISO: Invalid or incomplete multibyte or wide - character): *Note Error Codes::. - -`int EINPROGRESS' - `errno.h' (BSD: Operation now in progress): *Note Error Codes::. - -`int EINTR' - `errno.h' (POSIX.1: Interrupted system call): *Note Error Codes::. - -`int EINVAL' - `errno.h' (POSIX.1: Invalid argument): *Note Error Codes::. - -`int EIO' - `errno.h' (POSIX.1: Input/output error): *Note Error Codes::. - -`int EISCONN' - `errno.h' (BSD: Transport endpoint is already connected): *Note - Error Codes::. - -`int EISDIR' - `errno.h' (POSIX.1: Is a directory): *Note Error Codes::. - -`int EISNAM' - `errno.h' (Linux???: Is a named type file): *Note Error Codes::. - -`int EL2HLT' - `errno.h' (Linux???: Level 2 halted): *Note Error Codes::. - -`int EL2NSYNC' - `errno.h' (Linux???: Level 2 not synchronized): *Note Error - Codes::. - -`int EL3HLT' - `errno.h' (Linux???: Level 3 halted): *Note Error Codes::. - -`int EL3RST' - `errno.h' (Linux???: Level 3 reset): *Note Error Codes::. - -`int ELIBACC' - `errno.h' (Linux???: Can not access a needed shared library): - *Note Error Codes::. - -`int ELIBBAD' - `errno.h' (Linux???: Accessing a corrupted shared library): *Note - Error Codes::. - -`int ELIBEXEC' - `errno.h' (Linux???: Cannot exec a shared library directly): - *Note Error Codes::. - -`int ELIBMAX' - `errno.h' (Linux???: Attempting to link in too many shared - libraries): *Note Error Codes::. - -`int ELIBSCN' - `errno.h' (Linux???: .lib section in a.out corrupted): *Note - Error Codes::. - -`int ELNRNG' - `errno.h' (Linux???: Link number out of range): *Note Error - Codes::. - -`int ELOOP' - `errno.h' (BSD: Too many levels of symbolic links): *Note Error - Codes::. - -`int EMEDIUMTYPE' - `errno.h' (Linux???: Wrong medium type): *Note Error Codes::. - -`int EMFILE' - `errno.h' (POSIX.1: Too many open files): *Note Error Codes::. - -`int EMLINK' - `errno.h' (POSIX.1: Too many links): *Note Error Codes::. - -`int EMSGSIZE' - `errno.h' (BSD: Message too long): *Note Error Codes::. - -`int EMULTIHOP' - `errno.h' (XOPEN: Multihop attempted): *Note Error Codes::. - -`int ENAMETOOLONG' - `errno.h' (POSIX.1: File name too long): *Note Error Codes::. - -`int ENAVAIL' - `errno.h' (Linux???: No XENIX semaphores available): *Note Error - Codes::. - -`void endgrent (void)' - `grp.h' (SVID, BSD): *Note Scanning All Groups::. - -`void endhostent ()' - `netdb.h' (BSD): *Note Host Names::. - -`void endnetent (void)' - `netdb.h' (BSD): *Note Networks Database::. - -`void endnetgrent (void)' - `netdb.h' (netdb.h): *Note Lookup Netgroup::. - -`void endprotoent (void)' - `netdb.h' (BSD): *Note Protocols Database::. - -`void endpwent (void)' - `pwd.h' (SVID, BSD): *Note Scanning All Users::. - -`void endservent (void)' - `netdb.h' (BSD): *Note Services Database::. - -`int ENEEDAUTH' - `errno.h' (BSD: Need authenticator): *Note Error Codes::. - -`int ENETDOWN' - `errno.h' (BSD: Network is down): *Note Error Codes::. - -`int ENETRESET' - `errno.h' (BSD: Network dropped connection on reset): *Note Error - Codes::. - -`int ENETUNREACH' - `errno.h' (BSD: Network is unreachable): *Note Error Codes::. - -`int ENFILE' - `errno.h' (POSIX.1: Too many open files in system): *Note Error - Codes::. - -`int ENOANO' - `errno.h' (Linux???: No anode): *Note Error Codes::. - -`int ENOBUFS' - `errno.h' (BSD: No buffer space available): *Note Error Codes::. - -`int ENOCSI' - `errno.h' (Linux???: No CSI structure available): *Note Error - Codes::. - -`int ENODATA' - `errno.h' (XOPEN: No data available): *Note Error Codes::. - -`int ENODEV' - `errno.h' (POSIX.1: Operation not supported by device): *Note - Error Codes::. - -`int ENOENT' - `errno.h' (POSIX.1: No such file or directory): *Note Error - Codes::. - -`int ENOEXEC' - `errno.h' (POSIX.1: Exec format error): *Note Error Codes::. - -`int ENOLCK' - `errno.h' (POSIX.1: No locks available): *Note Error Codes::. - -`int ENOLINK' - `errno.h' (XOPEN: Link has been severed): *Note Error Codes::. - -`int ENOMEDIUM' - `errno.h' (Linux???: No medium found): *Note Error Codes::. - -`int ENOMEM' - `errno.h' (POSIX.1: Cannot allocate memory): *Note Error Codes::. - -`int ENOMSG' - `errno.h' (XOPEN: No message of desired type): *Note Error - Codes::. - -`int ENONET' - `errno.h' (Linux???: Machine is not on the network): *Note Error - Codes::. - -`int ENOPKG' - `errno.h' (Linux???: Package not installed): *Note Error Codes::. - -`int ENOPROTOOPT' - `errno.h' (BSD: Protocol not available): *Note Error Codes::. - -`int ENOSPC' - `errno.h' (POSIX.1: No space left on device): *Note Error Codes::. - -`int ENOSR' - `errno.h' (XOPEN: Out of streams resources): *Note Error Codes::. - -`int ENOSTR' - `errno.h' (XOPEN: Device not a stream): *Note Error Codes::. - -`int ENOSYS' - `errno.h' (POSIX.1: Function not implemented): *Note Error - Codes::. - -`int ENOTBLK' - `errno.h' (BSD: Block device required): *Note Error Codes::. - -`int ENOTCONN' - `errno.h' (BSD: Transport endpoint is not connected): *Note Error - Codes::. - -`int ENOTDIR' - `errno.h' (POSIX.1: Not a directory): *Note Error Codes::. - -`int ENOTEMPTY' - `errno.h' (POSIX.1: Directory not empty): *Note Error Codes::. - -`int ENOTNAM' - `errno.h' (Linux???: Not a XENIX named type file): *Note Error - Codes::. - -`int ENOTSOCK' - `errno.h' (BSD: Socket operation on non-socket): *Note Error - Codes::. - -`int ENOTTY' - `errno.h' (POSIX.1: Inappropriate ioctl for device): *Note Error - Codes::. - -`int ENOTUNIQ' - `errno.h' (Linux???: Name not unique on network): *Note Error - Codes::. - -`char ** environ' - `unistd.h' (POSIX.1): *Note Environment Access::. - -`int ENXIO' - `errno.h' (POSIX.1: Device not configured): *Note Error Codes::. - -`int EOF' - `stdio.h' (ISO): *Note EOF and Errors::. - -`int EOPNOTSUPP' - `errno.h' (BSD: Operation not supported): *Note Error Codes::. - -`int EOVERFLOW' - `errno.h' (XOPEN: Value too large for defined data type): *Note - Error Codes::. - -`int EPERM' - `errno.h' (POSIX.1: Operation not permitted): *Note Error Codes::. - -`int EPFNOSUPPORT' - `errno.h' (BSD: Protocol family not supported): *Note Error - Codes::. - -`int EPIPE' - `errno.h' (POSIX.1: Broken pipe): *Note Error Codes::. - -`int EPROCLIM' - `errno.h' (BSD: Too many processes): *Note Error Codes::. - -`int EPROCUNAVAIL' - `errno.h' (BSD: RPC bad procedure for program): *Note Error - Codes::. - -`int EPROGMISMATCH' - `errno.h' (BSD: RPC program version wrong): *Note Error Codes::. - -`int EPROGUNAVAIL' - `errno.h' (BSD: RPC program not available): *Note Error Codes::. - -`int EPROTO' - `errno.h' (XOPEN: Protocol error): *Note Error Codes::. - -`int EPROTONOSUPPORT' - `errno.h' (BSD: Protocol not supported): *Note Error Codes::. - -`int EPROTOTYPE' - `errno.h' (BSD: Protocol wrong type for socket): *Note Error - Codes::. - -`int EQUIV_CLASS_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. - -`int ERANGE' - `errno.h' (ISO: Numerical result out of range): *Note Error - Codes::. - -`int EREMCHG' - `errno.h' (Linux???: Remote address changed): *Note Error Codes::. - -`int EREMOTEIO' - `errno.h' (Linux???: Remote I/O error): *Note Error Codes::. - -`int EREMOTE' - `errno.h' (BSD: Object is remote): *Note Error Codes::. - -`int ERESTART' - `errno.h' (Linux???: Interrupted system call should be restarted): - *Note Error Codes::. - -`int EROFS' - `errno.h' (POSIX.1: Read-only file system): *Note Error Codes::. - -`int ERPCMISMATCH' - `errno.h' (BSD: RPC version wrong): *Note Error Codes::. - -`volatile int errno' - `errno.h' (ISO): *Note Checking for Errors::. - -`int ESHUTDOWN' - `errno.h' (BSD: Cannot send after transport endpoint shutdown): - *Note Error Codes::. - -`int ESOCKTNOSUPPORT' - `errno.h' (BSD: Socket type not supported): *Note Error Codes::. - -`int ESPIPE' - `errno.h' (POSIX.1: Illegal seek): *Note Error Codes::. - -`int ESRCH' - `errno.h' (POSIX.1: No such process): *Note Error Codes::. - -`int ESRMNT' - `errno.h' (Linux???: Srmount error): *Note Error Codes::. - -`int ESTALE' - `errno.h' (BSD: Stale NFS file handle): *Note Error Codes::. - -`int ESTRPIPE' - `errno.h' (Linux???: Streams pipe error): *Note Error Codes::. - -`int ETIMEDOUT' - `errno.h' (BSD: Connection timed out): *Note Error Codes::. - -`int ETIME' - `errno.h' (XOPEN: Timer expired): *Note Error Codes::. - -`int ETOOMANYREFS' - `errno.h' (BSD: Too many references: cannot splice): *Note Error - Codes::. - -`int ETXTBSY' - `errno.h' (BSD: Text file busy): *Note Error Codes::. - -`int EUCLEAN' - `errno.h' (Linux???: Structure needs cleaning): *Note Error - Codes::. - -`int EUNATCH' - `errno.h' (Linux???: Protocol driver not attached): *Note Error - Codes::. - -`int EUSERS' - `errno.h' (BSD: Too many users): *Note Error Codes::. - -`int EWOULDBLOCK' - `errno.h' (BSD: Operation would block): *Note Error Codes::. - -`int EXDEV' - `errno.h' (POSIX.1: Invalid cross-device link): *Note Error - Codes::. - -`int execle (const char *FILENAME, const char *ARG0, char *const ENV[], ...)' - `unistd.h' (POSIX.1): *Note Executing a File::. - -`int execl (const char *FILENAME, const char *ARG0, ...)' - `unistd.h' (POSIX.1): *Note Executing a File::. - -`int execlp (const char *FILENAME, const char *ARG0, ...)' - `unistd.h' (POSIX.1): *Note Executing a File::. - -`int execve (const char *FILENAME, char *const ARGV[], char *const ENV[])' - `unistd.h' (POSIX.1): *Note Executing a File::. - -`int execv (const char *FILENAME, char *const ARGV[])' - `unistd.h' (POSIX.1): *Note Executing a File::. - -`int execvp (const char *FILENAME, char *const ARGV[])' - `unistd.h' (POSIX.1): *Note Executing a File::. - -`int EXFULL' - `errno.h' (Linux???: Exchange full): *Note Error Codes::. - -`int EXIT_FAILURE' - `stdlib.h' (ISO): *Note Exit Status::. - -`void _exit (int STATUS)' - `unistd.h' (POSIX.1): *Note Termination Internals::. - -`void exit (int STATUS)' - `stdlib.h' (ISO): *Note Normal Termination::. - -`int EXIT_SUCCESS' - `stdlib.h' (ISO): *Note Exit Status::. - -`double exp (double X)' - `math.h' (ISO): *Note Exponents and Logarithms::. - -`double expm1 (double X)' - `math.h' (BSD): *Note Exponents and Logarithms::. - -`int EXPR_NEST_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. - -`double fabs (double NUMBER)' - `math.h' (ISO): *Note Absolute Value::. - -`int fchmod (int FILEDES, int MODE)' - `sys/stat.h' (BSD): *Note Setting Permissions::. - -`int fchown (int FILEDES, int OWNER, int GROUP)' - `unistd.h' (BSD): *Note File Owner::. - -`int fclean (FILE *STREAM)' - `stdio.h' (GNU): *Note Cleaning Streams::. - -`int fcloseall (void)' - `stdio.h' (GNU): *Note Closing Streams::. - -`int fclose (FILE *STREAM)' - `stdio.h' (ISO): *Note Closing Streams::. - -`int fcntl (int FILEDES, int COMMAND, ...)' - `fcntl.h' (POSIX.1): *Note Control Operations::. - -`int FD_CLOEXEC' - `fcntl.h' (POSIX.1): *Note Descriptor Flags::. - -`void FD_CLR (int FILEDES, fd_set *SET)' - `sys/types.h' (BSD): *Note Waiting for I/O::. - -`int FD_ISSET (int FILEDES, fd_set *SET)' - `sys/types.h' (BSD): *Note Waiting for I/O::. - -`FILE * fdopen (int FILEDES, const char *OPENTYPE)' - `stdio.h' (POSIX.1): *Note Descriptors and Streams::. - -`void FD_SET (int FILEDES, fd_set *SET)' - `sys/types.h' (BSD): *Note Waiting for I/O::. - -`fd_set' - `sys/types.h' (BSD): *Note Waiting for I/O::. - -`int FD_SETSIZE' - `sys/types.h' (BSD): *Note Waiting for I/O::. - -`int F_DUPFD' - `fcntl.h' (POSIX.1): *Note Duplicating Descriptors::. - -`void FD_ZERO (fd_set *SET)' - `sys/types.h' (BSD): *Note Waiting for I/O::. - -`int feof (FILE *STREAM)' - `stdio.h' (ISO): *Note EOF and Errors::. - -`int ferror (FILE *STREAM)' - `stdio.h' (ISO): *Note EOF and Errors::. - -`int fflush (FILE *STREAM)' - `stdio.h' (ISO): *Note Flushing Buffers::. - -`int fgetc (FILE *STREAM)' - `stdio.h' (ISO): *Note Character Input::. - -`int F_GETFD' - `fcntl.h' (POSIX.1): *Note Descriptor Flags::. - -`int F_GETFL' - `fcntl.h' (POSIX.1): *Note Getting File Status Flags::. - -`struct group * fgetgrent (FILE *STREAM)' - `grp.h' (SVID): *Note Scanning All Groups::. - -`int fgetgrent_r (FILE *STREAM, struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' - `grp.h' (GNU): *Note Scanning All Groups::. - -`int F_GETLK' - `fcntl.h' (POSIX.1): *Note File Locks::. - -`int F_GETOWN' - `fcntl.h' (BSD): *Note Interrupt Input::. - -`int fgetpos (FILE *STREAM, fpos_t *POSITION)' - `stdio.h' (ISO): *Note Portable Positioning::. - -`struct passwd * fgetpwent (FILE *STREAM)' - `pwd.h' (SVID): *Note Scanning All Users::. - -`int fgetpwent_r (FILE *STREAM, struct passwd *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd **RESULT)' - `pwd.h' (GNU): *Note Scanning All Users::. - -`char * fgets (char *S, int COUNT, FILE *STREAM)' - `stdio.h' (ISO): *Note Line Input::. - -`FILE' - `stdio.h' (ISO): *Note Streams::. - -`int FILENAME_MAX' - `stdio.h' (ISO): *Note Limits for Files::. - -`int fileno (FILE *STREAM)' - `stdio.h' (POSIX.1): *Note Descriptors and Streams::. - -`int finite (double X)' - `math.h' (BSD): *Note Predicates on Floats::. +`LDBL_MIN_EXP' + These are similar to `FLT_MIN_EXP', but for the data types + `double' and `long double', respectively. -`double floor (double X)' - `math.h' (ISO): *Note Rounding and Remainders::. +`FLT_MIN_10_EXP' + This is the minimum negative integer such that `10' raised to this + power minus 1 can be represented as a normalized floating point + number of type `float'. This is supposed to be `-37' or even less. -`FLT_DIG' - `float.h' (ISO): *Note Floating Point Parameters::. +`DBL_MIN_10_EXP' +`LDBL_MIN_10_EXP' + These are similar to `FLT_MIN_10_EXP', but for the data types + `double' and `long double', respectively. -`FLT_EPSILON' - `float.h' (ISO): *Note Floating Point Parameters::. +`FLT_MAX_EXP' + This is the largest possible exponent value for type `float'. More + precisely, this is the maximum positive integer such that value + `FLT_RADIX' raised to this power minus 1 can be represented as a + floating point number of type `float'. -`FLT_MANT_DIG' - `float.h' (ISO): *Note Floating Point Parameters::. +`DBL_MAX_EXP' +`LDBL_MAX_EXP' + These are similar to `FLT_MAX_EXP', but for the data types + `double' and `long double', respectively. `FLT_MAX_10_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. + This is the maximum positive integer such that `10' raised to this + power minus 1 can be represented as a normalized floating point + number of type `float'. This is supposed to be at least `37'. -`FLT_MAX_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. +`DBL_MAX_10_EXP' +`LDBL_MAX_10_EXP' + These are similar to `FLT_MAX_10_EXP', but for the data types + `double' and `long double', respectively. `FLT_MAX' - `float.h' (ISO): *Note Floating Point Parameters::. + The value of this macro is the maximum number representable in type + `float'. It is supposed to be at least `1E+37'. The value has + type `float'. -`FLT_MIN_10_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. + The smallest representable number is `- FLT_MAX'. -`FLT_MIN_EXP' - `float.h' (ISO): *Note Floating Point Parameters::. +`DBL_MAX' +`LDBL_MAX' + These are similar to `FLT_MAX', but for the data types `double' + and `long double', respectively. The type of the macro's value is + the same as the type it describes. `FLT_MIN' - `float.h' (ISO): *Note Floating Point Parameters::. - -`FLT_RADIX' - `float.h' (ISO): *Note Floating Point Parameters::. - -`FLT_ROUNDS' - `float.h' (ISO): *Note Floating Point Parameters::. - -`tcflag_t FLUSHO' - `termios.h' (BSD): *Note Local Modes::. - -`FILE * fmemopen (void *BUF, size_t SIZE, const char *OPENTYPE)' - `stdio.h' (GNU): *Note String Streams::. - -`double fmod (double NUMERATOR, double DENOMINATOR)' - `math.h' (ISO): *Note Rounding and Remainders::. - -`int fnmatch (const char *PATTERN, const char *STRING, int FLAGS)' - `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. - -`FNM_CASEFOLD' - `fnmatch.h' (GNU): *Note Wildcard Matching::. - -`FNM_FILE_NAME' - `fnmatch.h' (GNU): *Note Wildcard Matching::. - -`FNM_LEADING_DIR' - `fnmatch.h' (GNU): *Note Wildcard Matching::. - -`FNM_NOESCAPE' - `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. - -`FNM_PATHNAME' - `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. - -`FNM_PERIOD' - `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. - -`int F_OK' - `unistd.h' (POSIX.1): *Note Testing File Access::. - -`FILE * fopencookie (void *COOKIE, const char *OPENTYPE, cookie_io_functions_t IO-FUNCTIONS)' - `stdio.h' (GNU): *Note Streams and Cookies::. - -`FILE * fopen (const char *FILENAME, const char *OPENTYPE)' - `stdio.h' (ISO): *Note Opening Streams::. - -`int FOPEN_MAX' - `stdio.h' (ISO): *Note Opening Streams::. - -`pid_t fork (void)' - `unistd.h' (POSIX.1): *Note Creating a Process::. - -`long int fpathconf (int FILEDES, int PARAMETER)' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`FPE_DECOVF_TRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_FLTDIV_FAULT' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_FLTDIV_TRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_FLTOVF_FAULT' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_FLTOVF_TRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_FLTUND_FAULT' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_FLTUND_TRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_INTDIV_TRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_INTOVF_TRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`FPE_SUBRNG_TRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`fpos_t' - `stdio.h' (ISO): *Note Portable Positioning::. - -`int fprintf (FILE *STREAM, const char *TEMPLATE, ...)' - `stdio.h' (ISO): *Note Formatted Output Functions::. - -`int fputc (int C, FILE *STREAM)' - `stdio.h' (ISO): *Note Simple Output::. - -`int fputs (const char *S, FILE *STREAM)' - `stdio.h' (ISO): *Note Simple Output::. - -`F_RDLCK' - `fcntl.h' (POSIX.1): *Note File Locks::. - -`size_t fread (void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM)' - `stdio.h' (ISO): *Note Block Input/Output::. - -`__free_hook' - `malloc.h' (GNU): *Note Hooks for Malloc::. - -`void free (void *PTR)' - `malloc.h', `stdlib.h' (ISO): *Note Freeing after Malloc::. - -`FILE * freopen (const char *FILENAME, const char *OPENTYPE, FILE *STREAM)' - `stdio.h' (ISO): *Note Opening Streams::. - -`double frexp (double VALUE, int *EXPONENT)' - `math.h' (ISO): *Note Normalization Functions::. - -`int fscanf (FILE *STREAM, const char *TEMPLATE, ...)' - `stdio.h' (ISO): *Note Formatted Input Functions::. - -`int fseek (FILE *STREAM, long int OFFSET, int WHENCE)' - `stdio.h' (ISO): *Note File Positioning::. - -`int F_SETFD' - `fcntl.h' (POSIX.1): *Note Descriptor Flags::. - -`int F_SETFL' - `fcntl.h' (POSIX.1): *Note Getting File Status Flags::. - -`int F_SETLK' - `fcntl.h' (POSIX.1): *Note File Locks::. - -`int F_SETLKW' - `fcntl.h' (POSIX.1): *Note File Locks::. - -`int F_SETOWN' - `fcntl.h' (BSD): *Note Interrupt Input::. - -`int fsetpos (FILE *STREAM, const fpos_t POSITION)' - `stdio.h' (ISO): *Note Portable Positioning::. - -`int fstat (int FILEDES, struct stat *BUF)' - `sys/stat.h' (POSIX.1): *Note Reading Attributes::. - -`long int ftell (FILE *STREAM)' - `stdio.h' (ISO): *Note File Positioning::. - -`F_UNLCK' - `fcntl.h' (POSIX.1): *Note File Locks::. - -`size_t fwrite (const void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM)' - `stdio.h' (ISO): *Note Block Input/Output::. - -`F_WRLCK' - `fcntl.h' (POSIX.1): *Note File Locks::. - -`int getchar (void)' - `stdio.h' (ISO): *Note Character Input::. - -`int getc (FILE *STREAM)' - `stdio.h' (ISO): *Note Character Input::. - -`char * getcwd (char *BUFFER, size_t SIZE)' - `unistd.h' (POSIX.1): *Note Working Directory::. - -`ssize_t getdelim (char **LINEPTR, size_t *N, int DELIMITER, FILE *STREAM)' - `stdio.h' (GNU): *Note Line Input::. - -`gid_t getegid (void)' - `unistd.h' (POSIX.1): *Note Reading Persona::. - -`char * getenv (const char *NAME)' - `stdlib.h' (ISO): *Note Environment Access::. - -`uid_t geteuid (void)' - `unistd.h' (POSIX.1): *Note Reading Persona::. - -`gid_t getgid (void)' - `unistd.h' (POSIX.1): *Note Reading Persona::. - -`struct group * getgrent (void)' - `grp.h' (SVID, BSD): *Note Scanning All Groups::. - -`int getgrent_r (struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' - `grp.h' (GNU): *Note Scanning All Groups::. - -`struct group * getgrgid (gid_t GID)' - `grp.h' (POSIX.1): *Note Lookup Group::. - -`int getgrgid_r (gid_t GID, struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' - `grp.h' (POSIX.1c): *Note Lookup Group::. - -`struct group * getgrnam (const char *NAME)' - `grp.h' (SVID, BSD): *Note Lookup Group::. - -`int getgrnam_r (const char *NAME, struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' - `grp.h' (POSIX.1c): *Note Lookup Group::. - -`int getgroups (int COUNT, gid_t *GROUPS)' - `unistd.h' (POSIX.1): *Note Reading Persona::. - -`struct hostent * gethostbyaddr (const char *ADDR, int LENGTH, int FORMAT)' - `netdb.h' (BSD): *Note Host Names::. - -`struct hostent * gethostbyname (const char *NAME)' - `netdb.h' (BSD): *Note Host Names::. - -`struct hostent * gethostent ()' - `netdb.h' (BSD): *Note Host Names::. - -`long int gethostid (void)' - `unistd.h' (BSD): *Note Host Identification::. - -`int gethostname (char *NAME, size_t SIZE)' - `unistd.h' (BSD): *Note Host Identification::. - -`int getitimer (int WHICH, struct itimerval *OLD)' - `sys/time.h' (BSD): *Note Setting an Alarm::. - -`ssize_t getline (char **LINEPTR, size_t *N, FILE *STREAM)' - `stdio.h' (GNU): *Note Line Input::. - -`char * getlogin (void)' - `unistd.h' (POSIX.1): *Note Who Logged In::. - -`struct netent * getnetbyaddr (long NET, int TYPE)' - `netdb.h' (BSD): *Note Networks Database::. - -`struct netent * getnetbyname (const char *NAME)' - `netdb.h' (BSD): *Note Networks Database::. - -`struct netent * getnetent (void)' - `netdb.h' (BSD): *Note Networks Database::. - -`int getnetgrent (char **HOSTP, char **USERP, char **DOMAINP)' - `netdb.h' (netdb.h): *Note Lookup Netgroup::. - -`int getnetgrent_r (char **HOSTP, char **USERP, char **DOMAINP, char *BUFFER, int BUFLEN)' - `netdb.h' (netdb.h): *Note Lookup Netgroup::. - -`int getopt (int ARGC, char **ARGV, const char *OPTIONS)' - `unistd.h' (POSIX.2): *Note Parsing Options::. - -`int getopt_long (int ARGC, char **ARGV, const char *SHORTOPTS, struct option *LONGOPTS, int *INDEXPTR)' - `getopt.h' (GNU): *Note Long Options::. - -`int getpeername (int SOCKET, struct sockaddr *ADDR, size_t *LENGTH-PTR)' - `sys/socket.h' (BSD): *Note Who is Connected::. - -`pid_t getpgrp (pid_t PID)' - `unistd.h' (BSD): *Note Process Group Functions::. - -`pid_t getpgrp (void)' - `unistd.h' (POSIX.1): *Note Process Group Functions::. - -`pid_t getpid (void)' - `unistd.h' (POSIX.1): *Note Process Identification::. - -`pid_t getppid (void)' - `unistd.h' (POSIX.1): *Note Process Identification::. - -`int getpriority (int CLASS, int ID)' - `sys/resource.h' (BSD): *Note Priority::. - -`struct protoent * getprotobyname (const char *NAME)' - `netdb.h' (BSD): *Note Protocols Database::. - -`struct protoent * getprotobynumber (int PROTOCOL)' - `netdb.h' (BSD): *Note Protocols Database::. - -`struct protoent * getprotoent (void)' - `netdb.h' (BSD): *Note Protocols Database::. - -`struct passwd * getpwent (void)' - `pwd.h' (POSIX.1): *Note Scanning All Users::. - -`int getpwent_r (struct passwd *RESULT_BUF, char *BUFFER, int BUFLEN, struct passwd **RESULT)' - `pwd.h' (GNU): *Note Scanning All Users::. - -`struct passwd * getpwnam (const char *NAME)' - `pwd.h' (POSIX.1): *Note Lookup User::. - -`int getpwnam_r (const char *NAME, struct passwd *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd **RESULT)' - `pwd.h' (POSIX.1c): *Note Lookup User::. - -`struct passwd * getpwuid (uid_t UID)' - `pwd.h' (POSIX.1): *Note Lookup User::. - -`int getpwuid_r (uid_t UID, struct passwd *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd **RESULT)' - `pwd.h' (POSIX.1c): *Note Lookup User::. - -`int getrlimit (int RESOURCE, struct rlimit *RLP)' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`int getrusage (int PROCESSES, struct rusage *RUSAGE)' - `sys/resource.h' (BSD): *Note Resource Usage::. - -`struct servent * getservbyname (const char *NAME, const char *PROTO)' - `netdb.h' (BSD): *Note Services Database::. - -`struct servent * getservbyport (int PORT, const char *PROTO)' - `netdb.h' (BSD): *Note Services Database::. - -`struct servent * getservent (void)' - `netdb.h' (BSD): *Note Services Database::. - -`char * gets (char *S)' - `stdio.h' (ISO): *Note Line Input::. - -`int getsockname (int SOCKET, struct sockaddr *ADDR, size_t *LENGTH-PTR)' - `sys/socket.h' (BSD): *Note Reading Address::. - -`int getsockopt (int SOCKET, int LEVEL, int OPTNAME, void *OPTVAL, size_t *OPTLEN-PTR)' - `sys/socket.h' (BSD): *Note Socket Option Functions::. - -`int getsubopt (char **OPTIONP, const char* const *TOKENS, char **VALUEP)' - `stdlib.h' (stdlib.h): *Note Suboptions::. - -`int gettimeofday (struct timeval *TP, struct timezone *TZP)' - `sys/time.h' (BSD): *Note High-Resolution Calendar::. - -`uid_t getuid (void)' - `unistd.h' (POSIX.1): *Note Reading Persona::. - -`mode_t getumask (void)' - `sys/stat.h' (GNU): *Note Setting Permissions::. - -`char * getwd (char *BUFFER)' - `unistd.h' (BSD): *Note Working Directory::. - -`int getw (FILE *STREAM)' - `stdio.h' (SVID): *Note Character Input::. - -`gid_t' - `sys/types.h' (POSIX.1): *Note Reading Persona::. - -`GLOB_ABORTED' - `glob.h' (POSIX.2): *Note Calling Glob::. - -`GLOB_APPEND' - `glob.h' (POSIX.2): *Note Flags for Globbing::. - -`GLOB_DOOFFS' - `glob.h' (POSIX.2): *Note Flags for Globbing::. - -`GLOB_ERR' - `glob.h' (POSIX.2): *Note Flags for Globbing::. - -`int glob (const char *PATTERN, int FLAGS, int (*ERRFUNC) (const char *FILENAME, int ERROR-CODE), glob_t *VECTOR-PTR)' - `glob.h' (POSIX.2): *Note Calling Glob::. - -`GLOB_MARK' - `glob.h' (POSIX.2): *Note Flags for Globbing::. - -`GLOB_NOCHECK' - `glob.h' (POSIX.2): *Note Flags for Globbing::. - -`GLOB_NOESCAPE' - `glob.h' (POSIX.2): *Note Flags for Globbing::. - -`GLOB_NOMATCH' - `glob.h' (POSIX.2): *Note Calling Glob::. - -`GLOB_NOSORT' - `glob.h' (POSIX.2): *Note Flags for Globbing::. - -`GLOB_NOSPACE' - `glob.h' (POSIX.2): *Note Calling Glob::. - -`glob_t' - `glob.h' (POSIX.2): *Note Calling Glob::. - -`struct tm * gmtime (const time_t *TIME)' - `time.h' (ISO): *Note Broken-down Time::. - -`_GNU_SOURCE' - (GNU): *Note Feature Test Macros::. - -`int gsignal (int SIGNUM)' - `signal.h' (SVID): *Note Signaling Yourself::. - -`HOST_NOT_FOUND' - `netdb.h' (BSD): *Note Host Names::. - -`unsigned long int htonl (unsigned long int HOSTLONG)' - `netinet/in.h' (BSD): *Note Byte Order::. - -`unsigned short int htons (unsigned short int HOSTSHORT)' - `netinet/in.h' (BSD): *Note Byte Order::. - -`float HUGE_VALf' - `math.h' (GNU): *Note Domain and Range Errors::. - -`double HUGE_VAL' - `math.h' (ISO): *Note Domain and Range Errors::. - -`long double HUGE_VALl' - `math.h' (GNU): *Note Domain and Range Errors::. - -`tcflag_t HUPCL' - `termios.h' (POSIX.1): *Note Control Modes::. - -`double hypot (double X, double Y)' - `math.h' (BSD): *Note Exponents and Logarithms::. - -`tcflag_t ICANON' - `termios.h' (POSIX.1): *Note Local Modes::. - -`tcflag_t ICRNL' - `termios.h' (POSIX.1): *Note Input Modes::. - -`tcflag_t IEXTEN' - `termios.h' (POSIX.1): *Note Local Modes::. - -`tcflag_t IGNBRK' - `termios.h' (POSIX.1): *Note Input Modes::. - -`tcflag_t IGNCR' - `termios.h' (POSIX.1): *Note Input Modes::. - -`tcflag_t IGNPAR' - `termios.h' (POSIX.1): *Note Input Modes::. - -`tcflag_t IMAXBEL' - `termios.h' (BSD): *Note Input Modes::. - -`unsigned long int INADDR_ANY' - `netinet/in.h' (BSD): *Note Host Address Data Type::. - -`unsigned long int INADDR_BROADCAST' - `netinet/in.h' (BSD): *Note Host Address Data Type::. - -`unsigned long int INADDR_LOOPBACK' - `netinet/in.h' (BSD): *Note Host Address Data Type::. - -`unsigned long int INADDR_NONE' - `netinet/in.h' (BSD): *Note Host Address Data Type::. - -`char * index (const char *STRING, int C)' - `string.h' (BSD): *Note Search Functions::. - -`unsigned long int inet_addr (const char *NAME)' - `arpa/inet.h' (BSD): *Note Host Address Functions::. - -`int inet_aton (const char *NAME, struct in_addr *ADDR)' - `arpa/inet.h' (BSD): *Note Host Address Functions::. - -`int inet_lnaof (struct in_addr ADDR)' - `arpa/inet.h' (BSD): *Note Host Address Functions::. - -`struct in_addr inet_makeaddr (int NET, int LOCAL)' - `arpa/inet.h' (BSD): *Note Host Address Functions::. - -`int inet_netof (struct in_addr ADDR)' - `arpa/inet.h' (BSD): *Note Host Address Functions::. - -`unsigned long int inet_network (const char *NAME)' - `arpa/inet.h' (BSD): *Note Host Address Functions::. - -`char * inet_ntoa (struct in_addr ADDR)' - `arpa/inet.h' (BSD): *Note Host Address Functions::. - -`double infnan (int ERROR)' - `math.h' (BSD): *Note Predicates on Floats::. - -`int initgroups (const char *USER, gid_t GID)' - `grp.h' (BSD): *Note Setting Groups::. - -`void * initstate (unsigned int SEED, void *STATE, size_t SIZE)' - `stdlib.h' (BSD): *Note BSD Random::. - -`tcflag_t INLCR' - `termios.h' (POSIX.1): *Note Input Modes::. - -`int innetgr (const char *NETGROUP, const char *HOST, const char *USER, const char *DOMAIN)' - `netdb.h' (netdb.h): *Note Netgroup Membership::. - -`ino_t' - `sys/types.h' (POSIX.1): *Note Attribute Meanings::. - -`tcflag_t INPCK' - `termios.h' (POSIX.1): *Note Input Modes::. - -`int RLIM_INFINITY' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`INT_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`INT_MIN' - `limits.h' (ISO): *Note Range of Type::. - -`int _IOFBF' - `stdio.h' (ISO): *Note Controlling Buffering::. - -`int _IOLBF' - `stdio.h' (ISO): *Note Controlling Buffering::. - -`int _IONBF' - `stdio.h' (ISO): *Note Controlling Buffering::. - -`int IPPORT_RESERVED' - `netinet/in.h' (BSD): *Note Ports::. - -`int IPPORT_USERRESERVED' - `netinet/in.h' (BSD): *Note Ports::. - -`int isalnum (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int isalpha (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int isascii (int C)' - `ctype.h' (SVID, BSD): *Note Classification of Characters::. - -`int isatty (int FILEDES)' - `unistd.h' (POSIX.1): *Note Is It a Terminal::. - -`int isblank (int C)' - `ctype.h' (GNU): *Note Classification of Characters::. - -`int iscntrl (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int isdigit (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int isgraph (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`tcflag_t ISIG' - `termios.h' (POSIX.1): *Note Local Modes::. - -`int isinf (double X)' - `math.h' (BSD): *Note Predicates on Floats::. - -`int islower (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int isnan (double X)' - `math.h' (BSD): *Note Predicates on Floats::. - -`int isprint (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int ispunct (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int isspace (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`tcflag_t ISTRIP' - `termios.h' (POSIX.1): *Note Input Modes::. - -`int isupper (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`int isxdigit (int C)' - `ctype.h' (ISO): *Note Classification of Characters::. - -`ITIMER_PROF' - `sys/time.h' (BSD): *Note Setting an Alarm::. - -`ITIMER_REAL' - `sys/time.h' (BSD): *Note Setting an Alarm::. - -`ITIMER_VIRTUAL' - `sys/time.h' (BSD): *Note Setting an Alarm::. - -`tcflag_t IXANY' - `termios.h' (BSD): *Note Input Modes::. - -`tcflag_t IXOFF' - `termios.h' (POSIX.1): *Note Input Modes::. - -`tcflag_t IXON' - `termios.h' (POSIX.1): *Note Input Modes::. - -`jmp_buf' - `setjmp.h' (ISO): *Note Non-Local Details::. - -`int kill (pid_t PID, int SIGNUM)' - `signal.h' (POSIX.1): *Note Signaling Another Process::. - -`int killpg (int PGID, int SIGNUM)' - `signal.h' (BSD): *Note Signaling Another Process::. - -`long int labs (long int NUMBER)' - `stdlib.h' (ISO): *Note Absolute Value::. - -`LANG' - `locale.h' (ISO): *Note Locale Categories::. - -`LC_ALL' - `locale.h' (ISO): *Note Locale Categories::. - -`LC_COLLATE' - `locale.h' (ISO): *Note Locale Categories::. - -`LC_CTYPE' - `locale.h' (ISO): *Note Locale Categories::. - -`LC_MESSAGES' - `locale.h' (XOPEN): *Note Locale Categories::. - -`LC_MONETARY' - `locale.h' (ISO): *Note Locale Categories::. - -`LC_NUMERIC' - `locale.h' (ISO): *Note Locale Categories::. - -`int L_ctermid' - `stdio.h' (POSIX.1): *Note Identifying the Terminal::. - -`LC_TIME' - `locale.h' (ISO): *Note Locale Categories::. - -`int L_cuserid' - `stdio.h' (POSIX.1): *Note Who Logged In::. - -`double ldexp (double VALUE, int EXPONENT)' - `math.h' (ISO): *Note Normalization Functions::. - -`ldiv_t ldiv (long int NUMERATOR, long int DENOMINATOR)' - `stdlib.h' (ISO): *Note Integer Division::. - -`ldiv_t' - `stdlib.h' (ISO): *Note Integer Division::. - -`L_INCR' - `sys/file.h' (BSD): *Note File Positioning::. - -`int LINE_MAX' - `limits.h' (POSIX.2): *Note Utility Limits::. - -`int link (const char *OLDNAME, const char *NEWNAME)' - `unistd.h' (POSIX.1): *Note Hard Links::. - -`int LINK_MAX' - `limits.h' (POSIX.1): *Note Limits for Files::. - -`int listen (int SOCKET, unsigned int N)' - `sys/socket.h' (BSD): *Note Listening::. - -`struct lconv * localeconv (void)' - `locale.h' (ISO): *Note Numeric Formatting::. - -`struct tm * localtime (const time_t *TIME)' - `time.h' (ISO): *Note Broken-down Time::. - -`double log10 (double X)' - `math.h' (ISO): *Note Exponents and Logarithms::. - -`double log1p (double X)' - `math.h' (BSD): *Note Exponents and Logarithms::. - -`double logb (double X)' - `math.h' (BSD): *Note Normalization Functions::. - -`double log (double X)' - `math.h' (ISO): *Note Exponents and Logarithms::. - -`void longjmp (jmp_buf STATE, int VALUE)' - `setjmp.h' (ISO): *Note Non-Local Details::. - -`LONG_LONG_MAX' - `limits.h' (GNU): *Note Range of Type::. - -`LONG_LONG_MIN' - `limits.h' (GNU): *Note Range of Type::. - -`LONG_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`LONG_MIN' - `limits.h' (ISO): *Note Range of Type::. - -`off_t lseek (int FILEDES, off_t OFFSET, int WHENCE)' - `unistd.h' (POSIX.1): *Note File Position Primitive::. - -`L_SET' - `sys/file.h' (BSD): *Note File Positioning::. - -`int lstat (const char *FILENAME, struct stat *BUF)' - `sys/stat.h' (BSD): *Note Reading Attributes::. - -`int L_tmpnam' - `stdio.h' (ISO): *Note Temporary Files::. - -`L_XTND' - `sys/file.h' (BSD): *Note File Positioning::. - -`struct mallinfo mallinfo (void)' - `malloc.h' (SVID): *Note Statistics of Malloc::. - -`__malloc_hook' - `malloc.h' (GNU): *Note Hooks for Malloc::. - -`void * malloc (size_t SIZE)' - `malloc.h', `stdlib.h' (ISO): *Note Basic Allocation::. - -`int MAX_CANON' - `limits.h' (POSIX.1): *Note Limits for Files::. - -`int MAX_INPUT' - `limits.h' (POSIX.1): *Note Limits for Files::. - -`int MAXNAMLEN' - `dirent.h' (BSD): *Note Limits for Files::. - -`int MB_CUR_MAX' - `stdlib.h' (ISO): *Note Multibyte Char Intro::. - -`int mblen (const char *STRING, size_t SIZE)' - `stdlib.h' (ISO): *Note Length of Char::. - -`int MB_LEN_MAX' - `limits.h' (ISO): *Note Multibyte Char Intro::. - -`size_t mbstowcs (wchar_t *WSTRING, const char *STRING, size_t SIZE)' - `stdlib.h' (ISO): *Note Wide String Conversion::. - -`int mbtowc (wchar_t *RESULT, const char *STRING, size_t SIZE)' - `stdlib.h' (ISO): *Note Converting One Char::. - -`int mcheck (void (*ABORTFN) (enum mcheck_status STATUS))' - `malloc.h' (GNU): *Note Heap Consistency Checking::. - -`tcflag_t MDMBUF' - `termios.h' (BSD): *Note Control Modes::. - -`void * memalign (size_t BOUNDARY, size_t SIZE)' - `malloc.h', `stdlib.h' (BSD): *Note Aligned Memory Blocks::. - -`void * memccpy (void *TO, const void *FROM, int C, size_t SIZE)' - `string.h' (SVID): *Note Copying and Concatenation::. - -`void * memchr (const void *BLOCK, int C, size_t SIZE)' - `string.h' (ISO): *Note Search Functions::. - -`int memcmp (const void *A1, const void *A2, size_t SIZE)' - `string.h' (ISO): *Note String/Array Comparison::. - -`void * memcpy (void *TO, const void *FROM, size_t SIZE)' - `string.h' (ISO): *Note Copying and Concatenation::. - -`void * memmem (const void *HAYSTACK, size_t HAYSTACK-LEN, - const void *NEEDLE, size_t NEEDLE-LEN)' - `string.h' (GNU): *Note Search Functions::. - -`void * memmove (void *TO, const void *FROM, size_t SIZE)' - `string.h' (ISO): *Note Copying and Concatenation::. - -`void * memset (void *BLOCK, int C, size_t SIZE)' - `string.h' (ISO): *Note Copying and Concatenation::. - -`int mkdir (const char *FILENAME, mode_t MODE)' - `sys/stat.h' (POSIX.1): *Note Creating Directories::. - -`int mkfifo (const char *FILENAME, mode_t MODE)' - `sys/stat.h' (POSIX.1): *Note FIFO Special Files::. - -`int mknod (const char *FILENAME, int MODE, int DEV)' - `sys/stat.h' (BSD): *Note Making Special Files::. - -`int mkstemp (char *TEMPLATE)' - `unistd.h' (BSD): *Note Temporary Files::. - -`char * mktemp (char *TEMPLATE)' - `unistd.h' (Unix): *Note Temporary Files::. - -`time_t mktime (struct tm *BROKENTIME)' - `time.h' (ISO): *Note Broken-down Time::. - -`mode_t' - `sys/types.h' (POSIX.1): *Note Attribute Meanings::. - -`double modf (double VALUE, double *INTEGER-PART)' - `math.h' (ISO): *Note Rounding and Remainders::. - -`int MSG_DONTROUTE' - `sys/socket.h' (BSD): *Note Socket Data Options::. - -`int MSG_OOB' - `sys/socket.h' (BSD): *Note Socket Data Options::. - -`int MSG_PEEK' - `sys/socket.h' (BSD): *Note Socket Data Options::. - -`int NAME_MAX' - `limits.h' (POSIX.1): *Note Limits for Files::. - -`double NAN' - `math.h' (GNU): *Note Not a Number::. - -`int NCCS' - `termios.h' (POSIX.1): *Note Mode Data Types::. - -`int NGROUPS_MAX' - `limits.h' (POSIX.1): *Note General Limits::. - -`int nice (int INCREMENT)' - `dunno.h' (dunno.h): *Note Priority::. - -`nlink_t' - `sys/types.h' (POSIX.1): *Note Attribute Meanings::. - -`NO_ADDRESS' - `netdb.h' (BSD): *Note Host Names::. - -`tcflag_t NOFLSH' - `termios.h' (POSIX.1): *Note Local Modes::. - -`tcflag_t NOKERNINFO' - `termios.h' (BSD): *Note Local Modes::. - -`NO_RECOVERY' - `netdb.h' (BSD): *Note Host Names::. - -`int NSIG' - `signal.h' (BSD): *Note Standard Signals::. - -`unsigned long int ntohl (unsigned long int NETLONG)' - `netinet/in.h' (BSD): *Note Byte Order::. - -`unsigned short int ntohs (unsigned short int NETSHORT)' - `netinet/in.h' (BSD): *Note Byte Order::. - -`void * NULL' - `stddef.h' (ISO): *Note Null Pointer Constant::. - -`int O_ACCMODE' - `fcntl.h' (POSIX.1): *Note Access Modes::. - -`int O_APPEND' - `fcntl.h' (POSIX.1): *Note Operating Modes::. - -`int O_ASYNC' - `fcntl.h' (BSD): *Note Operating Modes::. - -`void obstack_1grow_fast (struct obstack *OBSTACK-PTR, char C)' - `obstack.h' (GNU): *Note Extra Fast Growing::. - -`void obstack_1grow (struct obstack *OBSTACK-PTR, char C)' - `obstack.h' (GNU): *Note Growing Objects::. - -`int obstack_alignment_mask (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Obstacks Data Alignment::. - -`void * obstack_alloc (struct obstack *OBSTACK-PTR, int SIZE)' - `obstack.h' (GNU): *Note Allocation in an Obstack::. - -`void * obstack_base (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Status of an Obstack::. - -`void obstack_blank_fast (struct obstack *OBSTACK-PTR, int SIZE)' - `obstack.h' (GNU): *Note Extra Fast Growing::. - -`void obstack_blank (struct obstack *OBSTACK-PTR, int SIZE)' - `obstack.h' (GNU): *Note Growing Objects::. - -`int obstack_chunk_size (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Obstack Chunks::. - -`void * obstack_copy0 (struct obstack *OBSTACK-PTR, void *ADDRESS, int SIZE)' - `obstack.h' (GNU): *Note Allocation in an Obstack::. - -`void * obstack_copy (struct obstack *OBSTACK-PTR, void *ADDRESS, int SIZE)' - `obstack.h' (GNU): *Note Allocation in an Obstack::. - -`void * obstack_finish (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Growing Objects::. - -`void obstack_free (struct obstack *OBSTACK-PTR, void *OBJECT)' - `obstack.h' (GNU): *Note Freeing Obstack Objects::. - -`void obstack_grow0 (struct obstack *OBSTACK-PTR, void *DATA, int SIZE)' - `obstack.h' (GNU): *Note Growing Objects::. - -`void obstack_grow (struct obstack *OBSTACK-PTR, void *DATA, int SIZE)' - `obstack.h' (GNU): *Note Growing Objects::. - -`int obstack_init (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Preparing for Obstacks::. - -`void obstack_int_grow_fast (struct obstack *OBSTACK-PTR, int DATA)' - `obstack.h' (GNU): *Note Extra Fast Growing::. - -`void obstack_int_grow (struct obstack *OBSTACK-PTR, int DATA)' - `obstack.h' (GNU): *Note Growing Objects::. - -`void * obstack_next_free (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Status of an Obstack::. - -`int obstack_object_size (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Growing Objects::. - -`int obstack_object_size (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Status of an Obstack::. - -`int obstack_printf (struct obstack *OBSTACK, const char *TEMPLATE, ...)' - `stdio.h' (GNU): *Note Dynamic Output::. - -`void obstack_ptr_grow_fast (struct obstack *OBSTACK-PTR, void *DATA)' - `obstack.h' (GNU): *Note Extra Fast Growing::. - -`void obstack_ptr_grow (struct obstack *OBSTACK-PTR, void *DATA)' - `obstack.h' (GNU): *Note Growing Objects::. - -`int obstack_room (struct obstack *OBSTACK-PTR)' - `obstack.h' (GNU): *Note Extra Fast Growing::. - -`int obstack_vprintf (struct obstack *OBSTACK, const char *TEMPLATE, va_list AP)' - `stdio.h' (GNU): *Note Variable Arguments Output::. - -`int O_CREAT' - `fcntl.h' (POSIX.1): *Note Open-time Flags::. - -`int O_EXCL' - `fcntl.h' (POSIX.1): *Note Open-time Flags::. - -`int O_EXEC' - `fcntl.h' (GNU): *Note Access Modes::. - -`int O_EXLOCK' - `fcntl.h' (BSD): *Note Open-time Flags::. - -`size_t offsetof (TYPE, MEMBER)' - `stddef.h' (ISO): *Note Structure Measurement::. - -`off_t' - `sys/types.h' (POSIX.1): *Note File Position Primitive::. - -`int O_FSYNC' - `fcntl.h' (BSD): *Note Operating Modes::. - -`int O_IGNORE_CTTY' - `fcntl.h' (GNU): *Note Open-time Flags::. - -`int O_NDELAY' - `fcntl.h' (BSD): *Note Operating Modes::. - -`int on_exit (void (*FUNCTION)(int STATUS, void *ARG), void *ARG)' - `stdlib.h' (SunOS): *Note Cleanups on Exit::. - -`tcflag_t ONLCR' - `termios.h' (BSD): *Note Output Modes::. - -`int O_NOATIME' - `fcntl.h' (GNU): *Note Operating Modes::. - -`int O_NOCTTY' - `fcntl.h' (POSIX.1): *Note Open-time Flags::. - -`tcflag_t ONOEOT' - `termios.h' (BSD): *Note Output Modes::. - -`int O_NOLINK' - `fcntl.h' (GNU): *Note Open-time Flags::. - -`int O_NONBLOCK' - `fcntl.h' (POSIX.1): *Note Open-time Flags::. - -`int O_NONBLOCK' - `fcntl.h' (POSIX.1): *Note Operating Modes::. - -`int O_NOTRANS' - `fcntl.h' (GNU): *Note Open-time Flags::. - -`DIR * opendir (const char *DIRNAME)' - `dirent.h' (POSIX.1): *Note Opening a Directory::. - -`int open (const char *FILENAME, int FLAGS[, mode_t MODE])' - `fcntl.h' (POSIX.1): *Note Opening and Closing Files::. - -`int OPEN_MAX' - `limits.h' (POSIX.1): *Note General Limits::. - -`FILE * open_memstream (char **PTR, size_t *SIZELOC)' - `stdio.h' (GNU): *Note String Streams::. - -`FILE * open_obstack_stream (struct obstack *OBSTACK)' - `stdio.h' (GNU): *Note Obstack Streams::. - -`tcflag_t OPOST' - `termios.h' (POSIX.1): *Note Output Modes::. - -`char * optarg' - `unistd.h' (POSIX.2): *Note Parsing Options::. - -`int opterr' - `unistd.h' (POSIX.2): *Note Parsing Options::. - -`int optind' - `unistd.h' (POSIX.2): *Note Parsing Options::. - -`int optopt' - `unistd.h' (POSIX.2): *Note Parsing Options::. - -`int O_RDONLY' - `fcntl.h' (POSIX.1): *Note Access Modes::. - -`int O_RDWR' - `fcntl.h' (POSIX.1): *Note Access Modes::. - -`int O_READ' - `fcntl.h' (GNU): *Note Access Modes::. - -`int O_SHLOCK' - `fcntl.h' (BSD): *Note Open-time Flags::. - -`int O_SYNC' - `fcntl.h' (BSD): *Note Operating Modes::. - -`int O_TRUNC' - `fcntl.h' (POSIX.1): *Note Open-time Flags::. - -`int O_WRITE' - `fcntl.h' (GNU): *Note Access Modes::. - -`int O_WRONLY' - `fcntl.h' (POSIX.1): *Note Access Modes::. - -`tcflag_t OXTABS' - `termios.h' (BSD): *Note Output Modes::. - -`PA_CHAR' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_DOUBLE' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_FLAG_LONG_DOUBLE' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_FLAG_LONG' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_FLAG_LONG_LONG' - `printf.h' (GNU): *Note Parsing a Template String::. - -`int PA_FLAG_MASK' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_FLAG_PTR' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_FLAG_SHORT' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_FLOAT' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_INT' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_LAST' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_POINTER' - `printf.h' (GNU): *Note Parsing a Template String::. - -`tcflag_t PARENB' - `termios.h' (POSIX.1): *Note Control Modes::. - -`tcflag_t PARMRK' - `termios.h' (POSIX.1): *Note Input Modes::. - -`tcflag_t PARODD' - `termios.h' (POSIX.1): *Note Control Modes::. - -`size_t parse_printf_format (const char *TEMPLATE, size_t N, int *ARGTYPES)' - `printf.h' (GNU): *Note Parsing a Template String::. - -`PA_STRING' - `printf.h' (GNU): *Note Parsing a Template String::. - -`long int pathconf (const char *FILENAME, int PARAMETER)' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`int PATH_MAX' - `limits.h' (POSIX.1): *Note Limits for Files::. - -`int pause ()' - `unistd.h' (POSIX.1): *Note Using Pause::. - -`_PC_CHOWN_RESTRICTED' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`_PC_LINK_MAX' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`int pclose (FILE *STREAM)' - `stdio.h' (POSIX.2, SVID, BSD): *Note Pipe to a Subprocess::. - -`_PC_MAX_CANON' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`_PC_MAX_INPUT' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`_PC_NAME_MAX' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`_PC_NO_TRUNC' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`_PC_PATH_MAX' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`_PC_PIPE_BUF' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`_PC_VDISABLE' - `unistd.h' (POSIX.1): *Note Pathconf::. - -`tcflag_t PENDIN' - `termios.h' (BSD): *Note Local Modes::. - -`void perror (const char *MESSAGE)' - `stdio.h' (ISO): *Note Error Messages::. - -`int PF_FILE' - `sys/socket.h' (GNU): *Note File Namespace Details::. - -`int PF_INET' - `sys/socket.h' (BSD): *Note Internet Namespace::. - -`int PF_UNIX' - `sys/socket.h' (BSD): *Note File Namespace Details::. - -`pid_t' - `sys/types.h' (POSIX.1): *Note Process Identification::. - -`int PIPE_BUF' - `limits.h' (POSIX.1): *Note Limits for Files::. - -`int pipe (int FILEDES[2])' - `unistd.h' (POSIX.1): *Note Creating a Pipe::. - -`FILE * popen (const char *COMMAND, const char *MODE)' - `stdio.h' (POSIX.2, SVID, BSD): *Note Pipe to a Subprocess::. - -`_POSIX2_BC_BASE_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`_POSIX2_BC_DIM_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`_POSIX2_BC_SCALE_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`_POSIX2_BC_STRING_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`int _POSIX2_C_DEV' - `unistd.h' (POSIX.2): *Note System Options::. - -`_POSIX2_COLL_WEIGHTS_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`long int _POSIX2_C_VERSION' - `unistd.h' (POSIX.2): *Note Version Supported::. - -`_POSIX2_EQUIV_CLASS_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`_POSIX2_EXPR_NEST_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`int _POSIX2_FORT_DEV' - `unistd.h' (POSIX.2): *Note System Options::. - -`int _POSIX2_FORT_RUN' - `unistd.h' (POSIX.2): *Note System Options::. - -`_POSIX2_LINE_MAX' - `limits.h' (POSIX.2): *Note Utility Minimums::. - -`int _POSIX2_LOCALEDEF' - `unistd.h' (POSIX.2): *Note System Options::. - -`_POSIX2_RE_DUP_MAX' - `limits.h' (POSIX.2): *Note Minimums::. - -`int _POSIX2_SW_DEV' - `unistd.h' (POSIX.2): *Note System Options::. - -`_POSIX_ARG_MAX' - `limits.h' (POSIX.1): *Note Minimums::. - -`_POSIX_CHILD_MAX' - `limits.h' (POSIX.1): *Note Minimums::. - -`int _POSIX_CHOWN_RESTRICTED' - `unistd.h' (POSIX.1): *Note Options for Files::. - -`_POSIX_C_SOURCE' - (POSIX.2): *Note Feature Test Macros::. - -`int _POSIX_JOB_CONTROL' - `unistd.h' (POSIX.1): *Note System Options::. - -`_POSIX_LINK_MAX' - `limits.h' (POSIX.1): *Note File Minimums::. - -`_POSIX_MAX_CANON' - `limits.h' (POSIX.1): *Note File Minimums::. - -`_POSIX_MAX_INPUT' - `limits.h' (POSIX.1): *Note File Minimums::. - -`_POSIX_NAME_MAX' - `limits.h' (POSIX.1): *Note File Minimums::. - -`_POSIX_NGROUPS_MAX' - `limits.h' (POSIX.1): *Note Minimums::. - -`int _POSIX_NO_TRUNC' - `unistd.h' (POSIX.1): *Note Options for Files::. - -`_POSIX_OPEN_MAX' - `limits.h' (POSIX.1): *Note Minimums::. - -`_POSIX_PATH_MAX' - `limits.h' (POSIX.1): *Note File Minimums::. - -`_POSIX_PIPE_BUF' - `limits.h' (POSIX.1): *Note File Minimums::. - -`int _POSIX_SAVED_IDS' - `unistd.h' (POSIX.1): *Note System Options::. - -`_POSIX_SOURCE' - (POSIX.1): *Note Feature Test Macros::. - -`_POSIX_SSIZE_MAX' - `limits.h' (POSIX.1): *Note Minimums::. - -`_POSIX_STREAM_MAX' - `limits.h' (POSIX.1): *Note Minimums::. - -`_POSIX_TZNAME_MAX' - `limits.h' (POSIX.1): *Note Minimums::. - -`unsigned char _POSIX_VDISABLE' - `unistd.h' (POSIX.1): *Note Options for Files::. - -`long int _POSIX_VERSION' - `unistd.h' (POSIX.1): *Note Version Supported::. - -`double pow (double BASE, double POWER)' - `math.h' (ISO): *Note Exponents and Logarithms::. - -`printf_arginfo_function' - `printf.h' (GNU): *Note Defining the Output Handler::. - -`printf_function' - `printf.h' (GNU): *Note Defining the Output Handler::. - -`int printf (const char *TEMPLATE, ...)' - `stdio.h' (ISO): *Note Formatted Output Functions::. - -`PRIO_MAX' - `sys/resource.h' (BSD): *Note Priority::. - -`PRIO_MIN' - `sys/resource.h' (BSD): *Note Priority::. - -`PRIO_PGRP' - `sys/resource.h' (BSD): *Note Priority::. - -`PRIO_PROCESS' - `sys/resource.h' (BSD): *Note Priority::. - -`PRIO_USER' - `sys/resource.h' (BSD): *Note Priority::. - -`char * program_invocation_name' - `errno.h' (GNU): *Note Error Messages::. - -`char * program_invocation_short_name' - `errno.h' (GNU): *Note Error Messages::. - -`void psignal (int SIGNUM, const char *MESSAGE)' - `signal.h' (BSD): *Note Signal Messages::. - -`char * P_tmpdir' - `stdio.h' (SVID): *Note Temporary Files::. - -`ptrdiff_t' - `stddef.h' (ISO): *Note Important Data Types::. - -`int putchar (int C)' - `stdio.h' (ISO): *Note Simple Output::. - -`int putc (int C, FILE *STREAM)' - `stdio.h' (ISO): *Note Simple Output::. - -`int putenv (const char *STRING)' - `stdlib.h' (SVID): *Note Environment Access::. - -`int putpwent (const struct passwd *P, FILE *STREAM)' - `pwd.h' (SVID): *Note Writing a User Entry::. - -`int puts (const char *S)' - `stdio.h' (ISO): *Note Simple Output::. - -`int putw (int W, FILE *STREAM)' - `stdio.h' (SVID): *Note Simple Output::. - -`void qsort (void *ARRAY, size_t COUNT, size_t SIZE, comparison_fn_t COMPARE)' - `stdlib.h' (ISO): *Note Array Sort Function::. - -`int raise (int SIGNUM)' - `signal.h' (ISO): *Note Signaling Yourself::. - -`void r_alloc_free (void **HANDLEPTR)' - `malloc.h' (GNU): *Note Using Relocator::. - -`void * r_alloc (void **HANDLEPTR, size_t SIZE)' - `malloc.h' (GNU): *Note Using Relocator::. - -`int rand ()' - `stdlib.h' (ISO): *Note ISO Random::. - -`int RAND_MAX' - `stdlib.h' (ISO): *Note ISO Random::. - -`long int random ()' - `stdlib.h' (BSD): *Note BSD Random::. - -`struct dirent * readdir (DIR *DIRSTREAM)' - `dirent.h' (POSIX.1): *Note Reading/Closing Directory::. - -`int readdir_r (DIR *DIRSTREAM, struct *ENTRY, struct **RESULT)' - `dirent.h' (GNU): *Note Reading/Closing Directory::. - -`ssize_t read (int FILEDES, void *BUFFER, size_t SIZE)' - `unistd.h' (POSIX.1): *Note I/O Primitives::. - -`int readlink (const char *FILENAME, char *BUFFER, size_t SIZE)' - `unistd.h' (BSD): *Note Symbolic Links::. - -`__realloc_hook' - `malloc.h' (GNU): *Note Hooks for Malloc::. - -`void * realloc (void *PTR, size_t NEWSIZE)' - `malloc.h', `stdlib.h' (ISO): *Note Changing Block Size::. - -`int recvfrom (int SOCKET, void *BUFFER, size_t SIZE, int FLAGS, struct sockaddr *ADDR, size_t *LENGTH-PTR)' - `sys/socket.h' (BSD): *Note Receiving Datagrams::. - -`int recv (int SOCKET, void *BUFFER, size_t SIZE, int FLAGS)' - `sys/socket.h' (BSD): *Note Receiving Data::. - -`int recvmsg (int SOCKET, struct msghdr *MESSAGE, int FLAGS)' - `sys/socket.h' (BSD): *Note Receiving Datagrams::. - -`int RE_DUP_MAX' - `limits.h' (POSIX.2): *Note General Limits::. - -`_REENTRANT' - (GNU): *Note Feature Test Macros::. - -`REG_BADBR' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_BADPAT' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_BADRPT' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`int regcomp (regex_t *COMPILED, const char *PATTERN, int CFLAGS)' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_EBRACE' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_EBRACK' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_ECOLLATE' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_ECTYPE' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_EESCAPE' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_EPAREN' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_ERANGE' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`size_t regerror (int ERRCODE, regex_t *COMPILED, char *BUFFER, size_t LENGTH)' - `regex.h' (POSIX.2): *Note Regexp Cleanup::. - -`REG_ESPACE' - `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. - -`REG_ESPACE' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`REG_ESUBREG' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`int regexec (regex_t *COMPILED, char *STRING, size_t NMATCH, regmatch_t MATCHPTR [], int EFLAGS)' - `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. - -`REG_EXTENDED' - `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. - -`regex_t' - `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. - -`void regfree (regex_t *COMPILED)' - `regex.h' (POSIX.2): *Note Regexp Cleanup::. - -`REG_ICASE' - `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. - -`int register_printf_function (int SPEC, printf_function HANDLER-FUNCTION, printf_arginfo_function ARGINFO-FUNCTION)' - `printf.h' (GNU): *Note Registering New Conversions::. - -`regmatch_t' - `regex.h' (POSIX.2): *Note Regexp Subexpressions::. - -`REG_NEWLINE' - `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. - -`REG_NOMATCH' - `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. - -`REG_NOSUB' - `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. - -`REG_NOTBOL' - `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. - -`REG_NOTEOL' - `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. - -`regoff_t' - `regex.h' (POSIX.2): *Note Regexp Subexpressions::. - -`int remove (const char *FILENAME)' - `stdio.h' (ISO): *Note Deleting Files::. - -`int rename (const char *OLDNAME, const char *NEWNAME)' - `stdio.h' (ISO): *Note Renaming Files::. - -`void rewinddir (DIR *DIRSTREAM)' - `dirent.h' (POSIX.1): *Note Random Access Directory::. - -`void rewind (FILE *STREAM)' - `stdio.h' (ISO): *Note File Positioning::. - -`char * rindex (const char *STRING, int C)' - `string.h' (BSD): *Note Search Functions::. - -`double rint (double X)' - `math.h' (BSD): *Note Rounding and Remainders::. - -`RLIMIT_CORE' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_CPU' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_DATA' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_FSIZE' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_MEMLOCK' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_NOFILE' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_NPROC' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_RSS' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIMIT_STACK' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`RLIM_NLIMITS' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`int rmdir (const char *FILENAME)' - `unistd.h' (POSIX.1): *Note Deleting Files::. - -`int R_OK' - `unistd.h' (POSIX.1): *Note Testing File Access::. - -`void * r_re_alloc (void **HANDLEPTR, size_t SIZE)' - `malloc.h' (GNU): *Note Using Relocator::. - -`RUSAGE_CHILDREN' - `sys/resource.h' (BSD): *Note Resource Usage::. - -`RUSAGE_SELF' - `sys/resource.h' (BSD): *Note Resource Usage::. - -`int SA_NOCLDSTOP' - `signal.h' (POSIX.1): *Note Flags for Sigaction::. - -`int SA_ONSTACK' - `signal.h' (BSD): *Note Flags for Sigaction::. - -`int SA_RESTART' - `signal.h' (BSD): *Note Flags for Sigaction::. - -`_SC_2_C_DEV' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_2_FORT_DEV' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_2_FORT_RUN' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_2_LOCALEDEF' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_2_SW_DEV' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_2_VERSION' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`double scalb (double VALUE, int EXPONENT)' - `math.h' (BSD): *Note Normalization Functions::. - -`int scanf (const char *TEMPLATE, ...)' - `stdio.h' (ISO): *Note Formatted Input Functions::. - -`_SC_ARG_MAX' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_BC_BASE_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_BC_DIM_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_BC_SCALE_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_BC_STRING_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_CHILD_MAX' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_CLK_TCK' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_COLL_WEIGHTS_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_EQUIV_CLASS_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_EXPR_NEST_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`SCHAR_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`SCHAR_MIN' - `limits.h' (ISO): *Note Range of Type::. - -`_SC_JOB_CONTROL' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_LINE_MAX' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`_SC_NGROUPS_MAX' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_OPEN_MAX' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_PAGESIZE' - `unistd.h' (GNU): *Note Constants for Sysconf::. - -`_SC_SAVED_IDS' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_STREAM_MAX' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_TZNAME_MAX' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_VERSION' - `unistd.h' (POSIX.1): *Note Constants for Sysconf::. - -`_SC_VERSION' - `unistd.h' (POSIX.2): *Note Constants for Sysconf::. - -`int SEEK_CUR' - `stdio.h' (ISO): *Note File Positioning::. - -`void seekdir (DIR *DIRSTREAM, off_t POS)' - `dirent.h' (BSD): *Note Random Access Directory::. - -`int SEEK_END' - `stdio.h' (ISO): *Note File Positioning::. - -`int SEEK_SET' - `stdio.h' (ISO): *Note File Positioning::. - -`int select (int NFDS, fd_set *READ-FDS, fd_set *WRITE-FDS, fd_set *EXCEPT-FDS, struct timeval *TIMEOUT)' - `sys/types.h' (BSD): *Note Waiting for I/O::. - -`int send (int SOCKET, void *BUFFER, size_t SIZE, int FLAGS)' - `sys/socket.h' (BSD): *Note Sending Data::. - -`int sendmsg (int SOCKET, const struct msghdr *MESSAGE, int FLAGS)' - `sys/socket.h' (BSD): *Note Receiving Datagrams::. - -`int sendto (int SOCKET, void *BUFFER. size_t SIZE, int FLAGS, struct sockaddr *ADDR, size_t LENGTH)' - `sys/socket.h' (BSD): *Note Sending Datagrams::. - -`void setbuffer (FILE *STREAM, char *BUF, size_t SIZE)' - `stdio.h' (BSD): *Note Controlling Buffering::. - -`void setbuf (FILE *STREAM, char *BUF)' - `stdio.h' (ISO): *Note Controlling Buffering::. - -`int setgid (gid_t NEWGID)' - `unistd.h' (POSIX.1): *Note Setting Groups::. - -`void setgrent (void)' - `grp.h' (SVID, BSD): *Note Scanning All Groups::. - -`int setgroups (size_t COUNT, gid_t *GROUPS)' - `grp.h' (BSD): *Note Setting Groups::. - -`void sethostent (int STAYOPEN)' - `netdb.h' (BSD): *Note Host Names::. - -`int sethostid (long int ID)' - `unistd.h' (BSD): *Note Host Identification::. - -`int sethostname (const char *NAME, size_t LENGTH)' - `unistd.h' (BSD): *Note Host Identification::. - -`int setitimer (int WHICH, struct itimerval *NEW, struct itimerval *OLD)' - `sys/time.h' (BSD): *Note Setting an Alarm::. - -`int setjmp (jmp_buf STATE)' - `setjmp.h' (ISO): *Note Non-Local Details::. - -`void setlinebuf (FILE *STREAM)' - `stdio.h' (BSD): *Note Controlling Buffering::. - -`char * setlocale (int CATEGORY, const char *LOCALE)' - `locale.h' (ISO): *Note Setting the Locale::. - -`void setnetent (int STAYOPEN)' - `netdb.h' (BSD): *Note Networks Database::. - -`int setnetgrent (const char *NETGROUP)' - `netdb.h' (netdb.h): *Note Lookup Netgroup::. - -`int setpgid (pid_t PID, pid_t PGID)' - `unistd.h' (POSIX.1): *Note Process Group Functions::. - -`int setpgrp (pid_t PID, pid_t PGID)' - `unistd.h' (BSD): *Note Process Group Functions::. - -`int setpriority (int CLASS, int ID, int PRIORITY)' - `sys/resource.h' (BSD): *Note Priority::. - -`void setprotoent (int STAYOPEN)' - `netdb.h' (BSD): *Note Protocols Database::. - -`void setpwent (void)' - `pwd.h' (SVID, BSD): *Note Scanning All Users::. - -`int setregid (gid_t RGID, fid_t EGID)' - `unistd.h' (BSD): *Note Setting Groups::. - -`int setreuid (uid_t RUID, uid_t EUID)' - `unistd.h' (BSD): *Note Setting User ID::. - -`int setrlimit (int RESOURCE, struct rlimit *RLP)' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`void setservent (int STAYOPEN)' - `netdb.h' (BSD): *Note Services Database::. - -`pid_t setsid (void)' - `unistd.h' (POSIX.1): *Note Process Group Functions::. - -`int setsockopt (int SOCKET, int LEVEL, int OPTNAME, void *OPTVAL, size_t OPTLEN)' - `sys/socket.h' (BSD): *Note Socket Option Functions::. - -`void * setstate (void *STATE)' - `stdlib.h' (BSD): *Note BSD Random::. - -`int settimeofday (const struct timeval *TP, const struct timezone *TZP)' - `sys/time.h' (BSD): *Note High-Resolution Calendar::. - -`int setuid (uid_t NEWUID)' - `unistd.h' (POSIX.1): *Note Setting User ID::. - -`int setvbuf (FILE *STREAM, char *BUF, int MODE, size_t SIZE)' - `stdio.h' (ISO): *Note Controlling Buffering::. - -`SHRT_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`SHRT_MIN' - `limits.h' (ISO): *Note Range of Type::. - -`int shutdown (int SOCKET, int HOW)' - `sys/socket.h' (BSD): *Note Closing a Socket::. - -`S_IEXEC' - `sys/stat.h' (BSD): *Note Permission Bits::. - -`S_IFBLK' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`S_IFCHR' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`S_IFDIR' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`S_IFIFO' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`S_IFLNK' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`int S_IFMT' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`S_IFREG' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`S_IFSOCK' - `sys/stat.h' (BSD): *Note Testing File Type::. - -`int SIGABRT' - `signal.h' (ISO): *Note Program Error Signals::. - -`int sigaction (int SIGNUM, const struct sigaction *ACTION, struct sigaction *OLD-ACTION)' - `signal.h' (POSIX.1): *Note Advanced Signal Handling::. - -`int sigaddset (sigset_t *SET, int SIGNUM)' - `signal.h' (POSIX.1): *Note Signal Sets::. - -`int SIGALRM' - `signal.h' (POSIX.1): *Note Alarm Signals::. - -`int sigaltstack (const struct sigaltstack *STACK, struct sigaltstack *OLDSTACK)' - `signal.h' (BSD): *Note Signal Stack::. - -`sig_atomic_t' - `signal.h' (ISO): *Note Atomic Types::. - -`SIG_BLOCK' - `signal.h' (POSIX.1): *Note Process Signal Mask::. - -`int sigblock (int MASK)' - `signal.h' (BSD): *Note Blocking in BSD::. - -`int SIGBUS' - `signal.h' (BSD): *Note Program Error Signals::. - -`int SIGCHLD' - `signal.h' (POSIX.1): *Note Job Control Signals::. - -`int SIGCLD' - `signal.h' (SVID): *Note Job Control Signals::. - -`int SIGCONT' - `signal.h' (POSIX.1): *Note Job Control Signals::. - -`int sigdelset (sigset_t *SET, int SIGNUM)' - `signal.h' (POSIX.1): *Note Signal Sets::. - -`int sigemptyset (sigset_t *SET)' - `signal.h' (POSIX.1): *Note Signal Sets::. - -`int SIGEMT' - `signal.h' (BSD): *Note Program Error Signals::. - -`sighandler_t SIG_ERR' - `signal.h' (ISO): *Note Basic Signal Handling::. - -`int sigfillset (sigset_t *SET)' - `signal.h' (POSIX.1): *Note Signal Sets::. - -`int SIGFPE' - `signal.h' (ISO): *Note Program Error Signals::. - -`sighandler_t' - `signal.h' (GNU): *Note Basic Signal Handling::. - -`int SIGHUP' - `signal.h' (POSIX.1): *Note Termination Signals::. - -`int SIGILL' - `signal.h' (ISO): *Note Program Error Signals::. - -`int SIGINFO' - `signal.h' (BSD): *Note Miscellaneous Signals::. - -`int siginterrupt (int SIGNUM, int FAILFLAG)' - `signal.h' (BSD): *Note BSD Handler::. - -`int SIGINT' - `signal.h' (ISO): *Note Termination Signals::. - -`int SIGIO' - `signal.h' (BSD): *Note Asynchronous I/O Signals::. - -`int SIGIOT' - `signal.h' (Unix): *Note Program Error Signals::. - -`int sigismember (const sigset_t *SET, int SIGNUM)' - `signal.h' (POSIX.1): *Note Signal Sets::. - -`sigjmp_buf' - `setjmp.h' (POSIX.1): *Note Non-Local Exits and Signals::. - -`int SIGKILL' - `signal.h' (POSIX.1): *Note Termination Signals::. - -`void siglongjmp (sigjmp_buf STATE, int VALUE)' - `setjmp.h' (POSIX.1): *Note Non-Local Exits and Signals::. - -`int SIGLOST' - `signal.h' (GNU): *Note Operation Error Signals::. - -`int sigmask (int SIGNUM)' - `signal.h' (BSD): *Note Blocking in BSD::. - -`sighandler_t signal (int SIGNUM, sighandler_t ACTION)' - `signal.h' (ISO): *Note Basic Signal Handling::. - -`int sigpause (int MASK)' - `signal.h' (BSD): *Note Blocking in BSD::. - -`int sigpending (sigset_t *SET)' - `signal.h' (POSIX.1): *Note Checking for Pending Signals::. - -`int SIGPIPE' - `signal.h' (POSIX.1): *Note Operation Error Signals::. - -`int SIGPOLL' - `signal.h' (SVID): *Note Asynchronous I/O Signals::. - -`int sigprocmask (int HOW, const sigset_t *SET, sigset_t *OLDSET)' - `signal.h' (POSIX.1): *Note Process Signal Mask::. - -`int SIGPROF' - `signal.h' (BSD): *Note Alarm Signals::. - -`int SIGQUIT' - `signal.h' (POSIX.1): *Note Termination Signals::. - -`int SIGSEGV' - `signal.h' (ISO): *Note Program Error Signals::. - -`int sigsetjmp (sigjmp_buf STATE, int SAVESIGS)' - `setjmp.h' (POSIX.1): *Note Non-Local Exits and Signals::. - -`SIG_SETMASK' - `signal.h' (POSIX.1): *Note Process Signal Mask::. - -`int sigsetmask (int MASK)' - `signal.h' (BSD): *Note Blocking in BSD::. - -`sigset_t' - `signal.h' (POSIX.1): *Note Signal Sets::. - -`int sigstack (const struct sigstack *STACK, struct sigstack *OLDSTACK)' - `signal.h' (BSD): *Note Signal Stack::. - -`int SIGSTOP' - `signal.h' (POSIX.1): *Note Job Control Signals::. - -`int sigsuspend (const sigset_t *SET)' - `signal.h' (POSIX.1): *Note Sigsuspend::. - -`int SIGSYS' - `signal.h' (Unix): *Note Program Error Signals::. - -`int SIGTERM' - `signal.h' (ISO): *Note Termination Signals::. - -`int SIGTRAP' - `signal.h' (BSD): *Note Program Error Signals::. - -`int SIGTSTP' - `signal.h' (POSIX.1): *Note Job Control Signals::. - -`int SIGTTIN' - `signal.h' (POSIX.1): *Note Job Control Signals::. - -`int SIGTTOU' - `signal.h' (POSIX.1): *Note Job Control Signals::. - -`SIG_UNBLOCK' - `signal.h' (POSIX.1): *Note Process Signal Mask::. - -`int SIGURG' - `signal.h' (BSD): *Note Asynchronous I/O Signals::. - -`int SIGUSR1' - `signal.h' (POSIX.1): *Note Miscellaneous Signals::. - -`int SIGUSR2' - `signal.h' (POSIX.1): *Note Miscellaneous Signals::. - -`int sigvec (int SIGNUM, const struct sigvec *ACTION,struct sigvec *OLD-ACTION)' - `signal.h' (BSD): *Note BSD Handler::. - -`int SIGVTALRM' - `signal.h' (BSD): *Note Alarm Signals::. - -`int SIGWINCH' - `signal.h' (BSD): *Note Miscellaneous Signals::. - -`int SIGXCPU' - `signal.h' (BSD): *Note Operation Error Signals::. - -`int SIGXFSZ' - `signal.h' (BSD): *Note Operation Error Signals::. - -`double sinh (double X)' - `math.h' (ISO): *Note Hyperbolic Functions::. - -`double sin (double X)' - `math.h' (ISO): *Note Trig Functions::. - -`S_IREAD' - `sys/stat.h' (BSD): *Note Permission Bits::. - -`S_IRGRP' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IROTH' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IRUSR' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IRWXG' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IRWXO' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IRWXU' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`int S_ISBLK (mode_t M)' - `sys/stat.h' (POSIX): *Note Testing File Type::. - -`int S_ISCHR (mode_t M)' - `sys/stat.h' (POSIX): *Note Testing File Type::. - -`int S_ISDIR (mode_t M)' - `sys/stat.h' (POSIX): *Note Testing File Type::. - -`int S_ISFIFO (mode_t M)' - `sys/stat.h' (POSIX): *Note Testing File Type::. - -`S_ISGID' - `sys/stat.h' (POSIX): *Note Permission Bits::. - -`int S_ISLNK (mode_t M)' - `sys/stat.h' (GNU): *Note Testing File Type::. - -`int S_ISREG (mode_t M)' - `sys/stat.h' (POSIX): *Note Testing File Type::. - -`int S_ISSOCK (mode_t M)' - `sys/stat.h' (GNU): *Note Testing File Type::. - -`S_ISUID' - `sys/stat.h' (POSIX): *Note Permission Bits::. - -`S_ISVTX' - `sys/stat.h' (BSD): *Note Permission Bits::. - -`S_IWGRP' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IWOTH' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IWRITE' - `sys/stat.h' (BSD): *Note Permission Bits::. - -`S_IWUSR' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IXGRP' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IXOTH' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`S_IXUSR' - `sys/stat.h' (POSIX.1): *Note Permission Bits::. - -`size_t' - `stddef.h' (ISO): *Note Important Data Types::. - -`unsigned int sleep (unsigned int SECONDS)' - `unistd.h' (POSIX.1): *Note Sleeping::. - -`int snprintf (char *S, size_t SIZE, const char *TEMPLATE, ...)' - `stdio.h' (GNU): *Note Formatted Output Functions::. - -`SO_BROADCAST' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`int SOCK_DGRAM' - `sys/socket.h' (BSD): *Note Communication Styles::. - -`int socket (int NAMESPACE, int STYLE, int PROTOCOL)' - `sys/socket.h' (BSD): *Note Creating a Socket::. - -`int socketpair (int NAMESPACE, int STYLE, int PROTOCOL, int FILEDES[2])' - `sys/socket.h' (BSD): *Note Socket Pairs::. - -`int SOCK_RAW' - `sys/socket.h' (BSD): *Note Communication Styles::. - -`int SOCK_RDM' - `sys/socket.h' (BSD): *Note Communication Styles::. - -`int SOCK_SEQPACKET' - `sys/socket.h' (BSD): *Note Communication Styles::. - -`int SOCK_STREAM' - `sys/socket.h' (BSD): *Note Communication Styles::. - -`SO_DEBUG' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_DONTROUTE' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_ERROR' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_KEEPALIVE' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_LINGER' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`int SOL_SOCKET' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_OOBINLINE' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_RCVBUF' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_REUSEADDR' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_SNDBUF' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`SO_STYLE' - `sys/socket.h' (GNU): *Note Socket-Level Options::. - -`SO_TYPE' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`speed_t' - `termios.h' (POSIX.1): *Note Line Speed::. - -`int sprintf (char *S, const char *TEMPLATE, ...)' - `stdio.h' (ISO): *Note Formatted Output Functions::. - -`double sqrt (double X)' - `math.h' (ISO): *Note Exponents and Logarithms::. - -`void srand (unsigned int SEED)' - `stdlib.h' (ISO): *Note ISO Random::. - -`void srandom (unsigned int SEED)' - `stdlib.h' (BSD): *Note BSD Random::. - -`int sscanf (const char *S, const char *TEMPLATE, ...)' - `stdio.h' (ISO): *Note Formatted Input Functions::. - -`sighandler_t ssignal (int SIGNUM, sighandler_t ACTION)' - `signal.h' (SVID): *Note Basic Signal Handling::. - -`int SSIZE_MAX' - `limits.h' (POSIX.1): *Note General Limits::. - -`ssize_t' - `unistd.h' (POSIX.1): *Note I/O Primitives::. - -`int stat (const char *FILENAME, struct stat *BUF)' - `sys/stat.h' (POSIX.1): *Note Reading Attributes::. - -`STDERR_FILENO' - `unistd.h' (POSIX.1): *Note Descriptors and Streams::. - -`FILE * stderr' - `stdio.h' (ISO): *Note Standard Streams::. - -`STDIN_FILENO' - `unistd.h' (POSIX.1): *Note Descriptors and Streams::. - -`FILE * stdin' - `stdio.h' (ISO): *Note Standard Streams::. - -`STDOUT_FILENO' - `unistd.h' (POSIX.1): *Note Descriptors and Streams::. - -`FILE * stdout' - `stdio.h' (ISO): *Note Standard Streams::. - -`char * stpcpy (char *TO, const char *FROM)' - `string.h' (Unknown origin): *Note Copying and Concatenation::. - -`char * stpncpy (char *TO, const char *FROM, size_t SIZE)' - `string.h' (GNU): *Note Copying and Concatenation::. - -`int strcasecmp (const char *S1, const char *S2)' - `string.h' (BSD): *Note String/Array Comparison::. - -`char * strcat (char *TO, const char *FROM)' - `string.h' (ISO): *Note Copying and Concatenation::. - -`char * strchr (const char *STRING, int C)' - `string.h' (ISO): *Note Search Functions::. - -`int strcmp (const char *S1, const char *S2)' - `string.h' (ISO): *Note String/Array Comparison::. - -`int strcoll (const char *S1, const char *S2)' - `string.h' (ISO): *Note Collation Functions::. - -`char * strcpy (char *TO, const char *FROM)' - `string.h' (ISO): *Note Copying and Concatenation::. - -`size_t strcspn (const char *STRING, const char *STOPSET)' - `string.h' (ISO): *Note Search Functions::. - -`char * strdupa (const char *S)' - `string.h' (GNU): *Note Copying and Concatenation::. - -`char * strdup (const char *S)' - `string.h' (SVID): *Note Copying and Concatenation::. - -`int STREAM_MAX' - `limits.h' (POSIX.1): *Note General Limits::. - -`char * strerror (int ERRNUM)' - `string.h' (ISO): *Note Error Messages::. - -`char * strerror_r (int ERRNUM, char *BUF, size_t N)' - `string.h' (GNU): *Note Error Messages::. - -`size_t strftime (char *S, size_t SIZE, const char *TEMPLATE, const struct tm *BROKENTIME)' - `time.h' (POSIX.2): *Note Formatting Date and Time::. - -`size_t strlen (const char *S)' - `string.h' (ISO): *Note String Length::. - -`int strncasecmp (const char *S1, const char *S2, size_t N)' - `string.h' (BSD): *Note String/Array Comparison::. - -`char * strncat (char *TO, const char *FROM, size_t SIZE)' - `string.h' (ISO): *Note Copying and Concatenation::. - -`int strncmp (const char *S1, const char *S2, size_t SIZE)' - `string.h' (ISO): *Note String/Array Comparison::. - -`char * strncpy (char *TO, const char *FROM, size_t SIZE)' - `string.h' (ISO): *Note Copying and Concatenation::. - -`char * strndupa (const char *S, size_t SIZE)' - `string.h' (GNU): *Note Copying and Concatenation::. - -`char * strndup (const char *S, size_t SIZE)' - `string.h' (GNU): *Note Copying and Concatenation::. - -`char * strpbrk (const char *STRING, const char *STOPSET)' - `string.h' (ISO): *Note Search Functions::. - -`char * strrchr (const char *STRING, int C)' - `string.h' (ISO): *Note Search Functions::. - -`char * strsep (char **STRING_PTR, const char *DELIMITER)' - `string.h' (BSD): *Note Finding Tokens in a String::. - -`char * strsignal (int SIGNUM)' - `string.h' (GNU): *Note Signal Messages::. - -`size_t strspn (const char *STRING, const char *SKIPSET)' - `string.h' (ISO): *Note Search Functions::. - -`char * strstr (const char *HAYSTACK, const char *NEEDLE)' - `string.h' (ISO): *Note Search Functions::. - -`double strtod (const char *STRING, char **TAILPTR)' - `stdlib.h' (ISO): *Note Parsing of Floats::. - -`float strtof (const char *STRING, char **TAILPTR)' - `stdlib.h' (GNU): *Note Parsing of Floats::. - -`char * strtok (char *NEWSTRING, const char *DELIMITERS)' - `string.h' (ISO): *Note Finding Tokens in a String::. - -`char * strtok_r (char *NEWSTRING, const char *DELIMITERS, char **SAVE_PTR)' - `string.h' (POSIX): *Note Finding Tokens in a String::. - -`long double strtold (const char *STRING, char **TAILPTR)' - `stdlib.h' (GNU): *Note Parsing of Floats::. - -`long int strtol (const char *STRING, char **TAILPTR, int BASE)' - `stdlib.h' (ISO): *Note Parsing of Integers::. - -`long long int strtoll (const char *STRING, char **TAILPTR, int BASE)' - `stdlib.h' (GNU): *Note Parsing of Integers::. - -`long long int strtoq (const char *STRING, char **TAILPTR, int BASE)' - `stdlib.h' (BSD): *Note Parsing of Integers::. - -`unsigned long int strtoul (const char *STRING, char **TAILPTR, int BASE)' - `stdlib.h' (ISO): *Note Parsing of Integers::. - -`unsigned long long int strtoull (const char *STRING, char **TAILPTR, int BASE)' - `stdlib.h' (GNU): *Note Parsing of Integers::. - -`unsigned long long int strtouq (const char *STRING, char **TAILPTR, int BASE)' - `stdlib.h' (BSD): *Note Parsing of Integers::. - -`struct dirent' - `dirent.h' (POSIX.1): *Note Directory Entries::. - -`struct flock' - `fcntl.h' (POSIX.1): *Note File Locks::. - -`struct group' - `grp.h' (POSIX.1): *Note Group Data Structure::. - -`struct hostent' - `netdb.h' (BSD): *Note Host Names::. - -`struct in_addr' - `netinet/in.h' (BSD): *Note Host Address Data Type::. - -`struct itimerval' - `sys/time.h' (BSD): *Note Setting an Alarm::. - -`struct lconv' - `locale.h' (ISO): *Note Numeric Formatting::. - -`struct linger' - `sys/socket.h' (BSD): *Note Socket-Level Options::. - -`struct mallinfo' - `malloc.h' (GNU): *Note Statistics of Malloc::. - -`struct msghdr' - `sys/socket.h' (BSD): *Note Receiving Datagrams::. - -`struct netent' - `netdb.h' (BSD): *Note Networks Database::. - -`struct obstack' - `obstack.h' (GNU): *Note Creating Obstacks::. - -`struct option' - `getopt.h' (GNU): *Note Long Options::. - -`struct passwd' - `pwd.h' (POSIX.1): *Note User Data Structure::. - -`struct printf_info' - `printf.h' (GNU): *Note Conversion Specifier Options::. - -`struct protoent' - `netdb.h' (BSD): *Note Protocols Database::. - -`struct rlimit' - `sys/resource.h' (BSD): *Note Limits on Resources::. - -`struct rusage' - `sys/resource.h' (BSD): *Note Resource Usage::. - -`struct servent' - `netdb.h' (BSD): *Note Services Database::. - -`struct sigaction' - `signal.h' (POSIX.1): *Note Advanced Signal Handling::. - -`struct sigaltstack' - `signal.h' (BSD): *Note Signal Stack::. - -`struct sigstack' - `signal.h' (BSD): *Note Signal Stack::. - -`struct sigvec' - `signal.h' (BSD): *Note BSD Handler::. - -`struct sockaddr' - `sys/socket.h' (BSD): *Note Address Formats::. - -`struct sockaddr_in' - `netinet/in.h' (BSD): *Note Internet Address Format::. - -`struct sockaddr_un' - `sys/un.h' (BSD): *Note File Namespace Details::. - -`struct stat' - `sys/stat.h' (POSIX.1): *Note Attribute Meanings::. - -`struct termios' - `termios.h' (POSIX.1): *Note Mode Data Types::. - -`struct timeval' - `sys/time.h' (BSD): *Note High-Resolution Calendar::. - -`struct timezone' - `sys/time.h' (BSD): *Note High-Resolution Calendar::. - -`struct tm' - `time.h' (ISO): *Note Broken-down Time::. - -`struct tms' - `sys/times.h' (POSIX.1): *Note Detailed CPU Time::. - -`struct utimbuf' - `time.h' (POSIX.1): *Note File Times::. - -`struct utsname' - `sys/utsname.h' (POSIX.1): *Note Hardware/Software Type ID::. - -`size_t strxfrm (char *TO, const char *FROM, size_t SIZE)' - `string.h' (ISO): *Note Collation Functions::. - -`_SVID_SOURCE' - (GNU): *Note Feature Test Macros::. - -`int SV_INTERRUPT' - `signal.h' (BSD): *Note BSD Handler::. - -`int SV_ONSTACK' - `signal.h' (BSD): *Note BSD Handler::. - -`int SV_RESETHAND' - `signal.h' (Sun): *Note BSD Handler::. - -`int symlink (const char *OLDNAME, const char *NEWNAME)' - `unistd.h' (BSD): *Note Symbolic Links::. - -`long int sysconf (int PARAMETER)' - `unistd.h' (POSIX.1): *Note Sysconf Definition::. - -`int system (const char *COMMAND)' - `stdlib.h' (ISO): *Note Running a Command::. - -`double tanh (double X)' - `math.h' (ISO): *Note Hyperbolic Functions::. - -`double tan (double X)' - `math.h' (ISO): *Note Trig Functions::. - -`int tcdrain (int FILEDES)' - `termios.h' (POSIX.1): *Note Line Control::. - -`tcflag_t' - `termios.h' (POSIX.1): *Note Mode Data Types::. - -`int tcflow (int FILEDES, int ACTION)' - `termios.h' (POSIX.1): *Note Line Control::. - -`int tcflush (int FILEDES, int QUEUE)' - `termios.h' (POSIX.1): *Note Line Control::. - -`int tcgetattr (int FILEDES, struct termios *TERMIOS-P)' - `termios.h' (POSIX.1): *Note Mode Functions::. - -`pid_t tcgetpgrp (int FILEDES)' - `unistd.h' (POSIX.1): *Note Terminal Access Functions::. - -`TCSADRAIN' - `termios.h' (POSIX.1): *Note Mode Functions::. - -`TCSAFLUSH' - `termios.h' (POSIX.1): *Note Mode Functions::. - -`TCSANOW' - `termios.h' (POSIX.1): *Note Mode Functions::. - -`TCSASOFT' - `termios.h' (BSD): *Note Mode Functions::. - -`int tcsendbreak (int FILEDES, int DURATION)' - `termios.h' (POSIX.1): *Note Line Control::. - -`int tcsetattr (int FILEDES, int WHEN, const struct termios *TERMIOS-P)' - `termios.h' (POSIX.1): *Note Mode Functions::. - -`int tcsetpgrp (int FILEDES, pid_t PGID)' - `unistd.h' (POSIX.1): *Note Terminal Access Functions::. - -`off_t telldir (DIR *DIRSTREAM)' - `dirent.h' (BSD): *Note Random Access Directory::. - -`TEMP_FAILURE_RETRY (EXPRESSION)' - `unistd.h' (GNU): *Note Interrupted Primitives::. - -`char * tempnam (const char *DIR, const char *PREFIX)' - `stdio.h' (SVID): *Note Temporary Files::. - -`time_t time (time_t *RESULT)' - `time.h' (ISO): *Note Simple Calendar Time::. - -`clock_t times (struct tms *BUFFER)' - `sys/times.h' (POSIX.1): *Note Detailed CPU Time::. - -`time_t' - `time.h' (ISO): *Note Simple Calendar Time::. - -`long int timezone' - `time.h' (SVID): *Note Time Zone Functions::. - -`FILE * tmpfile (void)' - `stdio.h' (ISO): *Note Temporary Files::. - -`int TMP_MAX' - `stdio.h' (ISO): *Note Temporary Files::. - -`char * tmpnam (char *RESULT)' - `stdio.h' (ISO): *Note Temporary Files::. - -`char * tmpnam_r (char *RESULT)' - `stdio.h' (GNU): *Note Temporary Files::. - -`int toascii (int C)' - `ctype.h' (SVID, BSD): *Note Case Conversion::. - -`int _tolower (int C)' - `ctype.h' (SVID): *Note Case Conversion::. - -`int tolower (int C)' - `ctype.h' (ISO): *Note Case Conversion::. - -`tcflag_t TOSTOP' - `termios.h' (POSIX.1): *Note Local Modes::. - -`int _toupper (int C)' - `ctype.h' (SVID): *Note Case Conversion::. - -`int toupper (int C)' - `ctype.h' (ISO): *Note Case Conversion::. - -`TRY_AGAIN' - `netdb.h' (BSD): *Note Host Names::. - -`char * ttyname (int FILEDES)' - `unistd.h' (POSIX.1): *Note Is It a Terminal::. - -`char * tzname [2]' - `time.h' (POSIX.1): *Note Time Zone Functions::. - -`int TZNAME_MAX' - `limits.h' (POSIX.1): *Note General Limits::. - -`void tzset (void)' - `time.h' (POSIX.1): *Note Time Zone Functions::. - -`UCHAR_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`uid_t' - `sys/types.h' (POSIX.1): *Note Reading Persona::. - -`UINT_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`ULONG_LONG_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`ULONG_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`mode_t umask (mode_t MASK)' - `sys/stat.h' (POSIX.1): *Note Setting Permissions::. - -`int uname (struct utsname *INFO)' - `sys/utsname.h' (POSIX.1): *Note Hardware/Software Type ID::. - -`int ungetc (int C, FILE *STREAM)' - `stdio.h' (ISO): *Note How Unread::. - -`union wait' - `sys/wait.h' (BSD): *Note BSD Wait Functions::. - -`int unlink (const char *FILENAME)' - `unistd.h' (POSIX.1): *Note Deleting Files::. - -`USHRT_MAX' - `limits.h' (ISO): *Note Range of Type::. - -`int utime (const char *FILENAME, const struct utimbuf *TIMES)' - `time.h' (POSIX.1): *Note File Times::. - -`int utimes (const char *FILENAME, struct timeval TVP[2])' - `sys/time.h' (BSD): *Note File Times::. - -`va_alist' - `varargs.h' (Unix): *Note Old Varargs::. - -`TYPE va_arg (va_list AP, TYPE)' - `stdarg.h' (ISO): *Note Argument Macros::. - -`va_dcl' - `varargs.h' (Unix): *Note Old Varargs::. - -`void va_end (va_list AP)' - `stdarg.h' (ISO): *Note Argument Macros::. - -`va_list' - `stdarg.h' (ISO): *Note Argument Macros::. - -`void * valloc (size_t SIZE)' - `malloc.h', `stdlib.h' (BSD): *Note Aligned Memory Blocks::. - -`int vasprintf (char **PTR, const char *TEMPLATE, va_list AP)' - `stdio.h' (GNU): *Note Variable Arguments Output::. - -`void va_start (va_list AP)' - `varargs.h' (Unix): *Note Old Varargs::. - -`void va_start (va_list AP, LAST-REQUIRED)' - `stdarg.h' (ISO): *Note Argument Macros::. - -`int VDISCARD' - `termios.h' (BSD): *Note Other Special::. - -`int VDSUSP' - `termios.h' (BSD): *Note Signal Characters::. - -`int VEOF' - `termios.h' (POSIX.1): *Note Editing Characters::. - -`int VEOL2' - `termios.h' (BSD): *Note Editing Characters::. - -`int VEOL' - `termios.h' (POSIX.1): *Note Editing Characters::. - -`int VERASE' - `termios.h' (POSIX.1): *Note Editing Characters::. - -`pid_t vfork (void)' - `unistd.h' (BSD): *Note Creating a Process::. - -`int vfprintf (FILE *STREAM, const char *TEMPLATE, va_list AP)' - `stdio.h' (ISO): *Note Variable Arguments Output::. - -`int vfscanf (FILE *STREAM, const char *TEMPLATE, va_list AP)' - `stdio.h' (GNU): *Note Variable Arguments Input::. - -`int VINTR' - `termios.h' (POSIX.1): *Note Signal Characters::. - -`int VKILL' - `termios.h' (POSIX.1): *Note Editing Characters::. - -`int VLNEXT' - `termios.h' (BSD): *Note Other Special::. - -`int VMIN' - `termios.h' (POSIX.1): *Note Noncanonical Input::. - -`int vprintf (const char *TEMPLATE, va_list AP)' - `stdio.h' (ISO): *Note Variable Arguments Output::. - -`int VQUIT' - `termios.h' (POSIX.1): *Note Signal Characters::. - -`int VREPRINT' - `termios.h' (BSD): *Note Editing Characters::. - -`int vscanf (const char *TEMPLATE, va_list AP)' - `stdio.h' (GNU): *Note Variable Arguments Input::. - -`int vsnprintf (char *S, size_t SIZE, const char *TEMPLATE, va_list AP)' - `stdio.h' (GNU): *Note Variable Arguments Output::. - -`int vsprintf (char *S, const char *TEMPLATE, va_list AP)' - `stdio.h' (ISO): *Note Variable Arguments Output::. - -`int vsscanf (const char *S, const char *TEMPLATE, va_list AP)' - `stdio.h' (GNU): *Note Variable Arguments Input::. - -`int VSTART' - `termios.h' (POSIX.1): *Note Start/Stop Characters::. - -`int VSTATUS' - `termios.h' (BSD): *Note Other Special::. - -`int VSTOP' - `termios.h' (POSIX.1): *Note Start/Stop Characters::. - -`int VSUSP' - `termios.h' (POSIX.1): *Note Signal Characters::. - -`int VTIME' - `termios.h' (POSIX.1): *Note Noncanonical Input::. - -`int VWERASE' - `termios.h' (BSD): *Note Editing Characters::. - -`pid_t wait3 (union wait *STATUS-PTR, int OPTIONS, struct rusage *USAGE)' - `sys/wait.h' (BSD): *Note BSD Wait Functions::. - -`pid_t wait4 (pid_t PID, int *STATUS-PTR, int OPTIONS, struct rusage *USAGE)' - `sys/wait.h' (BSD): *Note Process Completion::. - -`pid_t wait (int *STATUS-PTR)' - `sys/wait.h' (POSIX.1): *Note Process Completion::. - -`pid_t waitpid (pid_t PID, int *STATUS-PTR, int OPTIONS)' - `sys/wait.h' (POSIX.1): *Note Process Completion::. - -`WCHAR_MAX' - `limits.h' (GNU): *Note Range of Type::. - -`wchar_t' - `stddef.h' (ISO): *Note Wide Char Intro::. - -`int WCOREDUMP (int STATUS)' - `sys/wait.h' (BSD): *Note Process Completion Status::. - -`size_t wcstombs (char *STRING, const wchar_t WSTRING, size_t SIZE)' - `stdlib.h' (ISO): *Note Wide String Conversion::. - -`int wctomb (char *STRING, wchar_t WCHAR)' - `stdlib.h' (ISO): *Note Converting One Char::. - -`int WEXITSTATUS (int STATUS)' - `sys/wait.h' (POSIX.1): *Note Process Completion Status::. - -`int WIFEXITED (int STATUS)' - `sys/wait.h' (POSIX.1): *Note Process Completion Status::. - -`int WIFSIGNALED (int STATUS)' - `sys/wait.h' (POSIX.1): *Note Process Completion Status::. - -`int WIFSTOPPED (int STATUS)' - `sys/wait.h' (POSIX.1): *Note Process Completion Status::. - -`int W_OK' - `unistd.h' (POSIX.1): *Note Testing File Access::. - -`int wordexp (const char *WORDS, wordexp_t *WORD-VECTOR-PTR, int FLAGS)' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. - -`wordexp_t' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. - -`void wordfree (wordexp_t *WORD-VECTOR-PTR)' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + The value of this macro is the minimum normalized positive floating + point number that is representable in type `float'. It is supposed + to be no more than `1E-37'. -`WRDE_APPEND' - `wordexp.h' (POSIX.2): *Note Flags for Wordexp::. +`DBL_MIN' +`LDBL_MIN' + These are similar to `FLT_MIN', but for the data types `double' + and `long double', respectively. The type of the macro's value is + the same as the type it describes. -`WRDE_BADCHAR' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. +`FLT_EPSILON' + This is the minimum positive floating point number of type `float' + such that `1.0 + FLT_EPSILON != 1.0' is true. It's supposed to be + no greater than `1E-5'. -`WRDE_BADVAL' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. +`DBL_EPSILON' +`LDBL_EPSILON' + These are similar to `FLT_EPSILON', but for the data types + `double' and `long double', respectively. The type of the macro's + value is the same as the type it describes. The values are not + supposed to be greater than `1E-9'. -`WRDE_CMDSUB' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + +File: libc.info, Node: IEEE Floating Point, Prev: Floating Point Parameters, Up: Floating Type Macros -`WRDE_DOOFFS' - `wordexp.h' (POSIX.2): *Note Flags for Wordexp::. +IEEE Floating Point +................... -`WRDE_NOCMD' - `wordexp.h' (POSIX.2): *Note Flags for Wordexp::. + Here is an example showing how the floating type measurements come +out for the most common floating point representation, specified by the +`IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE Std +754-1985)'. Nearly all computers designed since the 1980s use this +format. -`WRDE_NOSPACE' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + The IEEE single-precision float representation uses a base of 2. +There is a sign bit, a mantissa with 23 bits plus one hidden bit (so +the total precision is 24 base-2 digits), and an 8-bit exponent that +can represent values in the range -125 to 128, inclusive. -`WRDE_REUSE' - `wordexp.h' (POSIX.2): *Note Flags for Wordexp::. + So, for an implementation that uses this representation for the +`float' data type, appropriate values for the corresponding parameters +are: -`WRDE_SHOWERR' - `wordexp.h' (POSIX.2): *Note Flags for Wordexp::. + FLT_RADIX 2 + FLT_MANT_DIG 24 + FLT_DIG 6 + FLT_MIN_EXP -125 + FLT_MIN_10_EXP -37 + FLT_MAX_EXP 128 + FLT_MAX_10_EXP +38 + FLT_MIN 1.17549435E-38F + FLT_MAX 3.40282347E+38F + FLT_EPSILON 1.19209290E-07F -`WRDE_SYNTAX' - `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + Here are the values for the `double' data type: -`WRDE_UNDEF' - `wordexp.h' (POSIX.2): *Note Flags for Wordexp::. + DBL_MANT_DIG 53 + DBL_DIG 15 + DBL_MIN_EXP -1021 + DBL_MIN_10_EXP -307 + DBL_MAX_EXP 1024 + DBL_MAX_10_EXP 308 + DBL_MAX 1.7976931348623157E+308 + DBL_MIN 2.2250738585072014E-308 + DBL_EPSILON 2.2204460492503131E-016 -`ssize_t write (int FILEDES, const void *BUFFER, size_t SIZE)' - `unistd.h' (POSIX.1): *Note I/O Primitives::. + +File: libc.info, Node: Structure Measurement, Prev: Floating Type Macros, Up: Data Type Measurements -`int WSTOPSIG (int STATUS)' - `sys/wait.h' (POSIX.1): *Note Process Completion Status::. +Structure Field Offset Measurement +---------------------------------- -`int WTERMSIG (int STATUS)' - `sys/wait.h' (POSIX.1): *Note Process Completion Status::. + You can use `offsetof' to measure the location within a structure +type of a particular structure member. -`int X_OK' - `unistd.h' (POSIX.1): *Note Testing File Access::. + - Macro: size_t offsetof (TYPE, MEMBER) + This expands to a integer constant expression that is the offset + of the structure member named MEMBER in a the structure type TYPE. + For example, `offsetof (struct s, elem)' is the offset, in bytes, + of the member `elem' in a `struct s'. -`_XOPEN_SOURCE' - (XOPEN): *Note Feature Test Macros::. + This macro won't work if MEMBER is a bit field; you get an error + from the C compiler in that case. diff -durpN glibc-2.0.4/manual/libc.info-29 glibc-2.0.5/manual/libc.info-29 --- glibc-2.0.4/manual/libc.info-29 Fri Apr 18 11:50:41 1997 +++ glibc-2.0.5/manual/libc.info-29 Tue Aug 5 18:48:40 1997 @@ -1,12 +1,17 @@ This is Info file libc.info, produced by Makeinfo version 1.67 from the input file libc.texinfo. +INFO-DIR-SECTION GNU libraries +START-INFO-DIR-ENTRY +* Libc: (libc). C library. +END-INFO-DIR-ENTRY + This file documents the GNU C library. This is Edition 0.07 DRAFT, last updated 4 Oct 1996, of `The GNU C Library Reference Manual', for Version 2.00 Beta. - Copyright (C) 1993, '94, '95, '96 Free Software Foundation, Inc. + Copyright (C) 1993, '94, '95, '96, '97 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 @@ -26,970 +31,3843 @@ entitled "GNU Library General Public Lic accuracy by the Foundation.  -File: libc.info, Node: Maintenance, Next: Copying, Prev: Library Summary, Up: Top +File: libc.info, Node: Library Summary, Next: Maintenance, Prev: Language Features, Up: Top -Library Maintenance -******************* +Summary of Library Facilities +***************************** -* Menu: + This appendix is a complete list of the facilities declared within +the header files supplied with the GNU C library. Each entry also +lists the standard or other source from which each facility is derived, +and tells you where in the manual you can find more information about +how to use it. -* 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. -* 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. -* Contributors:: Contributors to the GNU C Library. +`void abort (void)' + `stdlib.h' (ISO): *Note Aborting a Program::. - -File: libc.info, Node: Installation, Next: Reporting Bugs, Up: Maintenance +`int abs (int NUMBER)' + `stdlib.h' (ISO): *Note Absolute Value::. -How to Install the GNU C Library -================================ +`int accept (int SOCKET, struct sockaddr *ADDR, socklen_t *LENGTH-PTR)' + `sys/socket.h' (BSD): *Note Accepting Connections::. - Installation of the GNU C library is relatively simple, but usually -requires several GNU tools to be installed already. +`int access (const char *FILENAME, int HOW)' + `unistd.h' (POSIX.1): *Note Testing File Access::. -* Menu: +`double acosh (double X)' + `math.h' (BSD): *Note Hyperbolic Functions::. -* Tools for Installation:: We recommend using these tools to build. -* Supported Configurations:: What systems the GNU C library runs on. +`double acos (double X)' + `math.h' (ISO): *Note Inverse Trig Functions::. - To configure the GNU C library for your system, run the shell script -`configure' with `sh'. Use an argument which is the conventional GNU -name for your system configuration--for example, `sparc-sun-sunos4.1', -for a Sun 4 running SunOS 4.1. *Note Installation: -(gcc.info)Installation, for a full description of standard GNU -configuration names. If you omit the configuration name, `configure' -will try to guess one for you by inspecting the system it is running -on. It may or may not be able to come up with a guess, and the its -guess might be wrong. `configure' will tell you the canonical name of -the chosen configuration before proceeding. +`int adjtime (const struct timeval *DELTA, struct timeval *OLDDELTA)' + `sys/time.h' (BSD): *Note High-Resolution Calendar::. - Here are some options that you should specify (if appropriate) when -you run `configure': +`AF_FILE' + `sys/socket.h' (GNU): *Note Address Formats::. -`--with-gnu-ld' - Use this option if you plan to use GNU `ld' to link programs with - the GNU C Library. (We strongly recommend that you do.) This - option enables use of features that exist only in GNU `ld'; so if - you configure for GNU `ld' you must use GNU `ld' *every time* you - link with the GNU C Library, and when building it. +`AF_INET6' + `sys/socket.h' (IPv6 Basic API): *Note Address Formats::. -`--with-gnu-as' - Use this option if you plan to use the GNU assembler, `gas', when - building the GNU C Library. On some systems, the library may not - build properly if you do *not* use `gas'. +`AF_INET' + `sys/socket.h' (BSD): *Note Address Formats::. -`--with-gnu-binutils' - This option implies both `--with-gnu-ld' and `--with-gnu-as'. On - systems where GNU tools are the system tools, there is no need to - specify this option. These include GNU, GNU/Linux, and free BSD - systems. +`AF_UNIX' + `sys/socket.h' (BSD): *Note Address Formats::. -`--without-fp' -`--nfp' - Use this option if your computer lacks hardware floating-point - support. +`AF_UNSPEC' + `sys/socket.h' (BSD): *Note Address Formats::. -`--prefix=DIRECTORY' - Install machine-independent data files in subdirectories of - `DIRECTORY'. (You can also set this in `configparms'; see below.) +`unsigned int alarm (unsigned int SECONDS)' + `unistd.h' (POSIX.1): *Note Setting an Alarm::. -`--exec-prefix=DIRECTORY' - Install the library and other machine-dependent files in - subdirectories of `DIRECTORY'. (You can also set this in - `configparms'; see below.) +`void * alloca (size_t SIZE);' + `stdlib.h' (GNU, BSD): *Note Variable Size Automatic::. -`--enable-shared' -`--disable-shared' - Enable or disable building of an ELF shared library on systems that - support it. The default is to build the shared library on systems - using ELF when the GNU `binutils' are available. +`tcflag_t ALTWERASE' + `termios.h' (BSD): *Note Local Modes::. -`--enable-profile' -`--disable-profile' - Enable or disable building of the profiled C library, `-lc_p'. The - default is to build the profiled library. You may wish to disable - it if you don't plan to do profiling, because it doubles the build - time of compiling just the unprofiled static library. +`int ARG_MAX' + `limits.h' (POSIX.1): *Note General Limits::. -`--enable-omitfp' - Enable building a highly-optimized but possibly undebuggable - static C library. This causes the normal static and shared (if - enabled) C libraries to be compiled with maximal optimization, - including the `-fomit-frame-pointer' switch that makes debugging - impossible on many machines, and without debugging information - (which makes the binaries substantially smaller). An additional - static library is compiled with no optimization and full debugging - information, and installed as `-lc_g'. +`char * asctime (const struct tm *BROKENTIME)' + `time.h' (ISO): *Note Formatting Date and Time::. - The simplest way to run `configure' is to do it in the directory -that contains the library sources. This prepares to build the library -in that very directory. +`double asinh (double X)' + `math.h' (BSD): *Note Hyperbolic Functions::. - You can prepare to build the library in some other directory by going -to that other directory to run `configure'. In order to run configure, -you will have to specify a directory for it, like this: +`double asin (double X)' + `math.h' (ISO): *Note Inverse Trig Functions::. - mkdir sun4 - cd sun4 - ../configure sparc-sun-sunos4.1 +`int asprintf (char **PTR, const char *TEMPLATE, ...)' + `stdio.h' (GNU): *Note Dynamic Output::. -`configure' looks for the sources in whatever directory you specified -for finding `configure' itself. It does not matter where in the file -system the source and build directories are--as long as you specify the -source directory when you run `configure', you will get the proper -results. +`void assert (int EXPRESSION)' + `assert.h' (ISO): *Note Consistency Checking::. - This feature lets you keep sources and binaries in different -directories, and that makes it easy to build the library for several -different machines from the same set of sources. Simply create a build -directory for each target machine, and run `configure' in that -directory specifying the target machine's configuration name. +`void assert_perror (int ERRNUM)' + `assert.h' (GNU): *Note Consistency Checking::. - The library has a number of special-purpose configuration parameters. -These are defined in the file `Makeconfig'; see the comments in that -file for the details. +`double atan2 (double Y, double X)' + `math.h' (ISO): *Note Inverse Trig Functions::. - But don't edit the file `Makeconfig' yourself--instead, create a -file `configparms' in the directory where you are building the library, -and define in that file the parameters you want to specify. -`configparms' should *not* be an edited copy of `Makeconfig'; specify -only the parameters that you want to override. To see how to set these -parameters, find the section of `Makeconfig' that says "These are the -configuration variables." Then for each parameter that you want to -change, copy the definition from `Makeconfig' to your new `configparms' -file, and change the value as appropriate for your system. +`double atanh (double X)' + `math.h' (BSD): *Note Hyperbolic Functions::. - It is easy to configure the GNU C library for cross-compilation by -setting a few variables in `configparms'. Set `CC' to the -cross-compiler for the target you configured the library for; it is -important to use this same `CC' value when running `configure', like -this: `CC=TARGET-gcc configure TARGET'. Set `BUILD_CC' to the compiler -to use for for programs run on the build system as part of compiling -the library. You may need to set `AR' and `RANLIB' to cross-compiling -versions of `ar' and `ranlib' if the native tools are not configured to -work with object files for the target you configured for. +`double atan (double X)' + `math.h' (ISO): *Note Inverse Trig Functions::. - Some of the machine-dependent code for some machines uses extensions -in the GNU C compiler, so you may need to compile the library with GCC. -(In fact, all of the existing complete ports require GCC.) +`int atexit (void (*FUNCTION) (void))' + `stdlib.h' (ISO): *Note Cleanups on Exit::. - To build the library and related programs, type `make'. This will -produce a lot of output, some of which may look like errors from `make' -(but isn't). Look for error messages from `make' containing `***'. -Those indicate that something is really wrong. +`double atof (const char *STRING)' + `stdlib.h' (ISO): *Note Parsing of Floats::. - To build and run some test programs which exercise some of the -library facilities, type `make check'. This will produce several files -with names like `PROGRAM.out'. +`int atoi (const char *STRING)' + `stdlib.h' (ISO): *Note Parsing of Integers::. - To format the `GNU C Library Reference Manual' for printing, type -`make dvi'. +`long int atol (const char *STRING)' + `stdlib.h' (ISO): *Note Parsing of Integers::. - To install the library and its header files, and the Info files of -the manual, type `make install'. This will build things if necessary, -before installing them. +`B0' + `termios.h' (POSIX.1): *Note Line Speed::. - -File: libc.info, Node: Tools for Installation, Next: Supported Configurations, Up: Installation +`B110' + `termios.h' (POSIX.1): *Note Line Speed::. -Recommended Tools to Install the GNU C Library ----------------------------------------------- +`B1200' + `termios.h' (POSIX.1): *Note Line Speed::. - We recommend installing the following GNU tools before attempting to -build the GNU C library: +`B134' + `termios.h' (POSIX.1): *Note Line Speed::. - * `make' 3.75 +`B150' + `termios.h' (POSIX.1): *Note Line Speed::. - You need the latest version of GNU `make'. Modifying the GNU C - Library to work with other `make' programs would be so hard that we - recommend you port GNU `make' instead. *Really.* We recommend - version GNU `make' version 3.75 or later. +`B1800' + `termios.h' (POSIX.1): *Note Line Speed::. - * GCC 2.7.2 +`B19200' + `termios.h' (POSIX.1): *Note Line Speed::. - On most platforms, the GNU C library can only be compiled with the - GNU C compiler. We recommend GCC version 2.7.2 or later; earlier - versions may have problems. +`B200' + `termios.h' (POSIX.1): *Note Line Speed::. - * `binutils' 2.7 +`B2400' + `termios.h' (POSIX.1): *Note Line Speed::. - Using the GNU `binutils' (assembler, linker, and related tools) is - preferable when possible, and they are required to build an ELF - shared C library. We recommend `binutils' version 2.7 or later; - earlier versions are known to have problems or to not support all - architectures. +`B300' + `termios.h' (POSIX.1): *Note Line Speed::. - -File: libc.info, Node: Supported Configurations, Prev: Tools for Installation, Up: Installation +`B38400' + `termios.h' (POSIX.1): *Note Line Speed::. -Supported Configurations ------------------------- +`B4800' + `termios.h' (POSIX.1): *Note Line Speed::. - The GNU C Library currently supports configurations that match the -following patterns: +`B50' + `termios.h' (POSIX.1): *Note Line Speed::. - alpha-dec-osf1 - alpha-ANYTHING-linux - alpha-ANYTHING-linuxecoff - iX86-ANYTHING-bsd4.3 - iX86-ANYTHING-gnu - iX86-ANYTHING-isc2.2 - iX86-ANYTHING-isc3.N - iX86-ANYTHING-linux - iX86-ANYTHING-sco3.2 - iX86-ANYTHING-sco3.2v4 - iX86-ANYTHING-sysv - iX86-ANYTHING-sysv4 - iX86-force_cpu386-none - iX86-sequent-bsd - i960-nindy960-none - m68k-hp-bsd4.3 - m68k-mvme135-none - m68k-mvme136-none - m68k-sony-newsos3 - m68k-sony-newsos4 - m68k-sun-sunos4.N - mips-dec-ultrix4.N - mips-sgi-irix4.N - sparc-sun-solaris2.N - sparc-sun-sunos4.N +`B600' + `termios.h' (POSIX.1): *Note Line Speed::. - Each case of `iX86' can be `i386', `i486', `i586', or `i686'.. All -of those configurations produce a library that can run on any of these -processors. The library will be optimized for the specified processor, -but will not use instructions not available on all of them. +`B75' + `termios.h' (POSIX.1): *Note Line Speed::. - While no other configurations are supported, there are handy aliases -for these few. (These aliases work in other GNU software as well.) +`B9600' + `termios.h' (POSIX.1): *Note Line Speed::. - decstation - hp320-bsd4.3 hp300bsd - i486-gnu - i586-linux - i386-sco - i386-sco3.2v4 - i386-sequent-dynix - i386-svr4 - news - sun3-sunos4.N sun3 - sun4-solaris2.N sun4-sunos5.N - sun4-sunos4.N sun4 +`int BC_BASE_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. - -File: libc.info, Node: Reporting Bugs, Next: Source Layout, Prev: Installation, Up: Maintenance +`int BC_DIM_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. -Reporting Bugs -============== +`int BC_DIM_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. - There are probably bugs in the GNU C library. There are certainly -errors and omissions in this manual. If you report them, they will get -fixed. If you don't, no one will ever know about them and they will -remain unfixed for all eternity, if not longer. +`int bcmp (const void *A1, const void *A2, size_t SIZE)' + `string.h' (BSD): *Note String/Array Comparison::. - To report a bug, first you must find it. Hopefully, this will be the -hard part. Once you've found a bug, make sure it's really a bug. A -good way to do this is to see if the GNU C library behaves the same way -some other C library does. If so, probably you are wrong and the -libraries are right (but not necessarily). If not, one of the libraries -is probably wrong. +`void * bcopy (void *FROM, const void *TO, size_t SIZE)' + `string.h' (BSD): *Note Copying and Concatenation::. - Once you're sure you've found a bug, try to narrow it down to the -smallest test case that reproduces the problem. In the case of a C -library, you really only need to narrow it down to one library function -call, if possible. This should not be too difficult. +`int BC_SCALE_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. - The final step when you have a simple test case is to report the bug. -When reporting a bug, send your test case, the results you got, the -results you expected, what you think the problem might be (if you've -thought of anything), your system type, and the version of the GNU C -library which you are using. Also include the files `config.status' -and `config.make' which are created by running `configure'; they will -be in whatever directory was current when you ran `configure'. +`int BC_STRING_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. - If you think you have found some way in which the GNU C library does -not conform to the ISO and POSIX standards (*note Standards and -Portability::.), that is definitely a bug. Report it! +`int bind (int SOCKET, struct sockaddr *ADDR, socklen_t LENGTH)' + `sys/socket.h' (BSD): *Note Setting Address::. - Send bug reports to the Internet address `bug-glibc@prep.ai.mit.edu' -or the UUCP path `mit-eddie!prep.ai.mit.edu!bug-glibc'. If you have -other problems with installation or use, please report those as well. +`tcflag_t BRKINT' + `termios.h' (POSIX.1): *Note Input Modes::. - If you are not sure how a function should behave, and this manual -doesn't tell you, that's a bug in the manual. Report that too! If the -function's behavior disagrees with the manual, then either the library -or the manual has a bug, so report the disagreement. If you find any -errors or omissions in this manual, please report them to the Internet -address `bug-glibc-manual@prep.ai.mit.edu' or the UUCP path -`mit-eddie!prep.ai.mit.edu!bug-glibc-manual'. +`_BSD_SOURCE' + (GNU): *Note Feature Test Macros::. - -File: libc.info, Node: Source Layout, Next: Porting, Prev: Reporting Bugs, Up: Maintenance +`void * bsearch (const void *KEY, const void *ARRAY, size_t COUNT, size_t SIZE, comparison_fn_t COMPARE)' + `stdlib.h' (ISO): *Note Array Search Function::. -Adding New Functions -==================== +`int BUFSIZ' + `stdio.h' (ISO): *Note Controlling Buffering::. - The process of building the library is driven by the makefiles, which -make heavy use of special features of GNU `make'. The makefiles are -very complex, and you probably don't want to try to understand them. -But what they do is fairly straightforward, and only requires that you -define a few variables in the right places. +`void * bzero (void *BLOCK, size_t SIZE)' + `string.h' (BSD): *Note Copying and Concatenation::. - The library sources are divided into subdirectories, grouped by -topic. +`double cabs (struct { double real, imag; } Z)' + `math.h' (BSD): *Note Absolute Value::. - The `string' subdirectory has all the string-manipulation functions, -`math' has all the mathematical functions, etc. +`void * calloc (size_t COUNT, size_t ELTSIZE)' + `malloc.h', `stdlib.h' (ISO): *Note Allocating Cleared Space::. - Each subdirectory contains a simple makefile, called `Makefile', -which defines a few `make' variables and then includes the global -makefile `Rules' with a line like: +`double cbrt (double X)' + `math.h' (BSD): *Note Exponents and Logarithms::. - include ../Rules +`cc_t' + `termios.h' (POSIX.1): *Note Mode Data Types::. -The basic variables that a subdirectory makefile defines are: +`tcflag_t CCTS_OFLOW' + `termios.h' (BSD): *Note Control Modes::. -`subdir' - The name of the subdirectory, for example `stdio'. This variable - *must* be defined. +`double ceil (double X)' + `math.h' (ISO): *Note Rounding and Remainders::. -`headers' - The names of the header files in this section of the library, such - as `stdio.h'. +`speed_t cfgetispeed (const struct termios *TERMIOS-P)' + `termios.h' (POSIX.1): *Note Line Speed::. -`routines' -`aux' - The names of the modules (source files) in this section of the - library. These should be simple names, such as `strlen' (rather - than complete file names, such as `strlen.c'). Use `routines' for - modules that define functions in the library, and `aux' for - auxiliary modules containing things like data definitions. But the - values of `routines' and `aux' are just concatenated, so there - really is no practical difference. +`speed_t cfgetospeed (const struct termios *TERMIOS-P)' + `termios.h' (POSIX.1): *Note Line Speed::. -`tests' - The names of test programs for this section of the library. These - should be simple names, such as `tester' (rather than complete file - names, such as `tester.c'). `make tests' will build and run all - the test programs. If a test program needs input, put the test - data in a file called `TEST-PROGRAM.input'; it will be given to - the test program on its standard input. If a test program wants - to be run with arguments, put the arguments (all on a single line) - in a file called `TEST-PROGRAM.args'. Test programs should exit - with zero status when the test passes, and nonzero status when the - test indicates a bug in the library or error in building. +`int cfmakeraw (struct termios *TERMIOS-P)' + `termios.h' (BSD): *Note Noncanonical Input::. -`others' - The names of "other" programs associated with this section of the - library. These are programs which are not tests per se, but are - other small programs included with the library. They are built by - `make others'. +`void cfree (void *PTR)' + `stdlib.h' (Sun): *Note Freeing after Malloc::. -`install-lib' -`install-data' -`install' - Files to be installed by `make install'. Files listed in - `install-lib' are installed in the directory specified by `libdir' - in `configparms' or `Makeconfig' (*note Installation::.). Files - listed in `install-data' are installed in the directory specified - by `datadir' in `configparms' or `Makeconfig'. Files listed in - `install' are installed in the directory specified by `bindir' in - `configparms' or `Makeconfig'. +`int cfsetispeed (struct termios *TERMIOS-P, speed_t SPEED)' + `termios.h' (POSIX.1): *Note Line Speed::. -`distribute' - Other files from this subdirectory which should be put into a - distribution tar file. You need not list here the makefile itself - or the source and header files listed in the other standard - variables. Only define `distribute' if there are files used in an - unusual way that should go into the distribution. +`int cfsetospeed (struct termios *TERMIOS-P, speed_t SPEED)' + `termios.h' (POSIX.1): *Note Line Speed::. -`generated' - Files which are generated by `Makefile' in this subdirectory. - These files will be removed by `make clean', and they will never - go into a distribution. +`int cfsetspeed (struct termios *TERMIOS-P, speed_t SPEED)' + `termios.h' (BSD): *Note Line Speed::. -`extra-objs' - Extra object files which are built by `Makefile' in this - subdirectory. This should be a list of file names like `foo.o'; - the files will actually be found in whatever directory object - files are being built in. These files will be removed by - `make clean'. This variable is used for secondary object files - needed to build `others' or `tests'. +`CHAR_BIT' + `limits.h' (ISO): *Note Width of Type::. - -File: libc.info, Node: Porting, Next: Contributors, Prev: Source Layout, Up: Maintenance +`CHAR_MAX' + `limits.h' (ISO): *Note Range of Type::. -Porting the GNU C Library -========================= +`CHAR_MIN' + `limits.h' (ISO): *Note Range of Type::. - The GNU C library is written to be easily portable to a variety of -machines and operating systems. Machine- and operating system-dependent -functions are well separated to make it easy to add implementations for -new machines or operating systems. This section describes the layout of -the library source tree and explains the mechanisms used to select -machine-dependent code to use. +`int chdir (const char *FILENAME)' + `unistd.h' (POSIX.1): *Note Working Directory::. - All the machine-dependent and operating system-dependent files in the -library are in the subdirectory `sysdeps' under the top-level library -source directory. This directory contains a hierarchy of -subdirectories (*note Hierarchy Conventions::.). +`int CHILD_MAX' + `limits.h' (POSIX.1): *Note General Limits::. - Each subdirectory of `sysdeps' contains source files for a -particular machine or operating system, or for a class of machine or -operating system (for example, systems by a particular vendor, or all -machines that use IEEE 754 floating-point format). A configuration -specifies an ordered list of these subdirectories. Each subdirectory -implicitly appends its parent directory to the list. For example, -specifying the list `unix/bsd/vax' is equivalent to specifying the list -`unix/bsd/vax unix/bsd unix'. A subdirectory can also specify that it -implies other subdirectories which are not directly above it in the -directory hierarchy. If the file `Implies' exists in a subdirectory, -it lists other subdirectories of `sysdeps' which are appended to the -list, appearing after the subdirectory containing the `Implies' file. -Lines in an `Implies' file that begin with a `#' character are ignored -as comments. For example, `unix/bsd/Implies' contains: - # BSD has Internet-related things. - unix/inet +`int chmod (const char *FILENAME, mode_t MODE)' + `sys/stat.h' (POSIX.1): *Note Setting Permissions::. -and `unix/Implies' contains: - posix +`int chown (const char *FILENAME, uid_t OWNER, gid_t GROUP)' + `unistd.h' (POSIX.1): *Note File Owner::. -So the final list is `unix/bsd/vax unix/bsd unix/inet unix posix'. +`tcflag_t CIGNORE' + `termios.h' (BSD): *Note Control Modes::. - `sysdeps' has two "special" subdirectories, called `generic' and -`stub'. These two are always implicitly appended to the list of -subdirectories (in that order), so you needn't put them in an `Implies' -file, and you should not create any subdirectories under them intended -to be new specific categories. `generic' is for things that can be -implemented in machine-independent C, using only other -machine-independent functions in the C library. `stub' is for "stub" -versions of functions which cannot be implemented on a particular -machine or operating system. The stub functions always return an -error, and set `errno' to `ENOSYS' (Function not implemented). *Note -Error Reporting::. +`void clearerr (FILE *STREAM)' + `stdio.h' (ISO): *Note EOF and Errors::. - A source file is known to be system-dependent by its having a -version in `generic' or `stub'; every generally-available function whose -implementation is system-dependent in should have either a generic or -stub implementation (there is no point in having both). Some rare -functions are only useful on specific systems and aren't defined at all -on others; these do not appear anywhere in the system-independent -source code or makefiles (including the `generic' and `stub' -directories), only in the system-dependent `Makefile' in the specific -system's subdirectory. +`int CLK_TCK' + `time.h' (POSIX.1): *Note Basic CPU Time::. - If you come across a file that is in one of the main source -directories (`string', `stdio', etc.), and you want to write a machine- -or operating system-dependent version of it, move the file into -`sysdeps/generic' and write your new implementation in the appropriate -system-specific subdirectory. Note that if a file is to be -system-dependent, it *must not* appear in one of the main source -directories. +`tcflag_t CLOCAL' + `termios.h' (POSIX.1): *Note Control Modes::. - There are a few special files that may exist in each subdirectory of -`sysdeps': +`clock_t clock (void)' + `time.h' (ISO): *Note Basic CPU Time::. -`Makefile' - A makefile for this machine or operating system, or class of - machine or operating system. This file is included by the library - makefile `Makerules', which is used by the top-level makefile and - the subdirectory makefiles. It can change the variables set in the - including makefile or add new rules. It can use GNU `make' - conditional directives based on the variable `subdir' (see above) - to select different sets of variables and rules for different - sections of the library. It can also set the `make' variable - `sysdep-routines', to specify extra modules to be included in the - library. You should use `sysdep-routines' rather than adding - modules to `routines' because the latter is used in determining - what to distribute for each subdirectory of the main source tree. +`int CLOCKS_PER_SEC' + `time.h' (ISO): *Note Basic CPU Time::. - Each makefile in a subdirectory in the ordered list of - subdirectories to be searched is included in order. Since several - system-dependent makefiles may be included, each should append to - `sysdep-routines' rather than simply setting it: +`clock_t' + `time.h' (ISO): *Note Basic CPU Time::. - sysdep-routines := $(sysdep-routines) foo bar +`int closedir (DIR *DIRSTREAM)' + `dirent.h' (POSIX.1): *Note Reading/Closing Directory::. -`Subdirs' - This file contains the names of new whole subdirectories under the - top-level library source tree that should be included for this - system. These subdirectories are treated just like the - system-independent subdirectories in the library source tree, such - as `stdio' and `math'. +`int close (int FILEDES)' + `unistd.h' (POSIX.1): *Note Opening and Closing Files::. - Use this when there are completely new sets of functions and header - files that should go into the library for the system this - subdirectory of `sysdeps' implements. For example, - `sysdeps/unix/inet/Subdirs' contains `inet'; the `inet' directory - contains various network-oriented operations which only make sense - to put in the library on systems that support the Internet. +`int COLL_WEIGHTS_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. -`Dist' - This file contains the names of files (relative to the - subdirectory of `sysdeps' in which it appears) which should be - included in the distribution. List any new files used by rules in - the `Makefile' in the same directory, or header files used by the - source files in that directory. You don't need to list files that - are implementations (either C or assembly source) of routines - whose names are given in the machine-independent makefiles in the - main source tree. +`size_t confstr (int PARAMETER, char *BUF, size_t LEN)' + `unistd.h' (POSIX.2): *Note String Parameters::. -`configure' - This file is a shell script fragment to be run at configuration - time. The top-level `configure' script uses the shell `.' command - to read the `configure' file in each system-dependent directory - chosen, in order. The `configure' files are often generated from - `configure.in' files using Autoconf. +`int connect (int SOCKET, struct sockaddr *ADDR, socklen_t LENGTH)' + `sys/socket.h' (BSD): *Note Connecting::. - A system-dependent `configure' script will usually add things to - the shell variables `DEFS' and `config_vars'; see the top-level - `configure' script for details. The script can check for - `--with-PACKAGE' options that were passed to the top-level - `configure'. For an option `--with-PACKAGE=VALUE' `configure' - sets the shell variable `with_PACKAGE' (with any dashes in PACKAGE - converted to underscores) to VALUE; if the option is just - `--with-PACKAGE' (no argument), then it sets `with_PACKAGE' to - `yes'. +`cookie_close_function' + `stdio.h' (GNU): *Note Hook Functions::. -`configure.in' - This file is an Autoconf input fragment to be processed into the - file `configure' in this subdirectory. *Note Introduction: - (autoconf.info)Introduction, for a description of Autoconf. You - should write either `configure' or `configure.in', but not both. - The first line of `configure.in' should invoke the `m4' macro - `GLIBC_PROVIDES'. This macro does several `AC_PROVIDE' calls for - Autoconf macros which are used by the top-level `configure' - script; without this, those macros might be invoked again - unnecessarily by Autoconf. +`cookie_io_functions_t' + `stdio.h' (GNU): *Note Streams and Cookies::. - That is the general system for how system-dependencies are isolated. +`cookie_read_function' + `stdio.h' (GNU): *Note Hook Functions::. -* Menu: +`cookie_seek_function' + `stdio.h' (GNU): *Note Hook Functions::. -* Hierarchy Conventions:: The layout of the `sysdeps' hierarchy. -* Porting to Unix:: Porting the library to an average - Unix-like system. +`cookie_write_function' + `stdio.h' (GNU): *Note Hook Functions::. - -File: libc.info, Node: Hierarchy Conventions, Next: Porting to Unix, Up: Porting +`double copysign (double VALUE, double SIGN)' + `math.h' (BSD): *Note Normalization Functions::. -Layout of the `sysdeps' Directory Hierarchy -------------------------------------------- +`double cosh (double X)' + `math.h' (ISO): *Note Hyperbolic Functions::. - A GNU configuration name has three parts: the CPU type, the -manufacturer's name, and the operating system. `configure' uses these -to pick the list of system-dependent directories to look for. If the -`--nfp' option is *not* passed to `configure', the directory -`MACHINE/fpu' is also used. The operating system often has a "base -operating system"; for example, if the operating system is `sunos4.1', -the base operating system is `unix/bsd'. The algorithm used to pick -the list of directories is simple: `configure' makes a list of the base -operating system, manufacturer, CPU type, and operating system, in that -order. It then concatenates all these together with slashes in -between, to produce a directory name; for example, the configuration -`sparc-sun-sunos4.1' results in `unix/bsd/sun/sparc/sunos4.1'. -`configure' then tries removing each element of the list in turn, so -`unix/bsd/sparc' and `sun/sparc' are also tried, among others. Since -the precise version number of the operating system is often not -important, and it would be very inconvenient, for example, to have -identical `sunos4.1.1' and `sunos4.1.2' directories, `configure' tries -successively less specific operating system names by removing trailing -suffixes starting with a period. +`double cos (double X)' + `math.h' (ISO): *Note Trig Functions::. - As an example, here is the complete list of directories that would be -tried for the configuration `sparc-sun-sunos4.1' (without the `--nfp' -option): +`tcflag_t CREAD' + `termios.h' (POSIX.1): *Note Control Modes::. - sparc/fpu - unix/bsd/sun/sunos4.1/sparc - unix/bsd/sun/sunos4.1 - unix/bsd/sun/sunos4/sparc - unix/bsd/sun/sunos4 - unix/bsd/sun/sunos/sparc - unix/bsd/sun/sunos - unix/bsd/sun/sparc - unix/bsd/sun - unix/bsd/sunos4.1/sparc - unix/bsd/sunos4.1 - unix/bsd/sunos4/sparc - unix/bsd/sunos4 - unix/bsd/sunos/sparc - unix/bsd/sunos - unix/bsd/sparc - unix/bsd - unix/sun/sunos4.1/sparc - unix/sun/sunos4.1 - unix/sun/sunos4/sparc - unix/sun/sunos4 - unix/sun/sunos/sparc - unix/sun/sunos - unix/sun/sparc - unix/sun - unix/sunos4.1/sparc - unix/sunos4.1 - unix/sunos4/sparc - unix/sunos4 - unix/sunos/sparc - unix/sunos - unix/sparc - unix - sun/sunos4.1/sparc - sun/sunos4.1 - sun/sunos4/sparc - sun/sunos4 - sun/sunos/sparc - sun/sunos - sun/sparc - sun - sunos4.1/sparc - sunos4.1 - sunos4/sparc - sunos4 - sunos/sparc - sunos - sparc +`int creat (const char *FILENAME, mode_t MODE)' + `fcntl.h' (POSIX.1): *Note Opening and Closing Files::. - Different machine architectures are conventionally subdirectories at -the top level of the `sysdeps' directory tree. For example, -`sysdeps/sparc' and `sysdeps/m68k'. These contain files specific to -those machine architectures, but not specific to any particular -operating system. There might be subdirectories for specializations of -those architectures, such as `sysdeps/m68k/68020'. Code which is -specific to the floating-point coprocessor used with a particular -machine should go in `sysdeps/MACHINE/fpu'. +`tcflag_t CRTS_IFLOW' + `termios.h' (BSD): *Note Control Modes::. - There are a few directories at the top level of the `sysdeps' -hierarchy that are not for particular machine architectures. +`tcflag_t CS5' + `termios.h' (POSIX.1): *Note Control Modes::. -`generic' -`stub' - As described above (*note Porting::.), these are the two - subdirectories that every configuration implicitly uses after all - others. +`tcflag_t CS6' + `termios.h' (POSIX.1): *Note Control Modes::. -`ieee754' - This directory is for code using the IEEE 754 floating-point - format, where the C type `float' is IEEE 754 single-precision - format, and `double' is IEEE 754 double-precision format. Usually - this directory is referred to in the `Implies' file in a machine - architecture-specific directory, such as `m68k/Implies'. +`tcflag_t CS7' + `termios.h' (POSIX.1): *Note Control Modes::. -`posix' - This directory contains implementations of things in the library in - terms of POSIX.1 functions. This includes some of the POSIX.1 - functions themselves. Of course, POSIX.1 cannot be completely - implemented in terms of itself, so a configuration using just - `posix' cannot be complete. +`tcflag_t CS8' + `termios.h' (POSIX.1): *Note Control Modes::. -`unix' - This is the directory for Unix-like things. *Note Porting to - Unix::. `unix' implies `posix'. There are some special-purpose - subdirectories of `unix': +`tcflag_t CSIZE' + `termios.h' (POSIX.1): *Note Control Modes::. - `unix/common' - This directory is for things common to both BSD and System V - release 4. Both `unix/bsd' and `unix/sysv/sysv4' imply - `unix/common'. +`_CS_PATH' + `unistd.h' (POSIX.2): *Note String Parameters::. - `unix/inet' - This directory is for `socket' and related functions on Unix - systems. The `inet' top-level subdirectory is enabled by - `unix/inet/Subdirs'. `unix/common' implies `unix/inet'. +`tcflag_t CSTOPB' + `termios.h' (POSIX.1): *Note Control Modes::. -`mach' - This is the directory for things based on the Mach microkernel - from CMU (including the GNU operating system). Other basic - operating systems (VMS, for example) would have their own - directories at the top level of the `sysdeps' hierarchy, parallel - to `unix' and `mach'. +`char * ctermid (char *STRING)' + `stdio.h' (POSIX.1): *Note Identifying the Terminal::. - -File: libc.info, Node: Porting to Unix, Prev: Hierarchy Conventions, Up: Porting +`char * ctime (const time_t *TIME)' + `time.h' (ISO): *Note Formatting Date and Time::. -Porting the GNU C Library to Unix Systems ------------------------------------------ +`char * cuserid (char *STRING)' + `stdio.h' (POSIX.1): *Note Who Logged In::. - Most Unix systems are fundamentally very similar. There are -variations between different machines, and variations in what -facilities are provided by the kernel. But the interface to the -operating system facilities is, for the most part, pretty uniform and -simple. +`int daylight' + `time.h' (SVID): *Note Time Zone Functions::. - The code for Unix systems is in the directory `unix', at the top -level of the `sysdeps' hierarchy. This directory contains -subdirectories (and subdirectory trees) for various Unix variants. +`DBL_DIG' + `float.h' (ISO): *Note Floating Point Parameters::. - The functions which are system calls in most Unix systems are -implemented in assembly code in files in `sysdeps/unix'. These files -are named with a suffix of `.S'; for example, `__open.S'. Files ending -in `.S' are run through the C preprocessor before being fed to the -assembler. +`DBL_EPSILON' + `float.h' (ISO): *Note Floating Point Parameters::. - These files all use a set of macros that should be defined in -`sysdep.h'. The `sysdep.h' file in `sysdeps/unix' partially defines -them; a `sysdep.h' file in another directory must finish defining them -for the particular machine and operating system variant. See -`sysdeps/unix/sysdep.h' and the machine-specific `sysdep.h' -implementations to see what these macros are and what they should do. +`DBL_MANT_DIG' + `float.h' (ISO): *Note Floating Point Parameters::. - The system-specific makefile for the `unix' directory (that is, the -file `sysdeps/unix/Makefile') gives rules to generate several files -from the Unix system you are building the library on (which is assumed -to be the target system you are building the library *for*). All the -generated files are put in the directory where the object files are -kept; they should not affect the source tree itself. The files -generated are `ioctls.h', `errnos.h', `sys/param.h', and `errlist.c' -(for the `stdio' section of the library). +`DBL_MAX_10_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. - -File: libc.info, Node: Contributors, Prev: Porting, Up: Maintenance +`DBL_MAX_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. -Contributors to the GNU C Library -================================= +`DBL_MAX' + `float.h' (ISO): *Note Floating Point Parameters::. - The GNU C library was written originally by Roland McGrath. Some -parts of the library were contributed or worked on by other people. +`DBL_MIN_10_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. - * The `getopt' function and related code were written by Richard - Stallman, David J. MacKenzie, and Roland McGrath. +`DBL_MIN_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. - * The merge sort function `qsort' was written by Michael J. Haertel. +`DBL_MIN' + `float.h' (ISO): *Note Floating Point Parameters::. - * The quick sort function used as a fallback by `qsort' was written - by Douglas C. Schmidt. +`dev_t' + `sys/types.h' (POSIX.1): *Note Attribute Meanings::. - * The memory allocation functions `malloc', `realloc' and `free' and - related code were written by Michael J. Haertel. +`double difftime (time_t TIME1, time_t TIME0)' + `time.h' (ISO): *Note Simple Calendar Time::. - * Fast implementations of many of the string functions (`memcpy', - `strlen', etc.) were written by Torbjorn Granlund. +`DIR' + `dirent.h' (POSIX.1): *Note Opening a Directory::. - * The `tar.h' header file was written by David J. MacKenzie. +`div_t div (int NUMERATOR, int DENOMINATOR)' + `stdlib.h' (ISO): *Note Integer Division::. - * The port to the MIPS DECStation running Ultrix 4 - (`mips-dec-ultrix4') was contributed by Brendan Kehoe and Ian - Lance Taylor. +`div_t' + `stdlib.h' (ISO): *Note Integer Division::. - * The DES encryption function `crypt' and related functions were - contributed by Michael Glad. +`double drem (double NUMERATOR, double DENOMINATOR)' + `math.h' (BSD): *Note Rounding and Remainders::. - * The `ftw' function was contributed by Ian Lance Taylor. +`int dup2 (int OLD, int NEW)' + `unistd.h' (POSIX.1): *Note Duplicating Descriptors::. - * The startup code to support SunOS shared libraries was contributed - by Tom Quinn. +`int dup (int OLD)' + `unistd.h' (POSIX.1): *Note Duplicating Descriptors::. - * The `mktime' function was contributed by Paul Eggert. +`int E2BIG' + `errno.h' (POSIX.1: Argument list too long): *Note Error Codes::. - * The port to the Sequent Symmetry running Dynix version 3 - (`i386-sequent-bsd') was contributed by Jason Merrill. +`int EACCES' + `errno.h' (POSIX.1: Permission denied): *Note Error Codes::. - * The timezone support code is derived from the public-domain - timezone package by Arthur David Olson and his many contributors. +`int EADDRINUSE' + `errno.h' (BSD: Address already in use): *Note Error Codes::. - * The port to the DEC Alpha running OSF/1 (`alpha-dec-osf1') was - contributed by Brendan Kehoe, using some code written by Roland - McGrath. +`int EADDRNOTAVAIL' + `errno.h' (BSD: Cannot assign requested address): *Note Error + Codes::. - * The port to SGI machines running Irix 4 (`mips-sgi-irix4') was - contributed by Tom Quinn. +`int EADV' + `errno.h' (Linux???: Advertise error): *Note Error Codes::. - * The port of the Mach and Hurd code to the MIPS architecture - (`mips-ANYTHING-gnu') was contributed by Kazumoto Kojima. +`int EAFNOSUPPORT' + `errno.h' (BSD: Address family not supported by protocol): *Note + Error Codes::. - * The floating-point printing function used by `printf' and friends - and the floating-point reading function used by `scanf', `strtod' - and friends were written by Ulrich Drepper. The multi-precision - integer functions used in those functions are taken from GNU MP, - which was contributed by Torbjorn Granlund. +`int EAGAIN' + `errno.h' (POSIX.1: Resource temporarily unavailable): *Note + Error Codes::. - * The internationalization support in the library, and the support - programs `locale' and `localedef', were written by Ulrich Drepper. - Ulrich Drepper adapted the support code for message catalogs - (`libintl.h', etc.) from the GNU `gettext' package, which he also - wrote. He also contributed the `catgets' support and the entire - suite of multi-byte and wide-character support functions - (`wctype.h', `wchar.h', etc.). +`int EALREADY' + `errno.h' (BSD: Operation already in progress): *Note Error + Codes::. - * The implementations of the `nsswitch.conf' mechanism and the files - and DNS backends for it were designed and written by Ulrich - Drepper and Roland McGrath, based on a backend interface defined - by Peter Eriksson. +`int EAUTH' + `errno.h' (BSD: Authentication error): *Note Error Codes::. - * The port to Linux i386/ELF (`i386-ANYTHING-linux') was contributed - by Ulrich Drepper, based in large part on work done in Hongjiu - Lu's Linux version of the GNU C Library. +`int EBACKGROUND' + `errno.h' (GNU: Inappropriate operation for background process): + *Note Error Codes::. - * The port to Linux/m68k (`m68k-ANYTHING-linux') was contributed by - Andreas Schwab. +`int EBADE' + `errno.h' (Linux???: Invalid exchange): *Note Error Codes::. - * Richard Henderson contributed the ELF dynamic linking code and - other support for the Alpha processor. +`int EBADFD' + `errno.h' (Linux???: File descriptor in bad state): *Note Error + Codes::. - * David Mosberger-Tang contributed the port to Linux/Alpha - (`alpha-ANYTHING-linux'). +`int EBADF' + `errno.h' (POSIX.1: Bad file descriptor): *Note Error Codes::. - * Stephen R. van den Berg contributed a highly-optimized `strstr' - function. +`int EBADMSG' + `errno.h' (XOPEN: Bad message): *Note Error Codes::. - * Ulrich Drepper contributed the `hsearch' and `drand48' families of - functions; reentrant `...`_r'' versions of the `random' family; - System V shared memory and IPC support code; and several - highly-optimized string functions for iX86 processors. +`int EBADR' + `errno.h' (Linux???: Invalid request descriptor): *Note Error + Codes::. - * The math functions are taken from `fdlibm-5.1' by Sun - Microsystems, as modified by J.T. Conklin, Ian Lance Taylor, - Ulrich Drepper, Andreas Schwab, and Roland McGrath. +`int EBADRPC' + `errno.h' (BSD: RPC struct is bad): *Note Error Codes::. - * The `libio' library used to implement `stdio' functions on some - platforms was written by Per Bothner and modified by Ulrich - Drepper. +`int EBADRQC' + `errno.h' (Linux???: Invalid request code): *Note Error Codes::. - * The Internet-related code (most of the `inet' subdirectory) and - several other miscellaneous functions and header files have been - included from 4.4 BSD with little or no modification. +`int EBADSLT' + `errno.h' (Linux???: Invalid slot): *Note Error Codes::. - All code incorporated from 4.4 BSD is under the following - copyright: +`int EBFONT' + `errno.h' (Linux???: Bad font file format): *Note Error Codes::. - Copyright (C) 1991 Regents of the University of California. - All rights reserved. +`int EBUSY' + `errno.h' (POSIX.1: Device or resource busy): *Note Error Codes::. - Redistribution and use in source and binary forms, with or - without modification, are permitted provided that the - following conditions are met: +`int ECHILD' + `errno.h' (POSIX.1: No child processes): *Note Error Codes::. - 1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. +`tcflag_t ECHOCTL' + `termios.h' (BSD): *Note Local Modes::. - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. +`tcflag_t ECHOE' + `termios.h' (POSIX.1): *Note Local Modes::. - 3. All advertising materials mentioning features or use of - this software must display the following acknowledgement: - This product includes software developed by the - University of California, Berkeley and its - contributors. +`tcflag_t ECHO' + `termios.h' (POSIX.1): *Note Local Modes::. - 4. Neither the name of the University nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. +`tcflag_t ECHOKE' + `termios.h' (BSD): *Note Local Modes::. - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - OF SUCH DAMAGE. +`tcflag_t ECHOK' + `termios.h' (POSIX.1): *Note Local Modes::. - * The random number generation functions `random', `srandom', - `setstate' and `initstate', which are also the basis for the - `rand' and `srand' functions, were written by Earl T. Cohen for - the University of California at Berkeley and are copyrighted by the - Regents of the University of California. They have undergone minor - changes to fit into the GNU C library and to fit the ISO C - standard, but the functional code is Berkeley's. +`tcflag_t ECHONL' + `termios.h' (POSIX.1): *Note Local Modes::. - * The Internet resolver code is taken directly from BIND 4.9.5, - which is under both the Berkeley copyright above and also: +`tcflag_t ECHOPRT' + `termios.h' (BSD): *Note Local Modes::. - Portions Copyright (C) 1993 by Digital Equipment Corporation. +`int ECHRNG' + `errno.h' (Linux???: Channel number out of range): *Note Error + Codes::. - Permission to use, copy, modify, and distribute this software - for any purpose with or without fee is hereby granted, - provided that the above copyright notice and this permission - notice appear in all copies, and that the name of Digital - Equipment Corporation not be used in advertising or publicity - pertaining to distribution of the document or software - without specific, written prior permission. +`int ECOMM' + `errno.h' (Linux???: Communication error on send): *Note Error + Codes::. - THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT CORPORATION BE - LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +`int ECONNABORTED' + `errno.h' (BSD: Software caused connection abort): *Note Error + Codes::. - * The code to support Sun RPC is taken verbatim from Sun's - RPCSRC-4.0 distribution, and is covered by this copyright: +`int ECONNREFUSED' + `errno.h' (BSD: Connection refused): *Note Error Codes::. - Copyright (C) 1984, Sun Microsystems, Inc. +`int ECONNRESET' + `errno.h' (BSD: Connection reset by peer): *Note Error Codes::. - Sun RPC is a product of Sun Microsystems, Inc. and is - provided for unrestricted use provided that this legend is - included on all tape media and as a part of the software - program in whole or part. Users may copy or modify Sun RPC - without charge, but are not authorized to license or - distribute it to anyone else except as part of a product or - program developed by the user. +`int EDEADLK' + `errno.h' (POSIX.1: Resource deadlock avoided): *Note Error + Codes::. - SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND - INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND - FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF - DEALING, USAGE OR TRADE PRACTICE. +`int EDEADLOCK' + `errno.h' (Linux???: File locking deadlock error): *Note Error + Codes::. - Sun RPC is provided with no support and without any - obligation on the part of Sun Microsystems, Inc. to assist in - its use, correction, modification or enhancement. +`int EDESTADDRREQ' + `errno.h' (BSD: Destination address required): *Note Error + Codes::. - SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT - TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY - PATENTS BY SUN RPC OR ANY PART THEREOF. +`int EDIED' + `errno.h' (GNU: Translator died): *Note Error Codes::. - In no event will Sun Microsystems, Inc. be liable for any - lost revenue or profits or other special, indirect and - consequential damages, even if Sun has been advised of the - possibility of such damages. +`int ED' + `errno.h' (GNU: ?): *Note Error Codes::. - Sun Microsystems, Inc. - 2550 Garcia Avenue - Mountain View, California 94043 +`int EDOM' + `errno.h' (ISO: Numerical argument out of domain): *Note Error + Codes::. - * Some of the support code for Mach is taken from Mach 3.0 by CMU, - and is under the following copyright terms: +`int EDOTDOT' + `errno.h' (Linux???: RFS specific error): *Note Error Codes::. - Mach Operating System - Copyright (C) 1991,1990,1989 Carnegie Mellon University - All Rights Reserved. +`int EDQUOT' + `errno.h' (BSD: Disc quota exceeded): *Note Error Codes::. - Permission to use, copy, modify and distribute this software - and its documentation is hereby granted, provided that both - the copyright notice and this permission notice appear in all - copies of the software, derivative works or modified - versions, and any portions thereof, and that both notices - appear in supporting documentation. +`int EEXIST' + `errno.h' (POSIX.1: File exists): *Note Error Codes::. - CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS - IS" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF - ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF - THIS SOFTWARE. +`int EFAULT' + `errno.h' (POSIX.1: Bad address): *Note Error Codes::. - Carnegie Mellon requests users of this software to return to +`int EFBIG' + `errno.h' (POSIX.1: File too large): *Note Error Codes::. - Software Distribution Coordinator - School of Computer Science - Carnegie Mellon University - Pittsburgh PA 15213-3890 +`int EFTYPE' + `errno.h' (BSD: Inappropriate file type or format): *Note Error + Codes::. - or `Software.Distribution@CS.CMU.EDU' any improvements or - extensions that they make and grant Carnegie Mellon the - rights to redistribute these changes. +`int EGRATUITOUS' + `errno.h' (GNU: Gratuitous error): *Note Error Codes::. + +`int EGREGIOUS' + `errno.h' (GNU: You really blew it this time): *Note Error + Codes::. + +`int EHOSTDOWN' + `errno.h' (BSD: Host is down): *Note Error Codes::. + +`int EHOSTUNREACH' + `errno.h' (BSD: No route to host): *Note Error Codes::. + +`int EIDRM' + `errno.h' (XOPEN: Identifier removed): *Note Error Codes::. + +`int EIEIO' + `errno.h' (GNU: Computer bought the farm): *Note Error Codes::. + +`int EILSEQ' + `errno.h' (ISO: Invalid or incomplete multibyte or wide + character): *Note Error Codes::. + +`int EINPROGRESS' + `errno.h' (BSD: Operation now in progress): *Note Error Codes::. + +`int EINTR' + `errno.h' (POSIX.1: Interrupted system call): *Note Error Codes::. + +`int EINVAL' + `errno.h' (POSIX.1: Invalid argument): *Note Error Codes::. + +`int EIO' + `errno.h' (POSIX.1: Input/output error): *Note Error Codes::. + +`int EISCONN' + `errno.h' (BSD: Transport endpoint is already connected): *Note + Error Codes::. + +`int EISDIR' + `errno.h' (POSIX.1: Is a directory): *Note Error Codes::. + +`int EISNAM' + `errno.h' (Linux???: Is a named type file): *Note Error Codes::. + +`int EL2HLT' + `errno.h' (Linux???: Level 2 halted): *Note Error Codes::. + +`int EL2NSYNC' + `errno.h' (Linux???: Level 2 not synchronized): *Note Error + Codes::. + +`int EL3HLT' + `errno.h' (Linux???: Level 3 halted): *Note Error Codes::. + +`int EL3RST' + `errno.h' (Linux???: Level 3 reset): *Note Error Codes::. + +`int ELIBACC' + `errno.h' (Linux???: Can not access a needed shared library): + *Note Error Codes::. + +`int ELIBBAD' + `errno.h' (Linux???: Accessing a corrupted shared library): *Note + Error Codes::. + +`int ELIBEXEC' + `errno.h' (Linux???: Cannot exec a shared library directly): + *Note Error Codes::. + +`int ELIBMAX' + `errno.h' (Linux???: Attempting to link in too many shared + libraries): *Note Error Codes::. + +`int ELIBSCN' + `errno.h' (Linux???: .lib section in a.out corrupted): *Note + Error Codes::. + +`int ELNRNG' + `errno.h' (Linux???: Link number out of range): *Note Error + Codes::. + +`int ELOOP' + `errno.h' (BSD: Too many levels of symbolic links): *Note Error + Codes::. + +`int EMFILE' + `errno.h' (POSIX.1: Too many open files): *Note Error Codes::. + +`int EMLINK' + `errno.h' (POSIX.1: Too many links): *Note Error Codes::. + +`int EMSGSIZE' + `errno.h' (BSD: Message too long): *Note Error Codes::. + +`int EMULTIHOP' + `errno.h' (XOPEN: Multihop attempted): *Note Error Codes::. + +`int ENAMETOOLONG' + `errno.h' (POSIX.1: File name too long): *Note Error Codes::. + +`int ENAVAIL' + `errno.h' (Linux???: No XENIX semaphores available): *Note Error + Codes::. + +`void endgrent (void)' + `grp.h' (SVID, BSD): *Note Scanning All Groups::. + +`void endhostent ()' + `netdb.h' (BSD): *Note Host Names::. + +`void endnetent (void)' + `netdb.h' (BSD): *Note Networks Database::. + +`void endnetgrent (void)' + `netdb.h' (netdb.h): *Note Lookup Netgroup::. + +`void endprotoent (void)' + `netdb.h' (BSD): *Note Protocols Database::. + +`void endpwent (void)' + `pwd.h' (SVID, BSD): *Note Scanning All Users::. + +`void endservent (void)' + `netdb.h' (BSD): *Note Services Database::. + +`int ENEEDAUTH' + `errno.h' (BSD: Need authenticator): *Note Error Codes::. + +`int ENETDOWN' + `errno.h' (BSD: Network is down): *Note Error Codes::. + +`int ENETRESET' + `errno.h' (BSD: Network dropped connection on reset): *Note Error + Codes::. + +`int ENETUNREACH' + `errno.h' (BSD: Network is unreachable): *Note Error Codes::. + +`int ENFILE' + `errno.h' (POSIX.1: Too many open files in system): *Note Error + Codes::. + +`int ENOANO' + `errno.h' (Linux???: No anode): *Note Error Codes::. + +`int ENOBUFS' + `errno.h' (BSD: No buffer space available): *Note Error Codes::. + +`int ENOCSI' + `errno.h' (Linux???: No CSI structure available): *Note Error + Codes::. + +`int ENODATA' + `errno.h' (XOPEN: No data available): *Note Error Codes::. + +`int ENODEV' + `errno.h' (POSIX.1: Operation not supported by device): *Note + Error Codes::. + +`int ENOENT' + `errno.h' (POSIX.1: No such file or directory): *Note Error + Codes::. + +`int ENOEXEC' + `errno.h' (POSIX.1: Exec format error): *Note Error Codes::. + +`int ENOLCK' + `errno.h' (POSIX.1: No locks available): *Note Error Codes::. + +`int ENOLINK' + `errno.h' (XOPEN: Link has been severed): *Note Error Codes::. + +`int ENOMEM' + `errno.h' (POSIX.1: Cannot allocate memory): *Note Error Codes::. + +`int ENOMSG' + `errno.h' (XOPEN: No message of desired type): *Note Error + Codes::. + +`int ENONET' + `errno.h' (Linux???: Machine is not on the network): *Note Error + Codes::. + +`int ENOPKG' + `errno.h' (Linux???: Package not installed): *Note Error Codes::. + +`int ENOPROTOOPT' + `errno.h' (BSD: Protocol not available): *Note Error Codes::. + +`int ENOSPC' + `errno.h' (POSIX.1: No space left on device): *Note Error Codes::. + +`int ENOSR' + `errno.h' (XOPEN: Out of streams resources): *Note Error Codes::. + +`int ENOSTR' + `errno.h' (XOPEN: Device not a stream): *Note Error Codes::. + +`int ENOSYS' + `errno.h' (POSIX.1: Function not implemented): *Note Error + Codes::. + +`int ENOTBLK' + `errno.h' (BSD: Block device required): *Note Error Codes::. + +`int ENOTCONN' + `errno.h' (BSD: Transport endpoint is not connected): *Note Error + Codes::. + +`int ENOTDIR' + `errno.h' (POSIX.1: Not a directory): *Note Error Codes::. + +`int ENOTEMPTY' + `errno.h' (POSIX.1: Directory not empty): *Note Error Codes::. + +`int ENOTNAM' + `errno.h' (Linux???: Not a XENIX named type file): *Note Error + Codes::. + +`int ENOTSOCK' + `errno.h' (BSD: Socket operation on non-socket): *Note Error + Codes::. + +`int ENOTTY' + `errno.h' (POSIX.1: Inappropriate ioctl for device): *Note Error + Codes::. + +`int ENOTUNIQ' + `errno.h' (Linux???: Name not unique on network): *Note Error + Codes::. + +`char ** environ' + `unistd.h' (POSIX.1): *Note Environment Access::. + +`int ENXIO' + `errno.h' (POSIX.1: Device not configured): *Note Error Codes::. + +`int EOF' + `stdio.h' (ISO): *Note EOF and Errors::. + +`int EOPNOTSUPP' + `errno.h' (BSD: Operation not supported): *Note Error Codes::. + +`int EOVERFLOW' + `errno.h' (XOPEN: Value too large for defined data type): *Note + Error Codes::. + +`int EPERM' + `errno.h' (POSIX.1: Operation not permitted): *Note Error Codes::. + +`int EPFNOSUPPORT' + `errno.h' (BSD: Protocol family not supported): *Note Error + Codes::. + +`int EPIPE' + `errno.h' (POSIX.1: Broken pipe): *Note Error Codes::. + +`int EPROCLIM' + `errno.h' (BSD: Too many processes): *Note Error Codes::. + +`int EPROCUNAVAIL' + `errno.h' (BSD: RPC bad procedure for program): *Note Error + Codes::. + +`int EPROGMISMATCH' + `errno.h' (BSD: RPC program version wrong): *Note Error Codes::. + +`int EPROGUNAVAIL' + `errno.h' (BSD: RPC program not available): *Note Error Codes::. + +`int EPROTO' + `errno.h' (XOPEN: Protocol error): *Note Error Codes::. + +`int EPROTONOSUPPORT' + `errno.h' (BSD: Protocol not supported): *Note Error Codes::. + +`int EPROTOTYPE' + `errno.h' (BSD: Protocol wrong type for socket): *Note Error + Codes::. + +`int EQUIV_CLASS_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. + +`int ERANGE' + `errno.h' (ISO: Numerical result out of range): *Note Error + Codes::. + +`int EREMCHG' + `errno.h' (Linux???: Remote address changed): *Note Error Codes::. + +`int EREMOTEIO' + `errno.h' (Linux???: Remote I/O error): *Note Error Codes::. + +`int EREMOTE' + `errno.h' (BSD: Object is remote): *Note Error Codes::. + +`int ERESTART' + `errno.h' (Linux???: Interrupted system call should be restarted): + *Note Error Codes::. + +`int EROFS' + `errno.h' (POSIX.1: Read-only file system): *Note Error Codes::. + +`int ERPCMISMATCH' + `errno.h' (BSD: RPC version wrong): *Note Error Codes::. + +`volatile int errno' + `errno.h' (ISO): *Note Checking for Errors::. + +`int ESHUTDOWN' + `errno.h' (BSD: Cannot send after transport endpoint shutdown): + *Note Error Codes::. + +`int ESOCKTNOSUPPORT' + `errno.h' (BSD: Socket type not supported): *Note Error Codes::. + +`int ESPIPE' + `errno.h' (POSIX.1: Illegal seek): *Note Error Codes::. + +`int ESRCH' + `errno.h' (POSIX.1: No such process): *Note Error Codes::. + +`int ESRMNT' + `errno.h' (Linux???: Srmount error): *Note Error Codes::. + +`int ESTALE' + `errno.h' (BSD: Stale NFS file handle): *Note Error Codes::. + +`int ESTRPIPE' + `errno.h' (Linux???: Streams pipe error): *Note Error Codes::. + +`int ETIMEDOUT' + `errno.h' (BSD: Connection timed out): *Note Error Codes::. + +`int ETIME' + `errno.h' (XOPEN: Timer expired): *Note Error Codes::. + +`int ETOOMANYREFS' + `errno.h' (BSD: Too many references: cannot splice): *Note Error + Codes::. + +`int ETXTBSY' + `errno.h' (BSD: Text file busy): *Note Error Codes::. + +`int EUCLEAN' + `errno.h' (Linux???: Structure needs cleaning): *Note Error + Codes::. + +`int EUNATCH' + `errno.h' (Linux???: Protocol driver not attached): *Note Error + Codes::. + +`int EUSERS' + `errno.h' (BSD: Too many users): *Note Error Codes::. + +`int EWOULDBLOCK' + `errno.h' (BSD: Operation would block): *Note Error Codes::. + +`int EXDEV' + `errno.h' (POSIX.1: Invalid cross-device link): *Note Error + Codes::. + +`int execle (const char *FILENAME, const char *ARG0, char *const ENV[], ...)' + `unistd.h' (POSIX.1): *Note Executing a File::. + +`int execl (const char *FILENAME, const char *ARG0, ...)' + `unistd.h' (POSIX.1): *Note Executing a File::. + +`int execlp (const char *FILENAME, const char *ARG0, ...)' + `unistd.h' (POSIX.1): *Note Executing a File::. + +`int execve (const char *FILENAME, char *const ARGV[], char *const ENV[])' + `unistd.h' (POSIX.1): *Note Executing a File::. + +`int execv (const char *FILENAME, char *const ARGV[])' + `unistd.h' (POSIX.1): *Note Executing a File::. + +`int execvp (const char *FILENAME, char *const ARGV[])' + `unistd.h' (POSIX.1): *Note Executing a File::. + +`int EXFULL' + `errno.h' (Linux???: Exchange full): *Note Error Codes::. + +`int EXIT_FAILURE' + `stdlib.h' (ISO): *Note Exit Status::. + +`void _exit (int STATUS)' + `unistd.h' (POSIX.1): *Note Termination Internals::. + +`void exit (int STATUS)' + `stdlib.h' (ISO): *Note Normal Termination::. + +`int EXIT_SUCCESS' + `stdlib.h' (ISO): *Note Exit Status::. + +`double exp (double X)' + `math.h' (ISO): *Note Exponents and Logarithms::. + +`double expm1 (double X)' + `math.h' (BSD): *Note Exponents and Logarithms::. + +`int EXPR_NEST_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. + +`double fabs (double NUMBER)' + `math.h' (ISO): *Note Absolute Value::. + +`int fchmod (int FILEDES, int MODE)' + `sys/stat.h' (BSD): *Note Setting Permissions::. + +`int fchown (int FILEDES, int OWNER, int GROUP)' + `unistd.h' (BSD): *Note File Owner::. + +`int fclean (FILE *STREAM)' + `stdio.h' (GNU): *Note Cleaning Streams::. + +`int fcloseall (void)' + `stdio.h' (GNU): *Note Closing Streams::. + +`int fclose (FILE *STREAM)' + `stdio.h' (ISO): *Note Closing Streams::. + +`int fcntl (int FILEDES, int COMMAND, ...)' + `fcntl.h' (POSIX.1): *Note Control Operations::. + +`int FD_CLOEXEC' + `fcntl.h' (POSIX.1): *Note Descriptor Flags::. + +`void FD_CLR (int FILEDES, fd_set *SET)' + `sys/types.h' (BSD): *Note Waiting for I/O::. + +`int FD_ISSET (int FILEDES, fd_set *SET)' + `sys/types.h' (BSD): *Note Waiting for I/O::. + +`FILE * fdopen (int FILEDES, const char *OPENTYPE)' + `stdio.h' (POSIX.1): *Note Descriptors and Streams::. + +`void FD_SET (int FILEDES, fd_set *SET)' + `sys/types.h' (BSD): *Note Waiting for I/O::. + +`fd_set' + `sys/types.h' (BSD): *Note Waiting for I/O::. + +`int FD_SETSIZE' + `sys/types.h' (BSD): *Note Waiting for I/O::. + +`int F_DUPFD' + `fcntl.h' (POSIX.1): *Note Duplicating Descriptors::. + +`void FD_ZERO (fd_set *SET)' + `sys/types.h' (BSD): *Note Waiting for I/O::. + +`int feof (FILE *STREAM)' + `stdio.h' (ISO): *Note EOF and Errors::. + +`int ferror (FILE *STREAM)' + `stdio.h' (ISO): *Note EOF and Errors::. + +`int fflush (FILE *STREAM)' + `stdio.h' (ISO): *Note Flushing Buffers::. + +`int fgetc (FILE *STREAM)' + `stdio.h' (ISO): *Note Character Input::. + +`int F_GETFD' + `fcntl.h' (POSIX.1): *Note Descriptor Flags::. + +`int F_GETFL' + `fcntl.h' (POSIX.1): *Note Getting File Status Flags::. + +`struct group * fgetgrent (FILE *STREAM)' + `grp.h' (SVID): *Note Scanning All Groups::. + +`int fgetgrent_r (FILE *STREAM, struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' + `grp.h' (GNU): *Note Scanning All Groups::. + +`int F_GETLK' + `fcntl.h' (POSIX.1): *Note File Locks::. + +`int F_GETOWN' + `fcntl.h' (BSD): *Note Interrupt Input::. + +`int fgetpos (FILE *STREAM, fpos_t *POSITION)' + `stdio.h' (ISO): *Note Portable Positioning::. + +`struct passwd * fgetpwent (FILE *STREAM)' + `pwd.h' (SVID): *Note Scanning All Users::. + +`int fgetpwent_r (FILE *STREAM, struct passwd *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd **RESULT)' + `pwd.h' (GNU): *Note Scanning All Users::. + +`char * fgets (char *S, int COUNT, FILE *STREAM)' + `stdio.h' (ISO): *Note Line Input::. + +`FILE' + `stdio.h' (ISO): *Note Streams::. + +`int FILENAME_MAX' + `stdio.h' (ISO): *Note Limits for Files::. + +`int fileno (FILE *STREAM)' + `stdio.h' (POSIX.1): *Note Descriptors and Streams::. + +`int finite (double X)' + `math.h' (BSD): *Note Predicates on Floats::. + +`double floor (double X)' + `math.h' (ISO): *Note Rounding and Remainders::. + +`FLT_DIG' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_EPSILON' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_MANT_DIG' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_MAX_10_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_MAX_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_MAX' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_MIN_10_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_MIN_EXP' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_MIN' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_RADIX' + `float.h' (ISO): *Note Floating Point Parameters::. + +`FLT_ROUNDS' + `float.h' (ISO): *Note Floating Point Parameters::. + +`tcflag_t FLUSHO' + `termios.h' (BSD): *Note Local Modes::. + +`FILE * fmemopen (void *BUF, size_t SIZE, const char *OPENTYPE)' + `stdio.h' (GNU): *Note String Streams::. + +`double fmod (double NUMERATOR, double DENOMINATOR)' + `math.h' (ISO): *Note Rounding and Remainders::. + +`int fnmatch (const char *PATTERN, const char *STRING, int FLAGS)' + `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. + +`FNM_CASEFOLD' + `fnmatch.h' (GNU): *Note Wildcard Matching::. + +`FNM_FILE_NAME' + `fnmatch.h' (GNU): *Note Wildcard Matching::. + +`FNM_LEADING_DIR' + `fnmatch.h' (GNU): *Note Wildcard Matching::. + +`FNM_NOESCAPE' + `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. + +`FNM_PATHNAME' + `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. + +`FNM_PERIOD' + `fnmatch.h' (POSIX.2): *Note Wildcard Matching::. + +`int F_OK' + `unistd.h' (POSIX.1): *Note Testing File Access::. + +`FILE * fopencookie (void *COOKIE, const char *OPENTYPE, cookie_io_functions_t IO-FUNCTIONS)' + `stdio.h' (GNU): *Note Streams and Cookies::. + +`FILE * fopen (const char *FILENAME, const char *OPENTYPE)' + `stdio.h' (ISO): *Note Opening Streams::. + +`int FOPEN_MAX' + `stdio.h' (ISO): *Note Opening Streams::. + +`pid_t fork (void)' + `unistd.h' (POSIX.1): *Note Creating a Process::. + +`long int fpathconf (int FILEDES, int PARAMETER)' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`FPE_DECOVF_TRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_FLTDIV_FAULT' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_FLTDIV_TRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_FLTOVF_FAULT' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_FLTOVF_TRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_FLTUND_FAULT' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_FLTUND_TRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_INTDIV_TRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_INTOVF_TRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`FPE_SUBRNG_TRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`fpos_t' + `stdio.h' (ISO): *Note Portable Positioning::. + +`int fprintf (FILE *STREAM, const char *TEMPLATE, ...)' + `stdio.h' (ISO): *Note Formatted Output Functions::. + +`int fputc (int C, FILE *STREAM)' + `stdio.h' (ISO): *Note Simple Output::. + +`int fputs (const char *S, FILE *STREAM)' + `stdio.h' (ISO): *Note Simple Output::. + +`F_RDLCK' + `fcntl.h' (POSIX.1): *Note File Locks::. + +`size_t fread (void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM)' + `stdio.h' (ISO): *Note Block Input/Output::. + +`__free_hook' + `malloc.h' (GNU): *Note Hooks for Malloc::. + +`void free (void *PTR)' + `malloc.h', `stdlib.h' (ISO): *Note Freeing after Malloc::. + +`FILE * freopen (const char *FILENAME, const char *OPENTYPE, FILE *STREAM)' + `stdio.h' (ISO): *Note Opening Streams::. + +`double frexp (double VALUE, int *EXPONENT)' + `math.h' (ISO): *Note Normalization Functions::. + +`int fscanf (FILE *STREAM, const char *TEMPLATE, ...)' + `stdio.h' (ISO): *Note Formatted Input Functions::. + +`int fseek (FILE *STREAM, long int OFFSET, int WHENCE)' + `stdio.h' (ISO): *Note File Positioning::. + +`int F_SETFD' + `fcntl.h' (POSIX.1): *Note Descriptor Flags::. + +`int F_SETFL' + `fcntl.h' (POSIX.1): *Note Getting File Status Flags::. + +`int F_SETLK' + `fcntl.h' (POSIX.1): *Note File Locks::. + +`int F_SETLKW' + `fcntl.h' (POSIX.1): *Note File Locks::. + +`int F_SETOWN' + `fcntl.h' (BSD): *Note Interrupt Input::. + +`int fsetpos (FILE *STREAM, const fpos_t POSITION)' + `stdio.h' (ISO): *Note Portable Positioning::. + +`int fstat (int FILEDES, struct stat *BUF)' + `sys/stat.h' (POSIX.1): *Note Reading Attributes::. + +`long int ftell (FILE *STREAM)' + `stdio.h' (ISO): *Note File Positioning::. + +`F_UNLCK' + `fcntl.h' (POSIX.1): *Note File Locks::. + +`size_t fwrite (const void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM)' + `stdio.h' (ISO): *Note Block Input/Output::. + +`F_WRLCK' + `fcntl.h' (POSIX.1): *Note File Locks::. + +`int getchar (void)' + `stdio.h' (ISO): *Note Character Input::. + +`int getc (FILE *STREAM)' + `stdio.h' (ISO): *Note Character Input::. + +`char * getcwd (char *BUFFER, size_t SIZE)' + `unistd.h' (POSIX.1): *Note Working Directory::. + +`ssize_t getdelim (char **LINEPTR, size_t *N, int DELIMITER, FILE *STREAM)' + `stdio.h' (GNU): *Note Line Input::. + +`gid_t getegid (void)' + `unistd.h' (POSIX.1): *Note Reading Persona::. + +`char * getenv (const char *NAME)' + `stdlib.h' (ISO): *Note Environment Access::. + +`uid_t geteuid (void)' + `unistd.h' (POSIX.1): *Note Reading Persona::. + +`gid_t getgid (void)' + `unistd.h' (POSIX.1): *Note Reading Persona::. + +`struct group * getgrent (void)' + `grp.h' (SVID, BSD): *Note Scanning All Groups::. + +`int getgrent_r (struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' + `grp.h' (GNU): *Note Scanning All Groups::. + +`struct group * getgrgid (gid_t GID)' + `grp.h' (POSIX.1): *Note Lookup Group::. + +`int getgrgid_r (gid_t GID, struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' + `grp.h' (POSIX.1c): *Note Lookup Group::. + +`struct group * getgrnam (const char *NAME)' + `grp.h' (SVID, BSD): *Note Lookup Group::. + +`int getgrnam_r (const char *NAME, struct group *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct group **RESULT)' + `grp.h' (POSIX.1c): *Note Lookup Group::. + +`int getgroups (int COUNT, gid_t *GROUPS)' + `unistd.h' (POSIX.1): *Note Reading Persona::. + +`struct hostent * gethostbyaddr (const char *ADDR, int LENGTH, int FORMAT)' + `netdb.h' (BSD): *Note Host Names::. + +`struct hostent * gethostbyname2 (const char *NAME, int AF)' + `netdb.h' (IPv6 Basic API): *Note Host Names::. + +`struct hostent * gethostbyname (const char *NAME)' + `netdb.h' (BSD): *Note Host Names::. + +`struct hostent * gethostent ()' + `netdb.h' (BSD): *Note Host Names::. + +`long int gethostid (void)' + `unistd.h' (BSD): *Note Host Identification::. + +`int gethostname (char *NAME, size_t SIZE)' + `unistd.h' (BSD): *Note Host Identification::. + +`int getitimer (int WHICH, struct itimerval *OLD)' + `sys/time.h' (BSD): *Note Setting an Alarm::. + +`ssize_t getline (char **LINEPTR, size_t *N, FILE *STREAM)' + `stdio.h' (GNU): *Note Line Input::. + +`char * getlogin (void)' + `unistd.h' (POSIX.1): *Note Who Logged In::. + +`struct netent * getnetbyaddr (long NET, int TYPE)' + `netdb.h' (BSD): *Note Networks Database::. + +`struct netent * getnetbyname (const char *NAME)' + `netdb.h' (BSD): *Note Networks Database::. + +`struct netent * getnetent (void)' + `netdb.h' (BSD): *Note Networks Database::. + +`int getnetgrent (char **HOSTP, char **USERP, char **DOMAINP)' + `netdb.h' (netdb.h): *Note Lookup Netgroup::. + +`int getnetgrent_r (char **HOSTP, char **USERP, char **DOMAINP, char *BUFFER, int BUFLEN)' + `netdb.h' (netdb.h): *Note Lookup Netgroup::. + +`int getopt (int ARGC, char **ARGV, const char *OPTIONS)' + `unistd.h' (POSIX.2): *Note Parsing Options::. + +`int getopt_long (int ARGC, char **ARGV, const char *SHORTOPTS, struct option *LONGOPTS, int *INDEXPTR)' + `getopt.h' (GNU): *Note Long Options::. + +`int getpeername (int SOCKET, struct sockaddr *ADDR, size_t *LENGTH-PTR)' + `sys/socket.h' (BSD): *Note Who is Connected::. + +`pid_t getpgrp (pid_t PID)' + `unistd.h' (BSD): *Note Process Group Functions::. + +`pid_t getpgrp (void)' + `unistd.h' (POSIX.1): *Note Process Group Functions::. + +`pid_t getpid (void)' + `unistd.h' (POSIX.1): *Note Process Identification::. + +`pid_t getppid (void)' + `unistd.h' (POSIX.1): *Note Process Identification::. + +`int getpriority (int CLASS, int ID)' + `sys/resource.h' (BSD): *Note Priority::. + +`struct protoent * getprotobyname (const char *NAME)' + `netdb.h' (BSD): *Note Protocols Database::. + +`struct protoent * getprotobynumber (int PROTOCOL)' + `netdb.h' (BSD): *Note Protocols Database::. + +`struct protoent * getprotoent (void)' + `netdb.h' (BSD): *Note Protocols Database::. + +`struct passwd * getpwent (void)' + `pwd.h' (POSIX.1): *Note Scanning All Users::. + +`int getpwent_r (struct passwd *RESULT_BUF, char *BUFFER, int BUFLEN, struct passwd **RESULT)' + `pwd.h' (GNU): *Note Scanning All Users::. + +`struct passwd * getpwnam (const char *NAME)' + `pwd.h' (POSIX.1): *Note Lookup User::. + +`int getpwnam_r (const char *NAME, struct passwd *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd **RESULT)' + `pwd.h' (POSIX.1c): *Note Lookup User::. + +`struct passwd * getpwuid (uid_t UID)' + `pwd.h' (POSIX.1): *Note Lookup User::. + +`int getpwuid_r (uid_t UID, struct passwd *RESULT_BUF, char *BUFFER, size_t BUFLEN, struct passwd **RESULT)' + `pwd.h' (POSIX.1c): *Note Lookup User::. + +`int getrlimit (int RESOURCE, struct rlimit *RLP)' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`int getrusage (int PROCESSES, struct rusage *RUSAGE)' + `sys/resource.h' (BSD): *Note Resource Usage::. + +`struct servent * getservbyname (const char *NAME, const char *PROTO)' + `netdb.h' (BSD): *Note Services Database::. + +`struct servent * getservbyport (int PORT, const char *PROTO)' + `netdb.h' (BSD): *Note Services Database::. + +`struct servent * getservent (void)' + `netdb.h' (BSD): *Note Services Database::. + +`char * gets (char *S)' + `stdio.h' (ISO): *Note Line Input::. + +`int getsockname (int SOCKET, struct sockaddr *ADDR, socklen_t *LENGTH-PTR)' + `sys/socket.h' (BSD): *Note Reading Address::. + +`int getsockopt (int SOCKET, int LEVEL, int OPTNAME, void *OPTVAL, socklen_t *OPTLEN-PTR)' + `sys/socket.h' (BSD): *Note Socket Option Functions::. + +`int getsubopt (char **OPTIONP, const char* const *TOKENS, char **VALUEP)' + `stdlib.h' (stdlib.h): *Note Suboptions::. + +`int gettimeofday (struct timeval *TP, struct timezone *TZP)' + `sys/time.h' (BSD): *Note High-Resolution Calendar::. + +`uid_t getuid (void)' + `unistd.h' (POSIX.1): *Note Reading Persona::. + +`mode_t getumask (void)' + `sys/stat.h' (GNU): *Note Setting Permissions::. + +`char * getwd (char *BUFFER)' + `unistd.h' (BSD): *Note Working Directory::. + +`int getw (FILE *STREAM)' + `stdio.h' (SVID): *Note Character Input::. + +`gid_t' + `sys/types.h' (POSIX.1): *Note Reading Persona::. + +`GLOB_ABORTED' + `glob.h' (POSIX.2): *Note Calling Glob::. + +`GLOB_APPEND' + `glob.h' (POSIX.2): *Note Flags for Globbing::. + +`GLOB_DOOFFS' + `glob.h' (POSIX.2): *Note Flags for Globbing::. + +`GLOB_ERR' + `glob.h' (POSIX.2): *Note Flags for Globbing::. + +`int glob (const char *PATTERN, int FLAGS, int (*ERRFUNC) (const char *FILENAME, int ERROR-CODE), glob_t *VECTOR-PTR)' + `glob.h' (POSIX.2): *Note Calling Glob::. + +`GLOB_MARK' + `glob.h' (POSIX.2): *Note Flags for Globbing::. + +`GLOB_NOCHECK' + `glob.h' (POSIX.2): *Note Flags for Globbing::. + +`GLOB_NOESCAPE' + `glob.h' (POSIX.2): *Note Flags for Globbing::. + +`GLOB_NOMATCH' + `glob.h' (POSIX.2): *Note Calling Glob::. + +`GLOB_NOSORT' + `glob.h' (POSIX.2): *Note Flags for Globbing::. + +`GLOB_NOSPACE' + `glob.h' (POSIX.2): *Note Calling Glob::. + +`glob_t' + `glob.h' (POSIX.2): *Note Calling Glob::. + +`struct tm * gmtime (const time_t *TIME)' + `time.h' (ISO): *Note Broken-down Time::. + +`_GNU_SOURCE' + (GNU): *Note Feature Test Macros::. + +`int gsignal (int SIGNUM)' + `signal.h' (SVID): *Note Signaling Yourself::. + +`HOST_NOT_FOUND' + `netdb.h' (BSD): *Note Host Names::. + +`unsigned long int htonl (unsigned long int HOSTLONG)' + `netinet/in.h' (BSD): *Note Byte Order::. + +`unsigned short int htons (unsigned short int HOSTSHORT)' + `netinet/in.h' (BSD): *Note Byte Order::. + +`float HUGE_VALf' + `math.h' (GNU): *Note Domain and Range Errors::. + +`double HUGE_VAL' + `math.h' (ISO): *Note Domain and Range Errors::. + +`long double HUGE_VALl' + `math.h' (GNU): *Note Domain and Range Errors::. + +`tcflag_t HUPCL' + `termios.h' (POSIX.1): *Note Control Modes::. + +`double hypot (double X, double Y)' + `math.h' (BSD): *Note Exponents and Logarithms::. + +`tcflag_t ICANON' + `termios.h' (POSIX.1): *Note Local Modes::. + +`tcflag_t ICRNL' + `termios.h' (POSIX.1): *Note Input Modes::. + +`tcflag_t IEXTEN' + `termios.h' (POSIX.1): *Note Local Modes::. + +`tcflag_t IGNBRK' + `termios.h' (POSIX.1): *Note Input Modes::. + +`tcflag_t IGNCR' + `termios.h' (POSIX.1): *Note Input Modes::. + +`tcflag_t IGNPAR' + `termios.h' (POSIX.1): *Note Input Modes::. + +`tcflag_t IMAXBEL' + `termios.h' (BSD): *Note Input Modes::. + +`struct in6_addr in6addr_any' + `netinet/in.h' (IPv6 basic API): *Note Host Address Data Type::. + +`struct in6_addr in6addr_loopback.' + `netinet/in.h' (IPv6 basic API): *Note Host Address Data Type::. + +`unsigned int INADDR_ANY' + `netinet/in.h' (BSD): *Note Host Address Data Type::. + +`unsigned int INADDR_BROADCAST' + `netinet/in.h' (BSD): *Note Host Address Data Type::. + +`unsigned int INADDR_LOOPBACK' + `netinet/in.h' (BSD): *Note Host Address Data Type::. + +`unsigned int INADDR_NONE' + `netinet/in.h' (BSD): *Note Host Address Data Type::. + +`char * index (const char *STRING, int C)' + `string.h' (BSD): *Note Search Functions::. + +`unsigned long int inet_addr (const char *NAME)' + `arpa/inet.h' (BSD): *Note Host Address Functions::. + +`int inet_aton (const char *NAME, struct in_addr *ADDR)' + `arpa/inet.h' (BSD): *Note Host Address Functions::. + +`int inet_lnaof (struct in_addr ADDR)' + `arpa/inet.h' (BSD): *Note Host Address Functions::. + +`struct in_addr inet_makeaddr (int NET, int LOCAL)' + `arpa/inet.h' (BSD): *Note Host Address Functions::. + +`int inet_netof (struct in_addr ADDR)' + `arpa/inet.h' (BSD): *Note Host Address Functions::. + +`unsigned long int inet_network (const char *NAME)' + `arpa/inet.h' (BSD): *Note Host Address Functions::. + +`char * inet_ntoa (struct in_addr ADDR)' + `arpa/inet.h' (BSD): *Note Host Address Functions::. + +`char * inet_ntop (int AF, const void *CP, char *BUF, size_t LEN)' + `arpa/inet.h' (IPv6 basic API): *Note Host Address Functions::. + +`int inet_pton (int AF, const char *CP, void *BUF)' + `arpa/inet.h' (IPv6 basic API): *Note Host Address Functions::. + +`double infnan (int ERROR)' + `math.h' (BSD): *Note Predicates on Floats::. + +`int initgroups (const char *USER, gid_t GID)' + `grp.h' (BSD): *Note Setting Groups::. + +`void * initstate (unsigned int SEED, void *STATE, size_t SIZE)' + `stdlib.h' (BSD): *Note BSD Random::. + +`tcflag_t INLCR' + `termios.h' (POSIX.1): *Note Input Modes::. + +`int innetgr (const char *NETGROUP, const char *HOST, const char *USER, const char *DOMAIN)' + `netdb.h' (netdb.h): *Note Netgroup Membership::. + +`ino_t' + `sys/types.h' (POSIX.1): *Note Attribute Meanings::. + +`tcflag_t INPCK' + `termios.h' (POSIX.1): *Note Input Modes::. + +`int RLIM_INFINITY' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`INT_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`INT_MIN' + `limits.h' (ISO): *Note Range of Type::. + +`int _IOFBF' + `stdio.h' (ISO): *Note Controlling Buffering::. + +`int _IOLBF' + `stdio.h' (ISO): *Note Controlling Buffering::. + +`int _IONBF' + `stdio.h' (ISO): *Note Controlling Buffering::. + +`int IPPORT_RESERVED' + `netinet/in.h' (BSD): *Note Ports::. + +`int IPPORT_USERRESERVED' + `netinet/in.h' (BSD): *Note Ports::. + +`int isalnum (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int isalpha (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int isascii (int C)' + `ctype.h' (SVID, BSD): *Note Classification of Characters::. + +`int isatty (int FILEDES)' + `unistd.h' (POSIX.1): *Note Is It a Terminal::. + +`int isblank (int C)' + `ctype.h' (GNU): *Note Classification of Characters::. + +`int iscntrl (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int isdigit (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int isgraph (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`tcflag_t ISIG' + `termios.h' (POSIX.1): *Note Local Modes::. + +`int isinf (double X)' + `math.h' (BSD): *Note Predicates on Floats::. + +`int islower (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int isnan (double X)' + `math.h' (BSD): *Note Predicates on Floats::. + +`int isprint (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int ispunct (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int isspace (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`tcflag_t ISTRIP' + `termios.h' (POSIX.1): *Note Input Modes::. + +`int isupper (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`int isxdigit (int C)' + `ctype.h' (ISO): *Note Classification of Characters::. + +`ITIMER_PROF' + `sys/time.h' (BSD): *Note Setting an Alarm::. + +`ITIMER_REAL' + `sys/time.h' (BSD): *Note Setting an Alarm::. + +`ITIMER_VIRTUAL' + `sys/time.h' (BSD): *Note Setting an Alarm::. + +`tcflag_t IXANY' + `termios.h' (BSD): *Note Input Modes::. + +`tcflag_t IXOFF' + `termios.h' (POSIX.1): *Note Input Modes::. + +`tcflag_t IXON' + `termios.h' (POSIX.1): *Note Input Modes::. + +`jmp_buf' + `setjmp.h' (ISO): *Note Non-Local Details::. + +`int kill (pid_t PID, int SIGNUM)' + `signal.h' (POSIX.1): *Note Signaling Another Process::. + +`int killpg (int PGID, int SIGNUM)' + `signal.h' (BSD): *Note Signaling Another Process::. + +`long int labs (long int NUMBER)' + `stdlib.h' (ISO): *Note Absolute Value::. + +`LANG' + `locale.h' (ISO): *Note Locale Categories::. + +`LC_ALL' + `locale.h' (ISO): *Note Locale Categories::. + +`LC_COLLATE' + `locale.h' (ISO): *Note Locale Categories::. + +`LC_CTYPE' + `locale.h' (ISO): *Note Locale Categories::. + +`LC_MESSAGES' + `locale.h' (XOPEN): *Note Locale Categories::. + +`LC_MONETARY' + `locale.h' (ISO): *Note Locale Categories::. + +`LC_NUMERIC' + `locale.h' (ISO): *Note Locale Categories::. + +`int L_ctermid' + `stdio.h' (POSIX.1): *Note Identifying the Terminal::. + +`LC_TIME' + `locale.h' (ISO): *Note Locale Categories::. + +`int L_cuserid' + `stdio.h' (POSIX.1): *Note Who Logged In::. + +`double ldexp (double VALUE, int EXPONENT)' + `math.h' (ISO): *Note Normalization Functions::. + +`ldiv_t ldiv (long int NUMERATOR, long int DENOMINATOR)' + `stdlib.h' (ISO): *Note Integer Division::. + +`ldiv_t' + `stdlib.h' (ISO): *Note Integer Division::. + +`L_INCR' + `sys/file.h' (BSD): *Note File Positioning::. + +`int LINE_MAX' + `limits.h' (POSIX.2): *Note Utility Limits::. + +`int link (const char *OLDNAME, const char *NEWNAME)' + `unistd.h' (POSIX.1): *Note Hard Links::. + +`int LINK_MAX' + `limits.h' (POSIX.1): *Note Limits for Files::. + +`int listen (int SOCKET, unsigned int N)' + `sys/socket.h' (BSD): *Note Listening::. + +`struct lconv * localeconv (void)' + `locale.h' (ISO): *Note Numeric Formatting::. + +`struct tm * localtime (const time_t *TIME)' + `time.h' (ISO): *Note Broken-down Time::. + +`double log10 (double X)' + `math.h' (ISO): *Note Exponents and Logarithms::. + +`double log1p (double X)' + `math.h' (BSD): *Note Exponents and Logarithms::. + +`double logb (double X)' + `math.h' (BSD): *Note Normalization Functions::. + +`double log (double X)' + `math.h' (ISO): *Note Exponents and Logarithms::. + +`void longjmp (jmp_buf STATE, int VALUE)' + `setjmp.h' (ISO): *Note Non-Local Details::. + +`LONG_LONG_MAX' + `limits.h' (GNU): *Note Range of Type::. + +`LONG_LONG_MIN' + `limits.h' (GNU): *Note Range of Type::. + +`LONG_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`LONG_MIN' + `limits.h' (ISO): *Note Range of Type::. + +`off_t lseek (int FILEDES, off_t OFFSET, int WHENCE)' + `unistd.h' (POSIX.1): *Note File Position Primitive::. + +`L_SET' + `sys/file.h' (BSD): *Note File Positioning::. + +`int lstat (const char *FILENAME, struct stat *BUF)' + `sys/stat.h' (BSD): *Note Reading Attributes::. + +`int L_tmpnam' + `stdio.h' (ISO): *Note Temporary Files::. + +`L_XTND' + `sys/file.h' (BSD): *Note File Positioning::. + +`struct mallinfo mallinfo (void)' + `malloc.h' (SVID): *Note Statistics of Malloc::. + +`__malloc_hook' + `malloc.h' (GNU): *Note Hooks for Malloc::. + +`void * malloc (size_t SIZE)' + `malloc.h', `stdlib.h' (ISO): *Note Basic Allocation::. + +`int MAX_CANON' + `limits.h' (POSIX.1): *Note Limits for Files::. + +`int MAX_INPUT' + `limits.h' (POSIX.1): *Note Limits for Files::. + +`int MAXNAMLEN' + `dirent.h' (BSD): *Note Limits for Files::. + +`int MB_CUR_MAX' + `stdlib.h' (ISO): *Note Multibyte Char Intro::. + +`int mblen (const char *STRING, size_t SIZE)' + `stdlib.h' (ISO): *Note Length of Char::. + +`int MB_LEN_MAX' + `limits.h' (ISO): *Note Multibyte Char Intro::. + +`size_t mbstowcs (wchar_t *WSTRING, const char *STRING, size_t SIZE)' + `stdlib.h' (ISO): *Note Wide String Conversion::. + +`int mbtowc (wchar_t *RESULT, const char *STRING, size_t SIZE)' + `stdlib.h' (ISO): *Note Converting One Char::. + +`int mcheck (void (*ABORTFN) (enum mcheck_status STATUS))' + `malloc.h' (GNU): *Note Heap Consistency Checking::. + +`tcflag_t MDMBUF' + `termios.h' (BSD): *Note Control Modes::. + +`void * memalign (size_t BOUNDARY, size_t SIZE)' + `malloc.h', `stdlib.h' (BSD): *Note Aligned Memory Blocks::. + +`void * memccpy (void *TO, const void *FROM, int C, size_t SIZE)' + `string.h' (SVID): *Note Copying and Concatenation::. + +`void * memchr (const void *BLOCK, int C, size_t SIZE)' + `string.h' (ISO): *Note Search Functions::. + +`int memcmp (const void *A1, const void *A2, size_t SIZE)' + `string.h' (ISO): *Note String/Array Comparison::. + +`void * memcpy (void *TO, const void *FROM, size_t SIZE)' + `string.h' (ISO): *Note Copying and Concatenation::. + +`void * memmem (const void *HAYSTACK, size_t HAYSTACK-LEN, + const void *NEEDLE, size_t NEEDLE-LEN)' + `string.h' (GNU): *Note Search Functions::. + +`void * memmove (void *TO, const void *FROM, size_t SIZE)' + `string.h' (ISO): *Note Copying and Concatenation::. + +`void * memset (void *BLOCK, int C, size_t SIZE)' + `string.h' (ISO): *Note Copying and Concatenation::. + +`int mkdir (const char *FILENAME, mode_t MODE)' + `sys/stat.h' (POSIX.1): *Note Creating Directories::. + +`int mkfifo (const char *FILENAME, mode_t MODE)' + `sys/stat.h' (POSIX.1): *Note FIFO Special Files::. + +`int mknod (const char *FILENAME, int MODE, int DEV)' + `sys/stat.h' (BSD): *Note Making Special Files::. + +`int mkstemp (char *TEMPLATE)' + `unistd.h' (BSD): *Note Temporary Files::. + +`char * mktemp (char *TEMPLATE)' + `unistd.h' (Unix): *Note Temporary Files::. + +`time_t mktime (struct tm *BROKENTIME)' + `time.h' (ISO): *Note Broken-down Time::. + +`mode_t' + `sys/types.h' (POSIX.1): *Note Attribute Meanings::. + +`double modf (double VALUE, double *INTEGER-PART)' + `math.h' (ISO): *Note Rounding and Remainders::. + +`int MSG_DONTROUTE' + `sys/socket.h' (BSD): *Note Socket Data Options::. + +`int MSG_OOB' + `sys/socket.h' (BSD): *Note Socket Data Options::. + +`int MSG_PEEK' + `sys/socket.h' (BSD): *Note Socket Data Options::. + +`int NAME_MAX' + `limits.h' (POSIX.1): *Note Limits for Files::. + +`double NAN' + `math.h' (GNU): *Note Not a Number::. + +`int NCCS' + `termios.h' (POSIX.1): *Note Mode Data Types::. + +`int NGROUPS_MAX' + `limits.h' (POSIX.1): *Note General Limits::. + +`int nice (int INCREMENT)' + `dunno.h' (dunno.h): *Note Priority::. + +`nlink_t' + `sys/types.h' (POSIX.1): *Note Attribute Meanings::. + +`NO_ADDRESS' + `netdb.h' (BSD): *Note Host Names::. + +`tcflag_t NOFLSH' + `termios.h' (POSIX.1): *Note Local Modes::. + +`tcflag_t NOKERNINFO' + `termios.h' (BSD): *Note Local Modes::. + +`NO_RECOVERY' + `netdb.h' (BSD): *Note Host Names::. + +`int NSIG' + `signal.h' (BSD): *Note Standard Signals::. + +`unsigned long int ntohl (unsigned long int NETLONG)' + `netinet/in.h' (BSD): *Note Byte Order::. + +`unsigned short int ntohs (unsigned short int NETSHORT)' + `netinet/in.h' (BSD): *Note Byte Order::. + +`void * NULL' + `stddef.h' (ISO): *Note Null Pointer Constant::. + +`int O_ACCMODE' + `fcntl.h' (POSIX.1): *Note Access Modes::. + +`int O_APPEND' + `fcntl.h' (POSIX.1): *Note Operating Modes::. + +`int O_ASYNC' + `fcntl.h' (BSD): *Note Operating Modes::. + +`void obstack_1grow_fast (struct obstack *OBSTACK-PTR, char C)' + `obstack.h' (GNU): *Note Extra Fast Growing::. + +`void obstack_1grow (struct obstack *OBSTACK-PTR, char C)' + `obstack.h' (GNU): *Note Growing Objects::. + +`int obstack_alignment_mask (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Obstacks Data Alignment::. + +`void * obstack_alloc (struct obstack *OBSTACK-PTR, int SIZE)' + `obstack.h' (GNU): *Note Allocation in an Obstack::. + +`void * obstack_base (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Status of an Obstack::. + +`void obstack_blank_fast (struct obstack *OBSTACK-PTR, int SIZE)' + `obstack.h' (GNU): *Note Extra Fast Growing::. + +`void obstack_blank (struct obstack *OBSTACK-PTR, int SIZE)' + `obstack.h' (GNU): *Note Growing Objects::. + +`int obstack_chunk_size (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Obstack Chunks::. + +`void * obstack_copy0 (struct obstack *OBSTACK-PTR, void *ADDRESS, int SIZE)' + `obstack.h' (GNU): *Note Allocation in an Obstack::. + +`void * obstack_copy (struct obstack *OBSTACK-PTR, void *ADDRESS, int SIZE)' + `obstack.h' (GNU): *Note Allocation in an Obstack::. + +`void * obstack_finish (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Growing Objects::. + +`void obstack_free (struct obstack *OBSTACK-PTR, void *OBJECT)' + `obstack.h' (GNU): *Note Freeing Obstack Objects::. + +`void obstack_grow0 (struct obstack *OBSTACK-PTR, void *DATA, int SIZE)' + `obstack.h' (GNU): *Note Growing Objects::. + +`void obstack_grow (struct obstack *OBSTACK-PTR, void *DATA, int SIZE)' + `obstack.h' (GNU): *Note Growing Objects::. + +`int obstack_init (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Preparing for Obstacks::. + +`void obstack_int_grow_fast (struct obstack *OBSTACK-PTR, int DATA)' + `obstack.h' (GNU): *Note Extra Fast Growing::. + +`void obstack_int_grow (struct obstack *OBSTACK-PTR, int DATA)' + `obstack.h' (GNU): *Note Growing Objects::. + +`void * obstack_next_free (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Status of an Obstack::. + +`int obstack_object_size (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Growing Objects::. + +`int obstack_object_size (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Status of an Obstack::. + +`int obstack_printf (struct obstack *OBSTACK, const char *TEMPLATE, ...)' + `stdio.h' (GNU): *Note Dynamic Output::. + +`void obstack_ptr_grow_fast (struct obstack *OBSTACK-PTR, void *DATA)' + `obstack.h' (GNU): *Note Extra Fast Growing::. + +`void obstack_ptr_grow (struct obstack *OBSTACK-PTR, void *DATA)' + `obstack.h' (GNU): *Note Growing Objects::. + +`int obstack_room (struct obstack *OBSTACK-PTR)' + `obstack.h' (GNU): *Note Extra Fast Growing::. + +`int obstack_vprintf (struct obstack *OBSTACK, const char *TEMPLATE, va_list AP)' + `stdio.h' (GNU): *Note Variable Arguments Output::. + +`int O_CREAT' + `fcntl.h' (POSIX.1): *Note Open-time Flags::. + +`int O_EXCL' + `fcntl.h' (POSIX.1): *Note Open-time Flags::. + +`int O_EXEC' + `fcntl.h' (GNU): *Note Access Modes::. + +`int O_EXLOCK' + `fcntl.h' (BSD): *Note Open-time Flags::. + +`size_t offsetof (TYPE, MEMBER)' + `stddef.h' (ISO): *Note Structure Measurement::. + +`off_t' + `sys/types.h' (POSIX.1): *Note File Position Primitive::. + +`int O_FSYNC' + `fcntl.h' (BSD): *Note Operating Modes::. + +`int O_IGNORE_CTTY' + `fcntl.h' (GNU): *Note Open-time Flags::. + +`int O_NDELAY' + `fcntl.h' (BSD): *Note Operating Modes::. + +`int on_exit (void (*FUNCTION)(int STATUS, void *ARG), void *ARG)' + `stdlib.h' (SunOS): *Note Cleanups on Exit::. + +`tcflag_t ONLCR' + `termios.h' (BSD): *Note Output Modes::. + +`int O_NOATIME' + `fcntl.h' (GNU): *Note Operating Modes::. + +`int O_NOCTTY' + `fcntl.h' (POSIX.1): *Note Open-time Flags::. + +`tcflag_t ONOEOT' + `termios.h' (BSD): *Note Output Modes::. + +`int O_NOLINK' + `fcntl.h' (GNU): *Note Open-time Flags::. + +`int O_NONBLOCK' + `fcntl.h' (POSIX.1): *Note Open-time Flags::. + +`int O_NONBLOCK' + `fcntl.h' (POSIX.1): *Note Operating Modes::. + +`int O_NOTRANS' + `fcntl.h' (GNU): *Note Open-time Flags::. + +`DIR * opendir (const char *DIRNAME)' + `dirent.h' (POSIX.1): *Note Opening a Directory::. + +`int open (const char *FILENAME, int FLAGS[, mode_t MODE])' + `fcntl.h' (POSIX.1): *Note Opening and Closing Files::. + +`int OPEN_MAX' + `limits.h' (POSIX.1): *Note General Limits::. + +`FILE * open_memstream (char **PTR, size_t *SIZELOC)' + `stdio.h' (GNU): *Note String Streams::. + +`FILE * open_obstack_stream (struct obstack *OBSTACK)' + `stdio.h' (GNU): *Note Obstack Streams::. + +`tcflag_t OPOST' + `termios.h' (POSIX.1): *Note Output Modes::. + +`char * optarg' + `unistd.h' (POSIX.2): *Note Parsing Options::. + +`int opterr' + `unistd.h' (POSIX.2): *Note Parsing Options::. + +`int optind' + `unistd.h' (POSIX.2): *Note Parsing Options::. + +`int optopt' + `unistd.h' (POSIX.2): *Note Parsing Options::. + +`int O_RDONLY' + `fcntl.h' (POSIX.1): *Note Access Modes::. + +`int O_RDWR' + `fcntl.h' (POSIX.1): *Note Access Modes::. + +`int O_READ' + `fcntl.h' (GNU): *Note Access Modes::. + +`int O_SHLOCK' + `fcntl.h' (BSD): *Note Open-time Flags::. + +`int O_SYNC' + `fcntl.h' (BSD): *Note Operating Modes::. + +`int O_TRUNC' + `fcntl.h' (POSIX.1): *Note Open-time Flags::. + +`int O_WRITE' + `fcntl.h' (GNU): *Note Access Modes::. + +`int O_WRONLY' + `fcntl.h' (POSIX.1): *Note Access Modes::. + +`tcflag_t OXTABS' + `termios.h' (BSD): *Note Output Modes::. + +`PA_CHAR' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_DOUBLE' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_FLAG_LONG_DOUBLE' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_FLAG_LONG' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_FLAG_LONG_LONG' + `printf.h' (GNU): *Note Parsing a Template String::. + +`int PA_FLAG_MASK' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_FLAG_PTR' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_FLAG_SHORT' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_FLOAT' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_INT' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_LAST' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_POINTER' + `printf.h' (GNU): *Note Parsing a Template String::. + +`tcflag_t PARENB' + `termios.h' (POSIX.1): *Note Control Modes::. + +`tcflag_t PARMRK' + `termios.h' (POSIX.1): *Note Input Modes::. + +`tcflag_t PARODD' + `termios.h' (POSIX.1): *Note Control Modes::. + +`size_t parse_printf_format (const char *TEMPLATE, size_t N, int *ARGTYPES)' + `printf.h' (GNU): *Note Parsing a Template String::. + +`PA_STRING' + `printf.h' (GNU): *Note Parsing a Template String::. + +`long int pathconf (const char *FILENAME, int PARAMETER)' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`int PATH_MAX' + `limits.h' (POSIX.1): *Note Limits for Files::. + +`int pause ()' + `unistd.h' (POSIX.1): *Note Using Pause::. + +`_PC_CHOWN_RESTRICTED' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`_PC_LINK_MAX' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`int pclose (FILE *STREAM)' + `stdio.h' (POSIX.2, SVID, BSD): *Note Pipe to a Subprocess::. + +`_PC_MAX_CANON' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`_PC_MAX_INPUT' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`_PC_NAME_MAX' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`_PC_NO_TRUNC' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`_PC_PATH_MAX' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`_PC_PIPE_BUF' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`_PC_VDISABLE' + `unistd.h' (POSIX.1): *Note Pathconf::. + +`tcflag_t PENDIN' + `termios.h' (BSD): *Note Local Modes::. + +`void perror (const char *MESSAGE)' + `stdio.h' (ISO): *Note Error Messages::. + +`int PF_FILE' + `sys/socket.h' (GNU): *Note File Namespace Details::. + +`int PF_INET' + `sys/socket.h' (BSD): *Note Internet Namespace::. + +`int PF_UNIX' + `sys/socket.h' (BSD): *Note File Namespace Details::. + +`pid_t' + `sys/types.h' (POSIX.1): *Note Process Identification::. + +`int PIPE_BUF' + `limits.h' (POSIX.1): *Note Limits for Files::. + +`int pipe (int FILEDES[2])' + `unistd.h' (POSIX.1): *Note Creating a Pipe::. + +`FILE * popen (const char *COMMAND, const char *MODE)' + `stdio.h' (POSIX.2, SVID, BSD): *Note Pipe to a Subprocess::. + +`_POSIX2_BC_BASE_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`_POSIX2_BC_DIM_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`_POSIX2_BC_SCALE_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`_POSIX2_BC_STRING_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`int _POSIX2_C_DEV' + `unistd.h' (POSIX.2): *Note System Options::. + +`_POSIX2_COLL_WEIGHTS_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`long int _POSIX2_C_VERSION' + `unistd.h' (POSIX.2): *Note Version Supported::. + +`_POSIX2_EQUIV_CLASS_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`_POSIX2_EXPR_NEST_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`int _POSIX2_FORT_DEV' + `unistd.h' (POSIX.2): *Note System Options::. + +`int _POSIX2_FORT_RUN' + `unistd.h' (POSIX.2): *Note System Options::. + +`_POSIX2_LINE_MAX' + `limits.h' (POSIX.2): *Note Utility Minimums::. + +`int _POSIX2_LOCALEDEF' + `unistd.h' (POSIX.2): *Note System Options::. + +`_POSIX2_RE_DUP_MAX' + `limits.h' (POSIX.2): *Note Minimums::. + +`int _POSIX2_SW_DEV' + `unistd.h' (POSIX.2): *Note System Options::. + +`_POSIX_ARG_MAX' + `limits.h' (POSIX.1): *Note Minimums::. + +`_POSIX_CHILD_MAX' + `limits.h' (POSIX.1): *Note Minimums::. + +`int _POSIX_CHOWN_RESTRICTED' + `unistd.h' (POSIX.1): *Note Options for Files::. + +`_POSIX_C_SOURCE' + (POSIX.2): *Note Feature Test Macros::. + +`int _POSIX_JOB_CONTROL' + `unistd.h' (POSIX.1): *Note System Options::. + +`_POSIX_LINK_MAX' + `limits.h' (POSIX.1): *Note File Minimums::. + +`_POSIX_MAX_CANON' + `limits.h' (POSIX.1): *Note File Minimums::. + +`_POSIX_MAX_INPUT' + `limits.h' (POSIX.1): *Note File Minimums::. + +`_POSIX_NAME_MAX' + `limits.h' (POSIX.1): *Note File Minimums::. + +`_POSIX_NGROUPS_MAX' + `limits.h' (POSIX.1): *Note Minimums::. + +`int _POSIX_NO_TRUNC' + `unistd.h' (POSIX.1): *Note Options for Files::. + +`_POSIX_OPEN_MAX' + `limits.h' (POSIX.1): *Note Minimums::. + +`_POSIX_PATH_MAX' + `limits.h' (POSIX.1): *Note File Minimums::. + +`_POSIX_PIPE_BUF' + `limits.h' (POSIX.1): *Note File Minimums::. + +`int _POSIX_SAVED_IDS' + `unistd.h' (POSIX.1): *Note System Options::. + +`_POSIX_SOURCE' + (POSIX.1): *Note Feature Test Macros::. + +`_POSIX_SSIZE_MAX' + `limits.h' (POSIX.1): *Note Minimums::. + +`_POSIX_STREAM_MAX' + `limits.h' (POSIX.1): *Note Minimums::. + +`_POSIX_TZNAME_MAX' + `limits.h' (POSIX.1): *Note Minimums::. + +`unsigned char _POSIX_VDISABLE' + `unistd.h' (POSIX.1): *Note Options for Files::. + +`long int _POSIX_VERSION' + `unistd.h' (POSIX.1): *Note Version Supported::. + +`double pow (double BASE, double POWER)' + `math.h' (ISO): *Note Exponents and Logarithms::. + +`printf_arginfo_function' + `printf.h' (GNU): *Note Defining the Output Handler::. + +`printf_function' + `printf.h' (GNU): *Note Defining the Output Handler::. + +`int printf (const char *TEMPLATE, ...)' + `stdio.h' (ISO): *Note Formatted Output Functions::. + +`PRIO_MAX' + `sys/resource.h' (BSD): *Note Priority::. + +`PRIO_MIN' + `sys/resource.h' (BSD): *Note Priority::. + +`PRIO_PGRP' + `sys/resource.h' (BSD): *Note Priority::. + +`PRIO_PROCESS' + `sys/resource.h' (BSD): *Note Priority::. + +`PRIO_USER' + `sys/resource.h' (BSD): *Note Priority::. + +`char * program_invocation_name' + `errno.h' (GNU): *Note Error Messages::. + +`char * program_invocation_short_name' + `errno.h' (GNU): *Note Error Messages::. + +`void psignal (int SIGNUM, const char *MESSAGE)' + `signal.h' (BSD): *Note Signal Messages::. + +`char * P_tmpdir' + `stdio.h' (SVID): *Note Temporary Files::. + +`ptrdiff_t' + `stddef.h' (ISO): *Note Important Data Types::. + +`int putchar (int C)' + `stdio.h' (ISO): *Note Simple Output::. + +`int putc (int C, FILE *STREAM)' + `stdio.h' (ISO): *Note Simple Output::. + +`int putenv (const char *STRING)' + `stdlib.h' (SVID): *Note Environment Access::. + +`int putpwent (const struct passwd *P, FILE *STREAM)' + `pwd.h' (SVID): *Note Writing a User Entry::. + +`int puts (const char *S)' + `stdio.h' (ISO): *Note Simple Output::. + +`int putw (int W, FILE *STREAM)' + `stdio.h' (SVID): *Note Simple Output::. + +`void qsort (void *ARRAY, size_t COUNT, size_t SIZE, comparison_fn_t COMPARE)' + `stdlib.h' (ISO): *Note Array Sort Function::. + +`int raise (int SIGNUM)' + `signal.h' (ISO): *Note Signaling Yourself::. + +`void r_alloc_free (void **HANDLEPTR)' + `malloc.h' (GNU): *Note Using Relocator::. + +`void * r_alloc (void **HANDLEPTR, size_t SIZE)' + `malloc.h' (GNU): *Note Using Relocator::. + +`int rand ()' + `stdlib.h' (ISO): *Note ISO Random::. + +`int RAND_MAX' + `stdlib.h' (ISO): *Note ISO Random::. + +`long int random ()' + `stdlib.h' (BSD): *Note BSD Random::. + +`struct dirent * readdir (DIR *DIRSTREAM)' + `dirent.h' (POSIX.1): *Note Reading/Closing Directory::. + +`int readdir_r (DIR *DIRSTREAM, struct *ENTRY, struct **RESULT)' + `dirent.h' (GNU): *Note Reading/Closing Directory::. + +`ssize_t read (int FILEDES, void *BUFFER, size_t SIZE)' + `unistd.h' (POSIX.1): *Note I/O Primitives::. + +`int readlink (const char *FILENAME, char *BUFFER, size_t SIZE)' + `unistd.h' (BSD): *Note Symbolic Links::. + +`__realloc_hook' + `malloc.h' (GNU): *Note Hooks for Malloc::. + +`void * realloc (void *PTR, size_t NEWSIZE)' + `malloc.h', `stdlib.h' (ISO): *Note Changing Block Size::. + +`int recvfrom (int SOCKET, void *BUFFER, size_t SIZE, int FLAGS, struct sockaddr *ADDR, socklen_t *LENGTH-PTR)' + `sys/socket.h' (BSD): *Note Receiving Datagrams::. + +`int recv (int SOCKET, void *BUFFER, size_t SIZE, int FLAGS)' + `sys/socket.h' (BSD): *Note Receiving Data::. + +`int recvmsg (int SOCKET, struct msghdr *MESSAGE, int FLAGS)' + `sys/socket.h' (BSD): *Note Receiving Datagrams::. + +`int RE_DUP_MAX' + `limits.h' (POSIX.2): *Note General Limits::. + +`_REENTRANT' + (GNU): *Note Feature Test Macros::. + +`REG_BADBR' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_BADPAT' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_BADRPT' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`int regcomp (regex_t *COMPILED, const char *PATTERN, int CFLAGS)' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_EBRACE' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_EBRACK' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_ECOLLATE' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_ECTYPE' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_EESCAPE' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_EPAREN' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_ERANGE' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`size_t regerror (int ERRCODE, regex_t *COMPILED, char *BUFFER, size_t LENGTH)' + `regex.h' (POSIX.2): *Note Regexp Cleanup::. + +`REG_ESPACE' + `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. + +`REG_ESPACE' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`REG_ESUBREG' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`int regexec (regex_t *COMPILED, char *STRING, size_t NMATCH, regmatch_t MATCHPTR [], int EFLAGS)' + `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. + +`REG_EXTENDED' + `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. + +`regex_t' + `regex.h' (POSIX.2): *Note POSIX Regexp Compilation::. + +`void regfree (regex_t *COMPILED)' + `regex.h' (POSIX.2): *Note Regexp Cleanup::. + +`REG_ICASE' + `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. + +`int register_printf_function (int SPEC, printf_function HANDLER-FUNCTION, printf_arginfo_function ARGINFO-FUNCTION)' + `printf.h' (GNU): *Note Registering New Conversions::. + +`regmatch_t' + `regex.h' (POSIX.2): *Note Regexp Subexpressions::. + +`REG_NEWLINE' + `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. + +`REG_NOMATCH' + `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. + +`REG_NOSUB' + `regex.h' (POSIX.2): *Note Flags for POSIX Regexps::. + +`REG_NOTBOL' + `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. + +`REG_NOTEOL' + `regex.h' (POSIX.2): *Note Matching POSIX Regexps::. + +`regoff_t' + `regex.h' (POSIX.2): *Note Regexp Subexpressions::. + +`int remove (const char *FILENAME)' + `stdio.h' (ISO): *Note Deleting Files::. + +`int rename (const char *OLDNAME, const char *NEWNAME)' + `stdio.h' (ISO): *Note Renaming Files::. + +`void rewinddir (DIR *DIRSTREAM)' + `dirent.h' (POSIX.1): *Note Random Access Directory::. + +`void rewind (FILE *STREAM)' + `stdio.h' (ISO): *Note File Positioning::. + +`char * rindex (const char *STRING, int C)' + `string.h' (BSD): *Note Search Functions::. + +`double rint (double X)' + `math.h' (BSD): *Note Rounding and Remainders::. + +`RLIMIT_CORE' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_CPU' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_DATA' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_FSIZE' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_MEMLOCK' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_NOFILE' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_NPROC' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_RSS' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIMIT_STACK' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`RLIM_NLIMITS' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`int rmdir (const char *FILENAME)' + `unistd.h' (POSIX.1): *Note Deleting Files::. + +`int R_OK' + `unistd.h' (POSIX.1): *Note Testing File Access::. + +`void * r_re_alloc (void **HANDLEPTR, size_t SIZE)' + `malloc.h' (GNU): *Note Using Relocator::. + +`RUSAGE_CHILDREN' + `sys/resource.h' (BSD): *Note Resource Usage::. + +`RUSAGE_SELF' + `sys/resource.h' (BSD): *Note Resource Usage::. + +`int SA_NOCLDSTOP' + `signal.h' (POSIX.1): *Note Flags for Sigaction::. + +`int SA_ONSTACK' + `signal.h' (BSD): *Note Flags for Sigaction::. + +`int SA_RESTART' + `signal.h' (BSD): *Note Flags for Sigaction::. + +`_SC_2_C_DEV' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_2_FORT_DEV' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_2_FORT_RUN' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_2_LOCALEDEF' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_2_SW_DEV' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_2_VERSION' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`double scalb (double VALUE, int EXPONENT)' + `math.h' (BSD): *Note Normalization Functions::. + +`int scanf (const char *TEMPLATE, ...)' + `stdio.h' (ISO): *Note Formatted Input Functions::. + +`_SC_ARG_MAX' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_BC_BASE_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_BC_DIM_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_BC_SCALE_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_BC_STRING_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_CHILD_MAX' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_CLK_TCK' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_COLL_WEIGHTS_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_EQUIV_CLASS_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_EXPR_NEST_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`SCHAR_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`SCHAR_MIN' + `limits.h' (ISO): *Note Range of Type::. + +`_SC_JOB_CONTROL' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_LINE_MAX' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`_SC_NGROUPS_MAX' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_OPEN_MAX' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_PAGESIZE' + `unistd.h' (GNU): *Note Constants for Sysconf::. + +`_SC_SAVED_IDS' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_STREAM_MAX' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_TZNAME_MAX' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_VERSION' + `unistd.h' (POSIX.1): *Note Constants for Sysconf::. + +`_SC_VERSION' + `unistd.h' (POSIX.2): *Note Constants for Sysconf::. + +`int SEEK_CUR' + `stdio.h' (ISO): *Note File Positioning::. + +`void seekdir (DIR *DIRSTREAM, off_t POS)' + `dirent.h' (BSD): *Note Random Access Directory::. + +`int SEEK_END' + `stdio.h' (ISO): *Note File Positioning::. + +`int SEEK_SET' + `stdio.h' (ISO): *Note File Positioning::. + +`int select (int NFDS, fd_set *READ-FDS, fd_set *WRITE-FDS, fd_set *EXCEPT-FDS, struct timeval *TIMEOUT)' + `sys/types.h' (BSD): *Note Waiting for I/O::. + +`int send (int SOCKET, void *BUFFER, size_t SIZE, int FLAGS)' + `sys/socket.h' (BSD): *Note Sending Data::. + +`int sendmsg (int SOCKET, const struct msghdr *MESSAGE, int FLAGS)' + `sys/socket.h' (BSD): *Note Receiving Datagrams::. + +`int sendto (int SOCKET, void *BUFFER. size_t SIZE, int FLAGS, struct sockaddr *ADDR, socklen_t LENGTH)' + `sys/socket.h' (BSD): *Note Sending Datagrams::. + +`void setbuffer (FILE *STREAM, char *BUF, size_t SIZE)' + `stdio.h' (BSD): *Note Controlling Buffering::. + +`void setbuf (FILE *STREAM, char *BUF)' + `stdio.h' (ISO): *Note Controlling Buffering::. + +`int setgid (gid_t NEWGID)' + `unistd.h' (POSIX.1): *Note Setting Groups::. + +`void setgrent (void)' + `grp.h' (SVID, BSD): *Note Scanning All Groups::. + +`int setgroups (size_t COUNT, gid_t *GROUPS)' + `grp.h' (BSD): *Note Setting Groups::. + +`void sethostent (int STAYOPEN)' + `netdb.h' (BSD): *Note Host Names::. + +`int sethostid (long int ID)' + `unistd.h' (BSD): *Note Host Identification::. + +`int sethostname (const char *NAME, size_t LENGTH)' + `unistd.h' (BSD): *Note Host Identification::. + +`int setitimer (int WHICH, struct itimerval *NEW, struct itimerval *OLD)' + `sys/time.h' (BSD): *Note Setting an Alarm::. + +`int setjmp (jmp_buf STATE)' + `setjmp.h' (ISO): *Note Non-Local Details::. + +`void setlinebuf (FILE *STREAM)' + `stdio.h' (BSD): *Note Controlling Buffering::. + +`char * setlocale (int CATEGORY, const char *LOCALE)' + `locale.h' (ISO): *Note Setting the Locale::. + +`void setnetent (int STAYOPEN)' + `netdb.h' (BSD): *Note Networks Database::. + +`int setnetgrent (const char *NETGROUP)' + `netdb.h' (netdb.h): *Note Lookup Netgroup::. + +`int setpgid (pid_t PID, pid_t PGID)' + `unistd.h' (POSIX.1): *Note Process Group Functions::. + +`int setpgrp (pid_t PID, pid_t PGID)' + `unistd.h' (BSD): *Note Process Group Functions::. + +`int setpriority (int CLASS, int ID, int PRIORITY)' + `sys/resource.h' (BSD): *Note Priority::. + +`void setprotoent (int STAYOPEN)' + `netdb.h' (BSD): *Note Protocols Database::. + +`void setpwent (void)' + `pwd.h' (SVID, BSD): *Note Scanning All Users::. + +`int setregid (gid_t RGID, fid_t EGID)' + `unistd.h' (BSD): *Note Setting Groups::. + +`int setreuid (uid_t RUID, uid_t EUID)' + `unistd.h' (BSD): *Note Setting User ID::. + +`int setrlimit (int RESOURCE, struct rlimit *RLP)' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`void setservent (int STAYOPEN)' + `netdb.h' (BSD): *Note Services Database::. + +`pid_t setsid (void)' + `unistd.h' (POSIX.1): *Note Process Group Functions::. + +`int setsockopt (int SOCKET, int LEVEL, int OPTNAME, void *OPTVAL, socklen_t OPTLEN)' + `sys/socket.h' (BSD): *Note Socket Option Functions::. + +`void * setstate (void *STATE)' + `stdlib.h' (BSD): *Note BSD Random::. + +`int settimeofday (const struct timeval *TP, const struct timezone *TZP)' + `sys/time.h' (BSD): *Note High-Resolution Calendar::. + +`int setuid (uid_t NEWUID)' + `unistd.h' (POSIX.1): *Note Setting User ID::. + +`int setvbuf (FILE *STREAM, char *BUF, int MODE, size_t SIZE)' + `stdio.h' (ISO): *Note Controlling Buffering::. + +`SHRT_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`SHRT_MIN' + `limits.h' (ISO): *Note Range of Type::. + +`int shutdown (int SOCKET, int HOW)' + `sys/socket.h' (BSD): *Note Closing a Socket::. + +`S_IEXEC' + `sys/stat.h' (BSD): *Note Permission Bits::. + +`S_IFBLK' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`S_IFCHR' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`S_IFDIR' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`S_IFIFO' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`S_IFLNK' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`int S_IFMT' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`S_IFREG' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`S_IFSOCK' + `sys/stat.h' (BSD): *Note Testing File Type::. + +`int SIGABRT' + `signal.h' (ISO): *Note Program Error Signals::. + +`int sigaction (int SIGNUM, const struct sigaction *ACTION, struct sigaction *OLD-ACTION)' + `signal.h' (POSIX.1): *Note Advanced Signal Handling::. + +`int sigaddset (sigset_t *SET, int SIGNUM)' + `signal.h' (POSIX.1): *Note Signal Sets::. + +`int SIGALRM' + `signal.h' (POSIX.1): *Note Alarm Signals::. + +`int sigaltstack (const struct sigaltstack *STACK, struct sigaltstack *OLDSTACK)' + `signal.h' (BSD): *Note Signal Stack::. + +`sig_atomic_t' + `signal.h' (ISO): *Note Atomic Types::. + +`SIG_BLOCK' + `signal.h' (POSIX.1): *Note Process Signal Mask::. + +`int sigblock (int MASK)' + `signal.h' (BSD): *Note Blocking in BSD::. + +`int SIGBUS' + `signal.h' (BSD): *Note Program Error Signals::. + +`int SIGCHLD' + `signal.h' (POSIX.1): *Note Job Control Signals::. + +`int SIGCLD' + `signal.h' (SVID): *Note Job Control Signals::. + +`int SIGCONT' + `signal.h' (POSIX.1): *Note Job Control Signals::. + +`int sigdelset (sigset_t *SET, int SIGNUM)' + `signal.h' (POSIX.1): *Note Signal Sets::. + +`int sigemptyset (sigset_t *SET)' + `signal.h' (POSIX.1): *Note Signal Sets::. + +`int SIGEMT' + `signal.h' (BSD): *Note Program Error Signals::. + +`sighandler_t SIG_ERR' + `signal.h' (ISO): *Note Basic Signal Handling::. + +`int sigfillset (sigset_t *SET)' + `signal.h' (POSIX.1): *Note Signal Sets::. + +`int SIGFPE' + `signal.h' (ISO): *Note Program Error Signals::. + +`sighandler_t' + `signal.h' (GNU): *Note Basic Signal Handling::. + +`int SIGHUP' + `signal.h' (POSIX.1): *Note Termination Signals::. + +`int SIGILL' + `signal.h' (ISO): *Note Program Error Signals::. + +`int SIGINFO' + `signal.h' (BSD): *Note Miscellaneous Signals::. + +`int siginterrupt (int SIGNUM, int FAILFLAG)' + `signal.h' (BSD): *Note BSD Handler::. + +`int SIGINT' + `signal.h' (ISO): *Note Termination Signals::. + +`int SIGIO' + `signal.h' (BSD): *Note Asynchronous I/O Signals::. + +`int SIGIOT' + `signal.h' (Unix): *Note Program Error Signals::. + +`int sigismember (const sigset_t *SET, int SIGNUM)' + `signal.h' (POSIX.1): *Note Signal Sets::. + +`sigjmp_buf' + `setjmp.h' (POSIX.1): *Note Non-Local Exits and Signals::. + +`int SIGKILL' + `signal.h' (POSIX.1): *Note Termination Signals::. + +`void siglongjmp (sigjmp_buf STATE, int VALUE)' + `setjmp.h' (POSIX.1): *Note Non-Local Exits and Signals::. + +`int SIGLOST' + `signal.h' (GNU): *Note Operation Error Signals::. + +`int sigmask (int SIGNUM)' + `signal.h' (BSD): *Note Blocking in BSD::. + +`sighandler_t signal (int SIGNUM, sighandler_t ACTION)' + `signal.h' (ISO): *Note Basic Signal Handling::. + +`int sigpause (int MASK)' + `signal.h' (BSD): *Note Blocking in BSD::. + +`int sigpending (sigset_t *SET)' + `signal.h' (POSIX.1): *Note Checking for Pending Signals::. + +`int SIGPIPE' + `signal.h' (POSIX.1): *Note Operation Error Signals::. + +`int SIGPOLL' + `signal.h' (SVID): *Note Asynchronous I/O Signals::. + +`int sigprocmask (int HOW, const sigset_t *SET, sigset_t *OLDSET)' + `signal.h' (POSIX.1): *Note Process Signal Mask::. + +`int SIGPROF' + `signal.h' (BSD): *Note Alarm Signals::. + +`int SIGQUIT' + `signal.h' (POSIX.1): *Note Termination Signals::. + +`int SIGSEGV' + `signal.h' (ISO): *Note Program Error Signals::. + +`int sigsetjmp (sigjmp_buf STATE, int SAVESIGS)' + `setjmp.h' (POSIX.1): *Note Non-Local Exits and Signals::. + +`SIG_SETMASK' + `signal.h' (POSIX.1): *Note Process Signal Mask::. + +`int sigsetmask (int MASK)' + `signal.h' (BSD): *Note Blocking in BSD::. + +`sigset_t' + `signal.h' (POSIX.1): *Note Signal Sets::. + +`int sigstack (const struct sigstack *STACK, struct sigstack *OLDSTACK)' + `signal.h' (BSD): *Note Signal Stack::. + +`int SIGSTOP' + `signal.h' (POSIX.1): *Note Job Control Signals::. + +`int sigsuspend (const sigset_t *SET)' + `signal.h' (POSIX.1): *Note Sigsuspend::. + +`int SIGSYS' + `signal.h' (Unix): *Note Program Error Signals::. + +`int SIGTERM' + `signal.h' (ISO): *Note Termination Signals::. + +`int SIGTRAP' + `signal.h' (BSD): *Note Program Error Signals::. + +`int SIGTSTP' + `signal.h' (POSIX.1): *Note Job Control Signals::. + +`int SIGTTIN' + `signal.h' (POSIX.1): *Note Job Control Signals::. + +`int SIGTTOU' + `signal.h' (POSIX.1): *Note Job Control Signals::. + +`SIG_UNBLOCK' + `signal.h' (POSIX.1): *Note Process Signal Mask::. + +`int SIGURG' + `signal.h' (BSD): *Note Asynchronous I/O Signals::. + +`int SIGUSR1' + `signal.h' (POSIX.1): *Note Miscellaneous Signals::. + +`int SIGUSR2' + `signal.h' (POSIX.1): *Note Miscellaneous Signals::. + +`int sigvec (int SIGNUM, const struct sigvec *ACTION,struct sigvec *OLD-ACTION)' + `signal.h' (BSD): *Note BSD Handler::. + +`int SIGVTALRM' + `signal.h' (BSD): *Note Alarm Signals::. + +`int SIGWINCH' + `signal.h' (BSD): *Note Miscellaneous Signals::. + +`int SIGXCPU' + `signal.h' (BSD): *Note Operation Error Signals::. + +`int SIGXFSZ' + `signal.h' (BSD): *Note Operation Error Signals::. + +`double sinh (double X)' + `math.h' (ISO): *Note Hyperbolic Functions::. + +`double sin (double X)' + `math.h' (ISO): *Note Trig Functions::. + +`S_IREAD' + `sys/stat.h' (BSD): *Note Permission Bits::. + +`S_IRGRP' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IROTH' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IRUSR' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IRWXG' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IRWXO' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IRWXU' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`int S_ISBLK (mode_t M)' + `sys/stat.h' (POSIX): *Note Testing File Type::. + +`int S_ISCHR (mode_t M)' + `sys/stat.h' (POSIX): *Note Testing File Type::. + +`int S_ISDIR (mode_t M)' + `sys/stat.h' (POSIX): *Note Testing File Type::. + +`int S_ISFIFO (mode_t M)' + `sys/stat.h' (POSIX): *Note Testing File Type::. + +`S_ISGID' + `sys/stat.h' (POSIX): *Note Permission Bits::. + +`int S_ISLNK (mode_t M)' + `sys/stat.h' (GNU): *Note Testing File Type::. + +`int S_ISREG (mode_t M)' + `sys/stat.h' (POSIX): *Note Testing File Type::. + +`int S_ISSOCK (mode_t M)' + `sys/stat.h' (GNU): *Note Testing File Type::. + +`S_ISUID' + `sys/stat.h' (POSIX): *Note Permission Bits::. + +`S_ISVTX' + `sys/stat.h' (BSD): *Note Permission Bits::. + +`S_IWGRP' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IWOTH' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IWRITE' + `sys/stat.h' (BSD): *Note Permission Bits::. + +`S_IWUSR' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IXGRP' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IXOTH' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`S_IXUSR' + `sys/stat.h' (POSIX.1): *Note Permission Bits::. + +`size_t' + `stddef.h' (ISO): *Note Important Data Types::. + +`unsigned int sleep (unsigned int SECONDS)' + `unistd.h' (POSIX.1): *Note Sleeping::. + +`int snprintf (char *S, size_t SIZE, const char *TEMPLATE, ...)' + `stdio.h' (GNU): *Note Formatted Output Functions::. + +`SO_BROADCAST' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`int SOCK_DGRAM' + `sys/socket.h' (BSD): *Note Communication Styles::. + +`int socket (int NAMESPACE, int STYLE, int PROTOCOL)' + `sys/socket.h' (BSD): *Note Creating a Socket::. + +`int socketpair (int NAMESPACE, int STYLE, int PROTOCOL, int FILEDES[2])' + `sys/socket.h' (BSD): *Note Socket Pairs::. + +`int SOCK_RAW' + `sys/socket.h' (BSD): *Note Communication Styles::. + +`int SOCK_RDM' + `sys/socket.h' (BSD): *Note Communication Styles::. + +`int SOCK_SEQPACKET' + `sys/socket.h' (BSD): *Note Communication Styles::. + +`int SOCK_STREAM' + `sys/socket.h' (BSD): *Note Communication Styles::. + +`SO_DEBUG' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_DONTROUTE' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_ERROR' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_KEEPALIVE' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_LINGER' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`int SOL_SOCKET' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_OOBINLINE' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_RCVBUF' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_REUSEADDR' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_SNDBUF' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`SO_STYLE' + `sys/socket.h' (GNU): *Note Socket-Level Options::. + +`SO_TYPE' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`speed_t' + `termios.h' (POSIX.1): *Note Line Speed::. + +`int sprintf (char *S, const char *TEMPLATE, ...)' + `stdio.h' (ISO): *Note Formatted Output Functions::. + +`double sqrt (double X)' + `math.h' (ISO): *Note Exponents and Logarithms::. + +`void srand (unsigned int SEED)' + `stdlib.h' (ISO): *Note ISO Random::. + +`void srandom (unsigned int SEED)' + `stdlib.h' (BSD): *Note BSD Random::. + +`int sscanf (const char *S, const char *TEMPLATE, ...)' + `stdio.h' (ISO): *Note Formatted Input Functions::. + +`sighandler_t ssignal (int SIGNUM, sighandler_t ACTION)' + `signal.h' (SVID): *Note Basic Signal Handling::. + +`int SSIZE_MAX' + `limits.h' (POSIX.1): *Note General Limits::. + +`ssize_t' + `unistd.h' (POSIX.1): *Note I/O Primitives::. + +`int stat (const char *FILENAME, struct stat *BUF)' + `sys/stat.h' (POSIX.1): *Note Reading Attributes::. + +`STDERR_FILENO' + `unistd.h' (POSIX.1): *Note Descriptors and Streams::. + +`FILE * stderr' + `stdio.h' (ISO): *Note Standard Streams::. + +`STDIN_FILENO' + `unistd.h' (POSIX.1): *Note Descriptors and Streams::. + +`FILE * stdin' + `stdio.h' (ISO): *Note Standard Streams::. + +`STDOUT_FILENO' + `unistd.h' (POSIX.1): *Note Descriptors and Streams::. + +`FILE * stdout' + `stdio.h' (ISO): *Note Standard Streams::. + +`char * stpcpy (char *TO, const char *FROM)' + `string.h' (Unknown origin): *Note Copying and Concatenation::. + +`char * stpncpy (char *TO, const char *FROM, size_t SIZE)' + `string.h' (GNU): *Note Copying and Concatenation::. + +`int strcasecmp (const char *S1, const char *S2)' + `string.h' (BSD): *Note String/Array Comparison::. + +`char * strcat (char *TO, const char *FROM)' + `string.h' (ISO): *Note Copying and Concatenation::. + +`char * strchr (const char *STRING, int C)' + `string.h' (ISO): *Note Search Functions::. + +`int strcmp (const char *S1, const char *S2)' + `string.h' (ISO): *Note String/Array Comparison::. + +`int strcoll (const char *S1, const char *S2)' + `string.h' (ISO): *Note Collation Functions::. + +`char * strcpy (char *TO, const char *FROM)' + `string.h' (ISO): *Note Copying and Concatenation::. + +`size_t strcspn (const char *STRING, const char *STOPSET)' + `string.h' (ISO): *Note Search Functions::. + +`char * strdupa (const char *S)' + `string.h' (GNU): *Note Copying and Concatenation::. + +`char * strdup (const char *S)' + `string.h' (SVID): *Note Copying and Concatenation::. + +`int STREAM_MAX' + `limits.h' (POSIX.1): *Note General Limits::. + +`char * strerror (int ERRNUM)' + `string.h' (ISO): *Note Error Messages::. + +`char * strerror_r (int ERRNUM, char *BUF, size_t N)' + `string.h' (GNU): *Note Error Messages::. + +`size_t strftime (char *S, size_t SIZE, const char *TEMPLATE, const struct tm *BROKENTIME)' + `time.h' (POSIX.2): *Note Formatting Date and Time::. + +`size_t strlen (const char *S)' + `string.h' (ISO): *Note String Length::. + +`int strncasecmp (const char *S1, const char *S2, size_t N)' + `string.h' (BSD): *Note String/Array Comparison::. + +`char * strncat (char *TO, const char *FROM, size_t SIZE)' + `string.h' (ISO): *Note Copying and Concatenation::. + +`int strncmp (const char *S1, const char *S2, size_t SIZE)' + `string.h' (ISO): *Note String/Array Comparison::. + +`char * strncpy (char *TO, const char *FROM, size_t SIZE)' + `string.h' (ISO): *Note Copying and Concatenation::. + +`char * strndupa (const char *S, size_t SIZE)' + `string.h' (GNU): *Note Copying and Concatenation::. + +`char * strndup (const char *S, size_t SIZE)' + `string.h' (GNU): *Note Copying and Concatenation::. + +`char * strpbrk (const char *STRING, const char *STOPSET)' + `string.h' (ISO): *Note Search Functions::. + +`char * strrchr (const char *STRING, int C)' + `string.h' (ISO): *Note Search Functions::. + +`char * strsep (char **STRING_PTR, const char *DELIMITER)' + `string.h' (BSD): *Note Finding Tokens in a String::. + +`char * strsignal (int SIGNUM)' + `string.h' (GNU): *Note Signal Messages::. + +`size_t strspn (const char *STRING, const char *SKIPSET)' + `string.h' (ISO): *Note Search Functions::. + +`char * strstr (const char *HAYSTACK, const char *NEEDLE)' + `string.h' (ISO): *Note Search Functions::. + +`double strtod (const char *STRING, char **TAILPTR)' + `stdlib.h' (ISO): *Note Parsing of Floats::. + +`float strtof (const char *STRING, char **TAILPTR)' + `stdlib.h' (GNU): *Note Parsing of Floats::. + +`char * strtok (char *NEWSTRING, const char *DELIMITERS)' + `string.h' (ISO): *Note Finding Tokens in a String::. + +`char * strtok_r (char *NEWSTRING, const char *DELIMITERS, char **SAVE_PTR)' + `string.h' (POSIX): *Note Finding Tokens in a String::. + +`long double strtold (const char *STRING, char **TAILPTR)' + `stdlib.h' (GNU): *Note Parsing of Floats::. + +`long int strtol (const char *STRING, char **TAILPTR, int BASE)' + `stdlib.h' (ISO): *Note Parsing of Integers::. + +`long long int strtoll (const char *STRING, char **TAILPTR, int BASE)' + `stdlib.h' (GNU): *Note Parsing of Integers::. + +`long long int strtoq (const char *STRING, char **TAILPTR, int BASE)' + `stdlib.h' (BSD): *Note Parsing of Integers::. + +`unsigned long int strtoul (const char *STRING, char **TAILPTR, int BASE)' + `stdlib.h' (ISO): *Note Parsing of Integers::. + +`unsigned long long int strtoull (const char *STRING, char **TAILPTR, int BASE)' + `stdlib.h' (GNU): *Note Parsing of Integers::. + +`unsigned long long int strtouq (const char *STRING, char **TAILPTR, int BASE)' + `stdlib.h' (BSD): *Note Parsing of Integers::. + +`struct dirent' + `dirent.h' (POSIX.1): *Note Directory Entries::. + +`struct flock' + `fcntl.h' (POSIX.1): *Note File Locks::. + +`struct group' + `grp.h' (POSIX.1): *Note Group Data Structure::. + +`struct hostent' + `netdb.h' (BSD): *Note Host Names::. + +`struct in6_addr' + `netinet/in.h' (IPv6 basic API): *Note Host Address Data Type::. + +`struct in_addr' + `netinet/in.h' (BSD): *Note Host Address Data Type::. + +`struct itimerval' + `sys/time.h' (BSD): *Note Setting an Alarm::. + +`struct lconv' + `locale.h' (ISO): *Note Numeric Formatting::. + +`struct linger' + `sys/socket.h' (BSD): *Note Socket-Level Options::. + +`struct mallinfo' + `malloc.h' (GNU): *Note Statistics of Malloc::. + +`struct msghdr' + `sys/socket.h' (BSD): *Note Receiving Datagrams::. + +`struct netent' + `netdb.h' (BSD): *Note Networks Database::. + +`struct obstack' + `obstack.h' (GNU): *Note Creating Obstacks::. + +`struct option' + `getopt.h' (GNU): *Note Long Options::. + +`struct passwd' + `pwd.h' (POSIX.1): *Note User Data Structure::. + +`struct printf_info' + `printf.h' (GNU): *Note Conversion Specifier Options::. + +`struct protoent' + `netdb.h' (BSD): *Note Protocols Database::. + +`struct rlimit' + `sys/resource.h' (BSD): *Note Limits on Resources::. + +`struct rusage' + `sys/resource.h' (BSD): *Note Resource Usage::. + +`struct servent' + `netdb.h' (BSD): *Note Services Database::. + +`struct sigaction' + `signal.h' (POSIX.1): *Note Advanced Signal Handling::. + +`struct sigaltstack' + `signal.h' (BSD): *Note Signal Stack::. + +`struct sigstack' + `signal.h' (BSD): *Note Signal Stack::. + +`struct sigvec' + `signal.h' (BSD): *Note BSD Handler::. + +`struct sockaddr' + `sys/socket.h' (BSD): *Note Address Formats::. + +`struct sockaddr_in' + `netinet/in.h' (BSD): *Note Internet Address Formats::. + +`struct sockaddr_un' + `sys/un.h' (BSD): *Note File Namespace Details::. + +`struct stat' + `sys/stat.h' (POSIX.1): *Note Attribute Meanings::. + +`struct termios' + `termios.h' (POSIX.1): *Note Mode Data Types::. + +`struct timeval' + `sys/time.h' (BSD): *Note High-Resolution Calendar::. + +`struct timezone' + `sys/time.h' (BSD): *Note High-Resolution Calendar::. + +`struct tm' + `time.h' (ISO): *Note Broken-down Time::. + +`struct tms' + `sys/times.h' (POSIX.1): *Note Detailed CPU Time::. + +`struct utimbuf' + `time.h' (POSIX.1): *Note File Times::. + +`struct utsname' + `sys/utsname.h' (POSIX.1): *Note Hardware/Software Type ID::. + +`size_t strxfrm (char *TO, const char *FROM, size_t SIZE)' + `string.h' (ISO): *Note Collation Functions::. + +`_SVID_SOURCE' + (GNU): *Note Feature Test Macros::. + +`int SV_INTERRUPT' + `signal.h' (BSD): *Note BSD Handler::. + +`int SV_ONSTACK' + `signal.h' (BSD): *Note BSD Handler::. + +`int SV_RESETHAND' + `signal.h' (Sun): *Note BSD Handler::. + +`int symlink (const char *OLDNAME, const char *NEWNAME)' + `unistd.h' (BSD): *Note Symbolic Links::. + +`long int sysconf (int PARAMETER)' + `unistd.h' (POSIX.1): *Note Sysconf Definition::. + +`int system (const char *COMMAND)' + `stdlib.h' (ISO): *Note Running a Command::. + +`double tanh (double X)' + `math.h' (ISO): *Note Hyperbolic Functions::. + +`double tan (double X)' + `math.h' (ISO): *Note Trig Functions::. + +`int tcdrain (int FILEDES)' + `termios.h' (POSIX.1): *Note Line Control::. + +`tcflag_t' + `termios.h' (POSIX.1): *Note Mode Data Types::. + +`int tcflow (int FILEDES, int ACTION)' + `termios.h' (POSIX.1): *Note Line Control::. + +`int tcflush (int FILEDES, int QUEUE)' + `termios.h' (POSIX.1): *Note Line Control::. + +`int tcgetattr (int FILEDES, struct termios *TERMIOS-P)' + `termios.h' (POSIX.1): *Note Mode Functions::. + +`pid_t tcgetpgrp (int FILEDES)' + `unistd.h' (POSIX.1): *Note Terminal Access Functions::. + +`TCSADRAIN' + `termios.h' (POSIX.1): *Note Mode Functions::. + +`TCSAFLUSH' + `termios.h' (POSIX.1): *Note Mode Functions::. + +`TCSANOW' + `termios.h' (POSIX.1): *Note Mode Functions::. + +`TCSASOFT' + `termios.h' (BSD): *Note Mode Functions::. + +`int tcsendbreak (int FILEDES, int DURATION)' + `termios.h' (POSIX.1): *Note Line Control::. + +`int tcsetattr (int FILEDES, int WHEN, const struct termios *TERMIOS-P)' + `termios.h' (POSIX.1): *Note Mode Functions::. + +`int tcsetpgrp (int FILEDES, pid_t PGID)' + `unistd.h' (POSIX.1): *Note Terminal Access Functions::. + +`off_t telldir (DIR *DIRSTREAM)' + `dirent.h' (BSD): *Note Random Access Directory::. + +`TEMP_FAILURE_RETRY (EXPRESSION)' + `unistd.h' (GNU): *Note Interrupted Primitives::. + +`char * tempnam (const char *DIR, const char *PREFIX)' + `stdio.h' (SVID): *Note Temporary Files::. + +`time_t time (time_t *RESULT)' + `time.h' (ISO): *Note Simple Calendar Time::. + +`clock_t times (struct tms *BUFFER)' + `sys/times.h' (POSIX.1): *Note Detailed CPU Time::. + +`time_t' + `time.h' (ISO): *Note Simple Calendar Time::. + +`long int timezone' + `time.h' (SVID): *Note Time Zone Functions::. + +`FILE * tmpfile (void)' + `stdio.h' (ISO): *Note Temporary Files::. + +`int TMP_MAX' + `stdio.h' (ISO): *Note Temporary Files::. + +`char * tmpnam (char *RESULT)' + `stdio.h' (ISO): *Note Temporary Files::. + +`char * tmpnam_r (char *RESULT)' + `stdio.h' (GNU): *Note Temporary Files::. + +`int toascii (int C)' + `ctype.h' (SVID, BSD): *Note Case Conversion::. + +`int _tolower (int C)' + `ctype.h' (SVID): *Note Case Conversion::. + +`int tolower (int C)' + `ctype.h' (ISO): *Note Case Conversion::. + +`tcflag_t TOSTOP' + `termios.h' (POSIX.1): *Note Local Modes::. + +`int _toupper (int C)' + `ctype.h' (SVID): *Note Case Conversion::. + +`int toupper (int C)' + `ctype.h' (ISO): *Note Case Conversion::. + +`TRY_AGAIN' + `netdb.h' (BSD): *Note Host Names::. + +`char * ttyname (int FILEDES)' + `unistd.h' (POSIX.1): *Note Is It a Terminal::. + +`char * tzname [2]' + `time.h' (POSIX.1): *Note Time Zone Functions::. + +`int TZNAME_MAX' + `limits.h' (POSIX.1): *Note General Limits::. + +`void tzset (void)' + `time.h' (POSIX.1): *Note Time Zone Functions::. + +`UCHAR_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`uid_t' + `sys/types.h' (POSIX.1): *Note Reading Persona::. + +`UINT_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`ULONG_LONG_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`ULONG_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`mode_t umask (mode_t MASK)' + `sys/stat.h' (POSIX.1): *Note Setting Permissions::. + +`int uname (struct utsname *INFO)' + `sys/utsname.h' (POSIX.1): *Note Hardware/Software Type ID::. + +`int ungetc (int C, FILE *STREAM)' + `stdio.h' (ISO): *Note How Unread::. + +`union wait' + `sys/wait.h' (BSD): *Note BSD Wait Functions::. + +`int unlink (const char *FILENAME)' + `unistd.h' (POSIX.1): *Note Deleting Files::. + +`USHRT_MAX' + `limits.h' (ISO): *Note Range of Type::. + +`int utime (const char *FILENAME, const struct utimbuf *TIMES)' + `time.h' (POSIX.1): *Note File Times::. + +`int utimes (const char *FILENAME, struct timeval TVP[2])' + `sys/time.h' (BSD): *Note File Times::. + +`va_alist' + `varargs.h' (Unix): *Note Old Varargs::. + +`TYPE va_arg (va_list AP, TYPE)' + `stdarg.h' (ISO): *Note Argument Macros::. + +`va_dcl' + `varargs.h' (Unix): *Note Old Varargs::. + +`void va_end (va_list AP)' + `stdarg.h' (ISO): *Note Argument Macros::. + +`va_list' + `stdarg.h' (ISO): *Note Argument Macros::. + +`void * valloc (size_t SIZE)' + `malloc.h', `stdlib.h' (BSD): *Note Aligned Memory Blocks::. + +`int vasprintf (char **PTR, const char *TEMPLATE, va_list AP)' + `stdio.h' (GNU): *Note Variable Arguments Output::. + +`void va_start (va_list AP)' + `varargs.h' (Unix): *Note Old Varargs::. + +`void va_start (va_list AP, LAST-REQUIRED)' + `stdarg.h' (ISO): *Note Argument Macros::. + +`int VDISCARD' + `termios.h' (BSD): *Note Other Special::. + +`int VDSUSP' + `termios.h' (BSD): *Note Signal Characters::. + +`int VEOF' + `termios.h' (POSIX.1): *Note Editing Characters::. + +`int VEOL2' + `termios.h' (BSD): *Note Editing Characters::. + +`int VEOL' + `termios.h' (POSIX.1): *Note Editing Characters::. + +`int VERASE' + `termios.h' (POSIX.1): *Note Editing Characters::. + +`pid_t vfork (void)' + `unistd.h' (BSD): *Note Creating a Process::. + +`int vfprintf (FILE *STREAM, const char *TEMPLATE, va_list AP)' + `stdio.h' (ISO): *Note Variable Arguments Output::. + +`int vfscanf (FILE *STREAM, const char *TEMPLATE, va_list AP)' + `stdio.h' (GNU): *Note Variable Arguments Input::. + +`int VINTR' + `termios.h' (POSIX.1): *Note Signal Characters::. + +`int VKILL' + `termios.h' (POSIX.1): *Note Editing Characters::. + +`int VLNEXT' + `termios.h' (BSD): *Note Other Special::. + +`int VMIN' + `termios.h' (POSIX.1): *Note Noncanonical Input::. + +`int vprintf (const char *TEMPLATE, va_list AP)' + `stdio.h' (ISO): *Note Variable Arguments Output::. + +`int VQUIT' + `termios.h' (POSIX.1): *Note Signal Characters::. + +`int VREPRINT' + `termios.h' (BSD): *Note Editing Characters::. + +`int vscanf (const char *TEMPLATE, va_list AP)' + `stdio.h' (GNU): *Note Variable Arguments Input::. + +`int vsnprintf (char *S, size_t SIZE, const char *TEMPLATE, va_list AP)' + `stdio.h' (GNU): *Note Variable Arguments Output::. + +`int vsprintf (char *S, const char *TEMPLATE, va_list AP)' + `stdio.h' (ISO): *Note Variable Arguments Output::. + +`int vsscanf (const char *S, const char *TEMPLATE, va_list AP)' + `stdio.h' (GNU): *Note Variable Arguments Input::. + +`int VSTART' + `termios.h' (POSIX.1): *Note Start/Stop Characters::. + +`int VSTATUS' + `termios.h' (BSD): *Note Other Special::. + +`int VSTOP' + `termios.h' (POSIX.1): *Note Start/Stop Characters::. + +`int VSUSP' + `termios.h' (POSIX.1): *Note Signal Characters::. + +`int VTIME' + `termios.h' (POSIX.1): *Note Noncanonical Input::. + +`int VWERASE' + `termios.h' (BSD): *Note Editing Characters::. + +`pid_t wait3 (union wait *STATUS-PTR, int OPTIONS, struct rusage *USAGE)' + `sys/wait.h' (BSD): *Note BSD Wait Functions::. + +`pid_t wait4 (pid_t PID, int *STATUS-PTR, int OPTIONS, struct rusage *USAGE)' + `sys/wait.h' (BSD): *Note Process Completion::. + +`pid_t wait (int *STATUS-PTR)' + `sys/wait.h' (POSIX.1): *Note Process Completion::. + +`pid_t waitpid (pid_t PID, int *STATUS-PTR, int OPTIONS)' + `sys/wait.h' (POSIX.1): *Note Process Completion::. + +`WCHAR_MAX' + `limits.h' (GNU): *Note Range of Type::. + +`wchar_t' + `stddef.h' (ISO): *Note Wide Char Intro::. + +`int WCOREDUMP (int STATUS)' + `sys/wait.h' (BSD): *Note Process Completion Status::. + +`size_t wcstombs (char *STRING, const wchar_t WSTRING, size_t SIZE)' + `stdlib.h' (ISO): *Note Wide String Conversion::. + +`int wctomb (char *STRING, wchar_t WCHAR)' + `stdlib.h' (ISO): *Note Converting One Char::. + +`int WEXITSTATUS (int STATUS)' + `sys/wait.h' (POSIX.1): *Note Process Completion Status::. + +`int WIFEXITED (int STATUS)' + `sys/wait.h' (POSIX.1): *Note Process Completion Status::. + +`int WIFSIGNALED (int STATUS)' + `sys/wait.h' (POSIX.1): *Note Process Completion Status::. + +`int WIFSTOPPED (int STATUS)' + `sys/wait.h' (POSIX.1): *Note Process Completion Status::. + +`int W_OK' + `unistd.h' (POSIX.1): *Note Testing File Access::. + +`int wordexp (const char *WORDS, wordexp_t *WORD-VECTOR-PTR, int FLAGS)' + `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + +`wordexp_t' + `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + +`void wordfree (wordexp_t *WORD-VECTOR-PTR)' + `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + +`WRDE_APPEND' + `wordexp.h' (POSIX.2): *Note Flags for Wordexp::. + +`WRDE_BADCHAR' + `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + +`WRDE_BADVAL' + `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + +`WRDE_CMDSUB' + `wordexp.h' (POSIX.2): *Note Calling Wordexp::. + +`WRDE_DOOFFS' +