update for 2.0.5pre1

This commit is contained in:
Ulrich Drepper 1997-08-05 23:36:21 +00:00
parent c59a94711c
commit 044b16f4e9
146 changed files with 3101 additions and 1175 deletions

26
BUGS
View File

@ -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 please report bugs always using the
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 <linux/limits.h> 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

468
ChangeLog
View File

@ -1,3 +1,471 @@
1997-08-04 15:29 Ulrich Drepper <drepper@cygnus.com>
* 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 <drepper@cygnus.com>
* 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 <philip@talon.raptor.com>.
1997-07-29 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/sys/fsuid.h: Change include
<gnu/types.h> to <sys/types.h>.
1997-08-01 23:18 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/locale.c (print_escaped): New function.
(show_info): Use print_escaped if strings can control unprintable
characters.
Patch by Jochen Hein <jochen.hein@delphi.central.de>.
1997-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* md5-crypt/Makefile (extra-objs): Add onlymd5-crypt.o for
dependencies.
1997-07-28 23:35 Ulrich Drepper <drepper@cygnus.com>
* 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 <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/sys/fsuid.h: New file.
Provided by Michael Deutschmann <ldeutsch@mail.netshop.net>.
* 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 <drepper@cygnus.com>
* 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 <schwab@issan.informatik.uni-dortmund.de>
* include/gnu-versions.h (_GNU_OBSTACK_INTERFACE_VERSION):
Synchronize with malloc/obstack.c.
1997-07-15 Marcus G. Daniels <marcus@cathcart.sysc.pdx.edu>
* 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-06-22 Paul Eggert <eggert@twinsun.com>
* 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 <drepper@cygnus.com>
* 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 <istvan@cmdmail.amd.com>.
1997-07-12 17:56 Ulrich Drepper <drepper@cygnus.com>
* 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 <drepper@cygnus.com>
* 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 <hjl@gnu.ai.mit.edu>
* posix/execvp.c (execvp): Handle ESTALE.
1997-07-09 08:16 H.J. Lu <hjl@gnu.ai.mit.edu>
* libio/fileops.c (_IO_file_underflow): Adjust pointers
before calling _IO_SYSREAD ().
1997-07-08 13:59 Ulrich Drepper <drepper@cygnus.com>
* time/strftime.c (spaces, zeroes): Handle broken SGI compiler.
Patch by Richard Stallman <rms@gnu.ai.mit.edu>.
1997-07-08 02:18 Ulrich Drepper <drepper@cygnus.com>
* 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 <kukuk@uni-paderborn.de>.
* 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 <rms@gnu.ai.mit.edu>.
1997-07-04 18:04 H.J. Lu <hjl@gnu.ai.mit.edu>
* 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 <drepper@cygnus.com>
* login/login.c (tty_name): Use newly allocated buffer.
Patch by Jaakko Hyvätti <jaakko.hyvatti@iki.fi>.
* time/asctime.c: Never translate week and month name according
to LC_TIME. Patch by Paul Eggert <eggert@twinsun.com>.
1997-06-28 20:52 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/syscalls.list: Add getresgid and
setresgid.
1997-06-27 02:17 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/syscalls.list: Add quotactl.
Reported by a sun.
1997-06-26 14:28 Ulrich Drepper <drepper@cygnus.com>
* time/strftime.c: Don't define `memcpy' macro if HAVE_MEMCPY is
defined. Reported by Akim Demaille <demaille@inf.enst.fr>.
1997-06-23 23:39 Ulrich Drepper <drepper@cygnus.com>
* math/math.h: Add warning about use of M_* constants.
Pretty print.
1997-06-21 02:48 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/locale.c: Correct comment.
* po/ko.po: Update.
1997-06-20 02:35 a sun <asun@zoology.washington.edu>
* sysdeps/unix/sysv/linux/netipx/ipx.h: Don't use kernel header.
1997-06-19 19:38 Ulrich Drepper <drepper@cygnus.com>
* 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 <hjl@gnu.ai.mit.edu>
* time/tzfile.c (__tzfile_read): Store getc () return in int.
1997-06-18 Miles Bader <miles@gnu.ai.mit.edu>
* string/Makefile (routines): Add argz-replace.
1997-06-12 Miles Bader <miles@gnu.ai.mit.edu>
* string/argz.h (__argz_replace, argz_replace): New declarations.
* string/argz-replace.c: New file.
1997-06-18 00:11 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* 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 <drepper@cygnus.com>
* manual/Makefile (install): Make sure `dir' file exists if we use
install-info.
1997-06-17 19:32 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/Makefile (info): Depend on dir-add.info.
1997-06-17 00:26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* 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 <drepper@cygnus.com>
* sysdeps/libm-ieee754/k_standard.c: Undo change of Tue Aug 6
01:13:56 1996.
1997-06-15 00:43 Ulrich Drepper <drepper@cygnus.com>
* 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 <drepper@cygnus.com>
* 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 <miles@gnu.ai.mit.edu>.
1997-06-12 12:45 Ulrich Drepper <drepper@cygnus.com>
* 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 <Philip.Blundell@pobox.com>
* nss/getXXbyYY_r.c (do_weak_alias): Remove extra parentheses.
1997-06-11 13:22 Ulrich Drepper <drepper@cygnus.com>
* misc/regexp.h (compile): Allow use of macro INIT for variable
declaration. Add documentation for INIT.
Reported by Robert Bihlmeyer <robbe@orcus.priv.at>.
1997-06-11 10:47 Philip Blundell <Philip.Blundell@pobox.com>
* sysdeps/unix/sysv/linux/net/if_arp.h: Add two new hardware types.
1997-06-05 23:10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* 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 <fila@filapc.ibi.com>
* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add netipx/ipx.h.
1997-06-05 17:08 Ulrich Drepper <drepper@cygnus.com>
* string/argz-addsep.c: Correct weak alias.
Reported by Ben Pfaff <pfaffben@pilot.msu.edu>.
* 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 <pfaffben@pilot.msu.edu>.
1997-06-03 23:42 Ulrich Drepper <drepper@cygnus.com>
* time/Makefile: Make tzselect depend on config.make.
1997-06-01 12:48 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/alpha/gnu/types.h (__fd_mask): Change
type to `unsigned long int'.
Patch by Richard Henderson <richard@twiddle.rth.home>.
1997-05-30 17:34 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* nss/nss_files/files-hosts.c: Delete inclusion of
"../resolv/mapv4v6hostent.h".
1997-05-31 02:33 Ulrich Drepper <drepper@cygnus.com>
* libio/libio.h: Define bits for libg++-2.8.
1997-05-30 09:50 Richard Henderson <rth@tamu.edu>
* 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 <linux/posix_types.h>.
* sysdeps/unix/sysv/linux/alpha/ioperm.c: Add definition for Miata.
1997-05-29 13:59 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (manual/dir-add.texi): Force execution.
1997-05-29 13:55 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdlib/strfmon.c: Don't run past EOS after `='.
1997-05-29 12:48 Ulrich Drepper <drepper@cygnus.com>
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 <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/net/ppp_defs.h: Include <time.h> for
time_t.
* login/pty.h: Include <ioctl-types.h> for definition of struct
winsize.
1997-05-28 22:51 Ulrich Drepper <drepper@cygnus.com>
* 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 <hjl@lucon.org>.
1997-07-16 Miles Bader <miles@gnu.ai.mit.edu>
* 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 <drepper@cygnus.com>
* login/login.c (tty_name): Use newly allocated buffer.
Patch by Jaakko Hyvätti <jaakko.hyvatti@iki.fi>.
* time/asctime.c: Never translate week and month name according
to LC_TIME. Patch by Paul Eggert <eggert@twinsun.com>.
1997-07-01 16:40 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* hurd/hurdsig.c: Include <hurd/id.h>.
(reauth_proc): Call proc_setowner appropriately too.
1997-05-29 14:02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/sys/ttydefaults.h (CEOL, CSTATUS): Use
correct value for _POSIX_VDISABLE.
1997-05-06 13:25 H.J. Lu <hjl@gnu.ai.mit.edu>
* 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 <drepper@cygnus.com>
* Net release 2.0.4.

View File

@ -303,8 +303,9 @@ makeinfo --no-validate --no-warn --no-headers $< -o $@
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)

View File

@ -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 <bug-glibc@prep.ai.mit.edu>
@ -19,7 +19,16 @@ contact <bug-glibc@prep.ai.mit.edu>
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 <bug-glibc@prep.ai.mit.edu>
for the current status (of course better use a mirror of prep).
[ 4] Write wordexp() function; this is described in POSIX.2, the
header <wordexp.h> 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 <bug-glibc@prep.ai.mit.edu>
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 <bug-glibc@prep.ai.mit.edu>
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.
**** There are plans for a new approach to this problem. Please contact
bug-glibc@prep.ai.mit.edu before starting to work.)
[12] Several more or less small functions have to be written:
[13] Several more or less small functions have to be written:
+ 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.
More information is available on request.
[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.
[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!

View File

@ -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
@ -37,7 +37,7 @@
#ifdef NDEBUG
#define assert(expr) ((void) 0)
# define assert(expr) ((void) 0)
/* void assert_perror (int errnum);
@ -45,14 +45,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 <sys/cdefs.h>
__BEGIN_DECLS
/* This prints an "Assertion failed" message and aborts. */
@ -71,27 +69,27 @@ extern void __assert_perror_fail __P ((int __errnum,
__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. */

View File

@ -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

View File

@ -22,6 +22,7 @@
#include <hurd/signal.h>
#include <cthreads.h> /* For `struct mutex'. */
#include <string.h>
#include <hurd/id.h>
#include "hurdfault.h"
#include "hurdmalloc.h" /* XXX */
@ -1237,6 +1238,16 @@ reauth_proc (mach_port_t new)
__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. */
}
text_set_element (_hurd_reauth_hook, reauth_proc);

View File

@ -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 */

View File

@ -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 <drepper@cygnus.com>, 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 <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <libc-lock.h>
/* 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 (once);
char *buffer;
unsigned char *bytes;
p = (char *)&in;
#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 *) &in;
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);
}

View File

@ -105,7 +105,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
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, fd2p)
}
(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, fd2p)
} 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, fd2p)
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;
}

View File

@ -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 <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
/* lockf is a simplified interface to fcntl's locking facilities. */
@ -28,6 +29,8 @@ lockf (int fd, int cmd, off_t len)
{
struct flock fl;
memset ((char *) &fl, '\0', sizeof (fl));
switch (cmd)
{
case F_TEST:

View File

@ -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)

View File

@ -127,6 +127,7 @@ the executable file might be covered by the GNU General Public License. */
#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 the GNU General Public License. */
#define _IO_UNITBUF 020000
#define _IO_STDIO 040000
#define _IO_DONT_CLOSE 0100000
#define _IO_BOOLALPHA 0200000
struct _IO_jump_t; struct _IO_FILE;

View File

@ -88,7 +88,7 @@ DEFUN(_IO_str_init_static, (fp, ptr, size, pstart),
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;
}

View File

@ -205,13 +205,13 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
/* `-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 ('"');

View File

@ -255,8 +255,11 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
{
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)

View File

@ -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 *locale, struct charset_t *charset,
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);
}

View File

@ -204,8 +204,10 @@ new_composite_name (int category, char *newnames[LC_ALL])
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 *locale)
/* Critical section left. */
__libc_lock_unlock (__libc_setlocale_lock);
/* Free the resources (the locale path variable. */
free (locale_path);
return composite;
}
else
@ -394,6 +399,9 @@ setlocale (int category, const char *locale)
/* Critical section left. */
__libc_lock_unlock (__libc_setlocale_lock);
/* Free the resources (the locale path variable. */
free (locale_path);
return newname;
}
}

View File

@ -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 <drepper@cygnus.com>, 1996.
@ -42,7 +42,7 @@ tty_name (int fd, char **tty, size_t buf_len)
{
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 +65,8 @@ tty_name (int fd, char **tty, size_t buf_len)
__set_errno (ENOMEM);
break;
}
buf = new_buf;
}
if (rv == 0)

View File

@ -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 <features.h>
#include <ioctl-types.h>
#include <termios.h>

View File

@ -8,5 +8,5 @@ glibc-*
*.toc *.aux *.log
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
chapters chapters-incl summary.texi stamp-*
distinfo
chapters chapters-incl1 chapters-incl2 summary.texi stamp-*
distinfo dir-add.texi

View File

@ -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) $(chapters-incl)
# Generate a file which can be added to the `dir' content to provide direct
# access to the documentation of the function, variables, and other
# definitions.
dir-add.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 $(chapters)
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-dist) $(distribute)
.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-%: ;

16
manual/dir Normal file
View File

@ -0,0 +1,16 @@
$Id$
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<Return>" visits the Emacs topic, etc.
In Emacs, you can click mouse button 2 on a menu item or cross reference
to select it.
* Menu:

View File

@ -3,12 +3,18 @@
@setfilename libc.info
@settitle The GNU C Library
@setchapternewpage odd
@comment %**end of header (This is for running Texinfo on a region.)
@comment Tell install-info what to do.
@dircategory GNU libraries
@direntry
* Libc: (libc). C library.
@end direntry
@c This tells texinfo.tex to use the real section titles in xrefs in
@c place of the node name, when no section title is explicitly given.
@set xref-automatic-section-title
@smallbook
@comment %**end of header (This is for running Texinfo on a region.)
@c sold 0.06/1.09, print run out 21may96
@set EDITION 0.07 DRAFT
@ -22,7 +28,7 @@ This file documents the GNU C library.
This is Edition @value{EDITION}, last updated @value{UPDATED},
of @cite{The GNU C Library Reference Manual}, for Version @value{VERSION}.
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
@ -68,7 +74,7 @@ Foundation.
@center for version @value{VERSION}
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1993, '94, '95, '96 Free Software Foundation, Inc.
Copyright @copyright{} 1993, '94, '95, '96, '97 Free Software Foundation, Inc.
@sp 2
Published by the Free Software Foundation @*
59 Temple Place -- Suite 330, @*
@ -508,7 +514,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.

View File

@ -223,7 +223,6 @@ following patterns:
@smallexample
alpha-@var{anything}-linux
alpha-@var{anything}-linuxecoff
i@var{x}86-@var{anything}-gnu
i@var{x}86-@var{anything}-linux
m68k-@var{anything}-linux
@ -234,6 +233,7 @@ versions) used to run on the following configurations:
@smallexample
alpha-dec-osf1
alpha-@var{anything}-linuxecoff
i@var{x}86-@var{anything}-bsd4.3
i@var{x}86-@var{anything}-isc2.2
i@var{x}86-@var{anything}-isc3.@var{n}

View File

@ -128,6 +128,28 @@ protocol} which you can request by specifying 0 as the protocol
number. And that's what you should normally do---use the default.
@end itemize
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 @code{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 @code{size_t}". But on 64 bit machines
@code{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 @code{socklen_t}. This type is used in all of the cases in
previously changed to use @code{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.
@node Communication Styles
@section Communication Styles
@ -323,7 +345,13 @@ This is a synonym for @code{AF_FILE}, for compatibility.
@vindex AF_INET
This designates the address format that goes with the Internet
namespace. (@code{PF_INET} is the name of that namespace.)
@xref{Internet Address Format}.
@xref{Internet Address Formats}.
@comment sys/socket.h
@comment IPv6 Basic API
@item AF_INET6
This is similar to @code{AF_INET}, but refers to the IPv6 protocol.
(@code{PF_INET6} is the name of the corresponding namespace.)
@comment sys/socket.h
@comment BSD
@ -352,7 +380,7 @@ For examples of use, see @ref{File Namespace}, or see @ref{Inet Example}.
@comment sys/socket.h
@comment BSD
@deftypefun int bind (int @var{socket}, struct sockaddr *@var{addr}, size_t @var{length})
@deftypefun int bind (int @var{socket}, struct sockaddr *@var{addr}, socklen_t @var{length})
The @code{bind} function assigns an address to the socket
@var{socket}. The @var{addr} and @var{length} arguments specify the
address; the detailed format of the address depends on the namespace.
@ -400,7 +428,7 @@ Internet socket. The prototype for this function is in the header file
@comment sys/socket.h
@comment BSD
@deftypefun int getsockname (int @var{socket}, struct sockaddr *@var{addr}, size_t *@var{length-ptr})
@deftypefun int getsockname (int @var{socket}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
The @code{getsockname} function returns information about the
address of the socket @var{socket} in the locations specified by the
@var{addr} and @var{length-ptr} arguments. Note that the
@ -566,7 +594,7 @@ A socket address for the Internet namespace includes the following components:
@item
The address of the machine you want to connect to. Internet addresses
can be specified in several ways; these are discussed in @ref{Internet
Address Format}, @ref{Host Addresses}, and @ref{Host Names}.
Address Formats}, @ref{Host Addresses}, and @ref{Host Names}.
@item
A port number for that machine. @xref{Ports}.
@ -577,7 +605,7 @@ canonical format called @dfn{network byte order}. @xref{Byte Order},
for 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.
@ -589,16 +617,17 @@ for information about this.
* Inet Example:: Putting it all together.
@end menu
@node Internet Address Format
@subsection Internet Socket Address Format
@node Internet Address Formats
@subsection Internet Socket Address Formats
In the Internet namespace, a socket address consists of a host address
In the Internet namespace, for both IPv4 (@code{AF_INET}) and IPv6
(@code{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 @file{netinet/in.h}.
The data types for representing socket addresses in the Internet namespace
are defined in the header file @file{netinet/in.h}.
@pindex netinet/in.h
@comment netinet/in.h
@ -627,13 +656,39 @@ When you call @code{bind} or @code{getsockname}, you should specify
@code{sizeof (struct sockaddr_in)} as the @var{length} parameter if
you are using an Internet namespace socket address.
@deftp {Data Type} {struct sockaddr_in6}
This is the data type used to represent socket addresses in the IPv6
namespace. It has the following members:
@table @code
@item short int sin6_family
This identifies the address family or format of the socket address.
You should store the value of @code{AF_INET6} in this member.
@xref{Socket Addresses}.
@item struct in6_addr sin6_addr
This is the IPv6 address of the host machine. @xref{Host
Addresses}, and @ref{Host Names}, for how to get a value to store
here.
@item uint32_t sin6_flowinfo
This is a currently unimplemented field.
@item uint16_t sin6_port
This is the port number. @xref{Ports}.
@end table
@end deftp
@node Host Addresses
@subsection Host Addresses
Each computer on the Internet has one or more @dfn{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 @samp{128.52.46.32}.
Users typically write IPv4 numeric host addresses as sequences of four
numbers, separated by periods, as in @samp{128.52.46.32}, and IPv6
numeric host addresses as sequences of up to eight numbers seperated by
colons, as in @samp{5f03:1200:836f:c100::1}.
Each computer also has one or more @dfn{host names}, which are strings
of words separated by periods, as in @samp{churchy.gnu.ai.mit.edu}.
@ -660,6 +715,9 @@ Each computer on the Internet has one or more Internet addresses,
numbers which identify that computer among all those on the Internet.
@end ifinfo
@c I think this whole section could possibly be removed. It is slightly
@c misleading these days.
@cindex network number
@cindex local network address number
An Internet host address is a number containing four bytes of data.
@ -747,7 +805,7 @@ host address number as an @code{unsigned long int}.
@comment netinet/in.h
@comment BSD
@deftypevr Macro {unsigned long int} INADDR_LOOPBACK
@deftypevr 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
@samp{127.0.0.1}, which is usually called @samp{localhost}. This
@ -759,7 +817,7 @@ talking to itself.
@comment netinet/in.h
@comment BSD
@deftypevr Macro {unsigned long int} INADDR_ANY
@deftypevr Macro {unsigned int} INADDR_ANY
You can use this constant to stand for ``any incoming address,'' when
binding to an address. @xref{Setting Address}. This is the usual
address to give in the @code{sin_addr} member of @w{@code{struct
@ -768,17 +826,42 @@ sockaddr_in}} when you want to accept Internet connections.
@comment netinet/in.h
@comment BSD
@deftypevr Macro {unsigned long int} INADDR_BROADCAST
@deftypevr Macro {unsigned int} INADDR_BROADCAST
This constant is the address you use to send a broadcast message.
@c !!! broadcast needs further documented
@end deftypevr
@comment netinet/in.h
@comment BSD
@deftypevr Macro {unsigned long int} INADDR_NONE
@deftypevr Macro {unsigned int} INADDR_NONE
This constant is returned by some functions to indicate an error.
@end deftypevr
@comment netinet/in.h
@comment IPv6 basic API
@deftp {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.
@end deftp
@comment netinet/in.h
@comment IPv6 basic API
@deftypevr Constant {struct in6_addr} in6addr_loopback.
This constant is the IPv6 address @samp{::1}, the loopback address. See
above for a description of what this means. The macro
@code{IN6ADDR_LOOPBACK_INIT} is provided to allow you to initialise your
own variables to this value.
@end deftypevr
@comment netinet/in.h
@comment IPv6 basic API
@deftypevr Constant {struct in6_addr} in6addr_any
This constant is the IPv6 address @samp{::}, the unspecified address. See
above for a description of what this means. The macro
@code{IN6ADDR_ANY_INIT} is provided to allow you to initialise your
own variables to this value.
@end deftypevr
@node Host Address Functions
@subsubsection Host Address Functions
@ -791,7 +874,7 @@ local-address-within-network numbers in host byte order.
@comment arpa/inet.h
@comment BSD
@deftypefun {int} inet_aton (const char *@var{name}, struct in_addr *@var{addr})
@deftypefun int inet_aton (const char *@var{name}, struct in_addr *@var{addr})
This function converts the Internet host address @var{name}
from the standard numbers-and-dots notation into binary data and stores
it in the @code{struct in_addr} that @var{addr} points to.
@ -826,6 +909,10 @@ string in the standard numbers-and-dots notation. The return value is
a pointer into a statically-allocated buffer. Subsequent calls will
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 @code{inet_ntoa} in the same
thread will overwrite the result of the last call.
@end deftypefun
@comment arpa/inet.h
@ -850,6 +937,28 @@ This function returns the network number part of the Internet host
address @var{addr}.
@end deftypefun
@comment arpa/inet.h
@comment IPv6 basic API
@deftypefun int inet_pton (int @var{af}, const char *@var{cp}, void *@var{buf})
This function converts an Internet address (either IPv4 or IPv6) from
presentation (textual) to network (binary) format. @var{af} should be
either @code{AF_INET} or @code{AF_INET6}, as appropriate for the type of
address being converted. @var{cp} is a pointer to the input string, and
@var{buf} is a pointer to a buffer for the result. It is the caller's
responsibility to make sure the buffer is large enough.
@end deftypefun
@comment arpa/inet.h
@comment IPv6 basic API
@deftypefun {char *} inet_ntop (int @var{af}, const void *@var{cp}, char *@var{buf}, size_t @var{len})
This function converts an Internet address (either IPv4 or IPv6) from
network (binary) to presentation (textual) form. @var{af} should be
either @code{AF_INET} or @code{AF_INET6}, as appropriate. @var{cp} is a
pointer to the address to be converted. @var{buf} should be a pointer
to a buffer to hold the result, and @var{len} is the length of this
buffer. The return value from the function will be this buffer address.
@end deftypefun
@node Host Names
@subsubsection Host Names
@cindex hosts database
@ -887,11 +996,12 @@ These are alternative names for the host, represented as a null-terminated
vector of strings.
@item int h_addrtype
This is the host address type; in practice, its value is always
@code{AF_INET}. 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 @code{AF_INET}.
@xref{Socket Addresses}.
This is the host address type; in practice, its value is always either
@code{AF_INET} or @code{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 @code{AF_INET} or
@code{AF_INET6}. @xref{Socket Addresses}.
@item int h_length
This is the length, in bytes, of each address.
@ -913,10 +1023,12 @@ implicit assumption that you can convert this to a @code{struct in_addr} or
an @code{unsigned long int}. Host addresses in a @code{struct hostent}
structure are always given in network byte order; see @ref{Byte Order}.
You can use @code{gethostbyname} or @code{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 @code{gethostbyname}, @code{gethostbyname2} or
@code{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 @code{getaddrinfo} and
@code{getnameinfo} to obtain this information.
@comment netdb.h
@comment BSD
@ -925,6 +1037,14 @@ The @code{gethostbyname} function returns information about the host
named @var{name}. If the lookup fails, it returns a null pointer.
@end deftypefun
@comment netdb.h
@comment IPv6 Basic API
@deftypefun {struct hostent *} gethostbyname2 (const char *@var{name}, int @var{af})
The @code{gethostbyname2} function is like @code{gethostbyname}, but
allows the caller to specify the desired address family (e.g.@:
@code{AF_INET} or @code{AF_INET6}) for the result.
@end deftypefun
@comment netdb.h
@comment BSD
@deftypefun {struct hostent *} gethostbyaddr (const char *@var{addr}, int @var{length}, int @var{format})
@ -1590,7 +1710,7 @@ program must do, using the @code{connect} function, which is declared in
@comment sys/socket.h
@comment BSD
@deftypefun int connect (int @var{socket}, struct sockaddr *@var{addr}, size_t @var{length})
@deftypefun int connect (int @var{socket}, struct sockaddr *@var{addr}, socklen_t @var{length})
The @code{connect} function initiates a connection from the socket
with file descriptor @var{socket} to the socket whose address is
specified by the @var{addr} and @var{length} arguments. (This socket
@ -1735,7 +1855,7 @@ queue.
@comment sys/socket.h
@comment BSD
@deftypefun int accept (int @var{socket}, struct sockaddr *@var{addr}, size_t *@var{length-ptr})
@deftypefun int accept (int @var{socket}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
This function is used to accept a connection request on the server
socket @var{socket}.
@ -2229,7 +2349,7 @@ more information about the @code{connect} function.
@comment sys/socket.h
@comment BSD
@deftypefun int sendto (int @var{socket}, void *@var{buffer}. size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, size_t @var{length})
@deftypefun int sendto (int @var{socket}, void *@var{buffer}. size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t @var{length})
The @code{sendto} function transmits the data in the @var{buffer}
through the socket @var{socket} to the destination address specified
by the @var{addr} and @var{length} arguments. The @var{size} argument
@ -2258,7 +2378,7 @@ also tells you where it was sent from. This function is declared in
@comment sys/socket.h
@comment BSD
@deftypefun int recvfrom (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, size_t *@var{length-ptr})
@deftypefun int recvfrom (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
The @code{recvfrom} function reads one packet from the socket
@var{socket} into the buffer @var{buffer}. The @var{size} argument
specifies the maximum number of bytes to be read.
@ -2485,7 +2605,7 @@ They are declared in @file{sys/socket.h}.
@comment sys/socket.h
@comment BSD
@deftypefun int getsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, size_t *@var{optlen-ptr})
@deftypefun int getsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, socklen_t *@var{optlen-ptr})
The @code{getsockopt} function gets information about the value of
option @var{optname} at level @var{level} for socket @var{socket}.
@ -2515,7 +2635,7 @@ The @var{optname} doesn't make sense for the given @var{level}.
@comment sys/socket.h
@comment BSD
@deftypefun int setsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, size_t @var{optlen})
@deftypefun int setsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, socklen_t @var{optlen})
This function is used to set the socket option @var{optname} at level
@var{level} for socket @var{socket}. The value of the option is passed
in the buffer @var{optval}, which has size @var{optlen}.

View File

@ -1,5 +1,5 @@
%% TeX macros to handle Texinfo files.
%% $Id: texinfo.tex,v 2.196.2.1 1997/05/26 20:55:31 drepper Exp $
%% $Id: texinfo.tex,v 2.196.2.2 1997/08/05 23:34:23 drepper Exp $
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
% 94, 95, 96, 97 Free Software Foundation, Inc.
@ -36,7 +36,7 @@
% This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 2.196.2.1 $
\deftexinfoversion$Revision: 2.196.2.2 $
\message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number
@ -101,6 +101,7 @@
\hyphenation{ap-pen-dix}
\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell}
\hyphenation{white-space}
% Margin to add to right of even pages, to left of odd pages.
\newdimen \bindingoffset
@ -185,7 +186,13 @@
%
\unvbox\headlinebox
\pagebody{#1}%
\unvbox\footlinebox
\ifdim\ht\footlinebox > 0pt
% Only leave this space if the footline is nonempty.
% (We lessened \vsize for it in \oddfootingxxx.)
% The \baselineskip=24pt in plain's \makefootline has no effect.
\vskip 2\baselineskip
\unvbox\footlinebox
\fi
%
\ifcropmarks
\egroup % end of \vbox\bgroup
@ -729,10 +736,11 @@ where each line of input produces a line of output.}
%
\def\ignore{\doignore{ignore}}
% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
%
\def\ifinfo{\doignore{ifinfo}}
\def\ifhtml{\doignore{ifhtml}}
\def\ifnottex{\doignore{ifnottex}}
\def\html{\doignore{html}}
\def\menu{\doignore{menu}}
\def\direntry{\doignore{direntry}}
@ -759,6 +767,10 @@ where each line of input produces a line of output.}
% Make sure that spaces turn into tokens that match what \doignoretext wants.
\catcode32 = 10
%
% Ignore braces, too, so mismatched braces don't cause trouble.
\catcode`\{ = 9
\catcode`\} = 9
%
% And now expand that command.
\doignoretext
}
@ -850,7 +862,7 @@ where each line of input produces a line of output.}
\pretolerance = 10000
%
% Do not execute instructions in @tex
\def\tex{\doignore{tex}}
\def\tex{\doignore{tex}}%
}
% @set VAR sets the variable VAR to an empty value.
@ -926,11 +938,16 @@ where each line of input produces a line of output.}
\def\ifclearfail{\nestedignore{ifclear}}
\defineunmatchedend{ifclear}
% @iftex always succeeds; we read the text following, through @end
% iftex). But `@end iftex' should be valid only after an @iftex.
% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
% following, through the first @end iftex (etc.). Make `@end iftex'
% (etc.) valid only after an @iftex.
%
\def\iftex{\conditionalsucceed{iftex}}
\def\ifnothtml{\conditionalsucceed{ifnothtml}}
\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
\defineunmatchedend{iftex}
\defineunmatchedend{ifnothtml}
\defineunmatchedend{ifnotinfo}
% We can't just want to start a group at @iftex (for example) and end it
% at @end iftex, since then @set commands inside the conditional have no
@ -1006,6 +1023,15 @@ where each line of input produces a line of output.}
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
%
% If texinfo.cnf is present on the system, read it.
% Useful for site-wide @afourpaper, etc.
% Just to be on the safe side, close the input stream before the \input.
\openin 1 texinfo.cnf
\ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
\closein1
\temp
%
\comment % Ignore the actual filename.
}
@ -1041,8 +1067,9 @@ where each line of input produces a line of output.}
% We don't need math for this one.
\def\ttsl{\tenttsl}
%% Try out Computer Modern fonts at \magstephalf
\let\mainmagstep=\magstephalf
% Use Computer Modern fonts at \magstephalf (11pt).
\newcount\mainmagstep
\mainmagstep=\magstephalf
% Set the font macro #1 to the font named #2, adding on the
% specified font prefix (normally `cm').
@ -1114,13 +1141,26 @@ where each line of input produces a line of output.}
\font\indi=cmmi9
\font\indsy=cmsy9
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
\setfont\titleit\itbshape{10}{\magstep4}
\setfont\titlesl\slbshape{10}{\magstep4}
\setfont\titlett\ttbshape{12}{\magstep3}
\setfont\titlettsl\ttslshape{10}{\magstep4}
\setfont\titlesf\sfbshape{17}{\magstep1}
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\def\authorrm{\secrm}
% Chapter (and unnumbered) fonts (17.28pt).
\setfont\chaprm\rmbshape{12}{\magstep2}
\setfont\chapit\itbshape{10}{\magstep3}
\setfont\chapsl\slbshape{10}{\magstep3}
\setfont\chaptt\ttbshape{12}{\magstep2}
\setfont\chapttsl\ttslshape{10}{\magstep3}
\setfont\chapsf\sfbshape{12}{\magstep2}
\setfont\chapsf\sfbshape{17}{1000}
\let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3}
\font\chapi=cmmi12 scaled \magstep2
@ -1157,19 +1197,15 @@ where each line of input produces a line of output.}
\setfont\ssecit\itbshape{10}{1315}
\setfont\ssecsl\slbshape{10}{1315}
\setfont\ssectt\ttbshape{12}{\magstephalf}
\setfont\ssecttsl\ttslshape{10}{\magstep1}
\setfont\ssecttsl\ttslshape{10}{1315}
\setfont\ssecsf\sfbshape{12}{\magstephalf}
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{\magstep1}
\font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled \magstep1
\font\ssecsy=cmsy10 scaled 1315
% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
% but that is not a standard magnification.
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
\let\authorrm = \secrm
% In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. Since
% texinfo doesn't allow for producing subscripts and superscripts, we
@ -1194,6 +1230,13 @@ where each line of input produces a line of output.}
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
\resetmathfonts}
\def\titlefonts{%
\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl
\resetmathfonts \setleading{25pt}}
\def\titlefont#1{{\titlefonts #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
@ -1330,18 +1373,56 @@ where each line of input produces a line of output.}
% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.
%
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
% `example' (@kbd uses ttsl only inside of @example and friends),
% or `code' (@kbd uses normal tty font always).
\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
\def\kbdinputstylexxx#1{%
\def\arg{#1}%
\ifx\arg\worddistinct
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
\else\ifx\arg\wordexample
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\arg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
\fi\fi\fi
}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordcode{code}
% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
% the catcodes are wrong for parsearg to work.)
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
\def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
\else{\tclose{\ttsl\look}}\fi
\else{\tclose{\ttsl\look}}\fi}
\else{\tclose{\kbdfont\look}}\fi
\else{\tclose{\kbdfont\look}}\fi}
% @url. Quotes do not seem necessary, so use \code.
\let\url=\code
% @uref (abbreviation for `urlref') takes an optional second argument
% specifying the text to display. First (mandatory) arg is the url.
% Perhaps eventually put in a hypertex \special here.
%
\def\uref#1{\urefxxx #1,,\finish}
\def\urefxxx#1,#2,#3\finish{%
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\unhbox0\ (\code{#1})%
\else
\code{#1}%
\fi
}
% @url, @email. Quotes do not seem necessary.
\let\url=\code % perhaps include a hypertex \special eventually
% rms does not like the angle brackets --karl, 17may97.
% So now @email is just like @uref.
%\def\email#1{$\langle${\tt #1}$\rangle$}
\let\email=\code
\let\email=\uref
% Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and
@ -1378,8 +1459,6 @@ where each line of input produces a line of output.}
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
% First the title page. Must do @settitle before @titlepage.
\def\titlefont#1{{\titlerm #1}}
\newif\ifseenauthor
\newif\iffinishedtitlepage
@ -1401,7 +1480,7 @@ where each line of input produces a line of output.}
%
% Now you can print the title using @title.
\def\title{\parsearg\titlezzz}%
\def\titlezzz##1{\leftline{\titlefont{##1}}
\def\titlezzz##1{\leftline{\titlefonts\rm ##1}
% print a rule at the page bottom also.
\finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
@ -1490,10 +1569,7 @@ where each line of input produces a line of output.}
\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
@ -1501,12 +1577,15 @@ where each line of input produces a line of output.}
\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
%
% Leave some space for the footline. Hopefully ok to assume
% @evenfooting will not be used by itself.
\global\advance\pageheight by -\baselineskip
\global\advance\vsize by -\baselineskip
}
\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
%
}% unbind the catcode of @.
@ -1890,7 +1969,7 @@ July\or August\or September\or October\or November\or December\fi
\def\itemizeitem{%
\advance\itemno by 1
{\let\par=\endgraf \smallbreak}%
\ifhmode \errmessage{\in hmode at itemizeitem}\fi
\ifhmode \errmessage{In hmode at itemizeitem}\fi
{\parskip=0in \hskip 0pt
\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
\vadjust{\penalty 1200}}%
@ -2230,7 +2309,13 @@ width0pt\relax} \fi
%\def\char{\realbackslash char}%
\def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots }%
\def\copyright{\realbackslash copyright }%
\def\result{\realbackslash result}%
\def\equiv{\realbackslash equiv}%
\def\expansion{\realbackslash expansion}%
\def\print{\realbackslash print}%
\def\error{\realbackslash error}%
\def\point{\realbackslash point}%
\def\copyright{\realbackslash copyright}%
\def\tclose##1{\realbackslash tclose {##1}}%
\def\code##1{\realbackslash code {##1}}%
\def\dotless##1{\realbackslash dotless {##1}}%
@ -2248,6 +2333,7 @@ width0pt\relax} \fi
\def\kbd##1{\realbackslash kbd {##1}}%
\def\dfn##1{\realbackslash dfn {##1}}%
\def\emph##1{\realbackslash emph {##1}}%
\def\value##1{\realbackslash value {##1}}%
\unsepspaces
}
@ -2682,6 +2768,12 @@ width0pt\relax} \fi
\def\print{\realbackslash print}%
\def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots}%
\def\result{\realbackslash result}%
\def\equiv{\realbackslash equiv}%
\def\expansion{\realbackslash expansion}%
\def\print{\realbackslash print}%
\def\error{\realbackslash error}%
\def\point{\realbackslash point}%
\def\copyright{\realbackslash copyright}%
\def\tt{\realbackslash tt}%
\def\bf{\realbackslash bf}%
@ -3208,7 +3300,9 @@ width0pt\relax} \fi
\unnumbchapmacro{#1}\def\thischapter{}%
\begingroup % Set up to handle contents files properly.
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
% We can't do this, because then an actual ^ in a section
% title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
%\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
\raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
}
@ -3563,11 +3657,12 @@ width0pt\relax} \fi
%
\def\nonfillfinish{\afterenvbreak\endgroup}%
% This macro is
\def\lisp{\begingroup
\nonfillstart
\let\Elisp = \nonfillfinish
\tt
% Make @kbd do something special, if requested.
\let\kbdfont\kbdexamplefont
\rawbackslash % have \ input char produce \ char from current font
\gobble
}
@ -3685,16 +3780,17 @@ width0pt\relax} \fi
% Definitions of (, ) and & used in args for functions.
% This is the definition of ( outside of all parentheses.
\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
\global\advance\parencount by 1 }
\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
\global\advance\parencount by 1
}
%
% This is the definition of ( when already inside a level of parens.
\gdef\opnested{\char`\(\global\advance\parencount by 1 }
%
\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
% also in that case restore the outer-level definition of (.
\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
\global\advance \parencount by -1 }
% also in that case restore the outer-level definition of (.
\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
\global\advance \parencount by -1 }
% If we encounter &foo, then turn on ()-hacking afterwards
\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
%
@ -3702,8 +3798,11 @@ width0pt\relax} \fi
} % End of definition inside \activeparens
%% These parens (in \boldbrax) actually are a little bolder than the
%% contained text. This is especially needed for [ and ]
\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
\def\ampnr{\&}
\def\lbrb{{\bf\char`\[}}
\def\rbrb{{\bf\char`\]}}
% First, defname, which formats the header line itself.
% #1 should be the function name.
@ -3880,7 +3979,7 @@ width0pt\relax} \fi
\hyphenchar\tensl=0
#1%
\hyphenchar\tensl=45
\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
@ -3981,6 +4080,7 @@ width0pt\relax} \fi
\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
% @defmethod, and so on
@ -3996,6 +4096,16 @@ width0pt\relax} \fi
\defunargs {#3}\endgroup %
}
% @deftypemethod foo-class return-type foo-method args
%
\def\deftypemethod{%
\defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
%
% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
\def\deftypemethodheader#1#2#3#4{%
\deftypefnheaderx{Method on #1}{#2}#3 #4\relax
}
% @defmethod == @defop Method
\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
@ -4288,29 +4398,27 @@ width0pt\relax} \fi
% Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup
\catcode`\^^@=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\^^A=\other
\catcode`\^^B=\other
\catcode`\^^C=\other
\catcode`\^^D=\other
\catcode`\^^E=\other
\catcode`\^^F=\other
\catcode`\^^G=\other
\catcode`\^^H=\other
\catcode`\ =\other
\catcode`\^^K=\other
\catcode`\^^L=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode`\=\other
\catcode26=\other
\catcode`\^^N=\other
\catcode`\^^P=\other
\catcode`\^^Q=\other
\catcode`\^^R=\other
\catcode`\^^S=\other
\catcode`\^^T=\other
\catcode`\^^U=\other
\catcode`\^^V=\other
\catcode`\^^W=\other
\catcode`\^^X=\other
\catcode`\^^Z=\other
\catcode`\^^[=\other
\catcode`\^^\=\other
\catcode`\^^]=\other
@ -4388,7 +4496,7 @@ width0pt\relax} \fi
% space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 }
% @footnotestyle is meaningful for info output only..
% @footnotestyle is meaningful for info output only.
\let\footnotestyle=\comment
\let\ptexfootnote=\footnote
@ -4503,9 +4611,51 @@ width0pt\relax} \fi
%
\def\finalout{\overfullrule=0pt}
% @image. We use the macros from epsf.tex to support this.
% If epsf.tex is not installed and @image is used, we complain.
%
% Check for and read epsf.tex up front. If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
\openin 1 = xepsf.tex
\ifeof 1 \else
\closein 1
\def\epsfannounce{\toks0 = }% do not bother showing banner
\input epsf.tex
\fi
%
\newif\ifwarnednoepsf
\newhelp\noepsfhelp{epsf.tex must be installed for images to
work. It is also included in the Texinfo distribution, or you can get
it from ftp://ftp.tug.org/tex/epsf.tex.}
%
% Only complain once about lack of epsf.tex.
\def\image#1{%
\ifx\epsfbox\undefined
\ifwarnednoepsf \else
\errhelp = \noepsfhelp
\errmessage{epsf.tex not found, images will be ignored}%
\global\warnednoepsftrue
\fi
\else
\imagexxx #1,,,\finish
\fi
}
%
% Arguments to @image:
% #1 is (mandatory) image filename; we tack on .eps extension.
% #2 is (optional) width, #3 is (optional) height.
% #4 is just the usual extra ignored arg for parsing this stuff.
\def\imagexxx#1,#2,#3,#4\finish{%
% \epsfbox itself resets \epsf?size at each figure.
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
\epsfbox{#1.eps}%
}
% End of control word definitions.
\message{and turning on texinfo input format.}
\def\openindices{%

View File

@ -182,17 +182,25 @@ extern int matherr __P ((struct exception *));
#define M_SQRT2 _Mldbl(1.41421356237309504880) /* sqrt(2) */
#define M_SQRT1_2 _Mldbl(0.70710678118654752440) /* 1/sqrt(2) */
#endif
/* Our constants might specify more precision than `double' can represent.
Use `long double' constants in standard and GNU C, where they are
supported and the cast to `double'. */
supported and the cast to `double'.
If the constants are use in code which does not use prototypes, one
might get problems if a function takes a `double' argument and any
of the constants are provided as the argument. In this case, cast
the argument to `double'.
Please note we define the macro even if the constants are not defined.
This helps us to use the macros in other places. */
#if __STDC__ - 0 || __GNUC__ - 0
#define _Mldbl(x) x##L
#else /* Traditional C. */
#define _Mldbl(x) x
#endif /* Standard or GNU C. */
#endif
/* Get machine-dependent inline versions (if there are any). */
#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \

View File

@ -32,6 +32,11 @@ extra-libs-others := $(extra-libs)
md5-routines := crypt-entry md5-crypt md5
libcrypt-routines := $(md5-routines)
libcrypt-map := libcrypt.map
onlymd5-routines := onlymd5-entry md5-crypt md5
distribute += onlymd5-entry.c
extra-objs := onlymd5-entry.o
include ../Makeconfig
@ -41,6 +46,8 @@ ifeq ($(crypt-in-libc),yes)
routines += $(libcrypt-routines)
endif
$(objpfx)md5test: $(objpfx)md5.o
include ../Rules
ifeq ($(build-shared),yes)
@ -60,7 +67,7 @@ endif
define o-iterator-doit
$(objpfx)$(patsubst %,$(libtype$o),md5crypt): \
$(md5-routines:%=$(objpfx)%$o); $$(build-extra-lib)
$(onlymd5-routines:%=$(objpfx)%$o); $$(build-extra-lib)
endef
object-suffixes-left = $(object-suffixes)
include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes))
@ -69,3 +76,4 @@ include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes))
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
$(objpfx)libcrypt.so: $(common-objpfx)libc.so
$(objpfx)libmd5crypt.so: $(common-objpfx)libc.so

View File

@ -1,22 +1,22 @@
/* md5-crypt - One way encryption based on MD5 sum.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
/* One way encryption based on MD5 sum.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 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 <errno.h>
#include <stdlib.h>
@ -37,8 +37,11 @@ static const char b64t[64] =
/* Prototypes for local functions. */
extern char *md5_crypt_r __P ((const char *key, const char *salt, char *buffer,
int buflen));
extern char *__md5_crypt_r __P ((const char *key, const char *salt,
char *buffer, int buflen));
extern char *md5_crypt_r __P ((const char *key, const char *salt,
char *buffer, int buflen));
extern char *__md5_crypt __P ((const char *key, const char *salt));
extern char *md5_crypt __P ((const char *key, const char *salt));
@ -46,7 +49,7 @@ extern char *md5_crypt __P ((const char *key, const char *salt));
/* This entry point is equivalent to the `crypt' function in Unix
libcs. */
char *
md5_crypt_r (key, salt, buffer, buflen)
__md5_crypt_r (key, salt, buffer, buflen)
const char *key;
const char *salt;
char *buffer;
@ -155,10 +158,10 @@ md5_crypt_r (key, salt, buffer, buflen)
/* Now we can construct the result string. It consists of three
parts. */
cp = stpncpy (buffer, md5_salt_prefix, MAX (0, buflen));
cp = __stpncpy (buffer, md5_salt_prefix, MAX (0, buflen));
buflen -= sizeof (md5_salt_prefix);
cp = stpncpy (cp, salt, MIN ((size_t) buflen, salt_len));
cp = __stpncpy (cp, salt, MIN ((size_t) buflen, salt_len));
buflen -= MIN ((size_t) buflen, salt_len);
if (buflen > 0)
@ -201,10 +204,11 @@ md5_crypt_r (key, salt, buffer, buflen)
return buffer;
}
weak_alias (__md5_crypt_r, md5_crypt_r)
char *
md5_crypt (key, salt)
__md5_crypt (key, salt)
const char *key;
const char *salt;
{
@ -222,5 +226,6 @@ md5_crypt (key, salt)
return NULL;
}
return md5_crypt_r (key, salt, buffer, buflen);
return __md5_crypt_r (key, salt, buffer, buflen);
}
weak_alias (__md5_crypt, md5_crypt)

View File

@ -0,0 +1 @@
#include <sysdeps/generic/crypt-entry.c>

View File

@ -38,9 +38,12 @@
for the here included function is weird (this really is a harmless
word).
The user has to provide five macros before this header file can be
The user has to provide six macros before this header file can be
included:
INIT Declarations vor variables which can be used by the
other macros.
GETC() Return the value of the next character in the regular
expression pattern. Successive calls should return
successive characters.
@ -98,9 +101,10 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof)
{
char *__input_buffer = NULL;
size_t __input_size = 0;
size_t __current_size;
size_t __current_size = 0;
int __ch;
int __error;
INIT
/* Align the expression buffer according to the needs for an object
of type `regex_t'. Then check for minimum size of the buffer for
@ -191,7 +195,7 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof)
}
/* Everything is ok. */
RETURN ((char *) (__expr_ptr->buffer + __expr->used));
RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used));
}
#endif

View File

@ -59,7 +59,7 @@ ttyslot()
setttyent();
for (cnt = 0; cnt < 3; ++cnt)
if (__ttyname_r (cnt, name, buflen) >= 0) {
if (__ttyname_r (cnt, name, buflen) == 0) {
if (p = rindex(name, '/'))
++p;
else

View File

@ -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 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
@ -18,6 +18,7 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <fcntl.h>
#include <nss.h>
#include <grp.h>
#include <ctype.h>
@ -86,6 +87,26 @@ internal_setgrent (ent_t *ent)
if (ent->stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl (fileno (ent->stream), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl (fileno (ent->stream), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
fclose (ent->stream);
ent->stream = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
else
rewind (ent->stream);

View File

@ -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 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
@ -20,6 +20,7 @@
#include <nss.h>
#include <pwd.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <netdb.h>
#include <string.h>
@ -202,6 +203,26 @@ internal_setpwent (ent_t *ent)
if (ent->stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl (fileno (ent->stream), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl (fileno (ent->stream), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
fclose (ent->stream);
ent->stream = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
else
rewind (ent->stream);

View File

@ -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 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
@ -19,6 +19,7 @@
#include <nss.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <netdb.h>
#include <shadow.h>
@ -147,6 +148,26 @@ internal_setspent (ent_t *ent)
if (ent->stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl (fileno (ent->stream), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl (fileno (ent->stream), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
fclose (ent->stream);
ent->stream = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
else
rewind (ent->stream);

View File

@ -159,7 +159,8 @@
}
}
if (isxdigit (name[0]) || name[0] == ':')
if ((isxdigit (name[0]) && strchr (name, ':') != NULL)
|| name[0] == ':')
{
const char *cp;
char *hostname;
@ -238,8 +239,6 @@
{
if (*--cp == '.')
break;
if (!strchr (name, ':'))
break;
/* All-IPv6-legal, no dot at the end. Fake up a
hostent as if we'd actually done a lookup. */

View File

@ -140,5 +140,5 @@ done:
return status == NSS_STATUS_SUCCESS ? 0 : -1;
}
#define do_weak_alias(n1, n2) weak_alias ((n1), (n2))
#define do_weak_alias(n1, n2) weak_alias (n1, (n2))
do_weak_alias (INTERNAL (REENTRANT_NAME), REENTRANT_NAME)

View File

@ -1,5 +1,5 @@
/* Common code for DB-based databases in nss_db module.
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
@ -66,7 +66,27 @@ internal_setent (int stayopen)
db = dbopen (DBFILE, O_RDONLY, 0, DB_BTREE, NULL);
if (db == NULL)
status = NSS_STATUS_UNAVAIL;
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl ((*db->fd) (db), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl ((*db->fd) (db), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
(*db->close) (db);
db = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
/* Remember STAYOPEN flag. */

View File

@ -1,5 +1,5 @@
/* Mail alias file parser in nss_db module.
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 <drepper@cygnus.com>, 1996.
@ -50,7 +50,27 @@ internal_setent (int stayopen)
db = dbopen (_PATH_VARDB "aliases.db", O_RDONLY, 0, DB_BTREE, NULL);
if (db == NULL)
status = NSS_STATUS_UNAVAIL;
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl ((*db->fd) (db), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl ((*db->fd) (db), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
(*db->close) (db);
db = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
/* Remember STAYOPEN flag. */

View File

@ -53,6 +53,26 @@ _nss_db_setnetgrent (const char *group)
if (db == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl ((*db->fd) (db), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl ((*db->fd) (db), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
(*db->close) (db);
db = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
if (status == NSS_STATUS_SUCCESS)

View File

@ -19,6 +19,7 @@
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
#include <assert.h>
#include <errno.h>
#include <libc-lock.h>
@ -71,7 +72,27 @@ internal_setent (int stayopen)
stream = fopen (DATAFILE, "r");
if (stream == NULL)
status = NSS_STATUS_UNAVAIL;
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl (fileno (stream), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl (fileno (stream), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
fclose (stream);
stream = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
else
rewind (stream);

View File

@ -1,5 +1,5 @@
/* Mail alias file parser in nss_files module.
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 <drepper@cygnus.com>, 1996.
@ -21,6 +21,7 @@
#include <aliases.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <libc-lock.h>
#include <stdlib.h>
#include <stdio.h>
@ -48,7 +49,27 @@ internal_setent (void)
stream = fopen ("/etc/aliases", "r");
if (stream == NULL)
status = NSS_STATUS_UNAVAIL;
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
else
{
/* We have to make sure the file is `closed on exec'. */
int result, flags;
result = flags = fcntl (fileno (stream), F_GETFD, 0);
if (result >= 0)
{
flags |= FD_CLOEXEC;
result = fcntl (fileno (stream), F_SETFD, flags);
}
if (result < 0)
{
/* Something went wrong. Close the stream and return a
failure. */
fclose (stream);
stream = NULL;
status = NSS_STATUS_UNAVAIL;
}
}
}
else
rewind (stream);

View File

@ -26,7 +26,6 @@
/* Get implementation for some internal functions. */
#include "../resolv/mapv4v6addr.h"
#include "../resolv/mapv4v6hostent.h"
#define ENTNAME hostent
@ -51,13 +50,7 @@ LINE_PARSER
STRING_FIELD (addr, isspace, 1);
/* Parse address. */
if ((_res.options & RES_USE_INET6)
&& inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
{
result->h_addrtype = AF_INET6;
result->h_length = IN6ADDRSZ;
}
else if (inet_pton (AF_INET, addr, entdata->host_addr) > 0)
if (inet_pton (AF_INET, addr, entdata->host_addr) > 0)
{
if (_res.options & RES_USE_INET6)
{
@ -72,6 +65,11 @@ LINE_PARSER
result->h_length = INADDRSZ;
}
}
else if (inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
{
result->h_addrtype = AF_INET6;
result->h_length = IN6ADDRSZ;
}
else
/* Illegal address: ignore line. */
return 0;
@ -81,22 +79,18 @@ LINE_PARSER
entdata->h_addr_ptrs[1] = NULL;
result->h_addr_list = entdata->h_addr_ptrs;
/* If we need the host entry in IPv6 form change it now. */
if (_res.options & RES_USE_INET6)
{
char *bufptr = data->linebuffer;
int buflen = (char *) data + datalen - bufptr;
map_v4v6_hostent (result, &bufptr, &buflen);
}
STRING_FIELD (result->h_name, isspace, 1);
})
#include "files-XXX.c"
DB_LOOKUP (hostbyname, ,,
LOOKUP_NAME (h_name, h_aliases),
const char *name)
{
if (result->h_addrtype != ((_res.options & RES_USE_INET6)
? AF_INET6 : AF_INET))
continue;
LOOKUP_NAME (h_name, h_aliases)
}, const char *name)
DB_LOOKUP (hostbyname2, ,,
{

View File

@ -1,5 +1,5 @@
/* Netgroup file parser in nss_files modules.
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 <drepper@cygnus.com>, 1996.
@ -170,8 +170,7 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
/* Some sanity checks. */
if (cp == NULL)
/* User bug. setnetgrent() wasn't called before. */
abort ();
return NSS_STATUS_NOTFOUND;
/* First skip leading spaces. */
while (isspace (*cp))

763
po/ko.po

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,20 @@
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
/* Copyright (C) 1991, 1992, 1995, 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 <unistd.h>
#include <stdarg.h>
@ -116,6 +116,7 @@ execvp (file, argv)
that we did find one but were denied access. */
got_eacces = 1;
case ENOENT:
case ESTALE:
/* Those errors indicate the file is missing or not executable
by us, in which case we want to just try the next path
directory. */

View File

@ -1 +1 @@
BIND-4.9.5-P1
BIND-4.9.6-T1A

View File

@ -281,7 +281,12 @@ b64_pton(src, target, targsize)
case 2: /* Valid, means one byte of info */
/* Skip any number of spaces. */
#ifdef _LIBC
/* To avoid warnings. */
for ( ; ch != '\0'; ch = *src++)
#else
for (NULL; ch != '\0'; ch = *src++)
#endif
if (!isspace(ch))
break;
/* Make sure there is another trailing = sign. */
@ -296,7 +301,12 @@ b64_pton(src, target, targsize)
* We know this char is an =. Is there anything but
* whitespace after it?
*/
#ifdef _LIBC
/* To avoid warnings. */
for ( ; ch != '\0'; ch = *src++)
#else
for (NULL; ch != '\0'; ch = *src++)
#endif
if (!isspace(ch))
return (-1);

View File

@ -123,6 +123,12 @@ static void addrsort __P((char **, int));
#define MAXPACKET 1024
#endif
/* As per RFC 1034 and 1035 a host name cannot exceed 255 octets in length. */
#ifdef MAXHOSTNAMELEN
# undef MAXHOSTNAMELEN
#endif
#define MAXHOSTNAMELEN 256
typedef union {
HEADER hdr;
u_char buf[MAXPACKET];
@ -212,6 +218,10 @@ getanswer(answer, anslen, qname, qtype)
* (i.e., with the succeeding search-domain tacked on).
*/
n = strlen(bp) + 1; /* for the \0 */
if (n >= MAXHOSTNAMELEN) {
__set_h_errno (NO_RECOVERY);
return (NULL);
}
host.h_name = bp;
bp += n;
buflen -= n;
@ -256,11 +266,15 @@ getanswer(answer, anslen, qname, qtype)
/* Store alias. */
*ap++ = bp;
n = strlen(bp) + 1; /* for the \0 */
if (n >= MAXHOSTNAMELEN) {
had_error++;
continue;
}
bp += n;
buflen -= n;
/* Get canonical name. */
n = strlen(tbuf) + 1; /* for the \0 */
if (n > buflen) {
if (n > buflen || n >= MAXHOSTNAMELEN) {
had_error++;
continue;
}
@ -272,14 +286,14 @@ getanswer(answer, anslen, qname, qtype)
}
if (qtype == T_PTR && type == T_CNAME) {
n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
if ((n < 0) || !res_hnok(tbuf)) {
if (n < 0 || !res_hnok(tbuf)) {
had_error++;
continue;
}
cp += n;
/* Get canonical name. */
n = strlen(tbuf) + 1; /* for the \0 */
if (n > buflen) {
if (n > buflen || n >= MAXHOSTNAMELEN) {
had_error++;
continue;
}
@ -320,6 +334,10 @@ getanswer(answer, anslen, qname, qtype)
n = -1;
if (n != -1) {
n = strlen(bp) + 1; /* for the \0 */
if (n >= MAXHOSTNAMELEN) {
had_error++;
break;
}
bp += n;
buflen -= n;
}
@ -328,6 +346,10 @@ getanswer(answer, anslen, qname, qtype)
host.h_name = bp;
if (_res.options & RES_USE_INET6) {
n = strlen(bp) + 1; /* for the \0 */
if (n >= MAXHOSTNAMELEN) {
had_error++;
break;
}
bp += n;
buflen -= n;
map_v4v6_hostent(&host, &bp, &buflen);
@ -395,8 +417,8 @@ getanswer(answer, anslen, qname, qtype)
# endif /*RESOLVSORT*/
if (!host.h_name) {
n = strlen(qname) + 1; /* for the \0 */
if (n > buflen)
goto try_again;
if (n > buflen || n >= MAXHOSTNAMELEN)
goto no_recovery;
strcpy(bp, qname);
host.h_name = bp;
bp += n;
@ -407,8 +429,8 @@ getanswer(answer, anslen, qname, qtype)
__set_h_errno (NETDB_SUCCESS);
return (&host);
}
try_again:
__set_h_errno (TRY_AGAIN);
no_recovery:
__set_h_errno (NO_RECOVERY);
return (NULL);
}
@ -508,13 +530,12 @@ gethostbyname2(name, af)
if (!isdigit(*cp) && *cp != '.')
break;
}
if (isxdigit(name[0]) || name[0] == ':')
if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')
break;
if (!strchr (name, ':'))
break;
/*
* All-IPv6-legal, no dot at the end.
* Fake up a hostent as if we'd actually
@ -719,8 +740,7 @@ _gethtent()
if (!(cp = strpbrk(p, " \t")))
goto again;
*cp++ = '\0';
if ((_res.options & RES_USE_INET6) &&
inet_pton(AF_INET6, p, host_addr) > 0) {
if (inet_pton(AF_INET6, p, host_addr) > 0) {
af = AF_INET6;
len = IN6ADDRSZ;
} else if (inet_pton(AF_INET, p, host_addr) > 0) {
@ -757,12 +777,6 @@ _gethtent()
*cp++ = '\0';
}
*q = NULL;
if (_res.options & RES_USE_INET6) {
char *bp = hostbuf;
int buflen = sizeof hostbuf;
map_v4v6_hostent(&host, &bp, &buflen);
}
__set_h_errno (NETDB_SUCCESS);
return (&host);
}

View File

@ -166,7 +166,7 @@ inet_net_pton_ipv4(src, dst, size)
goto emsgsize;
}
/* Fiery death and destruction unless we prefetched EOS. */
/* Firey death and destruction unless we prefetched EOS. */
if (ch != '\0')
goto enoent;

View File

@ -99,6 +99,11 @@
#else
# define MAXPACKET 1024
#endif
/* As per RFC 1034 and 1035 a host name cannot exceed 255 octets in length. */
#ifdef MAXHOSTNAMELEN
# undef MAXHOSTNAMELEN
#endif
#define MAXHOSTNAMELEN 256
static const char AskedForGot[] = "\
gethostby*.getanswer: asked for \"%s\", got \"%s\"";
@ -197,8 +202,8 @@ _nss_dns_gethostbyaddr_r (const char *addr, int len, int af,
int size, n, status;
if (af == AF_INET6 && len == IN6ADDRSZ &&
(bcmp (uaddr, mapped, sizeof mapped) == 0
|| bcmp (uaddr, tunnelled, sizeof tunnelled) == 0))
(memcmp (uaddr, mapped, sizeof mapped) == 0
|| memcmp (uaddr, tunnelled, sizeof tunnelled) == 0))
{
/* Unmap. */
addr += sizeof mapped;
@ -260,7 +265,7 @@ _nss_dns_gethostbyaddr_r (const char *addr, int len, int af,
result->h_addrtype = af;
result->h_length = len;
bcopy (addr, host_data->host_addr, len);
memcpy (host_data->host_addr, addr, len);
host_data->h_addr_ptrs[0] = (char *) host_data->host_addr;
host_data->h_addr_ptrs[1] = NULL;
if (af == AF_INET && (_res.options & RES_USE_INET6))
@ -342,6 +347,11 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
* (i.e., with the succeeding search-domain tacked on).
*/
n = strlen (bp) + 1; /* for the \0 */
if (n >= MAXHOSTNAMELEN)
{
__set_h_errno (NO_RECOVERY);
return NSS_STATUS_TRYAGAIN;
}
result->h_name = bp;
bp += n;
linebuflen -= n;
@ -396,11 +406,16 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
/* Store alias. */
*ap++ = bp;
n = strlen (bp) + 1; /* For the \0. */
if (n >= MAXHOSTNAMELEN)
{
++had_error;
continue;
}
bp += n;
linebuflen -= n;
/* Get canonical name. */
n = strlen (tbuf) + 1; /* For the \0. */
if (n > buflen)
if ((size_t) n > buflen || n >= MAXHOSTNAMELEN)
{
++had_error;
continue;
@ -423,7 +438,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
cp += n;
/* Get canonical name. */
n = strlen (tbuf) + 1; /* For the \0. */
if (n > buflen)
if ((size_t) n > buflen || n >= MAXHOSTNAMELEN)
{
++had_error;
continue;
@ -469,6 +484,11 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
if (n != -1)
{
n = strlen (bp) + 1; /* for the \0 */
if (n >= MAXHOSTNAMELEN)
{
++had_error;
break;
}
bp += n;
linebuflen -= n;
}
@ -478,6 +498,11 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
if (_res.options & RES_USE_INET6)
{
n = strlen (bp) + 1; /* for the \0 */
if (n >= MAXHOSTNAMELEN)
{
++had_error;
break;
}
bp += n;
linebuflen -= n;
map_v4v6_hostent (result, &bp, &linebuflen);
@ -520,7 +545,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
cp += n;
continue;
}
bcopy (cp, *hap++ = bp, n);
memcpy (*hap++ = bp, cp, n);
bp += n;
cp += n;
linebuflen -= n;
@ -549,8 +574,8 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
if (result->h_name == NULL)
{
n = strlen (qname) + 1; /* For the \0. */
if (n > linebuflen)
goto try_again;
if (n > linebuflen || n >= MAXHOSTNAMELEN)
goto no_recovery;
strcpy (bp, qname); /* Cannot overflow. */
result->h_name = bp;
bp += n;
@ -562,7 +587,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
*h_errnop = NETDB_SUCCESS;
return NSS_STATUS_SUCCESS;
}
try_again:
*h_errnop = TRY_AGAIN;
no_recovery:
*h_errnop = NO_RECOVERY;
return NSS_STATUS_TRYAGAIN;
}

View File

@ -94,7 +94,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
register char *dn;
register int n, c;
char *eom;
int len = -1, checked = 0;
int len = -1, checked = 0, octets = 0;
dn = exp_dn;
cp = comp_dn;
@ -108,6 +108,9 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
*/
switch (n & INDIR_MASK) {
case 0:
octets += (n + 1);
if (octets > MAXCDNAME)
return (-1);
if (dn != exp_dn) {
if (dn >= eom)
return (-1);
@ -179,6 +182,8 @@ dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
dn = (u_char *)exp_dn;
cp = comp_dn;
if (length > MAXCDNAME)
length = MAXCDNAME;
eob = cp + length;
lpp = cpp = NULL;
if (dnptrs != NULL) {

View File

@ -1146,40 +1146,47 @@ static u_int8_t
precsize_aton(strptr)
char **strptr;
{
unsigned int mval = 0, cmval = 0;
u_int8_t retval = 0;
register char *cp;
register int exponent;
register int mantissa;
char *cp;
int exponent = 0;
int mantissa = 0;
cp = *strptr;
while (isdigit(*cp)) {
if (mantissa == 0)
mantissa = *cp - '0';
else
exponent++;
cp++;
}
while (isdigit(*cp))
mval = mval * 10 + (*cp++ - '0');
if (*cp == '.') { /* centimeters */
if (*cp == '.') {
cp++;
if (isdigit(*cp)) {
cmval = (*cp++ - '0') * 10;
if (mantissa == 0)
mantissa = *cp - '0';
else
exponent++;
cp++;
if (isdigit(*cp)) {
cmval += (*cp++ - '0');
if (mantissa == 0)
mantissa = *cp - '0';
else
exponent++;
cp++;
}
else
exponent++;
}
}
cmval = (mval * 100) + cmval;
for (exponent = 0; exponent < 9; exponent++)
if (cmval < poweroften[exponent+1])
break;
mantissa = cmval / poweroften[exponent];
if (mantissa > 9)
mantissa = 9;
else
exponent += 2;
if (mantissa == 0)
exponent = 0;
retval = (mantissa << 4) | exponent;
*strptr = cp;
return (retval);
}

View File

@ -159,7 +159,7 @@ res_init()
register FILE *fp;
register char *cp, **pp;
register int n;
char buf[BUFSIZ];
char buf[MAXDNAME];
int nserv = 0; /* number of nameserver records read from file */
int haveenv = 0;
int havesearch = 0;

View File

@ -601,6 +601,11 @@ read_len:
if ((long) timeout.tv_sec <= 0)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
if (s+1 > FD_SETSIZE) {
Perror(stderr, "s+1 > FD_SETSIZE", EMFILE);
res_close();
goto next_ns;
}
wait:
FD_ZERO(&dsmask);
FD_SET(s, &dsmask);

View File

@ -18,6 +18,8 @@
#include <errno.h>
#include <signal.h>
#define __need_NULL
#include <stddef.h>
/* Combine sets LEFT and RIGHT by logical AND and place result in DEST. */
int

View File

@ -18,6 +18,8 @@
#include <errno.h>
#include <signal.h>
#define __need_NULL
#include <stddef.h>
/* Test whether SET is empty. */
int

View File

@ -18,6 +18,8 @@
#include <errno.h>
#include <signal.h>
#define __need_NULL
#include <stddef.h>
/* Combine sets LEFT and RIGHT by logical OR and place result in DEST. */
int

View File

@ -1,5 +1,5 @@
/* Declarations of socket constants, types, and functions.
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
@ -18,8 +18,8 @@
Boston, MA 02111-1307, USA. */
#ifndef _SYS_SOCKET_H
#define _SYS_SOCKET_H 1
#include <features.h>
__BEGIN_DECLS
@ -49,14 +49,14 @@ struct osockaddr
uses with any of the listed types to be allowed without complaint.
G++ 2.7 does not support transparent unions so there we want the
old-style declaration, too. */
#if (!defined (__GNUC__) || __GNUC__ < 2 || defined(__cplusplus) || \
#if (!defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7))
#define __SOCKADDR_ARG struct sockaddr *
#define __CONST_SOCKADDR_ARG __const struct sockaddr *
# define __SOCKADDR_ARG struct sockaddr *
# define __CONST_SOCKADDR_ARG __const struct sockaddr *
#else
/* Add more `struct sockaddr_AF' types here as necessary.
These are all the ones I found on NetBSD and Linux. */
#define __SOCKADDR_ALLTYPES \
# define __SOCKADDR_ALLTYPES \
__SOCKADDR_ONETYPE (sockaddr) \
__SOCKADDR_ONETYPE (sockaddr_at) \
__SOCKADDR_ONETYPE (sockaddr_ax25) \
@ -71,14 +71,14 @@ struct osockaddr
__SOCKADDR_ONETYPE (sockaddr_un) \
__SOCKADDR_ONETYPE (sockaddr_x25)
#define __SOCKADDR_ONETYPE(type) struct type *__##type##__;
# define __SOCKADDR_ONETYPE(type) struct type *__##type##__;
typedef union { __SOCKADDR_ALLTYPES
} __SOCKADDR_ARG __attribute__ ((__transparent_union__));
#undef __SOCKADDR_ONETYPE
#define __SOCKADDR_ONETYPE(type) __const struct type *__##type##__;
# undef __SOCKADDR_ONETYPE
# define __SOCKADDR_ONETYPE(type) __const struct type *__##type##__;
typedef union { __SOCKADDR_ALLTYPES
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
#undef __SOCKADDR_ONETYPE
# undef __SOCKADDR_ONETYPE
#endif
@ -95,20 +95,20 @@ extern int socketpair __P ((int __domain, int __type, int __protocol,
int __fds[2]));
/* Give the socket FD the local address ADDR (which is LEN bytes long). */
extern int bind __P ((int __fd, __CONST_SOCKADDR_ARG __addr, size_t __len));
extern int bind __P ((int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len));
/* Put the local address of FD into *ADDR and its length in *LEN. */
extern int getsockname __P ((int __fd, __SOCKADDR_ARG __addr,
size_t *__len));
socklen_t *__len));
/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
For connectionless socket types, just set the default address to send to
and the only address from which to accept transmissions.
Return 0 on success, -1 for errors. */
extern int __connect __P ((int __fd,
__CONST_SOCKADDR_ARG __addr, size_t __len));
__CONST_SOCKADDR_ARG __addr, socklen_t __len));
extern int connect __P ((int __fd,
__CONST_SOCKADDR_ARG __addr, size_t __len));
__CONST_SOCKADDR_ARG __addr, socklen_t __len));
/* Put the address of the peer connected to socket FD into *ADDR
(which is *LEN bytes long), and its actual length into *LEN. */
@ -130,14 +130,14 @@ extern int recv __P ((int __fd, __ptr_t __buf, size_t __n, int __flags));
ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */
extern int sendto __P ((int __fd, __const __ptr_t __buf, size_t __n,
int __flags, __CONST_SOCKADDR_ARG __addr,
size_t __addr_len));
socklen_t __addr_len));
/* Read N bytes into BUF through socket FD.
If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
the sender, and store the actual size of the address in *ADDR_LEN.
Returns the number of bytes read or -1 for errors. */
extern int recvfrom __P ((int __fd, __ptr_t __buf, size_t __n, int __flags,
__SOCKADDR_ARG __addr, size_t *__addr_len));
__SOCKADDR_ARG __addr, socklen_t *__addr_len));
/* Send a message described MESSAGE on socket FD.
@ -154,13 +154,13 @@ extern int recvmsg __P ((int __fd, struct msghdr *__message, int __flags));
into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
actual length. Returns 0 on success, -1 for errors. */
extern int getsockopt __P ((int __fd, int __level, int __optname,
__ptr_t __optval, size_t *__optlen));
__ptr_t __optval, socklen_t *__optlen));
/* Set socket FD's option OPTNAME at protocol level LEVEL
to *OPTVAL (which is OPTLEN bytes long).
Returns 0 on success, -1 for errors. */
extern int setsockopt __P ((int __fd, int __level, int __optname,
__ptr_t __optval, size_t __optlen));
__ptr_t __optval, socklen_t __optlen));
/* Prepare to accept connections on socket FD.
@ -174,7 +174,7 @@ extern int listen __P ((int __fd, unsigned int __n));
peer and *ADDR_LEN to the address's actual length, and return the
new socket's descriptor, or -1 for errors. */
extern int accept __P ((int __fd, __SOCKADDR_ARG __addr,
size_t *__addr_len));
socklen_t *__addr_len));
/* Shut down all or part of the connection open on socket FD.
HOW determines what to shut down:

View File

@ -7,7 +7,7 @@ DEFUN_VOID(main)
{
FILE *f;
int i;
const char filename[] = "/tmp/bugtest";
const char filename[] = "/tmp/bug3.test";
f = fopen(filename, "w+");
for (i=0; i<9000; i++)

View File

@ -14,7 +14,7 @@ DEFUN(main, (argc, argv),
FILE *f;
int i;
char buffer[31];
const char filename[] = "/tmp/bugtest";
const char filename[] = "/tmp/bug4.test";
while ((i = getopt (argc, argv, "rw")) != -1)
switch (i)

View File

@ -1,5 +1,5 @@
/* Floating point output for `printf'.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@ -812,13 +812,24 @@ __printf_fp (FILE *fp,
{
char *tp = cp;
if (digit == '5')
if (digit == '5' && (*(cp - 1) & 1) == 0)
/* This is the critical case. */
if (fracsize == 1 && frac[0] == 0)
/* Rest of the number is zero -> round to even.
(IEEE 754-1985 4.1 says this is the default rounding.) */
if ((*(cp - 1) & 1) == 0)
goto do_expo;
goto do_expo;
else if (scalesize == 0)
{
/* Here we have to see whether all limbs are zero since no
normalization happened. */
size_t lcnt = fracsize;
while (lcnt >= 1 && frac[lcnt - 1] == 0)
--lcnt;
if (lcnt == 0)
/* Rest of the number is zero -> round to even.
(IEEE 754-1985 4.1 says this is the default rounding.) */
goto do_expo;
}
if (fracdig_no > 0)
{

View File

@ -14,7 +14,7 @@ sprint_double_type sprint_doubles[] =
{
{__LINE__, 30.3, "< +30.3>", "<%+15.10g>"},
{__LINE__, 10.0, "<10.00>", "<%5.2f>"},
{__LINE__, 1.002121970718271e+05, "100212.19707 ", "%0-15.5f"},
{__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%0-15.5f"},
{__LINE__, 1.002121970718271e+05, "000100212.19707", "%015.5f"},
@ -25,7 +25,7 @@ sprint_double_type sprint_doubles[] =
{__LINE__, -1.002121970718271e+05, "-00100212.19707", "% 015.5f"},
{__LINE__, 1.002121970718271e+05, "+100212.19707 ", "%+-15.5f"},
{__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%+-15.5f"},
{__LINE__, -1.002121970718271e+29, "-1.0E+29", "%.1E"},
{__LINE__, -1.002126048612756e-02, "-1.002126E-02", "%+#E"},
{__LINE__, -1.002653755271637e+00, "-1.00265", "%G"},
@ -4005,7 +4005,11 @@ sprint_double_type sprint_doubles[] =
#endif
{__LINE__, 9.978034352999867e+15, "9.978034e+15", "%2.6e"},
{__LINE__, 9.998315286730175e-30, "9.998315e-30", "%6e"},
{__LINE__, 1.25, "1.2", "%.1f"},
{__LINE__, 11.25, "11.2", "%.1f"},
{__LINE__, 1.75, "1.8", "%.1f"},
{__LINE__, 11.75, "11.8", "%.1f"},
{0 }
};

View File

@ -140,5 +140,39 @@ main (int argc, char **argv)
if (out != stdout)
pclose (out);
fputs ("Test 3:\n", out);
{
int res, val, n;
res = sscanf ("-242", "%3o%n", &val, &n);
printf ("res = %d, val = %d, n = %d\n", res, val, n);
if (res != 1 || val != -20 || n != 3)
return 1;
}
fputs ("Test 4:\n", out);
{
double a = 0, b = 0;
int res, n;
res = sscanf ("1234567", "%3lg%3lg%n", &a, &b, &n);
printf ("res = %d, a = %g, b = %g, n = %d\n", res, a, b, n);
if (res != 2 || a != 123 || b != 456 || n != 6)
return 1;
res = sscanf ("0", "%lg", &a);
printf ("res = %d, a = %g\n", res, a);
if (res != 1 || a != 0)
exit (EXIT_FAILURE);
res = sscanf ("1e3", "%lg%n", &a, &n);
printf ("res = %d, a = %g, n = %d\n", res, a, n);
if (res != 1 || a != 1000 || n != 3)
exit (EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}

View File

@ -54,8 +54,10 @@
# undef va_list
# define va_list _IO_va_list
# define ungetc(c, s) (--read_in, _IO_ungetc (c, s))
# define inchar() ((c = _IO_getc_unlocked (s)), (void) ++read_in, c)
# define ungetc(c, s) ((void) ((int) c != EOF && --read_in), \
_IO_ungetc (c, s))
# define inchar() ((c = _IO_getc_unlocked (s)), \
(void) (c != EOF && ++read_in), c)
# define encode_error() do { \
if (errp != NULL) *errp |= 4; \
_IO_funlockfile (s); \
@ -98,8 +100,8 @@
_IO_flockfile (S)
# define UNLOCK_STREAM __libc_cleanup_region_end (1)
#else
# define ungetc(c, s) (--read_in, ungetc (c, s))
# define inchar() ((c = getc (s)), (void) ++read_in, c)
# define ungetc(c, s) ((void) (c != EOF && --read_in), ungetc (c, s))
# define inchar() ((c = getc (s)), (void) (c != EOF && ++read_in), c)
# define encode_error() do { \
funlockfile (s); \
__set_errno (EILSEQ); \
@ -717,9 +719,6 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
STRING_ADD_CHAR (str, c, char);
} while ((width <= 0 || --width > 0) && inchar () != EOF);
if (c == EOF)
--read_in;
if (!(flags & SUPPRESS))
{
*str = '\0';
@ -943,14 +942,16 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
else if ((flags & GROUP) && c == thousands && !got_dot)
ADDW (c);
else
break;
{
/* The last read character is not part of the number
anymore. */
ungetc (c, s);
break;
}
if (width > 0)
--width;
}
while (inchar () != EOF && width != 0);
/* The last read character is not part of the number anymore. */
ungetc (c, s);
while (width != 0 && inchar () != EOF);
if (wpsize == 0)
conv_error ();

View File

@ -1,5 +1,5 @@
/* Formatting a monetary value according to the current locale.
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 <drepper@cygnus.com>
and Jochen Hein <Jochen.Hein@informatik.TU-Clausthal.de>, 1996.
@ -151,6 +151,13 @@ strfmon (char *s, size_t maxsize, const char *format, ...)
{
case '=': /* Set fill character. */
pad = *++fmt;
if (pad == '\0')
{
/* Premature EOS. */
__set_errno (EINVAL);
va_end (ap);
return -1;
}
continue;
case '^': /* Don't group digits. */
group = 0;

View File

@ -6,6 +6,7 @@
#include <errno.h>
#include <stdlib.h>
#include <strings.h>
#include <limits.h>
struct ltest
{
@ -17,7 +18,7 @@ struct ltest
};
static const struct ltest tests[] =
{
#if ~0UL == 0xffffffff
#if LONG_MAX == 0x7fffffff
/* First, signed numbers. */
{ " -17", -17, 0, 0, 0 },
{ " +0x123fg", 0x123f, 0, 'g', 0 },

View File

@ -36,7 +36,7 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
swab strfry memfrob memmem \
$(addprefix argz-,append count create ctsep next \
delete extract insert stringify \
addsep) \
addsep replace) \
envz basename
tests := tester testcopy test-ffs tst-strlen stratcliff

View File

@ -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 <drepper@gnu.ai.mit.edu>, 1996.
@ -56,4 +56,4 @@ __argz_add_sep (char **argz, size_t *argz_len, const char *string, int delim)
return 0;
}
weak_alias (__argz_create_sep, argz_create_sep)
weak_alias (__argz_add_sep, argz_add_sep)

135
string/argz-replace.c Normal file
View File

@ -0,0 +1,135 @@
/* String replacement in an argz vector
Copyright (C) 1997 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
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 <stdlib.h>
#include <argz.h>
/* Append BUF, of length BUF_LEN to *TO, of length *TO_LEN, reallocating and
updating *TO & *TO_LEN appropriately. If an allocation error occurs,
*TO's old value is freed, and *TO is set to 0. */
static void
str_append (char **to, size_t *to_len, const char *buf, const size_t buf_len)
{
size_t new_len = *to_len + buf_len;
char *new_to = realloc (*to, new_len + 1);
if (new_to)
{
memcpy (new_to + *to_len, buf, buf_len);
new_to[new_len] = '\0';
*to = new_to;
*to_len = new_len;
}
else
{
free (*to);
*to = 0;
}
}
/* Replace any occurances of the string STR in ARGZ with WITH, reallocating
ARGZ as necessary. If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be
incremented by number of replacements performed. */
error_t
__argz_replace (char **argz, size_t *argz_len, const char *str, const char *with,
unsigned *replace_count)
{
error_t err = 0;
if (str && *str)
{
char *arg = 0;
char *src = *argz;
size_t src_len = *argz_len;
char *dst = 0;
size_t dst_len = 0;
int delayed_copy = 1; /* True while we've avoided copying anything. */
size_t str_len = strlen (str), with_len = strlen (with);
while (!err && (arg = argz_next (src, src_len, arg)))
{
char *match = strstr (arg, str);
if (match)
{
char *from = match + str_len;
size_t to_len = match - arg;
char *to = strndup (arg, to_len);
while (to && from)
{
str_append (&to, &to_len, with, with_len);
if (to)
{
match = strstr (from, str);
if (match)
{
str_append (&to, &to_len, from, match - from);
from = match + str_len;
}
else
{
str_append (&to, &to_len, from, strlen (from));
from = 0;
}
}
}
if (to)
{
if (delayed_copy)
/* We avoided copying SRC to DST until we found a match;
now that we've done so, copy everything from the start
of SRC. */
{
if (arg > src)
err = argz_append (&dst, &dst_len, src, (arg - src));
delayed_copy = 0;
}
if (! err)
err = argz_add (&dst, &dst_len, to);
free (to);
}
else
err = ENOMEM;
if (replace_count)
(*replace_count)++;
}
else if (! delayed_copy)
err = argz_add (&dst, &dst_len, arg);
}
if (! err)
{
if (! delayed_copy)
/* We never found any instances of str. */
{
if (src)
free (src);
*argz = dst;
*argz_len = dst_len;
}
}
else if (dst_len > 0)
free (dst);
}
return err;
}
weak_alias (__argz_replace, argz_replace)

View File

@ -17,9 +17,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef __ARGZ_H__
#ifndef _ARGZ_H
#define _ARGZ_H 1
#define __ARGZ_H__ 1
#include <features.h>
#define __need_error_t
@ -103,6 +103,16 @@ extern error_t __argz_insert __P ((char **__argz, size_t *__argz_len,
char *__before, __const char *__entry));
extern error_t argz_insert __P ((char **__argz, size_t *__argz_len,
char *__before, __const char *__entry));
/* Replace any occurances of the string STR in ARGZ with WITH, reallocating
ARGZ as necessary. If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be
incremented by number of replacements performed. */
extern error_t __argz_replace (char **__argz, size_t *__argz_len,
__const char *__str, __const char *__with,
unsigned *__replace_count);
extern error_t argz_replace (char **__argz, size_t *__argz_len,
__const char *__str, __const char *__with,
unsigned *__replace_count);
/* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
are no more. If entry is NULL, then the first entry is returned. This

View File

@ -44,3 +44,7 @@ sysdep-CFLAGS += -mno-fp-regs
endif
divrem := divl divq reml remq
# For now, build everything with full IEEE math support.
# TODO: build separate libm and libm-ieee.
sysdep-CFLAGS += -mieee

View File

@ -1,23 +1,22 @@
/* FPU control word bits. Alpha version.
Copyright (C) 1996 Free Software Foundation, Inc.
Contributed by Olaf Flebbe.
/* FPU control word bits. Alpha-maped-to-Intel version.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Olaf Flebbe.
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. */
#ifndef _ALPHA_FPU_CONTROL_H
#define _ALPHA_FPU_CONTROL_H
@ -91,11 +90,12 @@ Cambridge, MA 02139, USA. */
qualifier. By setting the dynamic rounding mode to +infinity,
one can use /d to get round to +infinity with no extra overhead
(so long as the default isn't changed, of course...)
- exceptions on overflow, zero divide and NaN */
#define _FPU_DEFAULT 0x1f72
- no exceptions enabled. */
#define _FPU_DEFAULT 0x137f
/* IEEE: same as above, but exceptions */
#define _FPU_IEEE 0x1f7f
#define _FPU_IEEE 0x137f
/* Type of the control word. */
typedef unsigned int fpu_control_t;

View File

@ -27,6 +27,8 @@ __BEGIN_DECLS
#define __need_size_t
#include <stddef.h>
/* Type for length arguments in socket calls. */
typedef unsigned int socklen_t;
/* Types of sockets. */
enum __socket_type
@ -143,13 +145,15 @@ enum
struct msghdr
{
__ptr_t msg_name; /* Address to send to/receive from. */
size_t msg_namelen; /* Length of address data. */
socklen_t msg_namelen; /* Length of address data. */
struct iovec *msg_iov; /* Vector of data to send/receive into. */
size_t msg_iovlen; /* Number of elements in the vector. */
int msg_iovlen; /* Number of elements in the vector. */
__ptr_t msg_accrights; /* Access rights information. */
size_t msg_accrightslen; /* Length of access rights information. */
socklen_t msg_accrightslen; /* Length of access rights information. */
int msg_flags; /* Flags in received message. */
};

View File

@ -380,13 +380,17 @@ hypot (double __x, double __y)
return sqrt (__x * __x + __y * __y);
}
/* We cannot rely on M_SQRT being defined. So we do it for ourself
here. */
# define __M_SQRT2 _Mldbl(1.41421356237309504880) /* sqrt(2) */
__MATH_INLINE double log1p (double __x);
__MATH_INLINE double
log1p (double __x)
{
register double __value;
if (fabs (__x) >= 1.0 - 0.5 * M_SQRT2)
if (fabs (__x) >= 1.0 - 0.5 * __M_SQRT2)
__value = log (1.0 + __x);
else
__asm __volatile__

View File

@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
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 <drepper@cygnus.com>, 1996.
@ -49,6 +49,10 @@ ENTRY(__asinh)
movl $0x7fffffff, %eax
andl %ecx, %eax
andl $0x80000000, %ecx
movl %eax, %edx
orl $0x800fffff, %edx
incl %edx
jz 7f // x in ±Inf or NaN
xorl %ecx, 8(%esp)
fldl 4(%esp) // |x|
cmpl $0x3e300000, %eax
@ -83,6 +87,9 @@ ENTRY(__asinh)
fchs
4: ret
7: fldl 4(%esp)
ret
6: faddl MO(one)
fyl2x
jecxz 4f

View File

@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
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 <drepper@cygnus.com>, 1996.
@ -49,6 +49,10 @@ ENTRY(__asinhf)
movl $0x7fffffff, %eax
andl %ecx, %eax
andl $0x80000000, %ecx
movl %eax, %edx
orl $0x807fffff, %edx
incl %edx
jz 7f // x in ±Inf or NaN
xorl %ecx, 8(%esp)
flds 4(%esp) // |x|
cmpl $0x38000000, %eax
@ -83,6 +87,9 @@ ENTRY(__asinhf)
fchs
4: ret
7: flds 4(%esp)
ret
6: faddl MO(one)
fyl2x
jecxz 4f

View File

@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
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 <drepper@cygnus.com>, 1996.
@ -56,6 +56,10 @@ ENTRY(__asinhl)
movl $0x7fff, %eax
andl %ecx, %eax
andl $0x8000, %ecx
movl %eax, %edx
orl $0xffff8000, %edx
incl %edx
jz 7f // x in ±Inf or NaN
xorl %ecx, 12(%esp)
fldt 4(%esp) // |x|
cmpl $0x3fde, %eax
@ -90,6 +94,9 @@ ENTRY(__asinhl)
fchs
4: ret
7: fldt 4(%esp)
ret
6: faddl MO(one)
fyl2x
jecxz 4f

View File

@ -117,7 +117,7 @@ static double zero = 0.0; /* used as const */
exc.retval = NAN;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if(_LIB_VERSION == _SVID_) {
(void) WRITE2("acos: DOMAIN error\n", 19);
}
@ -137,7 +137,7 @@ static double zero = 0.0; /* used as const */
exc.retval = NAN;
if(_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if(_LIB_VERSION == _SVID_) {
(void) WRITE2("asin: DOMAIN error\n", 19);
}
@ -157,7 +157,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE;
if(_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if(_LIB_VERSION == _SVID_) {
(void) WRITE2("atan2: DOMAIN error\n", 20);
}
@ -177,7 +177,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -194,7 +194,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -211,7 +211,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -225,7 +225,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -241,7 +241,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y0: DOMAIN error\n", 17);
}
@ -260,7 +260,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y0: DOMAIN error\n", 17);
}
@ -279,7 +279,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y1: DOMAIN error\n", 17);
}
@ -298,7 +298,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y1: DOMAIN error\n", 17);
}
@ -317,7 +317,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("yn: DOMAIN error\n", 17);
}
@ -336,7 +336,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("yn: DOMAIN error\n", 17);
}
@ -356,7 +356,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -373,7 +373,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("lgamma: SING error\n", 19);
}
@ -392,7 +392,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log: SING error\n", 16);
}
@ -411,7 +411,7 @@ static double zero = 0.0; /* used as const */
exc.retval = NAN;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log: DOMAIN error\n", 18);
}
@ -431,7 +431,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log10: SING error\n", 18);
}
@ -451,7 +451,7 @@ static double zero = 0.0; /* used as const */
exc.retval = NAN;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log10: DOMAIN error\n", 20);
}
@ -467,7 +467,7 @@ static double zero = 0.0; /* used as const */
exc.name = type < 100 ? "pow" : (type < 200 ? "powf" : "powl");
exc.retval = zero;
if (_LIB_VERSION != _SVID_) exc.retval = 1.0;
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
(void) WRITE2("pow(0,0): DOMAIN error\n", 23);
__set_errno (EDOM);
}
@ -489,7 +489,7 @@ static double zero = 0.0; /* used as const */
}
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -502,7 +502,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -518,7 +518,7 @@ static double zero = 0.0; /* used as const */
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("pow(0,neg): DOMAIN error\n", 25);
}
@ -537,7 +537,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("pow(0,neg): DOMAIN error\n", 25);
}
@ -556,7 +556,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero/zero; /* X/Open allow NaN */
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("neg**non-integral: DOMAIN error\n", 32);
}
@ -576,7 +576,7 @@ static double zero = 0.0; /* used as const */
exc.retval = ( (x>zero) ? HUGE_VAL : -HUGE_VAL);
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -593,7 +593,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("sqrt: DOMAIN error\n", 19);
}
@ -613,7 +613,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("fmod: DOMAIN error\n", 20);
}
@ -631,7 +631,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("remainder: DOMAIN error\n", 24);
}
@ -648,7 +648,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("acosh: DOMAIN error\n", 20);
}
@ -665,7 +665,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("atanh: DOMAIN error\n", 20);
}
@ -682,7 +682,7 @@ static double zero = 0.0; /* used as const */
exc.retval = x/zero; /* sign(x)*inf */
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("atanh: SING error\n", 18);
}
@ -699,7 +699,7 @@ static double zero = 0.0; /* used as const */
exc.retval = x > zero ? HUGE_VAL : -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -713,7 +713,7 @@ static double zero = 0.0; /* used as const */
exc.retval = __copysign(zero,x);
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -726,7 +726,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
@ -743,7 +743,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
@ -760,7 +760,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
@ -777,7 +777,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
@ -794,7 +794,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
@ -811,7 +811,7 @@ static double zero = 0.0; /* used as const */
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
@ -832,7 +832,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (ERANGE);
}
break;
@ -849,7 +849,7 @@ static double zero = 0.0; /* used as const */
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (EDOM);
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("gamma: SING error\n", 18);
}
@ -866,7 +866,7 @@ static double zero = 0.0; /* used as const */
exc.retval = x;
if (_LIB_VERSION == _IEEE_ ||
_LIB_VERSION == _POSIX_) exc.retval = 1.0;
else if (!__matherr(&exc)) {
else if (!matherr(&exc)) {
__set_errno (EDOM);
}
break;

View File

@ -1,20 +1,20 @@
/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
/* Copyright (C) 1994, 1995, 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 <sys/types.h>
#include <sys/mman.h>
@ -98,7 +98,7 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
__mach_port_deallocate (__mach_task_self (), memobj);
}
else if (wobj == MACH_PORT_NULL && /* Not writable by mapping. */
(flags & (MAP_COPY|MAP_PRIVATE)))
!(flags & MAP_SHARED))
/* The file can only be mapped for reading. Since we are
making a private mapping, we will never try to write the
object anyway, so we don't care. */
@ -106,8 +106,7 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
else
{
__mach_port_deallocate (__mach_task_self (), wobj);
return ((caddr_t) (long int)
__hurd_fail (EGRATUITOUS)); /* XXX */
return (caddr_t) (long int) __hurd_fail (EACCES);
}
break;
}
@ -154,4 +153,3 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
}
weak_alias (__mmap, mmap)

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_acoshl (long double x)
{
fputs ("__ieee754_acoshl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_acosl (long double x)
{
fputs ("__ieee754_acosl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_asinl (long double x)
{
fputs ("__ieee754_asinl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

13
sysdeps/stub/e_atan2l.c Normal file
View File

@ -0,0 +1,13 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_atan2l (long double x, long double y)
{
fputs ("__ieee754_atan2l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}
stub_warning (__ieee754_atan2l)

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_expl (long double x)
{
fputs ("__ieee754_expl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_fmodl (long double x, long double y)
{
fputs ("__ieee754_fmodl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_j0l (long double x)
{
fputs ("__ieee754_j0l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}
@ -14,6 +16,7 @@ long double
__ieee754_y0l (long double x)
{
fputs ("__ieee754_y0l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_j1l (long double x)
{
fputs ("__ieee754_j1l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}
@ -14,6 +16,7 @@ long double
__ieee754_y1l (long double x)
{
fputs ("__ieee754_y1l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_jnl (int n, long double x)
{
fputs ("__ieee754_jnl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}
@ -14,6 +16,7 @@ long double
__ieee754_ynl (int n, long double x)
{
fputs ("__ieee754_ynl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_lgammal_r (long double x, int *signgamp)
{
fputs ("__ieee754_lgammal_r not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_log10l (long double x)
{
fputs ("__ieee754_log10l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_logl (long double x)
{
fputs ("__ieee754_logl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_powl (long double x, long double y)
{
fputs ("__ieee754_powl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_rem_pio2l (long double x, long double *y)
{
fputs ("__ieee754_rem_pio2l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__ieee754_sqrtl (long double x)
{
fputs ("__ieee754_sqrtl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__kernel_cosl (long double x, long double y)
{
fputs ("__kernel_cosl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,12 +1,14 @@
#include <math.h>
#include <math_private.h>
#include <stdio.h>
#include <errno.h>
int
__kernel_rem_pio2l (long double *x, long double *y, int e0, int nx, int prec,
const int *ipio2)
{
fputs ("__kernel_rem_pio2l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -1,10 +1,12 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
long double
__kernel_sinl (long double x, long double y)
{
fputs ("__kernel_sinl not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}

View File

@ -17,8 +17,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _LIBC_LOCK_H
#define _LIBC_LOCK_H 1
#ifndef _BITS_LIBC_LOCK_H
#define _BITS_LIBC_LOCK_H 1
/* Define a lock variable NAME with storage class CLASS. The lock must be
@ -70,6 +70,20 @@
/* Unlock the recursive named lock variable. */
#define __libc_lock_unlock_recursive(NAME)
/* Define once control variable. */
#define __libc_once_define(NAME) int NAME = 0
/* Call handler iff the first call. */
#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
do { \
if ((ONCE_CONTROL) == 0) { \
INIT_FUNCTION (); \
(ONCE_CONTROL) = 1; \
} \
} while (0)
/* Start critical region with cleanup. */
#define __libc_cleanup_region_start(FCT, ARG)
@ -80,4 +94,16 @@
/* We need portable names for some of the functions. */
#define __libc_mutex_unlock
#endif /* libc-lock.h */
/* Type for key of thread specific data. */
typedef int __libc_key_t;
/* Create key for thread specific data. */
#define __libc_key_create(KEY,DEST) -1
/* Set thread-specific data associated with KEY to VAL. */
#define __libc_setspecific(KEY,VAL) -1
/* Get thread-specific data associated with KEY. */
#define __libc_getspecific(KEY) 0
#endif /* bits/libc-lock.h */

Some files were not shown because too many files have changed in this diff Show More