mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 12:30:06 +00:00
Update.
1997-09-11 04:36 Ulrich Drepper <drepper@cygnus.com> * db2/db_int.h: Define __set_errno if not yet available. * db2/btree/bt_rec.c: Use __set_errno to set errno value. * db2/clib/getlong.c: Likewise. * db2/db185/db185.c: Likewise. * db2/db185/db185_int.h: Likewise. * db2/dbm/dbm.c: Likewise. * db2/lock/lock_deadlock.c: Likewise. * db2/log/log_archive.c: Likewise. * elf/dl-profile.c: Implement mcount function. * gmon/gmon.c: Use __profil not profil because of namespace pollution. * gmon/mcount.c: Remove BSD kernel code. Use compare&swap instruction if possible to change state variable. Optimize frompc folding. * gmon/sys/gmon.h (struct gmonparam): Change state field to long int. * sysdeps/i386/i486/atomicity.h: New file. * sysdeps/stub/atomicity.h: New file. * sysdeps/mach/hurd/profil.c: Define function as __profil and make profil weak alias. * sysdeps/posix/profil.c: Likewise. * string/bits/string2.h: New file. * include/bits/string2.h: New file. * string/Makefile (routines): Add mempcpy. (tests): Add inl-tester. Remove _D__NO_STRING_INLINES from CFLAGS-* variables. * sysdeps/generic/mempcpy.c: New file. * sysdeps/generic/memccpy.c: Undef function name to enable definition as macro. * sysdeps/generic/memchr.c: Likewise. * sysdeps/generic/memcmp.c: Likewise. * sysdeps/generic/memmem.c: Likewise. * sysdeps/generic/memmove.c: Likewise. * sysdeps/generic/strcat.c: Likewise. * sysdeps/generic/strchr.c: Likewise. * sysdeps/generic/strcmp.c: Likewise. * sysdeps/generic/strcpy.c: Likewise. * sysdeps/generic/strcspn.c: Likewise. * sysdeps/generic/strlen.c: Likewise. * sysdeps/generic/strncat.c: Likewise. * sysdeps/generic/strncmp.c: Likewise. * sysdeps/generic/strncpy.c: Likewise. * sysdeps/generic/strpbrk.c: Likewise. * sysdeps/generic/strrchr.c: Likewise. * sysdeps/generic/strsep.c: Likewise. * sysdeps/generic/strspn.c: Likewise. * sysdeps/generic/strstr.c: Likewise. * sysdeps/generic/strtok.c: Likewise. * sysdeps/generic/strtok_r.c: Likewise. * sysdeps/i386/memset.c: Likewise. * sysdeps/i386/bits/string.h: Correct a few types and constraints. * sysdeps/i386/i486/bits/string.h: Heavy rewrites and optimizations. * string/stratcliff.c: Undefine __USE_STRING_INLINES. * string/tst-strlen.c: Likewise. * string/string.h: Add prototype for mempcpy. Include bits/string2.h header always if optimizing. * intl/dcgettext.c: Don't unconditionally define stpcpy, only if not yet defined. * intl/l10nflist.c: Likewise. * string/tester.c: Add copyright and make little cleanups. * inet/test_ifindex.c: Change type of ni variable to unsigned int. * locale/programs/ld-ctype.c (struct locale_ctype_t): Change type of fields map_collection_max and map_collection_act to size_t. * nss/libnss_files.map: Group entries. * posix/unistd.h: Add prototype for __setpgid and __profil. * sysdeps/generic/crypt.h: Declare __crypt_r. * sysdeps/i386/bits/select.h: Fix fatal bugs, use correct casts now. * sysdeps/i386/fpu/bits/mathinline.h (isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered): Optimize a bit. * sysdeps/stub/ftruncate.c: Include missing header for prototype. * sysdeps/stub/getdents.c: Likewise. * sysdeps/stub/reboot.c: Likewise. * sysdeps/stub/swapon.c: Likewise. * sysdeps/stub/syscall.c: Likewise. * sysdeps/stub/ualarm.c: Likewise. * sysdeps/stub/usleep.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c: Don't compile or use opensock if SIOGIFINDEX and SIOGIFNAME are not defined. * sysdeps/unix/sysv/linux/net/if.h: Add IFF_PORTSEL and IFF_AUTOMEDIA according to recent kernel changes. 1997-09-10 21:32 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de> * Makeconfig: Use $(have-initfini) instead of $(elf) to figure out the installed name of the startup code. (common-generated): Add version.mk. * Makefile (distclean-1): Add glibcbug. * Makerules: Replace -lgcc by $(gnulib). * catgets/Makefile (generated): Add xmalloc.o. * csu/Makefile (generated): Replace align.h and end.h by defs.h to match the generated file. * manual/Makefile (mostlyclean): Add stub-manual and stamp.o. (realclean): Changed to remove chapters-incl[12]. * po/Makefile (realclean): New rule to remove the generated .mo files. * time/Makefile: Only include zonefile dependencies if $(no_deps) is not true to avoid make clean failure when directory time doesn't exist yet. (generated): Add tzselect. * stdio/fgets.c (fgets): Add casts to reduce gcc warning noise. * stdio/internals.c (flushbuf): Likewise. * stdio/linewrap.c (lwupdate): Likewise. * stdio/memstream.c (enlarge_buffer): Likewise. * stdio-common/vfscanf.c (_IO_vfscanf): Likewise. * time/tzset.c (compute_change): Likewise. * misc/init-misc.c (__init_misc): Only declare static if HAVE_GNU_LD is defined. * sysdeps/posix/pipestream.c (FUNC): Change to generate ANSI C style functions. * sysdeps/stub/init-posix.c: Likewise. * sysdeps/stub/profil.c: Likewise. * munch-tmpl.c (__libc_init): Convert to ANSI C style declaration to reduce gcc warning noise. * stdio/glue.c (_filbuf, _flsbuf): Likewise. * stdio/obstream.c (grow, seek, input, init_obstream): Likewise. * stdio/vasprintf.c (enlarge_buffer): Likewise. * sysdeps/generic/sysd-stdio.c (__stdio_read, __stdio_write, __stdio_seek, __stdio_close, __stdio_fileno, __stdio_open, __stdio_reopen): Likewise. * sysdeps/posix/defs.c (_cleanup): Likewise. * time/offtime.c (__offtime): Add cast. * posix/getopt.c: Don't use text_set_element if not defined. * configure.in: Provide a check for underscores before user labels that works even when the compiler used for building doesn't work (like when there is no C library). Use the old way if the compiler works. 1997-09-10 05:08 David S. Miller <davem@caip.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/bits/ioctls.h: The TC* ioctls use 'T' not 't' on SparcLinux. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: tcflag_t is 32 bits. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add aliases for _longjmp and siglongjmp. 1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libio/stdio.h: Add format attributes to the extra printf and scanf like functions. * stdio/stdio.h: Likewise. 1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r): Print tablename_val, not tablename_len. * nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_getntohost_r): Use sprintf instead of sprintf, the string always fits. * nis/nss_nisplus/nisplus-hosts.c (_nss_nisplus_gethostbyaddr_r): Likewise. * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r): Likewise. * nis/nss_nisplus/nisplus-proto.c (_nss_nisplus_getprotobynumber_r): Likewise. * nis/nss_nisplus/nisplus-rpc.c (_nss_nisplus_getrpcbynumber_r): Likewise. * nis/nss_nisplus/nisplus-service.c (_nss_nisplus_getservbynumber_r): Likewise. * nis/nss_nisplus/nisplus-alias.c (_nss_create_tablename): Use __stpcpy, __stpncpy and __strdup instead of public names. * nis/nss_nisplus/nisplus-ethers.c (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-grp.c (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-hosts.c (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-netgrp.c (_nss_nisplus_parse_netgroup): Likewise. * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_parse_netent): Likewise. (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-proto.c (_nss_nisplus_parse_protoent): Likewise. (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-pwd.c (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-rpc.c (_nss_nisplus_parse_rpcent): Likewise. (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-service.c (_nss_nisplus_parse_servent): Likewise. (_nss_create_tablename): Likewise. * nis/nss_nisplus/nisplus-spwd.c (_nss_create_tablename): Likewise. * libc.map: Export __stpcpy and __strdup. 1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * math/Makefile (CFLAGS-test-float.c, CFLAGS-test-double.c, CFLAGS-test-ldouble.c): Pass -ffloat-store to avoid excessive precision. 1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * include/rpc/auth_des.h: New file. 1997-09-09 Paul Eggert <eggert@twinsun.com> * time/mktime.c (__mktime_internal): Declare sec_requested even if !LEAP_SECONDS_POSSIBLE, since it's needed at the end when checking for time_t overflow. 1997-09-09 22:11 Ulrich Drepper <drepper@cygnus.com> * sysdeps/posix/getcwd.c: Correct test for too small buffer. Reported by Erik Troan <ewt@redhat.com>. * elf/dl-close.c: Include <bits/libc-lock.h>, not <libc-lock.h>. * elf/dl-open.c: Likewise. 1997-09-07 17:09 Richard Henderson <rth@cygnus.com> * sysdeps/alpha/Makefile: Kill setjmp_aux. * sysdeps/alpha/bits/setjmp.h: Rewrite in terms of an array. * sysdeps/alpha/__longjmp.c: Remove. * sysdeps/alpha/setjmp_aux.c: Remove. * sysdeps/alpha/__longjmp.S: New file. * sysdeps/alpha/bsd-_setjmp.S: Stub out. * sysdeps/alpha/bsd-setjmp.S: Likewise. * sysdeps/alpha/setjmp.S: Do the work; don't call __setjmp_aux. Move _setjmp and setjmp from bsd-*.S. 1997-09-06 20:20 Ulrich Drepper <drepper@cygnus.com> * include/rpc/auth.h: New file. * include/rpc/auth_unix.h: New file. 1997-09-06 Paul Eggert <eggert@twinsun.com> Fix gmtime so that it reports leap seconds when TZ indicates that leap seconds are desired. * time/gmtime.c (<stddef.h>): Remove unnecessary include. (gmtime): Put after gmtime_r, to help the compiler inline. (__tz_convert): New decl. (gmtime_r): Use __tz_convert instead of __offtime, so that leap seconds are handled correctly. * time/localtime.c (<errno.h>, <libc-lock.h>): Remove includes that are now unnecessary. (__tzset_internal, __tz_compute, __tzfile_compute, __use_tzfile, __tzset_lock): Remove extern decls that are now unnecessary. (localtime_internal): Moved to __tz_convert in tzset.c. so that localtime and gmtime can both use it easily. (localtime): Put after localtime_r, to help the compiler inline. (localtime_r): Use __tz_convert instead of localtime_internal. * time/strftime.c (__tz_compute): Remove unused (and now incorrect) decl. * time/tzfile.c (__tzfile_compute): New arg USE_LOCALTIME. * time/tzset.c (<errno.h>): Include. (_tmbuf): New decl. (__tzfile_compute): New function. (tz_compute): Renamed from __tz_compute. No longer extern. Remove redundant call to tzset_internal. (tzset_internal): Renamed from __tzset_internal. No longer extern. (tzset_lock): Renamed from __tzset_lock. No longer extern. (__tz_convert): New function, containing functionality of old localtime_internal function, plus locking and optional UTC. 1997-09-06 Paul Eggert <eggert@twinsun.com> * time/tzfile.c (__tzfile_read): Don't read a file if TZ is the empty string, just use UTC without leap seconds. This is for compatibility with the Olson code. 1997-09-06 Paul Eggert <eggert@twinsun.com> * time/tzset.c (__tzname_max): Lock tz data structures before invoking tzset_internal. * time/tzfile.c: Define compute_tzname_max statically. 1997-09-07 10:57 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/nis_call.c: Remove not longer necessary HAVE_SECURE_RPC ifdefs. * nis/nis_intern.h: Likewise. * nis/nss_nis/nis-publickey.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nis/ypclnt.c: Likewise. * sunrpc/auth_des.c: Don't dereference NULL pointer, initialize ad->ad_timediff. * sunrpc/auth_none.c: Don't define our own prototypes, use the one from the header files. * sunrpc/auth_unix.c: Likewise. * sunrpc/clnt_raw.c: Likewise. * sunrpc/clnt_tcp.c: Likewise. * sunrpc/rpc_cmsg.c: Likewise. * sunrpc/key_call.c: Fix signal handling. * sunrpc/openchild.c: Don't use /bin/sh to start /usr/etc/keyenvoy, or we will get a deadlock with NIS+. * sunrpc/rpc/auth.h: Add prototype for xdr_opaque_auth, don't define HAVE_SECURE_RPC. 1997-09-07 15:51 Ulrich Drepper <drepper@cygnus.com> * sysdeps/i386/bits/select.h [__GNUC__] (__FD_ZERO, __FD_SET, __FD_CLR, __FD_ISSET): Use correct casts to address array correctly. Reported by urbanw@cs.umu.se. 1997-09-07 05:07 Ulrich Drepper <drepper@cygnus.com> * elf/dl-close.c: Include <bits/libc-lock.h>, not <libc-lock.h>. * elf/dl-open.c: Likewise. * sysdeps/i386/memset.c: Undefine memset in case the header with the optimized functions is included. Patches by NIIBE Yutaka <gniibe@mri.co.jp>. * sysdeps/i386/bits/string.h [__PIC__] (strcspn, strspn, strpbrk, strsep): Use register for second parameter. * sysdeps/i386/i486/bits/string.h: Likewise. Reported by NIIBE Yutaka <gniibe@mri.co.jp>. 1997-09-03 09:48 Geoff Keating <geoffk@ozemail.com.au> * math/libm-test.c: Change various tolerances to match what the tested routines can actually provide. * math/Makefile: Add new tests. * math/atest-sincos.c: New file. * math/atest-exp.c: New file. * csu/Makefile: Give initfini.s and initfiniS.s their own CFLAGS-* macros so they can be overridden. * sysdeps/powerpc/Makefile [subdir=csu]: Override flags for initfiniS.s to use -fpic instead of -fPIC, because the sed script breaks otherwise. * sysdeps/powerpc/Makefile [build-shared]: Use -fpic not -fPIC for efficiency. * sysdeps/powerpc/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE): Don't use register 0, to let _mcount be in a shared object. * sysdeps/powerpc/dl-machine.h: Use full sentences in comments. Generally clean up. Suppress some code we don't need when relocating ld.so. * sysdeps/powerpc/test-arith.c: Change loop indices to size_t when appropriate to suppress gcc warning. * resolv/res_send.c: Suppress warning. * sunrpc/xdr_sizeof.c: Suppress warning. * FAQ: Add ppc-linux. * manual/maint.texi: Add ppc-linux. Explain that gcc can't build it yet. * sysdeps/unix/sysv/linux/powerpc/profil-counter.h: Correct for current kernels. 1997-08-15 07:45 Geoff Keating <geoffk@ozemail.com.au> * stdlib/fmtmsg.c: Use two parameters for __libc_once_define. * sysdeps/i386/machine-gmon.h: Correct typo. * sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Change to match kernel. * sysdeps/generic/dl-sysdep.c: Add hook for bizzare PPC argument hack. * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Rewrite to use sysdeps/linux/dl-sysdep.c. * sysdeps/powerpc/Makefile [subdir=gmon]: Compile ppc-mcount. * sysdeps/powerpc/machine-gmon.h: Use ppc-mcount. * sysdeps/powerpc/ppc-mcount: New file. The following are mostly changes to allow profiling: * sysdeps/powerpc/add_n.S: Added. * sysdeps/powerpc/add_n.s: Removed. * sysdeps/powerpc/addmul_1.S: Added. * sysdeps/powerpc/addmul_1.s: Removed. * sysdeps/powerpc/bsd-_setjmp.S: Use JUMPTARGET macro. * sysdeps/powerpc/bsd-setjmp.S: Use JUMPTARGET macro. * sysdeps/powerpc/lshift.S: Added. * sysdeps/powerpc/lshift.s: Removed. * sysdeps/powerpc/memset.S: Added. * sysdeps/powerpc/memset.s: Removed. * sysdeps/powerpc/mul_1.S: Added. * sysdeps/powerpc/mul_1.s: Removed. * sysdeps/powerpc/rshift.S: Added. * sysdeps/powerpc/rshift.s: Removed. * sysdeps/powerpc/s_copysign.S: Use ENTRY, END, weak_alias macros. * sysdeps/powerpc/s_fabs.S: Use ENTRY, END, weak_alias macros. * sysdeps/powerpc/setjmp.S: Use JUMPTARGET macro. * sysdeps/powerpc/strchr.S: Added. * sysdeps/powerpc/strchr.s: Removed. * sysdeps/powerpc/strcmp.S: Added. * sysdeps/powerpc/strcmp.s: Removed. * sysdeps/powerpc/strlen.S: Added. * sysdeps/powerpc/strlen.s: Removed. * sysdeps/powerpc/sub_n.S: Added. * sysdeps/powerpc/sub_n.s: Removed. * sysdeps/powerpc/submul_1.S: Added. * sysdeps/powerpc/submul_1.s: Removed. * sysdeps/unix/sysv/linux/powerpc/_exit.S: Removed. * sysdeps/unix/sysv/linux/powerpc/brk.S: Added. * sysdeps/unix/sysv/linux/powerpc/brk.c: Removed. * sysdeps/unix/sysv/linux/powerpc/clone.S: Use new macros. Fix various bugs. Document that it isn't tested. * sysdeps/unix/sysv/linux/powerpc/sigreturn.S: Make look like sysdeps/unix/_exit.S. * sysdeps/unix/sysv/linux/powerpc/socket.S: Use new macros. * sysdeps/unix/sysv/linux/powerpc/syscall.S: Use new macros. * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Define some new macros to make assembler (possibly) more portable, allow profiling, etc.
This commit is contained in:
parent
26b4d76671
commit
9a0a462ceb
6
BUGS
6
BUGS
@ -1,7 +1,7 @@
|
|||||||
List of known bugs (certainly very incomplete)
|
List of known bugs (certainly very incomplete)
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
|
||||||
Time-stamp: <1997-08-04T00:50:04+0200 drepper>
|
Time-stamp: <1997-09-06T18:30:16+0200 drepper>
|
||||||
|
|
||||||
This following list contains those bugs which I'm aware of. Please
|
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
|
make sure that bugs you report are not listed here. If you can fix one
|
||||||
@ -25,6 +25,10 @@ Severity: [ *] to [***]
|
|||||||
|
|
||||||
[ **] There are problems with signal handling when using LinuxThreads.
|
[ **] There are problems with signal handling when using LinuxThreads.
|
||||||
|
|
||||||
|
[ **] The libm-ieee `log2' function seems to be very inaccurate.
|
||||||
|
|
||||||
|
[ *] The libm-ieee `remquo' function rounds 3.0/2.0 incorrectly.
|
||||||
|
|
||||||
[ *] The precision of the `sinhl' and/or `asinhl' function do not seem
|
[ *] The precision of the `sinhl' and/or `asinhl' function do not seem
|
||||||
to be the best.
|
to be the best.
|
||||||
|
|
||||||
|
430
ChangeLog
430
ChangeLog
@ -1,3 +1,433 @@
|
|||||||
|
1997-09-11 04:36 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* db2/db_int.h: Define __set_errno if not yet available.
|
||||||
|
* db2/btree/bt_rec.c: Use __set_errno to set errno value.
|
||||||
|
* db2/clib/getlong.c: Likewise.
|
||||||
|
* db2/db185/db185.c: Likewise.
|
||||||
|
* db2/db185/db185_int.h: Likewise.
|
||||||
|
* db2/dbm/dbm.c: Likewise.
|
||||||
|
* db2/lock/lock_deadlock.c: Likewise.
|
||||||
|
* db2/log/log_archive.c: Likewise.
|
||||||
|
|
||||||
|
* elf/dl-profile.c: Implement mcount function.
|
||||||
|
|
||||||
|
* gmon/gmon.c: Use __profil not profil because of namespace pollution.
|
||||||
|
* gmon/mcount.c: Remove BSD kernel code.
|
||||||
|
Use compare&swap instruction if possible to change state variable.
|
||||||
|
Optimize frompc folding.
|
||||||
|
* gmon/sys/gmon.h (struct gmonparam): Change state field to long int.
|
||||||
|
* sysdeps/i386/i486/atomicity.h: New file.
|
||||||
|
* sysdeps/stub/atomicity.h: New file.
|
||||||
|
* sysdeps/mach/hurd/profil.c: Define function as __profil and make
|
||||||
|
profil weak alias.
|
||||||
|
* sysdeps/posix/profil.c: Likewise.
|
||||||
|
|
||||||
|
* string/bits/string2.h: New file.
|
||||||
|
* include/bits/string2.h: New file.
|
||||||
|
* string/Makefile (routines): Add mempcpy.
|
||||||
|
(tests): Add inl-tester.
|
||||||
|
Remove _D__NO_STRING_INLINES from CFLAGS-* variables.
|
||||||
|
* sysdeps/generic/mempcpy.c: New file.
|
||||||
|
* sysdeps/generic/memccpy.c: Undef function name to enable definition
|
||||||
|
as macro.
|
||||||
|
* sysdeps/generic/memchr.c: Likewise.
|
||||||
|
* sysdeps/generic/memcmp.c: Likewise.
|
||||||
|
* sysdeps/generic/memmem.c: Likewise.
|
||||||
|
* sysdeps/generic/memmove.c: Likewise.
|
||||||
|
* sysdeps/generic/strcat.c: Likewise.
|
||||||
|
* sysdeps/generic/strchr.c: Likewise.
|
||||||
|
* sysdeps/generic/strcmp.c: Likewise.
|
||||||
|
* sysdeps/generic/strcpy.c: Likewise.
|
||||||
|
* sysdeps/generic/strcspn.c: Likewise.
|
||||||
|
* sysdeps/generic/strlen.c: Likewise.
|
||||||
|
* sysdeps/generic/strncat.c: Likewise.
|
||||||
|
* sysdeps/generic/strncmp.c: Likewise.
|
||||||
|
* sysdeps/generic/strncpy.c: Likewise.
|
||||||
|
* sysdeps/generic/strpbrk.c: Likewise.
|
||||||
|
* sysdeps/generic/strrchr.c: Likewise.
|
||||||
|
* sysdeps/generic/strsep.c: Likewise.
|
||||||
|
* sysdeps/generic/strspn.c: Likewise.
|
||||||
|
* sysdeps/generic/strstr.c: Likewise.
|
||||||
|
* sysdeps/generic/strtok.c: Likewise.
|
||||||
|
* sysdeps/generic/strtok_r.c: Likewise.
|
||||||
|
* sysdeps/i386/memset.c: Likewise.
|
||||||
|
* sysdeps/i386/bits/string.h: Correct a few types and constraints.
|
||||||
|
* sysdeps/i386/i486/bits/string.h: Heavy rewrites and optimizations.
|
||||||
|
* string/stratcliff.c: Undefine __USE_STRING_INLINES.
|
||||||
|
* string/tst-strlen.c: Likewise.
|
||||||
|
* string/string.h: Add prototype for mempcpy. Include bits/string2.h
|
||||||
|
header always if optimizing.
|
||||||
|
* intl/dcgettext.c: Don't unconditionally define stpcpy, only if not
|
||||||
|
yet defined.
|
||||||
|
* intl/l10nflist.c: Likewise.
|
||||||
|
|
||||||
|
* string/tester.c: Add copyright and make little cleanups.
|
||||||
|
|
||||||
|
* inet/test_ifindex.c: Change type of ni variable to unsigned int.
|
||||||
|
|
||||||
|
* locale/programs/ld-ctype.c (struct locale_ctype_t): Change type
|
||||||
|
of fields map_collection_max and map_collection_act to size_t.
|
||||||
|
|
||||||
|
* nss/libnss_files.map: Group entries.
|
||||||
|
|
||||||
|
* posix/unistd.h: Add prototype for __setpgid and __profil.
|
||||||
|
|
||||||
|
* sysdeps/generic/crypt.h: Declare __crypt_r.
|
||||||
|
|
||||||
|
* sysdeps/i386/bits/select.h: Fix fatal bugs, use correct casts now.
|
||||||
|
|
||||||
|
* sysdeps/i386/fpu/bits/mathinline.h (isgreater, isgreaterequal,
|
||||||
|
isless, islessequal, islessgreater, isunordered): Optimize a bit.
|
||||||
|
|
||||||
|
* sysdeps/stub/ftruncate.c: Include missing header for prototype.
|
||||||
|
* sysdeps/stub/getdents.c: Likewise.
|
||||||
|
* sysdeps/stub/reboot.c: Likewise.
|
||||||
|
* sysdeps/stub/swapon.c: Likewise.
|
||||||
|
* sysdeps/stub/syscall.c: Likewise.
|
||||||
|
* sysdeps/stub/ualarm.c: Likewise.
|
||||||
|
* sysdeps/stub/usleep.c: Likewise.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/if_index.c: Don't compile or use opensock
|
||||||
|
if SIOGIFINDEX and SIOGIFNAME are not defined.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/net/if.h: Add IFF_PORTSEL and IFF_AUTOMEDIA
|
||||||
|
according to recent kernel changes.
|
||||||
|
|
||||||
|
1997-09-10 21:32 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>
|
||||||
|
|
||||||
|
* Makeconfig: Use $(have-initfini) instead of $(elf) to figure out
|
||||||
|
the installed name of the startup code.
|
||||||
|
(common-generated): Add version.mk.
|
||||||
|
* Makefile (distclean-1): Add glibcbug.
|
||||||
|
* Makerules: Replace -lgcc by $(gnulib).
|
||||||
|
* catgets/Makefile (generated): Add xmalloc.o.
|
||||||
|
* csu/Makefile (generated): Replace align.h and end.h by defs.h to
|
||||||
|
match the generated file.
|
||||||
|
* manual/Makefile (mostlyclean): Add stub-manual and stamp.o.
|
||||||
|
(realclean): Changed to remove chapters-incl[12].
|
||||||
|
* po/Makefile (realclean): New rule to remove the generated .mo files.
|
||||||
|
* time/Makefile: Only include zonefile dependencies if $(no_deps) is
|
||||||
|
not true to avoid make clean failure when directory time doesn't exist
|
||||||
|
yet.
|
||||||
|
(generated): Add tzselect.
|
||||||
|
|
||||||
|
* stdio/fgets.c (fgets): Add casts to reduce gcc warning noise.
|
||||||
|
* stdio/internals.c (flushbuf): Likewise.
|
||||||
|
* stdio/linewrap.c (lwupdate): Likewise.
|
||||||
|
* stdio/memstream.c (enlarge_buffer): Likewise.
|
||||||
|
* stdio-common/vfscanf.c (_IO_vfscanf): Likewise.
|
||||||
|
* time/tzset.c (compute_change): Likewise.
|
||||||
|
* misc/init-misc.c (__init_misc): Only declare static if HAVE_GNU_LD
|
||||||
|
is defined.
|
||||||
|
* sysdeps/posix/pipestream.c (FUNC): Change to generate ANSI C style
|
||||||
|
functions.
|
||||||
|
* sysdeps/stub/init-posix.c: Likewise.
|
||||||
|
* sysdeps/stub/profil.c: Likewise.
|
||||||
|
* munch-tmpl.c (__libc_init): Convert to ANSI C style declaration to
|
||||||
|
reduce gcc warning noise.
|
||||||
|
* stdio/glue.c (_filbuf, _flsbuf): Likewise.
|
||||||
|
* stdio/obstream.c (grow, seek, input, init_obstream): Likewise.
|
||||||
|
* stdio/vasprintf.c (enlarge_buffer): Likewise.
|
||||||
|
* sysdeps/generic/sysd-stdio.c (__stdio_read, __stdio_write,
|
||||||
|
__stdio_seek, __stdio_close, __stdio_fileno, __stdio_open,
|
||||||
|
__stdio_reopen): Likewise.
|
||||||
|
* sysdeps/posix/defs.c (_cleanup): Likewise.
|
||||||
|
* time/offtime.c (__offtime): Add cast.
|
||||||
|
|
||||||
|
* posix/getopt.c: Don't use text_set_element if not defined.
|
||||||
|
|
||||||
|
* configure.in: Provide a check for underscores before user labels
|
||||||
|
that works even when the compiler used for building doesn't work
|
||||||
|
(like when there is no C library). Use the old way if the compiler
|
||||||
|
works.
|
||||||
|
|
||||||
|
1997-09-10 05:08 David S. Miller <davem@caip.rutgers.edu>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/sparc/bits/ioctls.h: The TC* ioctls use
|
||||||
|
'T' not 't' on SparcLinux.
|
||||||
|
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: tcflag_t is 32 bits.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add aliases for
|
||||||
|
_longjmp and siglongjmp.
|
||||||
|
|
||||||
|
1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* libio/stdio.h: Add format attributes to the extra printf and
|
||||||
|
scanf like functions.
|
||||||
|
* stdio/stdio.h: Likewise.
|
||||||
|
|
||||||
|
1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r):
|
||||||
|
Print tablename_val, not tablename_len.
|
||||||
|
|
||||||
|
* nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_getntohost_r):
|
||||||
|
Use sprintf instead of sprintf, the string always fits.
|
||||||
|
* nis/nss_nisplus/nisplus-hosts.c (_nss_nisplus_gethostbyaddr_r):
|
||||||
|
Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r):
|
||||||
|
Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-proto.c
|
||||||
|
(_nss_nisplus_getprotobynumber_r): Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-rpc.c (_nss_nisplus_getrpcbynumber_r):
|
||||||
|
Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-service.c
|
||||||
|
(_nss_nisplus_getservbynumber_r): Likewise.
|
||||||
|
|
||||||
|
* nis/nss_nisplus/nisplus-alias.c (_nss_create_tablename): Use
|
||||||
|
__stpcpy, __stpncpy and __strdup instead of public names.
|
||||||
|
* nis/nss_nisplus/nisplus-ethers.c (_nss_create_tablename):
|
||||||
|
Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-grp.c (_nss_create_tablename): Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-hosts.c (_nss_create_tablename):
|
||||||
|
Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-netgrp.c (_nss_nisplus_parse_netgroup):
|
||||||
|
Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-network.c (_nss_nisplus_parse_netent):
|
||||||
|
Likewise.
|
||||||
|
(_nss_create_tablename): Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-proto.c (_nss_nisplus_parse_protoent):
|
||||||
|
Likewise.
|
||||||
|
(_nss_create_tablename): Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-pwd.c (_nss_create_tablename):
|
||||||
|
Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-rpc.c (_nss_nisplus_parse_rpcent):
|
||||||
|
Likewise.
|
||||||
|
(_nss_create_tablename): Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-service.c (_nss_nisplus_parse_servent):
|
||||||
|
Likewise.
|
||||||
|
(_nss_create_tablename): Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-spwd.c (_nss_create_tablename):
|
||||||
|
Likewise.
|
||||||
|
|
||||||
|
* libc.map: Export __stpcpy and __strdup.
|
||||||
|
|
||||||
|
1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* math/Makefile (CFLAGS-test-float.c, CFLAGS-test-double.c,
|
||||||
|
CFLAGS-test-ldouble.c): Pass -ffloat-store to avoid excessive
|
||||||
|
precision.
|
||||||
|
|
||||||
|
1997-09-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* include/rpc/auth_des.h: New file.
|
||||||
|
|
||||||
|
1997-09-09 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
|
* time/mktime.c (__mktime_internal): Declare sec_requested even if
|
||||||
|
!LEAP_SECONDS_POSSIBLE, since it's needed at the end when checking
|
||||||
|
for time_t overflow.
|
||||||
|
|
||||||
|
1997-09-09 22:11 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* sysdeps/posix/getcwd.c: Correct test for too small buffer.
|
||||||
|
Reported by Erik Troan <ewt@redhat.com>.
|
||||||
|
|
||||||
|
* elf/dl-close.c: Include <bits/libc-lock.h>, not <libc-lock.h>.
|
||||||
|
* elf/dl-open.c: Likewise.
|
||||||
|
|
||||||
|
1997-09-07 17:09 Richard Henderson <rth@cygnus.com>
|
||||||
|
|
||||||
|
* sysdeps/alpha/Makefile: Kill setjmp_aux.
|
||||||
|
* sysdeps/alpha/bits/setjmp.h: Rewrite in terms of an array.
|
||||||
|
* sysdeps/alpha/__longjmp.c: Remove.
|
||||||
|
* sysdeps/alpha/setjmp_aux.c: Remove.
|
||||||
|
* sysdeps/alpha/__longjmp.S: New file.
|
||||||
|
* sysdeps/alpha/bsd-_setjmp.S: Stub out.
|
||||||
|
* sysdeps/alpha/bsd-setjmp.S: Likewise.
|
||||||
|
* sysdeps/alpha/setjmp.S: Do the work; don't call __setjmp_aux.
|
||||||
|
Move _setjmp and setjmp from bsd-*.S.
|
||||||
|
|
||||||
|
1997-09-06 20:20 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* include/rpc/auth.h: New file.
|
||||||
|
* include/rpc/auth_unix.h: New file.
|
||||||
|
|
||||||
|
1997-09-06 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
|
Fix gmtime so that it reports leap seconds when TZ
|
||||||
|
indicates that leap seconds are desired.
|
||||||
|
|
||||||
|
* time/gmtime.c (<stddef.h>): Remove unnecessary include.
|
||||||
|
(gmtime): Put after gmtime_r, to help the compiler inline.
|
||||||
|
(__tz_convert): New decl.
|
||||||
|
(gmtime_r): Use __tz_convert instead of __offtime,
|
||||||
|
so that leap seconds are handled correctly.
|
||||||
|
|
||||||
|
* time/localtime.c (<errno.h>, <libc-lock.h>): Remove includes that
|
||||||
|
are now unnecessary.
|
||||||
|
(__tzset_internal, __tz_compute, __tzfile_compute, __use_tzfile,
|
||||||
|
__tzset_lock): Remove extern decls that are now unnecessary.
|
||||||
|
(localtime_internal): Moved to __tz_convert in tzset.c.
|
||||||
|
so that localtime and gmtime can both use it easily.
|
||||||
|
(localtime): Put after localtime_r, to help the compiler inline.
|
||||||
|
(localtime_r): Use __tz_convert instead of localtime_internal.
|
||||||
|
|
||||||
|
* time/strftime.c (__tz_compute): Remove unused (and now incorrect)
|
||||||
|
decl.
|
||||||
|
|
||||||
|
* time/tzfile.c (__tzfile_compute): New arg USE_LOCALTIME.
|
||||||
|
|
||||||
|
* time/tzset.c (<errno.h>): Include.
|
||||||
|
(_tmbuf): New decl.
|
||||||
|
(__tzfile_compute): New function.
|
||||||
|
(tz_compute): Renamed from __tz_compute. No longer extern.
|
||||||
|
Remove redundant call to tzset_internal.
|
||||||
|
(tzset_internal): Renamed from __tzset_internal. No longer extern.
|
||||||
|
(tzset_lock): Renamed from __tzset_lock. No longer extern.
|
||||||
|
(__tz_convert): New function, containing functionality of old
|
||||||
|
localtime_internal function, plus locking and optional UTC.
|
||||||
|
|
||||||
|
1997-09-06 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
|
* time/tzfile.c (__tzfile_read): Don't read a file if TZ is the empty
|
||||||
|
string, just use UTC without leap seconds. This is for compatibility
|
||||||
|
with the Olson code.
|
||||||
|
|
||||||
|
1997-09-06 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
|
* time/tzset.c (__tzname_max): Lock tz data structures before
|
||||||
|
invoking tzset_internal.
|
||||||
|
|
||||||
|
* time/tzfile.c: Define compute_tzname_max statically.
|
||||||
|
|
||||||
|
1997-09-07 10:57 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
|
||||||
|
|
||||||
|
* nis/nis_call.c: Remove not longer necessary HAVE_SECURE_RPC ifdefs.
|
||||||
|
* nis/nis_intern.h: Likewise.
|
||||||
|
* nis/nss_nis/nis-publickey.c: Likewise.
|
||||||
|
* nis/nss_nisplus/nisplus-publickey.c: Likewise.
|
||||||
|
* nis/ypclnt.c: Likewise.
|
||||||
|
|
||||||
|
* sunrpc/auth_des.c: Don't dereference NULL pointer,
|
||||||
|
initialize ad->ad_timediff.
|
||||||
|
|
||||||
|
* sunrpc/auth_none.c: Don't define our own prototypes, use the one
|
||||||
|
from the header files.
|
||||||
|
* sunrpc/auth_unix.c: Likewise.
|
||||||
|
* sunrpc/clnt_raw.c: Likewise.
|
||||||
|
* sunrpc/clnt_tcp.c: Likewise.
|
||||||
|
* sunrpc/rpc_cmsg.c: Likewise.
|
||||||
|
|
||||||
|
* sunrpc/key_call.c: Fix signal handling.
|
||||||
|
|
||||||
|
* sunrpc/openchild.c: Don't use /bin/sh to start /usr/etc/keyenvoy,
|
||||||
|
or we will get a deadlock with NIS+.
|
||||||
|
|
||||||
|
* sunrpc/rpc/auth.h: Add prototype for xdr_opaque_auth, don't define
|
||||||
|
HAVE_SECURE_RPC.
|
||||||
|
|
||||||
|
1997-09-07 15:51 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* sysdeps/i386/bits/select.h [__GNUC__] (__FD_ZERO, __FD_SET, __FD_CLR,
|
||||||
|
__FD_ISSET): Use correct casts to address array correctly.
|
||||||
|
Reported by urbanw@cs.umu.se.
|
||||||
|
|
||||||
|
1997-09-07 05:07 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* elf/dl-close.c: Include <bits/libc-lock.h>, not <libc-lock.h>.
|
||||||
|
* elf/dl-open.c: Likewise.
|
||||||
|
* sysdeps/i386/memset.c: Undefine memset in case the header with the
|
||||||
|
optimized functions is included.
|
||||||
|
Patches by NIIBE Yutaka <gniibe@mri.co.jp>.
|
||||||
|
|
||||||
|
* sysdeps/i386/bits/string.h [__PIC__] (strcspn, strspn, strpbrk,
|
||||||
|
strsep): Use register for second parameter.
|
||||||
|
* sysdeps/i386/i486/bits/string.h: Likewise.
|
||||||
|
Reported by NIIBE Yutaka <gniibe@mri.co.jp>.
|
||||||
|
|
||||||
|
1997-09-03 09:48 Geoff Keating <geoffk@ozemail.com.au>
|
||||||
|
|
||||||
|
* math/libm-test.c: Change various tolerances to match what the
|
||||||
|
tested routines can actually provide.
|
||||||
|
|
||||||
|
* math/Makefile: Add new tests.
|
||||||
|
* math/atest-sincos.c: New file.
|
||||||
|
* math/atest-exp.c: New file.
|
||||||
|
|
||||||
|
* csu/Makefile: Give initfini.s and initfiniS.s their own
|
||||||
|
CFLAGS-* macros so they can be overridden.
|
||||||
|
* sysdeps/powerpc/Makefile [subdir=csu]: Override flags for
|
||||||
|
initfiniS.s to use -fpic instead of -fPIC, because the sed script
|
||||||
|
breaks otherwise.
|
||||||
|
|
||||||
|
* sysdeps/powerpc/Makefile [build-shared]: Use -fpic not -fPIC for
|
||||||
|
efficiency.
|
||||||
|
|
||||||
|
* sysdeps/powerpc/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE):
|
||||||
|
Don't use register 0, to let _mcount be in a shared object.
|
||||||
|
|
||||||
|
* sysdeps/powerpc/dl-machine.h: Use full sentences in comments.
|
||||||
|
Generally clean up. Suppress some code we don't need when relocating
|
||||||
|
ld.so.
|
||||||
|
* sysdeps/powerpc/test-arith.c: Change loop indices to size_t when
|
||||||
|
appropriate to suppress gcc warning.
|
||||||
|
* resolv/res_send.c: Suppress warning.
|
||||||
|
* sunrpc/xdr_sizeof.c: Suppress warning.
|
||||||
|
|
||||||
|
* FAQ: Add ppc-linux.
|
||||||
|
* manual/maint.texi: Add ppc-linux. Explain that gcc can't build it
|
||||||
|
yet.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/profil-counter.h: Correct for
|
||||||
|
current kernels.
|
||||||
|
|
||||||
|
1997-08-15 07:45 Geoff Keating <geoffk@ozemail.com.au>
|
||||||
|
|
||||||
|
* stdlib/fmtmsg.c: Use two parameters for __libc_once_define.
|
||||||
|
* sysdeps/i386/machine-gmon.h: Correct typo.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Change to match
|
||||||
|
kernel.
|
||||||
|
|
||||||
|
* sysdeps/generic/dl-sysdep.c: Add hook for bizzare PPC argument hack.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Rewrite to use
|
||||||
|
sysdeps/linux/dl-sysdep.c.
|
||||||
|
|
||||||
|
* sysdeps/powerpc/Makefile [subdir=gmon]: Compile ppc-mcount.
|
||||||
|
* sysdeps/powerpc/machine-gmon.h: Use ppc-mcount.
|
||||||
|
* sysdeps/powerpc/ppc-mcount: New file.
|
||||||
|
|
||||||
|
The following are mostly changes to allow profiling:
|
||||||
|
* sysdeps/powerpc/add_n.S: Added.
|
||||||
|
* sysdeps/powerpc/add_n.s: Removed.
|
||||||
|
* sysdeps/powerpc/addmul_1.S: Added.
|
||||||
|
* sysdeps/powerpc/addmul_1.s: Removed.
|
||||||
|
* sysdeps/powerpc/bsd-_setjmp.S: Use JUMPTARGET macro.
|
||||||
|
* sysdeps/powerpc/bsd-setjmp.S: Use JUMPTARGET macro.
|
||||||
|
* sysdeps/powerpc/lshift.S: Added.
|
||||||
|
* sysdeps/powerpc/lshift.s: Removed.
|
||||||
|
* sysdeps/powerpc/memset.S: Added.
|
||||||
|
* sysdeps/powerpc/memset.s: Removed.
|
||||||
|
* sysdeps/powerpc/mul_1.S: Added.
|
||||||
|
* sysdeps/powerpc/mul_1.s: Removed.
|
||||||
|
* sysdeps/powerpc/rshift.S: Added.
|
||||||
|
* sysdeps/powerpc/rshift.s: Removed.
|
||||||
|
* sysdeps/powerpc/s_copysign.S: Use ENTRY, END, weak_alias macros.
|
||||||
|
* sysdeps/powerpc/s_fabs.S: Use ENTRY, END, weak_alias macros.
|
||||||
|
* sysdeps/powerpc/setjmp.S: Use JUMPTARGET macro.
|
||||||
|
* sysdeps/powerpc/strchr.S: Added.
|
||||||
|
* sysdeps/powerpc/strchr.s: Removed.
|
||||||
|
* sysdeps/powerpc/strcmp.S: Added.
|
||||||
|
* sysdeps/powerpc/strcmp.s: Removed.
|
||||||
|
* sysdeps/powerpc/strlen.S: Added.
|
||||||
|
* sysdeps/powerpc/strlen.s: Removed.
|
||||||
|
* sysdeps/powerpc/sub_n.S: Added.
|
||||||
|
* sysdeps/powerpc/sub_n.s: Removed.
|
||||||
|
* sysdeps/powerpc/submul_1.S: Added.
|
||||||
|
* sysdeps/powerpc/submul_1.s: Removed.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/_exit.S: Removed.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/brk.S: Added.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/brk.c: Removed.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/clone.S: Use new macros. Fix
|
||||||
|
various bugs. Document that it isn't tested.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/sigreturn.S: Make look like
|
||||||
|
sysdeps/unix/_exit.S.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/socket.S: Use new macros.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/syscall.S: Use new macros.
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/sysdep.h: Define some new macros
|
||||||
|
to make assembler (possibly) more portable, allow profiling, etc.
|
||||||
|
|
||||||
1997-09-05 03:15 Ulrich Drepper <drepper@cygnus.com>
|
1997-09-05 03:15 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* Makefile (subdirs): Reorganize order so that nss follows add-ons.
|
* Makefile (subdirs): Reorganize order so that nss follows add-ons.
|
||||||
|
4
FAQ
4
FAQ
@ -102,6 +102,7 @@ in the future are:
|
|||||||
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
||||||
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
||||||
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
||||||
|
powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems
|
||||||
|
|
||||||
Other Linux platforms are also on the way to be supported but I need
|
Other Linux platforms are also on the way to be supported but I need
|
||||||
some success reports first.
|
some success reports first.
|
||||||
@ -177,7 +178,8 @@ Library.
|
|||||||
form the tools from the GNU gettext package are necessary. See
|
form the tools from the GNU gettext package are necessary. See
|
||||||
ftp://prep.ai.mit.edu/pub/gnu or better any mirror site.
|
ftp://prep.ai.mit.edu/pub/gnu or better any mirror site.
|
||||||
|
|
||||||
* lots of diskspace (for i?86-linux this means, e.g., ~70MB).
|
* lots of diskspace (for i?86-linux this means, e.g., ~170MB; for ppc-linux
|
||||||
|
even ~200MB).
|
||||||
|
|
||||||
You should avoid compiling on a NFS mounted device. This is very
|
You should avoid compiling on a NFS mounted device. This is very
|
||||||
slow.
|
slow.
|
||||||
|
14
Makeconfig
14
Makeconfig
@ -338,15 +338,19 @@ ifndef asm-CPPFLAGS
|
|||||||
asm-CPPFLAGS =
|
asm-CPPFLAGS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# ELF always supports init/fini sections
|
||||||
|
ifeq ($(elf),yes)
|
||||||
|
have-initfini = yes
|
||||||
|
endif
|
||||||
|
|
||||||
# Installed name of the startup code.
|
# Installed name of the startup code.
|
||||||
ifneq ($(elf),yes)
|
ifneq ($(have-initfini),yes)
|
||||||
# When not using ELF, there is just one startfile, called crt0.o.
|
# When not having init/fini, there is just one startfile, called crt0.o.
|
||||||
start-installed-name = crt0.o
|
start-installed-name = crt0.o
|
||||||
else
|
else
|
||||||
# In the ELF universe, crt0.o is called crt1.o, and there are
|
# On systems having init/fini, crt0.o is called crt1.o, and there are
|
||||||
# some additional bizarre files.
|
# some additional bizarre files.
|
||||||
start-installed-name = crt1.o
|
start-installed-name = crt1.o
|
||||||
have-initfini = yes
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@ -584,6 +588,8 @@ $(common-objpfx)version.mk: $(..)version.h $(..)Makeconfig
|
|||||||
< $< > $@-new
|
< $< > $@-new
|
||||||
mv -f $@-new $@
|
mv -f $@-new $@
|
||||||
|
|
||||||
|
common-generated += version.mk
|
||||||
|
|
||||||
ifeq (yes, $(build-shared))
|
ifeq (yes, $(build-shared))
|
||||||
|
|
||||||
# Process the shlib-versions file, which tells us what shared library
|
# Process the shlib-versions file, which tells us what shared library
|
||||||
|
1
Makefile
1
Makefile
@ -268,6 +268,7 @@ distclean-1: subdir_$(distclean-1)
|
|||||||
-rm -f $(config-generated)
|
-rm -f $(config-generated)
|
||||||
-rm -f $(addprefix $(objpfx),config.status config.cache config.log)
|
-rm -f $(addprefix $(objpfx),config.status config.cache config.log)
|
||||||
-rm -f $(addprefix $(objpfx),config.make config-name.h config.h)
|
-rm -f $(addprefix $(objpfx),config.make config-name.h config.h)
|
||||||
|
-rm -f $(addprefix $(objpfx),glibcbug)
|
||||||
ifdef objdir
|
ifdef objdir
|
||||||
-rm -f $(objpfx)Makefile
|
-rm -f $(objpfx)Makefile
|
||||||
endif
|
endif
|
||||||
|
@ -377,8 +377,8 @@ endef
|
|||||||
# Also omits crti.o and crtn.o, which we do not want
|
# Also omits crti.o and crtn.o, which we do not want
|
||||||
# since we define our own `.init' section specially.
|
# since we define our own `.init' section specially.
|
||||||
LDFLAGS-c.so = -nostdlib -nostartfiles
|
LDFLAGS-c.so = -nostdlib -nostartfiles
|
||||||
# But we still want to link libc.so against -lgcc.
|
# But we still want to link libc.so against $(gnulib).
|
||||||
LDLIBS-c.so = -lgcc
|
LDLIBS-c.so = $(gnulib)
|
||||||
# Give libc.so an entry point and make it directly runnable itself.
|
# Give libc.so an entry point and make it directly runnable itself.
|
||||||
LDFLAGS-c.so += -e __libc_main
|
LDFLAGS-c.so += -e __libc_main
|
||||||
# We have a versioning file for libc.so.
|
# We have a versioning file for libc.so.
|
||||||
|
@ -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.
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
# The GNU C Library is free software; you can redistribute it and/or
|
# The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -29,6 +29,8 @@ install-bin = gencat
|
|||||||
|
|
||||||
gencat-modules = xmalloc
|
gencat-modules = xmalloc
|
||||||
|
|
||||||
|
generated += xmalloc.o
|
||||||
|
|
||||||
# To find xmalloc.c
|
# To find xmalloc.c
|
||||||
vpath %.c ../locale/programs
|
vpath %.c ../locale/programs
|
||||||
|
|
||||||
|
61
config.guess
vendored
61
config.guess
vendored
@ -52,6 +52,9 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
|
|||||||
|
|
||||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||||
alpha:OSF1:*:*)
|
alpha:OSF1:*:*)
|
||||||
|
if test $UNAME_RELEASE = "V4.0"; then
|
||||||
|
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||||
|
fi
|
||||||
# A Vn.n version is a released version.
|
# A Vn.n version is a released version.
|
||||||
# A Tn.n version is a released field test version.
|
# A Tn.n version is a released field test version.
|
||||||
# A Xn.n version is an unreleased experimental baselevel.
|
# A Xn.n version is an unreleased experimental baselevel.
|
||||||
@ -62,9 +65,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
main:
|
main:
|
||||||
.frame \$30,0,\$26,0
|
.frame \$30,0,\$26,0
|
||||||
.prologue 0
|
.prologue 0
|
||||||
.long 0x47e03d84
|
.long 0x47e03d80 # implver $0
|
||||||
cmoveq \$4,0,\$3
|
lda \$2,259
|
||||||
addl \$3,\$31,\$0
|
.long 0x47e20c21 # amask $2,$1
|
||||||
|
srl \$1,8,\$2
|
||||||
|
sll \$2,2,\$2
|
||||||
|
sll \$0,3,\$0
|
||||||
|
addl \$1,\$0,\$0
|
||||||
|
addl \$2,\$0,\$0
|
||||||
ret \$31,(\$26),1
|
ret \$31,(\$26),1
|
||||||
.end main
|
.end main
|
||||||
EOF
|
EOF
|
||||||
@ -72,16 +80,25 @@ EOF
|
|||||||
if test "$?" = 0 ; then
|
if test "$?" = 0 ; then
|
||||||
./dummy
|
./dummy
|
||||||
case "$?" in
|
case "$?" in
|
||||||
1)
|
7)
|
||||||
|
UNAME_MACHINE="alpha"
|
||||||
|
;;
|
||||||
|
15)
|
||||||
UNAME_MACHINE="alphaev5"
|
UNAME_MACHINE="alphaev5"
|
||||||
;;
|
;;
|
||||||
2)
|
14)
|
||||||
UNAME_MACHINE="alphaev56"
|
UNAME_MACHINE="alphaev56"
|
||||||
;;
|
;;
|
||||||
|
10)
|
||||||
|
UNAME_MACHINE="alphapca56"
|
||||||
|
;;
|
||||||
|
16)
|
||||||
|
UNAME_MACHINE="alphaev6"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
rm -f dummy.s dummy
|
rm -f dummy.s dummy
|
||||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
|
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
21064:Windows_NT:50:3)
|
21064:Windows_NT:50:3)
|
||||||
echo alpha-dec-winnt3.5
|
echo alpha-dec-winnt3.5
|
||||||
@ -500,9 +517,14 @@ EOF
|
|||||||
main:
|
main:
|
||||||
.frame \$30,0,\$26,0
|
.frame \$30,0,\$26,0
|
||||||
.prologue 0
|
.prologue 0
|
||||||
.long 0x47e03d84
|
.long 0x47e03d80 # implver $0
|
||||||
cmoveq \$4,0,\$3
|
lda \$2,259
|
||||||
addl \$3,\$31,\$0
|
.long 0x47e20c21 # amask $2,$1
|
||||||
|
srl \$1,8,\$2
|
||||||
|
sll \$2,2,\$2
|
||||||
|
sll \$0,3,\$0
|
||||||
|
addl \$1,\$0,\$0
|
||||||
|
addl \$2,\$0,\$0
|
||||||
ret \$31,(\$26),1
|
ret \$31,(\$26),1
|
||||||
.end main
|
.end main
|
||||||
EOF
|
EOF
|
||||||
@ -511,12 +533,21 @@ EOF
|
|||||||
if test "$?" = 0 ; then
|
if test "$?" = 0 ; then
|
||||||
./dummy
|
./dummy
|
||||||
case "$?" in
|
case "$?" in
|
||||||
1)
|
7)
|
||||||
UNAME_MACHINE="alphaev5"
|
UNAME_MACHINE="alpha"
|
||||||
;;
|
;;
|
||||||
2)
|
15)
|
||||||
UNAME_MACHINE="alphaev56"
|
UNAME_MACHINE="alphaev5"
|
||||||
;;
|
;;
|
||||||
|
14)
|
||||||
|
UNAME_MACHINE="alphaev56"
|
||||||
|
;;
|
||||||
|
10)
|
||||||
|
UNAME_MACHINE="alphapca56"
|
||||||
|
;;
|
||||||
|
16)
|
||||||
|
UNAME_MACHINE="alphaev6"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
objdump --private-headers dummy | \
|
objdump --private-headers dummy | \
|
||||||
|
15
config.sub
vendored
15
config.sub
vendored
@ -149,14 +149,14 @@ esac
|
|||||||
case $basic_machine in
|
case $basic_machine in
|
||||||
# Recognize the basic CPU types without company name.
|
# Recognize the basic CPU types without company name.
|
||||||
# Some are omitted here because they have special meanings below.
|
# Some are omitted here because they have special meanings below.
|
||||||
tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
|
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||||
| arme[lb] | pyramid | mn10200 | mn10300 \
|
| arme[lb] | pyramid | mn10200 | mn10300 \
|
||||||
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
|
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
|
||||||
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
||||||
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
||||||
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
||||||
| mipstx39 | mipstx39el \
|
| mipstx39 | mipstx39el \
|
||||||
| sparc | sparclet | sparclite | sparc64)
|
| sparc | sparclet | sparclite | sparc64 | v850)
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
;;
|
;;
|
||||||
# We use `pc' rather than `unknown'
|
# We use `pc' rather than `unknown'
|
||||||
@ -172,7 +172,7 @@ case $basic_machine in
|
|||||||
;;
|
;;
|
||||||
# Recognize the basic CPU types with company name.
|
# Recognize the basic CPU types with company name.
|
||||||
vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
|
vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
|
||||||
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
|
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||||
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
||||||
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
|
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
|
||||||
@ -209,9 +209,9 @@ case $basic_machine in
|
|||||||
amiga | amiga-*)
|
amiga | amiga-*)
|
||||||
basic_machine=m68k-cbm
|
basic_machine=m68k-cbm
|
||||||
;;
|
;;
|
||||||
amigados)
|
amigaos | amigados)
|
||||||
basic_machine=m68k-cbm
|
basic_machine=m68k-cbm
|
||||||
os=-amigados
|
os=-amigaos
|
||||||
;;
|
;;
|
||||||
amigaunix | amix)
|
amigaunix | amix)
|
||||||
basic_machine=m68k-cbm
|
basic_machine=m68k-cbm
|
||||||
@ -707,7 +707,8 @@ case $os in
|
|||||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||||
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
|
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||||
|
| -aos* \
|
||||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||||
@ -841,7 +842,7 @@ case $basic_machine in
|
|||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
*-cbm)
|
*-cbm)
|
||||||
os=-amigados
|
os=-amigaos
|
||||||
;;
|
;;
|
||||||
*-dg)
|
*-dg)
|
||||||
os=-dgux
|
os=-dgux
|
||||||
|
62
configure
vendored
62
configure
vendored
@ -1918,23 +1918,26 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if test $elf = yes; then
|
if test $elf = yes; then
|
||||||
libc_cv_asm_underscores=no
|
libc_cv_asm_underscores=no
|
||||||
else
|
else
|
||||||
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
if test $ac_cv_prog_cc_works = yes; then
|
||||||
echo "configure:1926: checking for _ prefix on C symbol names" >&5
|
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||||
|
echo "configure:1929: checking for _ prefix on C symbol names" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 1931 "configure"
|
#line 1934 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
asm ("_glibc_foobar:");
|
asm ("_glibc_foobar:");
|
||||||
int main() {
|
int main() {
|
||||||
glibc_foobar ();
|
glibc_foobar ();
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
if { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
libc_cv_asm_underscores=yes
|
libc_cv_asm_underscores=yes
|
||||||
else
|
else
|
||||||
@ -1947,6 +1950,37 @@ rm -f conftest*
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
|
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
|
||||||
|
else
|
||||||
|
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||||
|
echo "configure:1956: checking for _ prefix on C symbol names" >&5
|
||||||
|
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||||
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
else
|
||||||
|
cat > conftest.$ac_ext <<EOF
|
||||||
|
#line 1961 "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
void underscore_test(void) {
|
||||||
|
return; }
|
||||||
|
EOF
|
||||||
|
if { (eval echo configure:1966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||||
|
if grep _underscore_test conftest* >/dev/null; then
|
||||||
|
rm -f conftest*
|
||||||
|
libc_cv_asm_underscores=yes
|
||||||
|
else
|
||||||
|
rm -f conftest*
|
||||||
|
libc_cv_asm_underscores=no
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "configure: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
rm -f conftest*
|
||||||
|
libc_cv_asm_underscores=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if test $libc_cv_asm_underscores = no; then
|
if test $libc_cv_asm_underscores = no; then
|
||||||
cat >> confdefs.h <<\EOF
|
cat >> confdefs.h <<\EOF
|
||||||
@ -1961,7 +1995,7 @@ if test $elf = yes; then
|
|||||||
libc_cv_asm_weakext_directive=no
|
libc_cv_asm_weakext_directive=no
|
||||||
else
|
else
|
||||||
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
|
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
|
||||||
echo "configure:1965: checking for assembler .weak directive" >&5
|
echo "configure:1999: checking for assembler .weak directive" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@ -1984,7 +2018,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
|
|||||||
|
|
||||||
if test $libc_cv_asm_weak_directive = no; then
|
if test $libc_cv_asm_weak_directive = no; then
|
||||||
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
|
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
|
||||||
echo "configure:1988: checking for assembler .weakext directive" >&5
|
echo "configure:2022: checking for assembler .weakext directive" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@ -2021,7 +2055,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
|
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
|
||||||
echo "configure:2025: checking for ld --no-whole-archive" >&5
|
echo "configure:2059: checking for ld --no-whole-archive" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@ -2032,7 +2066,7 @@ __throw () {}
|
|||||||
EOF
|
EOF
|
||||||
if { ac_try='${CC-cc} $CFLAGS
|
if { ac_try='${CC-cc} $CFLAGS
|
||||||
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
||||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
-o conftest conftest.c 1>&5'; { (eval echo configure:2070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||||
libc_cv_ld_no_whole_archive=yes
|
libc_cv_ld_no_whole_archive=yes
|
||||||
else
|
else
|
||||||
libc_cv_ld_no_whole_archive=no
|
libc_cv_ld_no_whole_archive=no
|
||||||
@ -2043,7 +2077,7 @@ fi
|
|||||||
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
|
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
|
||||||
|
|
||||||
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
|
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
|
||||||
echo "configure:2047: checking for gcc -fno-exceptions" >&5
|
echo "configure:2081: checking for gcc -fno-exceptions" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@ -2054,7 +2088,7 @@ __throw () {}
|
|||||||
EOF
|
EOF
|
||||||
if { ac_try='${CC-cc} $CFLAGS
|
if { ac_try='${CC-cc} $CFLAGS
|
||||||
-nostdlib -nostartfiles -fno-exceptions
|
-nostdlib -nostartfiles -fno-exceptions
|
||||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
-o conftest conftest.c 1>&5'; { (eval echo configure:2092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||||
libc_cv_gcc_no_exceptions=yes
|
libc_cv_gcc_no_exceptions=yes
|
||||||
else
|
else
|
||||||
libc_cv_gcc_no_exceptions=no
|
libc_cv_gcc_no_exceptions=no
|
||||||
@ -2106,7 +2140,7 @@ if test "$uname" = "sysdeps/generic"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
||||||
echo "configure:2110: checking OS release for uname" >&5
|
echo "configure:2144: checking OS release for uname" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@ -2128,7 +2162,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
|
|||||||
uname_release="$libc_cv_uname_release"
|
uname_release="$libc_cv_uname_release"
|
||||||
|
|
||||||
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
||||||
echo "configure:2132: checking OS version for uname" >&5
|
echo "configure:2166: checking OS version for uname" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@ -2150,7 +2184,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
||||||
echo "configure:2154: checking stdio selection" >&5
|
echo "configure:2188: checking stdio selection" >&5
|
||||||
|
|
||||||
case $stdio in
|
case $stdio in
|
||||||
libio) cat >> confdefs.h <<\EOF
|
libio) cat >> confdefs.h <<\EOF
|
||||||
@ -2162,7 +2196,7 @@ esac
|
|||||||
echo "$ac_t""$stdio" 1>&6
|
echo "$ac_t""$stdio" 1>&6
|
||||||
|
|
||||||
echo $ac_n "checking ldap selection""... $ac_c" 1>&6
|
echo $ac_n "checking ldap selection""... $ac_c" 1>&6
|
||||||
echo "configure:2166: checking ldap selection" >&5
|
echo "configure:2200: checking ldap selection" >&5
|
||||||
|
|
||||||
case $add_ons in
|
case $add_ons in
|
||||||
*ldap*)
|
*ldap*)
|
||||||
|
40
configure.in
40
configure.in
@ -605,13 +605,45 @@ if test $elf != yes; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl AC_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||||
|
AC_DEFUN(AC_CHECK_ASM_UNDERSCORE,
|
||||||
|
[cat > conftest.$ac_ext <<EOF
|
||||||
|
dnl This sometimes fails to find confdefs.h, for some reason.
|
||||||
|
dnl [#]line __oline__ "[$]0"
|
||||||
|
[#]line __oline__ "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
void underscore_test(void) {
|
||||||
|
return; }
|
||||||
|
EOF
|
||||||
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
|
if grep _underscore_test conftest* >/dev/null; then
|
||||||
|
ifelse([$1], , :, [rm -f conftest*
|
||||||
|
$1])
|
||||||
|
else
|
||||||
|
ifelse([$2], , , [rm -f conftest*
|
||||||
|
$2])
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "configure: failed program was:" >&AC_FD_CC
|
||||||
|
cat conftest.$ac_ext >&AC_FD_CC
|
||||||
|
ifelse([$2], , , [rm -f conftest*
|
||||||
|
$2])
|
||||||
|
fi
|
||||||
|
rm -f conftest*])
|
||||||
|
|
||||||
if test $elf = yes; then
|
if test $elf = yes; then
|
||||||
libc_cv_asm_underscores=no
|
libc_cv_asm_underscores=no
|
||||||
else
|
else
|
||||||
AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
|
if test $ac_cv_prog_cc_works = yes; then
|
||||||
[AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
|
AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
|
||||||
libc_cv_asm_underscores=yes,
|
[AC_TRY_LINK([asm ("_glibc_foobar:");], [glibc_foobar ();],
|
||||||
libc_cv_asm_underscores=no)])
|
libc_cv_asm_underscores=yes,
|
||||||
|
libc_cv_asm_underscores=no)])
|
||||||
|
else
|
||||||
|
AC_CACHE_CHECK(for _ prefix on C symbol names, libc_cv_asm_underscores,
|
||||||
|
[AC_CHECK_ASM_UNDERSCORE(libc_cv_asm_underscores=yes,
|
||||||
|
libc_cv_asm_underscores=no)])
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if test $libc_cv_asm_underscores = no; then
|
if test $libc_cv_asm_underscores = no; then
|
||||||
AC_DEFINE(NO_UNDERSCORES)
|
AC_DEFINE(NO_UNDERSCORES)
|
||||||
|
@ -55,15 +55,17 @@ crtstuff = crti crtn
|
|||||||
|
|
||||||
install-lib += $(crtstuff:=.o)
|
install-lib += $(crtstuff:=.o)
|
||||||
extra-objs += $(crtstuff:=.o)
|
extra-objs += $(crtstuff:=.o)
|
||||||
generated += $(crtstuff:=.S) initfini.s align.h end.h
|
generated += $(crtstuff:=.S) initfini.s defs.h
|
||||||
omit-deps += $(crtstuff)
|
omit-deps += $(crtstuff)
|
||||||
|
|
||||||
# Special rules for the building of crti.o and crtn.o
|
# Special rules for the building of crti.o and crtn.o
|
||||||
$(objpfx)crt%.o: $(objpfx)crt%.S $(objpfx)defs.h
|
$(objpfx)crt%.o: $(objpfx)crt%.S $(objpfx)defs.h
|
||||||
$(compile.S) -g0 $(ASFLAGS-.os) -o $@
|
$(compile.S) -g0 $(ASFLAGS-.os) -o $@
|
||||||
|
|
||||||
|
CFLAGS-initfini.s = -O0 -g0 -fPIC
|
||||||
|
|
||||||
$(objpfx)initfini.s: initfini.c
|
$(objpfx)initfini.s: initfini.c
|
||||||
$(compile.c) -O0 -g0 -S -fPIC -finhibit-size-directive \
|
$(compile.c) -S $(CFLAGS-initfini.s) -finhibit-size-directive \
|
||||||
$(no-exceptions) -o $@
|
$(no-exceptions) -o $@
|
||||||
|
|
||||||
# We only have one kind of startup code files. Static binaries and
|
# We only have one kind of startup code files. Static binaries and
|
||||||
|
3
db2/README
Normal file
3
db2/README
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
The LICENSE file, mentioned in the beginning of the source files, can
|
||||||
|
be found together with all the other relevant license texts in the
|
||||||
|
manual and the INSTALL file in the toplevel directory.
|
@ -301,7 +301,7 @@ __bam_split_recover(logp, dbtp, lsnp, redo, info)
|
|||||||
if ((_lp = (PAGE *)malloc(file_dbp->pgsize)) == NULL)
|
if ((_lp = (PAGE *)malloc(file_dbp->pgsize)) == NULL)
|
||||||
goto nomem;
|
goto nomem;
|
||||||
if ((_rp = (PAGE *)malloc(file_dbp->pgsize)) == NULL) {
|
if ((_rp = (PAGE *)malloc(file_dbp->pgsize)) == NULL) {
|
||||||
nomem: errno = ENOMEM;
|
nomem: __set_errno(ENOMEM);
|
||||||
__db_err(file_dbp->dbenv, "%s", strerror(errno));
|
__db_err(file_dbp->dbenv, "%s", strerror(errno));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -668,7 +668,7 @@ __bam_cadjust_recover(logp, dbtp, lsnp, redo, info)
|
|||||||
REC_INTRO(__bam_cadjust_read);
|
REC_INTRO(__bam_cadjust_read);
|
||||||
|
|
||||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) {
|
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) {
|
||||||
errno = __db_pgerr(file_dbp, argp->pgno);
|
__set_errno(__db_pgerr(file_dbp, argp->pgno));
|
||||||
pagep = NULL;
|
pagep = NULL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ static const char sccsid[] = "@(#)getlong.c 10.2 (Sleepycat) 5/1/97";
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
|
#include "db_int.h"
|
||||||
#include "clib_ext.h"
|
#include "clib_ext.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -34,7 +35,7 @@ get_long(p, min, max, storep)
|
|||||||
long val;
|
long val;
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
errno = 0;
|
__set_errno(0);
|
||||||
val = strtol(p, &end, 10);
|
val = strtol(p, &end, 10);
|
||||||
if ((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE)
|
if ((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE)
|
||||||
err(1, "%s", p);
|
err(1, "%s", p);
|
||||||
|
@ -38,7 +38,7 @@ static int db185_seq __P((const DB185 *, DBT185 *, DBT185 *, u_int));
|
|||||||
static int db185_sync __P((const DB185 *, u_int));
|
static int db185_sync __P((const DB185 *, u_int));
|
||||||
|
|
||||||
DB185 *
|
DB185 *
|
||||||
dbopen(file, oflags, mode, type, openinfo)
|
__dbopen(file, oflags, mode, type, openinfo)
|
||||||
const char *file;
|
const char *file;
|
||||||
int oflags, mode;
|
int oflags, mode;
|
||||||
DBTYPE type;
|
DBTYPE type;
|
||||||
@ -181,18 +181,19 @@ dbopen(file, oflags, mode, type, openinfo)
|
|||||||
* Store the returned pointer to the real DB 2.0 structure in the
|
* Store the returned pointer to the real DB 2.0 structure in the
|
||||||
* internal pointer. Ugly, but we're not going for pretty, here.
|
* internal pointer. Ugly, but we're not going for pretty, here.
|
||||||
*/
|
*/
|
||||||
if ((errno = db_open(file,
|
if ((__set_errno(db_open(file,
|
||||||
type, __db_oflags(oflags), mode, NULL, dbinfop, &dbp)) != 0) {
|
type, __db_oflags(oflags), mode, NULL, dbinfop, &dbp))) != 0) {
|
||||||
free(db185p);
|
free(db185p);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the cursor used for sequential ops. */
|
/* Create the cursor used for sequential ops. */
|
||||||
if ((errno = dbp->cursor(dbp, NULL, &((DB185 *)db185p)->dbc)) != 0) {
|
if ((__set_errno(dbp->cursor(dbp, NULL, &((DB185 *)db185p)->dbc)))
|
||||||
|
!= 0) {
|
||||||
s_errno = errno;
|
s_errno = errno;
|
||||||
(void)dbp->close(dbp, 0);
|
(void)dbp->close(dbp, 0);
|
||||||
free(db185p);
|
free(db185p);
|
||||||
errno = s_errno;
|
__set_errno(s_errno);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,9 +201,10 @@ dbopen(file, oflags, mode, type, openinfo)
|
|||||||
return (db185p);
|
return (db185p);
|
||||||
|
|
||||||
einval: free(db185p);
|
einval: free(db185p);
|
||||||
errno = EINVAL;
|
__set_errno(EINVAL);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
weak_alias (__dbopen, dbopen)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
db185_close(db185p)
|
db185_close(db185p)
|
||||||
@ -212,7 +214,7 @@ db185_close(db185p)
|
|||||||
|
|
||||||
dbp = (DB *)db185p->internal;
|
dbp = (DB *)db185p->internal;
|
||||||
|
|
||||||
errno = dbp->close(dbp, 0);
|
__set_errno(dbp->close(dbp, 0));
|
||||||
|
|
||||||
free(db185p);
|
free(db185p);
|
||||||
|
|
||||||
@ -237,9 +239,9 @@ db185_del(db185p, key185, flags)
|
|||||||
if (flags & ~R_CURSOR)
|
if (flags & ~R_CURSOR)
|
||||||
goto einval;
|
goto einval;
|
||||||
if (flags & R_CURSOR)
|
if (flags & R_CURSOR)
|
||||||
errno = db185p->dbc->c_del(db185p->dbc, 0);
|
__set_errno(db185p->dbc->c_del(db185p->dbc, 0));
|
||||||
else
|
else
|
||||||
errno = dbp->del(dbp, NULL, &key, 0);
|
__set_errno(dbp->del(dbp, NULL, &key, 0));
|
||||||
|
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -249,7 +251,7 @@ db185_del(db185p, key185, flags)
|
|||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
einval: errno = EINVAL;
|
einval: __set_errno(EINVAL);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,7 +264,7 @@ db185_fd(db185p)
|
|||||||
|
|
||||||
dbp = (DB *)db185p->internal;
|
dbp = (DB *)db185p->internal;
|
||||||
|
|
||||||
return ((errno = dbp->fd(dbp, &fd)) == 0 ? fd : -1);
|
return ((__set_errno(dbp->fd(dbp, &fd))) == 0 ? fd : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -287,7 +289,7 @@ db185_get(db185p, key185, data185, flags)
|
|||||||
if (flags)
|
if (flags)
|
||||||
goto einval;
|
goto einval;
|
||||||
|
|
||||||
switch (errno = dbp->get(dbp, NULL, &key, &data, 0)) {
|
switch (__set_errno(dbp->get(dbp, NULL, &key, &data, 0))) {
|
||||||
case 0:
|
case 0:
|
||||||
data185->data = data.data;
|
data185->data = data.data;
|
||||||
data185->size = data.size;
|
data185->size = data.size;
|
||||||
@ -297,7 +299,7 @@ db185_get(db185p, key185, data185, flags)
|
|||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
einval: errno = EINVAL;
|
einval: __set_errno(EINVAL);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,46 +326,46 @@ db185_put(db185p, key185, data185, flags)
|
|||||||
|
|
||||||
switch (flags) {
|
switch (flags) {
|
||||||
case 0:
|
case 0:
|
||||||
errno = dbp->put(dbp, NULL, &key, &data, 0);
|
__set_errno(dbp->put(dbp, NULL, &key, &data, 0));
|
||||||
break;
|
break;
|
||||||
case R_CURSOR:
|
case R_CURSOR:
|
||||||
errno =
|
__set_errno(
|
||||||
db185p->dbc->c_put(db185p->dbc, &key, &data, DB_CURRENT);
|
db185p->dbc->c_put(db185p->dbc, &key, &data, DB_CURRENT));
|
||||||
break;
|
break;
|
||||||
case R_IAFTER:
|
case R_IAFTER:
|
||||||
case R_IBEFORE:
|
case R_IBEFORE:
|
||||||
if (dbp->type != DB_RECNO)
|
if (dbp->type != DB_RECNO)
|
||||||
goto einval;
|
goto einval;
|
||||||
|
|
||||||
if ((errno = dbp->cursor(dbp, NULL, &dbcp_put)) != 0)
|
if ((__set_errno(dbp->cursor(dbp, NULL, &dbcp_put))) != 0)
|
||||||
return (-1);
|
return (-1);
|
||||||
if ((errno =
|
if ((__set_errno(
|
||||||
dbcp_put->c_get(dbcp_put, &key, &data, DB_SET)) != 0) {
|
dbcp_put->c_get(dbcp_put, &key, &data, DB_SET))) != 0) {
|
||||||
s_errno = errno;
|
s_errno = errno;
|
||||||
(void)dbcp_put->c_close(dbcp_put);
|
(void)dbcp_put->c_close(dbcp_put);
|
||||||
errno = s_errno;
|
__set_errno(s_errno);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
memset(&data, 0, sizeof(data));
|
memset(&data, 0, sizeof(data));
|
||||||
data.data = data185->data;
|
data.data = data185->data;
|
||||||
data.size = data185->size;
|
data.size = data185->size;
|
||||||
errno = dbcp_put->c_put(dbcp_put,
|
__set_errno(dbcp_put->c_put(dbcp_put,
|
||||||
&key, &data, flags == R_IAFTER ? DB_AFTER : DB_BEFORE);
|
&key, &data, flags == R_IAFTER ? DB_AFTER : DB_BEFORE));
|
||||||
s_errno = errno;
|
s_errno = errno;
|
||||||
(void)dbcp_put->c_close(dbcp_put);
|
(void)dbcp_put->c_close(dbcp_put);
|
||||||
errno = s_errno;
|
__set_errno(s_errno);
|
||||||
break;
|
break;
|
||||||
case R_NOOVERWRITE:
|
case R_NOOVERWRITE:
|
||||||
errno = dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE);
|
__set_errno(dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE));
|
||||||
break;
|
break;
|
||||||
case R_SETCURSOR:
|
case R_SETCURSOR:
|
||||||
if (dbp->type != DB_BTREE && dbp->type != DB_RECNO)
|
if (dbp->type != DB_BTREE && dbp->type != DB_RECNO)
|
||||||
goto einval;
|
goto einval;
|
||||||
|
|
||||||
if ((errno = dbp->put(dbp, NULL, &key, &data, 0)) != 0)
|
if ((__set_errno(dbp->put(dbp, NULL, &key, &data, 0))) != 0)
|
||||||
break;
|
break;
|
||||||
errno =
|
__set_errno(db185p->dbc->c_get(db185p->dbc,
|
||||||
db185p->dbc->c_get(db185p->dbc, &key, &data, DB_SET_RANGE);
|
&key, &data, DB_SET_RANGE));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
goto einval;
|
goto einval;
|
||||||
@ -379,7 +381,7 @@ db185_put(db185p, key185, data185, flags)
|
|||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
einval: errno = EINVAL;
|
einval: __set_errno(EINVAL);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,7 +426,8 @@ db185_seq(db185p, key185, data185, flags)
|
|||||||
default:
|
default:
|
||||||
goto einval;
|
goto einval;
|
||||||
}
|
}
|
||||||
switch (errno = db185p->dbc->c_get(db185p->dbc, &key, &data, flags)) {
|
switch (__set_errno(db185p->dbc->c_get(db185p->dbc,
|
||||||
|
&key, &data, flags))) {
|
||||||
case 0:
|
case 0:
|
||||||
key185->data = key.data;
|
key185->data = key.data;
|
||||||
key185->size = key.size;
|
key185->size = key.size;
|
||||||
@ -436,7 +439,7 @@ db185_seq(db185p, key185, data185, flags)
|
|||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
einval: errno = EINVAL;
|
einval: __set_errno(EINVAL);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,8 +467,8 @@ db185_sync(db185p, flags)
|
|||||||
goto einval;
|
goto einval;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((errno = dbp->sync(dbp, 0)) == 0 ? 0 : -1);
|
return ((__set_errno(dbp->sync(dbp, 0))) == 0 ? 0 : -1);
|
||||||
|
|
||||||
einval: errno = EINVAL;
|
einval: __set_errno(EINVAL);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,7 @@ typedef struct {
|
|||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
DB185 *__dbopen __P((const char *, int, int, DBTYPE, const void *));
|
||||||
DB185 *dbopen __P((const char *, int, int, DBTYPE, const void *));
|
DB185 *dbopen __P((const char *, int, int, DBTYPE, const void *));
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
};
|
};
|
||||||
|
@ -25,6 +25,12 @@
|
|||||||
|
|
||||||
#define DB_MINCACHE 10 /* Minimum cached pages */
|
#define DB_MINCACHE 10 /* Minimum cached pages */
|
||||||
|
|
||||||
|
/* Handle `errno' in the presence of multi-threading correctly. On some
|
||||||
|
systems we need a special macro to do this right. */
|
||||||
|
#ifndef __set_errno
|
||||||
|
# define __set_errno(val) (errno) = (val)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Aligning items to particular sizes or in pages or memory. ALIGNP is a
|
* Aligning items to particular sizes or in pages or memory. ALIGNP is a
|
||||||
* separate macro, as we've had to cast the pointer to different integral
|
* separate macro, as we've had to cast the pointer to different integral
|
||||||
|
@ -199,8 +199,8 @@ dbm_open(file, oflags, mode)
|
|||||||
dbinfo.h_nelem = 1;
|
dbinfo.h_nelem = 1;
|
||||||
|
|
||||||
(void)snprintf(path, sizeof(path), "%s%s", file, DBM_SUFFIX);
|
(void)snprintf(path, sizeof(path), "%s%s", file, DBM_SUFFIX);
|
||||||
if ((errno = db_open(path,
|
if ((__set_errno(db_open(path,
|
||||||
DB_HASH, __db_oflags(oflags), mode, NULL, &dbinfo, &dbp)) != 0)
|
DB_HASH, __db_oflags(oflags), mode, NULL, &dbinfo, &dbp))) != 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
return ((DBM *)dbp);
|
return ((DBM *)dbp);
|
||||||
}
|
}
|
||||||
@ -261,7 +261,7 @@ dbm_firstkey(db)
|
|||||||
DBC *cp;
|
DBC *cp;
|
||||||
|
|
||||||
if ((cp = TAILQ_FIRST(&db->curs_queue)) == NULL)
|
if ((cp = TAILQ_FIRST(&db->curs_queue)) == NULL)
|
||||||
if ((errno = db->cursor(db, NULL, &cp)) != 0) {
|
if ((__set_errno(db->cursor(db, NULL, &cp))) != 0) {
|
||||||
memset(&key, 0, sizeof(key));
|
memset(&key, 0, sizeof(key));
|
||||||
return (key);
|
return (key);
|
||||||
}
|
}
|
||||||
@ -294,7 +294,7 @@ dbm_nextkey(db)
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
if ((cp = TAILQ_FIRST(&db->curs_queue)) == NULL)
|
if ((cp = TAILQ_FIRST(&db->curs_queue)) == NULL)
|
||||||
if ((errno = db->cursor(db, NULL, &cp)) != 0) {
|
if ((__set_errno(db->cursor(db, NULL, &cp))) != 0) {
|
||||||
memset(&key, 0, sizeof(key));
|
memset(&key, 0, sizeof(key));
|
||||||
return (key);
|
return (key);
|
||||||
}
|
}
|
||||||
@ -330,9 +330,9 @@ dbm_delete(db, key)
|
|||||||
_key.size = key.dsize;
|
_key.size = key.dsize;
|
||||||
ret = (((DB *)db)->del)((DB *)db, NULL, &_key, 0);
|
ret = (((DB *)db)->del)((DB *)db, NULL, &_key, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
errno = ENOENT;
|
__set_errno(ENOENT);
|
||||||
else if (ret > 0) {
|
else if (ret > 0) {
|
||||||
errno = ret;
|
__set_errno(ret);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
return (ret);
|
return (ret);
|
||||||
|
@ -300,8 +300,8 @@ retry: count = lt->region->nlockers;
|
|||||||
for (lp = SH_TAILQ_FIRST(&op->holders, __db_lock);
|
for (lp = SH_TAILQ_FIRST(&op->holders, __db_lock);
|
||||||
lp != NULL;
|
lp != NULL;
|
||||||
lp = SH_TAILQ_NEXT(lp, links, __db_lock)) {
|
lp = SH_TAILQ_NEXT(lp, links, __db_lock)) {
|
||||||
if ((errno = __lock_getobj(lt, lp->holder,
|
if ((__set_errno(__lock_getobj(lt, lp->holder,
|
||||||
NULL, DB_LOCK_LOCKER, &lockerp)) != 0) {
|
NULL, DB_LOCK_LOCKER, &lockerp))) != 0) {
|
||||||
__db_err(dbenv,
|
__db_err(dbenv,
|
||||||
"warning unable to find object");
|
"warning unable to find object");
|
||||||
continue;
|
continue;
|
||||||
@ -472,7 +472,7 @@ __dd_debug(dbenv, idmap, bitmap, nlockers)
|
|||||||
* Alloc space to print 10 bytes per item waited on.
|
* Alloc space to print 10 bytes per item waited on.
|
||||||
*/
|
*/
|
||||||
if ((msgbuf = (char *)malloc((nlockers + 1) * 10 + 64)) == NULL) {
|
if ((msgbuf = (char *)malloc((nlockers + 1) * 10 + 64)) == NULL) {
|
||||||
errno = ENOMEM;
|
__set_errno(ENOMEM);
|
||||||
__db_err(dbenv, "%s", strerror(errno));
|
__db_err(dbenv, "%s", strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ log_archive(logp, listp, flags, db_malloc)
|
|||||||
* but that's just not possible.
|
* but that's just not possible.
|
||||||
*/
|
*/
|
||||||
if (LF_ISSET(DB_ARCH_ABS)) {
|
if (LF_ISSET(DB_ARCH_ABS)) {
|
||||||
errno = 0;
|
__set_errno(0);
|
||||||
if ((pref = getcwd(buf, sizeof(buf))) == NULL)
|
if ((pref = getcwd(buf, sizeof(buf))) == NULL)
|
||||||
return (errno == 0 ? ENOMEM : errno);
|
return (errno == 0 ? ENOMEM : errno);
|
||||||
} else
|
} else
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <libc-lock.h>
|
#include <bits/libc-lock.h>
|
||||||
|
|
||||||
|
|
||||||
/* During the program run we must not modify the global data of
|
/* During the program run we must not modify the global data of
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libc-lock.h>
|
#include <bits/libc-lock.h>
|
||||||
|
|
||||||
|
|
||||||
extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
|
extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
|
||||||
|
167
elf/dl-profile.c
167
elf/dl-profile.c
@ -2,6 +2,7 @@
|
|||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
Based on the BSD mcount implementation.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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
|
modify it under the terms of the GNU Library General Public License as
|
||||||
@ -30,6 +31,7 @@
|
|||||||
#include <sys/gmon_out.h>
|
#include <sys/gmon_out.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <atomicity.h>
|
||||||
|
|
||||||
/* The LD_PROFILE feature has to be implemented different to the
|
/* The LD_PROFILE feature has to be implemented different to the
|
||||||
normal profiling using the gmon/ functions. The problem is that an
|
normal profiling using the gmon/ functions. The problem is that an
|
||||||
@ -146,19 +148,19 @@ static long int state;
|
|||||||
static volatile uint16_t *kcount;
|
static volatile uint16_t *kcount;
|
||||||
static size_t kcountsize;
|
static size_t kcountsize;
|
||||||
|
|
||||||
struct here_tostruct
|
struct here_fromstruct
|
||||||
{
|
{
|
||||||
struct here_cg_arc_record volatile *here;
|
struct here_cg_arc_record volatile *here;
|
||||||
uint16_t link;
|
uint16_t link;
|
||||||
};
|
};
|
||||||
|
|
||||||
static uint16_t *froms;
|
static uint16_t *tos;
|
||||||
static size_t fromssize;
|
|
||||||
|
|
||||||
static struct here_tostruct *tos;
|
|
||||||
static size_t tossize;
|
static size_t tossize;
|
||||||
static size_t tolimit;
|
|
||||||
static size_t toidx;
|
static struct here_fromstruct *froms;
|
||||||
|
static size_t fromssize;
|
||||||
|
static size_t fromlimit;
|
||||||
|
static size_t fromidx;
|
||||||
|
|
||||||
static uintptr_t lowpc;
|
static uintptr_t lowpc;
|
||||||
static uintptr_t highpc;
|
static uintptr_t highpc;
|
||||||
@ -170,6 +172,11 @@ static unsigned int log_hashfraction;
|
|||||||
static struct gmon_hdr *addr;
|
static struct gmon_hdr *addr;
|
||||||
static off_t expected_size;
|
static off_t expected_size;
|
||||||
|
|
||||||
|
/* See profil(2) where this is described. */
|
||||||
|
static int s_scale;
|
||||||
|
#define SCALE_1_TO_1 0x10000L
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Set up profiling data to profile object desribed by MAP. The output
|
/* Set up profiling data to profile object desribed by MAP. The output
|
||||||
file is found (or created) in OUTPUT_DIR. */
|
file is found (or created) in OUTPUT_DIR. */
|
||||||
@ -184,7 +191,7 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
ElfW(Addr) mapend = 0;
|
ElfW(Addr) mapend = 0;
|
||||||
struct gmon_hdr gmon_hdr;
|
struct gmon_hdr gmon_hdr;
|
||||||
struct gmon_hist_hdr hist_hdr;
|
struct gmon_hist_hdr hist_hdr;
|
||||||
char *hist;
|
char *hist, *cp;
|
||||||
size_t idx;
|
size_t idx;
|
||||||
|
|
||||||
/* Compute the size of the sections which contain program code. */
|
/* Compute the size of the sections which contain program code. */
|
||||||
@ -205,9 +212,9 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
with the same formulars as in `monstartup' (see gmon.c). */
|
with the same formulars as in `monstartup' (see gmon.c). */
|
||||||
state = GMON_PROF_OFF;
|
state = GMON_PROF_OFF;
|
||||||
lowpc = ROUNDDOWN (mapstart + map->l_addr,
|
lowpc = ROUNDDOWN (mapstart + map->l_addr,
|
||||||
HISTFRACTION * sizeof(HISTCOUNTER));
|
HISTFRACTION * sizeof (HISTCOUNTER));
|
||||||
highpc = ROUNDUP (mapend + map->l_addr,
|
highpc = ROUNDUP (mapend + map->l_addr,
|
||||||
HISTFRACTION * sizeof(HISTCOUNTER));
|
HISTFRACTION * sizeof (HISTCOUNTER));
|
||||||
textsize = highpc - lowpc;
|
textsize = highpc - lowpc;
|
||||||
kcountsize = textsize / HISTFRACTION;
|
kcountsize = textsize / HISTFRACTION;
|
||||||
hashfraction = HASHFRACTION;
|
hashfraction = HASHFRACTION;
|
||||||
@ -217,17 +224,17 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
log_hashfraction = __builtin_ffs (hashfraction * sizeof (*froms)) - 1;
|
log_hashfraction = __builtin_ffs (hashfraction * sizeof (*froms)) - 1;
|
||||||
else
|
else
|
||||||
log_hashfraction = -1;
|
log_hashfraction = -1;
|
||||||
fromssize = textsize / HASHFRACTION;
|
tossize = textsize / HASHFRACTION;
|
||||||
tolimit = textsize * ARCDENSITY / 100;
|
fromlimit = textsize * ARCDENSITY / 100;
|
||||||
if (tolimit < MINARCS)
|
if (fromlimit < MINARCS)
|
||||||
tolimit = MINARCS;
|
fromlimit = MINARCS;
|
||||||
if (tolimit > MAXARCS)
|
if (fromlimit > MAXARCS)
|
||||||
tolimit = MAXARCS;
|
fromlimit = MAXARCS;
|
||||||
tossize = tolimit * sizeof (struct here_tostruct);
|
fromssize = fromlimit * sizeof (struct here_fromstruct);
|
||||||
|
|
||||||
expected_size = (sizeof (struct gmon_hdr)
|
expected_size = (sizeof (struct gmon_hdr)
|
||||||
+ 4 + sizeof (struct gmon_hist_hdr) + kcountsize
|
+ 4 + sizeof (struct gmon_hist_hdr) + kcountsize
|
||||||
+ 4 + 4 + tossize * sizeof (struct here_cg_arc_record));
|
+ 4 + 4 + fromssize * sizeof (struct here_cg_arc_record));
|
||||||
|
|
||||||
/* Create the gmon_hdr we expect or write. */
|
/* Create the gmon_hdr we expect or write. */
|
||||||
memset (&gmon_hdr, '\0', sizeof (struct gmon_hdr));
|
memset (&gmon_hdr, '\0', sizeof (struct gmon_hdr));
|
||||||
@ -247,9 +254,9 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
soname (or the file name) and the ending ".profile". */
|
soname (or the file name) and the ending ".profile". */
|
||||||
filename = (char *) alloca (strlen (output_dir) + 1 + strlen (_dl_profile)
|
filename = (char *) alloca (strlen (output_dir) + 1 + strlen (_dl_profile)
|
||||||
+ sizeof ".profile");
|
+ sizeof ".profile");
|
||||||
__stpcpy (__stpcpy (__stpcpy (__stpcpy (filename, output_dir), "/"),
|
cp = __stpcpy (filename, output_dir);
|
||||||
_dl_profile),
|
*cp++ = '/';
|
||||||
".profile");
|
__stpcpy (__stpcpy (cp, _dl_profile), ".profile");
|
||||||
|
|
||||||
fd = __open (filename, O_RDWR | O_CREAT, 0666);
|
fd = __open (filename, O_RDWR | O_CREAT, 0666);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
@ -356,7 +363,7 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate memory for the froms data and the pointer to the tos records. */
|
/* Allocate memory for the froms data and the pointer to the tos records. */
|
||||||
froms = (uint16_t *) calloc (fromssize + tossize, 1);
|
tos = (uint16_t *) calloc (tossize + fromssize, 1);
|
||||||
if (froms == NULL)
|
if (froms == NULL)
|
||||||
{
|
{
|
||||||
__munmap ((void *) addr, expected_size);
|
__munmap ((void *) addr, expected_size);
|
||||||
@ -364,8 +371,8 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
tos = (struct here_tostruct *) ((char *) froms + fromssize);
|
froms = (struct here_fromstruct *) ((char *) tos + tossize);
|
||||||
toidx = 0;
|
fromidx = 0;
|
||||||
|
|
||||||
/* Now we have to process all the arc count entries. BTW: it is
|
/* Now we have to process all the arc count entries. BTW: it is
|
||||||
not critical whether the *NARCSP value changes meanwhile. Before
|
not critical whether the *NARCSP value changes meanwhile. Before
|
||||||
@ -376,17 +383,26 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
frequently used entries at the front of the list. */
|
frequently used entries at the front of the list. */
|
||||||
for (idx = narcs = *narcsp; idx > 0; )
|
for (idx = narcs = *narcsp; idx > 0; )
|
||||||
{
|
{
|
||||||
size_t from_index;
|
size_t to_index;
|
||||||
size_t newtoidx;
|
size_t newfromidx;
|
||||||
--idx;
|
--idx;
|
||||||
from_index = ((data[idx].from_pc - lowpc)
|
to_index = ((data[idx].self_pc - lowpc)
|
||||||
/ (hashfraction * sizeof (*froms)));
|
/ (hashfraction * sizeof (*tos)));
|
||||||
newtoidx = toidx++;
|
newfromidx = fromidx++;
|
||||||
tos[newtoidx].here = &data[idx];
|
froms[newfromidx].here = &data[idx];
|
||||||
tos[newtoidx].link = froms[from_index];
|
froms[newfromidx].link = tos[to_index];
|
||||||
froms[from_index] = newtoidx;
|
tos[to_index] = newfromidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Setup counting data. */
|
||||||
|
if (kcountsize < highpc - lowpc)
|
||||||
|
s_scale = ((double) kcountsize / (highpc - lowpc)) * SCALE_1_TO_1;
|
||||||
|
else
|
||||||
|
s_scale = SCALE_1_TO_1;
|
||||||
|
|
||||||
|
/* Start the profiler. */
|
||||||
|
__profil ((void *) kcount, kcountsize, lowpc, s_scale);
|
||||||
|
|
||||||
/* Turn on profiling. */
|
/* Turn on profiling. */
|
||||||
state = GMON_PROF_ON;
|
state = GMON_PROF_ON;
|
||||||
}
|
}
|
||||||
@ -395,9 +411,12 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
void
|
void
|
||||||
_dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
|
_dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
|
||||||
{
|
{
|
||||||
if (state != GMON_PROF_ON)
|
uint16_t *topcindex;
|
||||||
|
size_t i, fromindex;
|
||||||
|
struct here_fromstruct *fromp;
|
||||||
|
|
||||||
|
if (! compare_and_swap (&state, GMON_PROF_ON, GMON_PROF_BUSY))
|
||||||
return;
|
return;
|
||||||
state = GMON_PROF_BUSY;
|
|
||||||
|
|
||||||
/* Compute relative addresses. The shared object can be loaded at
|
/* Compute relative addresses. The shared object can be loaded at
|
||||||
any address. The value of frompc could be anything. We cannot
|
any address. The value of frompc could be anything. We cannot
|
||||||
@ -411,6 +430,86 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
|
|||||||
if (selfpc >= textsize)
|
if (selfpc >= textsize)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
/* Getting here we now have to find out whether the location was
|
||||||
|
already used. If yes we are lucky and only have to increment a
|
||||||
|
counter (this also has to be atomic). If the entry is new things
|
||||||
|
are getting complicated... */
|
||||||
|
|
||||||
|
/* Avoid integer divide if possible. */
|
||||||
|
if ((HASHFRACTION & (HASHFRACTION - 1)) == 0)
|
||||||
|
i = selfpc >> log_hashfraction;
|
||||||
|
else
|
||||||
|
i = selfpc / (hashfraction * sizeof (*tos));
|
||||||
|
|
||||||
|
topcindex = &tos[i];
|
||||||
|
fromindex = *topcindex;
|
||||||
|
|
||||||
|
if (fromindex == 0)
|
||||||
|
goto check_new_or_add;
|
||||||
|
|
||||||
|
fromp = &froms[fromindex];
|
||||||
|
|
||||||
|
/* We have to look through the chain of arcs whether there is already
|
||||||
|
an entry for our arc. */
|
||||||
|
while (fromp->here->from_pc == frompc)
|
||||||
|
{
|
||||||
|
if (fromp->link != 0)
|
||||||
|
do
|
||||||
|
fromp = &froms[fromp->link];
|
||||||
|
while (fromp->link != 0 && fromp->here->from_pc != frompc);
|
||||||
|
|
||||||
|
if (fromp->link == 0)
|
||||||
|
{
|
||||||
|
topcindex = &fromp->link;
|
||||||
|
|
||||||
|
check_new_or_add:
|
||||||
|
/* Our entry is not among the entries we read so far from the
|
||||||
|
data file. Now see whether we have to update the list. */
|
||||||
|
while (narcs != *narcsp)
|
||||||
|
{
|
||||||
|
size_t to_index;
|
||||||
|
size_t newfromidx;
|
||||||
|
to_index = ((data[narcs].self_pc - lowpc)
|
||||||
|
/ (hashfraction * sizeof (*tos)));
|
||||||
|
newfromidx = fromidx++;
|
||||||
|
froms[newfromidx].here = &data[narcs];
|
||||||
|
froms[newfromidx].link = tos[to_index];
|
||||||
|
tos[to_index] = newfromidx;
|
||||||
|
++narcs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we still have no entry stop searching and insert. */
|
||||||
|
if (*topcindex == 0)
|
||||||
|
{
|
||||||
|
fromidx = 1 + exchange_and_add (narcsp, 1);
|
||||||
|
++narcs;
|
||||||
|
|
||||||
|
/* In rare cases it could happen that all entries in FROMS are
|
||||||
|
occupied. So we cannot count this anymore. */
|
||||||
|
if (fromidx >= fromlimit)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
*topcindex = fromindex;
|
||||||
|
fromp = &froms[fromindex];
|
||||||
|
|
||||||
|
fromp = &froms[fromp->link];
|
||||||
|
|
||||||
|
fromp->link = 0;
|
||||||
|
fromp->here->from_pc = frompc;
|
||||||
|
fromp->here->count = 0;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
fromp = &froms[*topcindex];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* Found in. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Increment the counter. */
|
||||||
|
atomic_add (&fromp->here->count, 1);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
state = GMON_PROF_ON;
|
state = GMON_PROF_ON;
|
||||||
|
@ -82,13 +82,13 @@ __moncontrol (mode)
|
|||||||
if (mode)
|
if (mode)
|
||||||
{
|
{
|
||||||
/* start */
|
/* start */
|
||||||
profil((void *) p->kcount, p->kcountsize, p->lowpc, s_scale);
|
__profil((void *) p->kcount, p->kcountsize, p->lowpc, s_scale);
|
||||||
p->state = GMON_PROF_ON;
|
p->state = GMON_PROF_ON;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* stop */
|
/* stop */
|
||||||
profil((void *) 0, 0, 0, 0);
|
__profil(NULL, 0, 0, 0);
|
||||||
p->state = GMON_PROF_OFF;
|
p->state = GMON_PROF_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,6 +113,8 @@ __monstartup (lowpc, highpc)
|
|||||||
p->kcountsize = p->textsize / HISTFRACTION;
|
p->kcountsize = p->textsize / HISTFRACTION;
|
||||||
p->hashfraction = HASHFRACTION;
|
p->hashfraction = HASHFRACTION;
|
||||||
p->log_hashfraction = -1;
|
p->log_hashfraction = -1;
|
||||||
|
/* The following test must be kept in sync with the corresponding
|
||||||
|
test in mcount.c. */
|
||||||
if ((HASHFRACTION & (HASHFRACTION - 1)) == 0) {
|
if ((HASHFRACTION & (HASHFRACTION - 1)) == 0) {
|
||||||
/* if HASHFRACTION is a power of two, mcount can use shifting
|
/* if HASHFRACTION is a power of two, mcount can use shifting
|
||||||
instead of integer division. Precompute shift amount. */
|
instead of integer division. Precompute shift amount. */
|
||||||
|
@ -42,6 +42,8 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
|
|||||||
and MCOUNT macros. */
|
and MCOUNT macros. */
|
||||||
#include "machine-gmon.h"
|
#include "machine-gmon.h"
|
||||||
|
|
||||||
|
#include <atomicity.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mcount is called on entry to each function compiled with the profiling
|
* mcount is called on entry to each function compiled with the profiling
|
||||||
* switch set. _mcount(), which is declared in a machine-dependent way
|
* switch set. _mcount(), which is declared in a machine-dependent way
|
||||||
@ -63,9 +65,6 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
|
|||||||
register struct tostruct *top, *prevtop;
|
register struct tostruct *top, *prevtop;
|
||||||
register struct gmonparam *p;
|
register struct gmonparam *p;
|
||||||
register long toindex;
|
register long toindex;
|
||||||
#ifdef KERNEL
|
|
||||||
register int s;
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
p = &_gmonparam;
|
p = &_gmonparam;
|
||||||
@ -73,13 +72,9 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
|
|||||||
* check that we are profiling
|
* check that we are profiling
|
||||||
* and that we aren't recursively invoked.
|
* and that we aren't recursively invoked.
|
||||||
*/
|
*/
|
||||||
if (p->state != GMON_PROF_ON)
|
if (! compare_and_swap (&p->state, GMON_PROF_ON, GMON_PROF_BUSY))
|
||||||
return;
|
return;
|
||||||
#ifdef KERNEL
|
|
||||||
MCOUNT_ENTER;
|
|
||||||
#else
|
|
||||||
p->state = GMON_PROF_BUSY;
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* check that frompcindex is a reasonable pc value.
|
* check that frompcindex is a reasonable pc value.
|
||||||
* for example: signal catchers get called from the stack,
|
* for example: signal catchers get called from the stack,
|
||||||
@ -89,8 +84,14 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
|
|||||||
if (frompc > p->textsize)
|
if (frompc > p->textsize)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/* avoid integer divide if possible: */
|
/* The following test used to be
|
||||||
if (p->log_hashfraction >= 0) {
|
if (p->log_hashfraction >= 0)
|
||||||
|
But we can simplify this if we assume the profiling data
|
||||||
|
is always initialized by the functions in gmon.c. But
|
||||||
|
then it is possible to avoid a runtime check and use the
|
||||||
|
smae `if' as in gmon.c. So keep these tests in sync. */
|
||||||
|
if ((HASHFRACTION & (HASHFRACTION - 1)) == 0) {
|
||||||
|
/* avoid integer divide if possible: */
|
||||||
i = frompc >> p->log_hashfraction;
|
i = frompc >> p->log_hashfraction;
|
||||||
} else {
|
} else {
|
||||||
i = frompc / (p->hashfraction * sizeof(*p->froms));
|
i = frompc / (p->hashfraction * sizeof(*p->froms));
|
||||||
@ -167,17 +168,10 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
|
|||||||
|
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
#ifdef KERNEL
|
|
||||||
MCOUNT_EXIT;
|
|
||||||
#else
|
|
||||||
p->state = GMON_PROF_ON;
|
p->state = GMON_PROF_ON;
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
overflow:
|
overflow:
|
||||||
p->state = GMON_PROF_ERROR;
|
p->state = GMON_PROF_ERROR;
|
||||||
#ifdef KERNEL
|
|
||||||
MCOUNT_EXIT;
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ struct rawarc {
|
|||||||
* The profiling data structures are housed in this structure.
|
* The profiling data structures are housed in this structure.
|
||||||
*/
|
*/
|
||||||
struct gmonparam {
|
struct gmonparam {
|
||||||
int state;
|
long int state;
|
||||||
u_short *kcount;
|
u_short *kcount;
|
||||||
u_long kcountsize;
|
u_long kcountsize;
|
||||||
u_short *froms;
|
u_short *froms;
|
||||||
|
1
include/bits/string2.h
Normal file
1
include/bits/string2.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include <string/bits/string2.h>
|
1
include/rpc/auth.h
Normal file
1
include/rpc/auth.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include <sunrpc/rpc/auth.h>
|
1
include/rpc/auth_des.h
Normal file
1
include/rpc/auth_des.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include <sunrpc/rpc/auth_des.h>
|
1
include/rpc/key_prot.h
Normal file
1
include/rpc/key_prot.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include <sunrpc/rpc/key_prot.h>
|
@ -45,7 +45,8 @@ main (void)
|
|||||||
for (p = idx; p->if_index || p->if_name; ++p)
|
for (p = idx; p->if_index || p->if_name; ++p)
|
||||||
{
|
{
|
||||||
char buf[IFNAMSIZ];
|
char buf[IFNAMSIZ];
|
||||||
int ni, result;
|
unsigned int ni;
|
||||||
|
int result;
|
||||||
printf ("%3d %15s | ", p->if_index, p->if_name);
|
printf ("%3d %15s | ", p->if_index, p->if_name);
|
||||||
printf ("%3d", ni = if_nametoindex (p->if_name));
|
printf ("%3d", ni = if_nametoindex (p->if_name));
|
||||||
printf ("%15s", if_indextoname (p->if_index, buf));
|
printf ("%15s", if_indextoname (p->if_index, buf));
|
||||||
|
@ -95,7 +95,9 @@ void free ();
|
|||||||
because some ANSI C functions will require linking with this object
|
because some ANSI C functions will require linking with this object
|
||||||
file and the name space must not be polluted. */
|
file and the name space must not be polluted. */
|
||||||
# define getcwd __getcwd
|
# define getcwd __getcwd
|
||||||
# define stpcpy __stpcpy
|
# ifndef stpcpy
|
||||||
|
# define stpcpy __stpcpy
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# if !defined HAVE_GETCWD
|
# if !defined HAVE_GETCWD
|
||||||
char *getwd ();
|
char *getwd ();
|
||||||
|
@ -68,7 +68,9 @@
|
|||||||
/* Rename the non ANSI C functions. This is required by the standard
|
/* Rename the non ANSI C functions. This is required by the standard
|
||||||
because some ANSI C functions will require linking with this object
|
because some ANSI C functions will require linking with this object
|
||||||
file and the name space must not be polluted. */
|
file and the name space must not be polluted. */
|
||||||
# define stpcpy(dest, src) __stpcpy(dest, src)
|
# ifndef stpcpy
|
||||||
|
# define stpcpy(dest, src) __stpcpy(dest, src)
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifndef HAVE_STPCPY
|
# ifndef HAVE_STPCPY
|
||||||
static char *stpcpy PARAMS ((char *dest, const char *src));
|
static char *stpcpy PARAMS ((char *dest, const char *src));
|
||||||
|
2
libc.map
2
libc.map
@ -60,7 +60,7 @@ GLIBC_2.0 {
|
|||||||
__ctype_get_mb_cur_max;
|
__ctype_get_mb_cur_max;
|
||||||
|
|
||||||
# functions used in other libraries
|
# functions used in other libraries
|
||||||
__printf_fp; __stpncpy;
|
__printf_fp; __stpncpy; __stpcpy; __strdup;
|
||||||
_nss_files_parse_grent; _nss_files_parse_pwent; _nss_files_parse_spent;
|
_nss_files_parse_grent; _nss_files_parse_pwent; _nss_files_parse_spent;
|
||||||
__nss_database_lookup; __internal_endnetgrent; __internal_getnetgrent_r;
|
__nss_database_lookup; __internal_endnetgrent; __internal_getnetgrent_r;
|
||||||
__internal_setnetgrent; __gmtime_r; __secure_getenv;
|
__internal_setnetgrent; __gmtime_r; __secure_getenv;
|
||||||
|
@ -251,30 +251,38 @@ vprintf (const char *__restrict __fmt, _G_va_list __arg)
|
|||||||
#if defined __USE_BSD || defined __USE_ISOC9X
|
#if defined __USE_BSD || defined __USE_ISOC9X
|
||||||
/* Maximum chars of output to write in MAXLEN. */
|
/* Maximum chars of output to write in MAXLEN. */
|
||||||
extern int __snprintf __P ((char *__restrict __s, size_t __maxlen,
|
extern int __snprintf __P ((char *__restrict __s, size_t __maxlen,
|
||||||
__const char *__restrict __format, ...));
|
__const char *__restrict __format, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||||
extern int snprintf __P ((char *__restrict __s, size_t __maxlen,
|
extern int snprintf __P ((char *__restrict __s, size_t __maxlen,
|
||||||
__const char *__restrict __format, ...));
|
__const char *__restrict __format, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||||
|
|
||||||
extern int __vsnprintf __P ((char *__restrict __s, size_t __maxlen,
|
extern int __vsnprintf __P ((char *__restrict __s, size_t __maxlen,
|
||||||
__const char *__restrict __format,
|
__const char *__restrict __format,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 0)));
|
||||||
extern int vsnprintf __P ((char *__restrict __s, size_t __maxlen,
|
extern int vsnprintf __P ((char *__restrict __s, size_t __maxlen,
|
||||||
__const char *__restrict __format,
|
__const char *__restrict __format,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 0)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __USE_GNU
|
#ifdef __USE_GNU
|
||||||
/* Write formatted output to a string dynamically allocated with `malloc'.
|
/* Write formatted output to a string dynamically allocated with `malloc'.
|
||||||
Store the address of the string in *PTR. */
|
Store the address of the string in *PTR. */
|
||||||
extern int vasprintf __P ((char **__restrict __ptr,
|
extern int vasprintf __P ((char **__restrict __ptr,
|
||||||
__const char *__restrict __f, _G_va_list __arg));
|
__const char *__restrict __f, _G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||||
extern int asprintf __P ((char **__restrict __ptr,
|
extern int asprintf __P ((char **__restrict __ptr,
|
||||||
__const char *__restrict __fmt, ...));
|
__const char *__restrict __fmt, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||||
|
|
||||||
/* Write formatted output to a file descriptor. */
|
/* Write formatted output to a file descriptor. */
|
||||||
extern int vdprintf __P ((int __fd, __const char *__restrict __fmt,
|
extern int vdprintf __P ((int __fd, __const char *__restrict __fmt,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
extern int dprintf __P ((int __fd, __const char *__restrict __fmt, ...));
|
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||||
|
extern int dprintf __P ((int __fd, __const char *__restrict __fmt, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -291,23 +299,29 @@ extern int sscanf __P ((__const char *__restrict __s,
|
|||||||
/* Read formatted input from S into argument list ARG. */
|
/* Read formatted input from S into argument list ARG. */
|
||||||
extern int __vfscanf __P ((FILE *__restrict __s,
|
extern int __vfscanf __P ((FILE *__restrict __s,
|
||||||
__const char *__restrict __format,
|
__const char *__restrict __format,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__scanf__, 2, 0)));
|
||||||
extern int vfscanf __P ((FILE *__restrict __s,
|
extern int vfscanf __P ((FILE *__restrict __s,
|
||||||
__const char *__restrict __format,
|
__const char *__restrict __format,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__scanf__, 2, 0)));
|
||||||
|
|
||||||
/* Read formatted input from stdin into argument list ARG. */
|
/* Read formatted input from stdin into argument list ARG. */
|
||||||
extern int __vscanf __P ((__const char *__restrict __format,
|
extern int __vscanf __P ((__const char *__restrict __format,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
extern int vscanf __P ((__const char *__restrict __format, _G_va_list __arg));
|
__attribute__ ((__format__ (__scanf__, 1, 0)));
|
||||||
|
extern int vscanf __P ((__const char *__restrict __format, _G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__scanf__, 1, 0)));
|
||||||
|
|
||||||
/* Read formatted input from S into argument list ARG. */
|
/* Read formatted input from S into argument list ARG. */
|
||||||
extern int __vsscanf __P ((__const char *__restrict __s,
|
extern int __vsscanf __P ((__const char *__restrict __s,
|
||||||
__const char *__restrict __format,
|
__const char *__restrict __format,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__scanf__, 2, 0)));
|
||||||
extern int vsscanf __P ((__const char *__restrict __s,
|
extern int vsscanf __P ((__const char *__restrict __s,
|
||||||
__const char *__restrict __format,
|
__const char *__restrict __format,
|
||||||
_G_va_list __arg));
|
_G_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__scanf__, 2, 0)));
|
||||||
#endif /* Use GNU. */
|
#endif /* Use GNU. */
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,8 +89,8 @@ struct locale_ctype_t
|
|||||||
#define MAX_NR_CHARMAP 16
|
#define MAX_NR_CHARMAP 16
|
||||||
const char *mapnames[MAX_NR_CHARMAP];
|
const char *mapnames[MAX_NR_CHARMAP];
|
||||||
u_int32_t *map_collection[MAX_NR_CHARMAP];
|
u_int32_t *map_collection[MAX_NR_CHARMAP];
|
||||||
u_int32_t map_collection_max[MAX_NR_CHARMAP];
|
size_t map_collection_max[MAX_NR_CHARMAP];
|
||||||
u_int32_t map_collection_act[MAX_NR_CHARMAP];
|
size_t map_collection_act[MAX_NR_CHARMAP];
|
||||||
size_t map_collection_nr;
|
size_t map_collection_nr;
|
||||||
size_t last_map_idx;
|
size_t last_map_idx;
|
||||||
unsigned int from_map_char;
|
unsigned int from_map_char;
|
||||||
|
@ -132,12 +132,13 @@ glibc-doc-$(edition).tar: $(doc-only-dist) $(distribute)
|
|||||||
|
|
||||||
.PHONY: mostlyclean distclean realclean clean
|
.PHONY: mostlyclean distclean realclean clean
|
||||||
mostlyclean:
|
mostlyclean:
|
||||||
-rm -f libc.dvi libc.info* dir-add.info
|
-rm -f libc.dvi libc.info* dir-add.info $(common-objpfx)stub-manual
|
||||||
|
-rm -f $(foreach o,$(object-suffixes),$(objpfx)stamp$o)
|
||||||
clean: mostlyclean
|
clean: mostlyclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
indices = cp fn pg tp vr ky
|
indices = cp fn pg tp vr ky
|
||||||
realclean: distclean
|
realclean: distclean
|
||||||
-rm -f chapters chapters-incl summary.texi stamp-summary *.c.texi
|
-rm -f chapters chapters-incl* summary.texi stamp-summary *.c.texi
|
||||||
-rm -f $(foreach index,$(indices),libc.$(index) libc.$(index)s)
|
-rm -f $(foreach index,$(indices),libc.$(index) libc.$(index)s)
|
||||||
-rm -f libc.log libc.aux libc.toc dir-add.texi
|
-rm -f libc.log libc.aux libc.toc dir-add.texi
|
||||||
|
|
||||||
|
@ -206,12 +206,15 @@ On most platforms, the GNU C library can only be compiled with the GNU C
|
|||||||
compiler. We recommend GCC version 2.7.2 or later; earlier versions may
|
compiler. We recommend GCC version 2.7.2 or later; earlier versions may
|
||||||
have problems.
|
have problems.
|
||||||
|
|
||||||
|
On PowerPC, GCC versions dated earlier than 970904 are known not to work
|
||||||
|
(they crash), including 2.7.2.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
@code{binutils} 2.8
|
@code{binutils} 2.8.1
|
||||||
|
|
||||||
Using the GNU @code{binutils} (assembler, linker, and related tools) is
|
Using the GNU @code{binutils} (assembler, linker, and related tools) is
|
||||||
preferable when possible, and they are required to build an ELF shared C
|
preferable when possible, and they are required to build an ELF shared C
|
||||||
library. We recommend @code{binutils} version 2.8 or later; earlier
|
library. We recommend @code{binutils} version 2.8.1 or later; earlier
|
||||||
versions are known to have problems or to not support all architectures.
|
versions are known to have problems or to not support all architectures.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@ -227,6 +230,7 @@ alpha-@var{anything}-linux
|
|||||||
i@var{x}86-@var{anything}-gnu
|
i@var{x}86-@var{anything}-gnu
|
||||||
i@var{x}86-@var{anything}-linux
|
i@var{x}86-@var{anything}-linux
|
||||||
m68k-@var{anything}-linux
|
m68k-@var{anything}-linux
|
||||||
|
powerpc-@var{anything}-linux
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
Former releases of this library (version 1.09.1 and perhaps earlier
|
Former releases of this library (version 1.09.1 and perhaps earlier
|
||||||
@ -897,6 +901,10 @@ support for the Alpha processor.
|
|||||||
David Mosberger-Tang contributed the port to Linux/Alpha
|
David Mosberger-Tang contributed the port to Linux/Alpha
|
||||||
(@code{alpha-@var{anything}-linux}).
|
(@code{alpha-@var{anything}-linux}).
|
||||||
|
|
||||||
|
@item
|
||||||
|
The port to Linux on PowerPC (@code{powerpc-@var{anything}-linux})
|
||||||
|
was contributed by Geoffrey Keating.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Miles Bader wrote the argp argument-parsing package, and the argz/envz
|
Miles Bader wrote the argp argument-parsing package, and the argz/envz
|
||||||
interfaces.
|
interfaces.
|
||||||
|
@ -77,14 +77,15 @@ distribute += $(long-c-yes:=.c)
|
|||||||
|
|
||||||
# Rules for the test suite.
|
# Rules for the test suite.
|
||||||
tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
|
tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
|
||||||
test-ifloat test-idouble test-matherr test-fenv
|
test-ifloat test-idouble test-matherr test-fenv \
|
||||||
|
atest-exp atest-sincos
|
||||||
# We do the `long double' tests only if this data type is available and
|
# We do the `long double' tests only if this data type is available and
|
||||||
# distrinct from `double'.
|
# distrinct from `double'.
|
||||||
test-longdouble-yes = test-ldouble test-ildoubl
|
test-longdouble-yes = test-ldouble test-ildoubl
|
||||||
|
|
||||||
CFLAGS-test-float.c = -fno-inline
|
CFLAGS-test-float.c = -fno-inline -ffloat-store
|
||||||
CFLAGS-test-double.c = -fno-inline
|
CFLAGS-test-double.c = -fno-inline -ffloat-store
|
||||||
CFLAGS-test-ldouble.c = -fno-inline
|
CFLAGS-test-ldouble.c = -fno-inline -ffloat-store
|
||||||
LDLIBS-test-ifloat = math/libm
|
LDLIBS-test-ifloat = math/libm
|
||||||
LDLIBS-test-idouble = math/libm
|
LDLIBS-test-idouble = math/libm
|
||||||
LDLIBS-test-ildoubl = math/libm
|
LDLIBS-test-ildoubl = math/libm
|
||||||
@ -92,6 +93,8 @@ LDLIBS-test-float = math/libm
|
|||||||
LDLIBS-test-double = math/libm
|
LDLIBS-test-double = math/libm
|
||||||
LDLIBS-test-ldouble = math/libm
|
LDLIBS-test-ldouble = math/libm
|
||||||
LDLIBS-test-matherr = math/libm
|
LDLIBS-test-matherr = math/libm
|
||||||
|
LDLIBS-atest-exp = math/libm
|
||||||
|
LDLIBS-atest-sincos = math/libm
|
||||||
|
|
||||||
distribute += libm-test.c
|
distribute += libm-test.c
|
||||||
|
|
||||||
|
191
math/atest-exp.c
Normal file
191
math/atest-exp.c
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by Geoffrey Keating <Geoff.Keating@anu.edu.au>, 1997.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib/gmp.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#define PRINT_ERRORS 0
|
||||||
|
|
||||||
|
#define TOL 80
|
||||||
|
#define N2 17
|
||||||
|
#define FRAC (32*4)
|
||||||
|
|
||||||
|
#define mpbpl (CHAR_BIT * sizeof (mp_limb_t))
|
||||||
|
#define SZ (FRAC / mpbpl + 1)
|
||||||
|
typedef mp_limb_t mp1[SZ], mp2[SZ * 2];
|
||||||
|
|
||||||
|
/* This string has 101 hex digits. */
|
||||||
|
static const char exp1[102] = "2" /* point */
|
||||||
|
"b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a7"
|
||||||
|
"84d9045190cfef324e7738926cfbe5f4bf8d8d8c31d763da07";
|
||||||
|
static const char hexdig[] = "0123456789abcdef";
|
||||||
|
|
||||||
|
void
|
||||||
|
print_mpn_hex (const mp_limb_t *x, unsigned size)
|
||||||
|
{
|
||||||
|
char value[size + 1];
|
||||||
|
unsigned i;
|
||||||
|
const unsigned final = (size * 4 > SZ * mpbpl) ? SZ * mpbpl / 4 : size;
|
||||||
|
|
||||||
|
memset (value, '0', size);
|
||||||
|
|
||||||
|
for (i = 0; i < final ; i++)
|
||||||
|
value[size - 1 - i] = hexdig[x[i * 4 / mpbpl] >> (i * 4) % mpbpl & 0xf];
|
||||||
|
|
||||||
|
value[size] = '\0';
|
||||||
|
fputs (value, stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
exp_mpn (mp1 ex, mp1 x)
|
||||||
|
{
|
||||||
|
unsigned n;
|
||||||
|
mp1 xp;
|
||||||
|
mp2 tmp;
|
||||||
|
mp_limb_t chk, round;
|
||||||
|
mp1 tol;
|
||||||
|
|
||||||
|
memset (xp, 0, sizeof (mp1));
|
||||||
|
memset (ex, 0, sizeof (mp1));
|
||||||
|
xp[FRAC / mpbpl] = 1 << FRAC % mpbpl;
|
||||||
|
memset (tol,0, sizeof (mp1));
|
||||||
|
tol[(FRAC - TOL) / mpbpl] = 1 << (FRAC - TOL) % mpbpl;
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
/* Calculate sum(x^n/n!) until the next term is sufficiently small. */
|
||||||
|
|
||||||
|
mpn_mul_n (tmp, xp, x, SZ);
|
||||||
|
assert (tmp[SZ * 2 - 1] == 0);
|
||||||
|
if (n > 0)
|
||||||
|
round = mpn_divmod_1 (xp, tmp + FRAC / mpbpl, SZ, n);
|
||||||
|
chk = mpn_add_n (ex, ex, xp, SZ);
|
||||||
|
assert (chk == 0);
|
||||||
|
n++;
|
||||||
|
assert (n < 80); /* Catch too-high TOL. */
|
||||||
|
}
|
||||||
|
while (n < 10 || mpn_cmp (xp, tol, SZ) >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mpn_bitsize(const mp_limb_t *SRC_PTR, mp_size_t SIZE)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
for (i = SIZE - 1; i > 0; i--)
|
||||||
|
if (SRC_PTR[i] != 0)
|
||||||
|
break;
|
||||||
|
for (j = mpbpl - 1; j > 0; j--)
|
||||||
|
if ((SRC_PTR[i] & 1 << j) != 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
return i * 32 + j;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
mp1 ex, x, xt, e2, e3;
|
||||||
|
int i;
|
||||||
|
int errors = 0;
|
||||||
|
int failures = 0;
|
||||||
|
mp1 maxerror;
|
||||||
|
int maxerror_s = 0;
|
||||||
|
const double sf = pow (2, mpbpl);
|
||||||
|
|
||||||
|
/* assert (mpbpl == mp_bits_per_limb); */
|
||||||
|
assert (FRAC / mpbpl * mpbpl == FRAC);
|
||||||
|
|
||||||
|
memset (maxerror, 0, sizeof (mp1));
|
||||||
|
memset (xt, 0, sizeof (mp1));
|
||||||
|
xt[(FRAC - N2) / mpbpl] = 1 << (FRAC - N2) % mpbpl;
|
||||||
|
|
||||||
|
for (i = 0; i < 1 << N2; i++)
|
||||||
|
{
|
||||||
|
int e2s, e3s, j;
|
||||||
|
double de2;
|
||||||
|
|
||||||
|
mpn_mul_1 (x,xt,SZ,i);
|
||||||
|
exp_mpn (ex, x);
|
||||||
|
de2 = exp (i / (double) (1 << N2));
|
||||||
|
for (j = SZ-1; j >= 0; j--)
|
||||||
|
{
|
||||||
|
e2[j] = (mp_limb_t) de2;
|
||||||
|
de2 = (de2 - e2[j]) * sf;
|
||||||
|
}
|
||||||
|
if (mpn_cmp (ex,e2,SZ) >= 0)
|
||||||
|
mpn_sub_n (e3,ex,e2,SZ);
|
||||||
|
else
|
||||||
|
mpn_sub_n (e3,e2,ex,SZ);
|
||||||
|
|
||||||
|
e2s = mpn_bitsize (e2,SZ);
|
||||||
|
e3s = mpn_bitsize (e3,SZ);
|
||||||
|
if (e3s > 1 && e2s - e3s < 54)
|
||||||
|
{
|
||||||
|
#if PRINT_ERRORS
|
||||||
|
printf ("%06x ", i * (0x100000 / (1 << N2)));
|
||||||
|
print_mpn_hex (ex, (FRAC / 4) + 1);
|
||||||
|
fputs ("\n ",stdout);
|
||||||
|
print_mpn_hex (e2, (FRAC / 4) + 1);
|
||||||
|
printf ("\n %c ",
|
||||||
|
e2s - e3s < 54 ? e2s - e3s == 53 ? 'e' : 'F' : 'P');
|
||||||
|
print_mpn_hex (e3, (FRAC / 4) + 1);
|
||||||
|
putchar ('\n');
|
||||||
|
#endif
|
||||||
|
errors += (e2s - e3s == 53);
|
||||||
|
failures += (e2s - e3s < 53);
|
||||||
|
}
|
||||||
|
if (e3s >= maxerror_s
|
||||||
|
&& mpn_cmp (e3, maxerror, SZ) > 0)
|
||||||
|
{
|
||||||
|
memcpy (maxerror, e3, sizeof (mp1));
|
||||||
|
maxerror_s = e3s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check exp_mpn against precomputed value of exp(1). */
|
||||||
|
memset (x, '\0', sizeof (mp1));
|
||||||
|
x[FRAC / mpbpl] = 1 << FRAC % mpbpl;
|
||||||
|
exp_mpn (ex, x);
|
||||||
|
|
||||||
|
memset (e2, '\0', sizeof (mp1));
|
||||||
|
for (i = -1; i < 100 && i < FRAC / 4; i++)
|
||||||
|
e2[(FRAC - i * 4 - 4) / mpbpl] |= (strchr (hexdig, exp1[i + 1]) - hexdig
|
||||||
|
<< (FRAC - i * 4 - 4) % mpbpl);
|
||||||
|
|
||||||
|
if (mpn_cmp (ex, e2, SZ) >= 0)
|
||||||
|
mpn_sub_n (e3, ex, e2, SZ);
|
||||||
|
else
|
||||||
|
mpn_sub_n (e3, e2, ex, SZ);
|
||||||
|
|
||||||
|
printf ("%d failures; %d errors; error rate %0.2f%%\n", failures, errors,
|
||||||
|
errors * 100.0 / (double) (1 << N2));
|
||||||
|
fputs ("maximum error: ", stdout);
|
||||||
|
print_mpn_hex (maxerror, (FRAC / 4) + 1);
|
||||||
|
fputs ("\nerror in exp(1): ", stdout);
|
||||||
|
print_mpn_hex (e3, (FRAC / 4) + 1);
|
||||||
|
putchar ('\n');
|
||||||
|
|
||||||
|
return failures == 0 ? 0 : 1;
|
||||||
|
}
|
275
math/atest-sincos.c
Normal file
275
math/atest-sincos.c
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by Geoffrey Keating <Geoff.Keating@anu.edu.au>, 1997.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib/gmp.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#define PRINT_ERRORS 0
|
||||||
|
|
||||||
|
#define N 0
|
||||||
|
#define N2 20
|
||||||
|
#define FRAC (32 * 4)
|
||||||
|
|
||||||
|
#define mpbpl (CHAR_BIT * sizeof (mp_limb_t))
|
||||||
|
#define SZ (FRAC / mpbpl + 1)
|
||||||
|
typedef mp_limb_t mp1[SZ], mp2[SZ * 2];
|
||||||
|
|
||||||
|
/* These strings have exactly 100 hex digits in them. */
|
||||||
|
static const char sin1[101] =
|
||||||
|
"d76aa47848677020c6e9e909c50f3c3289e511132f518b4def"
|
||||||
|
"b6ca5fd6c649bdfb0bd9ff1edcd4577655b5826a3d3b50c264";
|
||||||
|
static const char cos1[101] =
|
||||||
|
"8a51407da8345c91c2466d976871bd29a2373a894f96c3b7f2"
|
||||||
|
"300240b760e6fa96a94430a52d0e9e43f3450e3b8ff99bc934";
|
||||||
|
static const char hexdig[] = "0123456789abcdef";
|
||||||
|
|
||||||
|
void
|
||||||
|
print_mpn_hex (const mp_limb_t *x, unsigned size)
|
||||||
|
{
|
||||||
|
char value[size + 1];
|
||||||
|
unsigned i;
|
||||||
|
const unsigned final = (size * 4 > SZ * mpbpl) ? SZ * mpbpl / 4 : size;
|
||||||
|
|
||||||
|
memset (value, '0', size);
|
||||||
|
|
||||||
|
for (i = 0; i < final ; i++)
|
||||||
|
value[size-1-i] = hexdig[x[i * 4 / mpbpl] >> (i * 4) % mpbpl & 0xf];
|
||||||
|
|
||||||
|
value[size] = '\0';
|
||||||
|
fputs (value, stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sincosx_mpn (mp1 si, mp1 co, mp1 xx, mp1 ix)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
mp2 s[4], c[4];
|
||||||
|
mp1 tmp, x;
|
||||||
|
mp_limb_t chk, round;
|
||||||
|
|
||||||
|
if (ix == NULL)
|
||||||
|
{
|
||||||
|
memset (si, 0, sizeof (mp1));
|
||||||
|
memset (co, 0, sizeof (mp1));
|
||||||
|
co[SZ-1] = 1;
|
||||||
|
memcpy (x, xx, sizeof (mp1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mpn_sub_n (x, xx, ix, SZ);
|
||||||
|
|
||||||
|
for (i = 0; i < 1 << N; i++)
|
||||||
|
{
|
||||||
|
#define add_shift_mulh(d,x,s1,s2,sh,n) \
|
||||||
|
/* d = (n ? -1 : 1) * (s1 + (s2>>sh)) * x / (1>>N); */ \
|
||||||
|
do { \
|
||||||
|
if (s2 != NULL) { \
|
||||||
|
if (sh > 0) { \
|
||||||
|
assert (sh < mpbpl); \
|
||||||
|
mpn_lshift (tmp, s1, SZ, sh); \
|
||||||
|
chk = (n ? mpn_sub_n : mpn_add_n)(tmp,tmp,s2+FRAC/mpbpl,SZ); \
|
||||||
|
} else \
|
||||||
|
chk = (n ? mpn_sub_n : mpn_add_n)(tmp,s1,s2+FRAC/mpbpl,SZ); \
|
||||||
|
/* assert(chk == 0); */ \
|
||||||
|
mpn_mul_n(d,tmp,x,SZ); \
|
||||||
|
} else \
|
||||||
|
mpn_mul_n(d,s1,x,SZ); \
|
||||||
|
/* assert(d[SZ*2-1] == 0); */ \
|
||||||
|
assert(N+sh < mpbpl); \
|
||||||
|
if (N+sh > 0) mpn_rshift(d,d,2*SZ,N+sh); \
|
||||||
|
} while(0)
|
||||||
|
#define summ(d,ss,s,n) \
|
||||||
|
/* d = ss +/- (s[0]+2*s[1]+2*s[2]+s[3])/6; */ \
|
||||||
|
do { \
|
||||||
|
chk = mpn_add_n(tmp,s[1]+FRAC/mpbpl,s[2]+FRAC/mpbpl,SZ); \
|
||||||
|
mpn_lshift(tmp,tmp,SZ,1); \
|
||||||
|
chk |= mpn_add_n(tmp,tmp,s[0]+FRAC/mpbpl,SZ); \
|
||||||
|
chk |= mpn_add_n(tmp,tmp,s[3]+FRAC/mpbpl,SZ); \
|
||||||
|
round = mpn_divmod_1(tmp,tmp,SZ,6); \
|
||||||
|
/* chk |= mpn_add_1(tmp,tmp,SZ, (round > 3) ); */ \
|
||||||
|
chk |= (n ? mpn_sub_n : mpn_add_n)(d,ss,tmp,SZ); \
|
||||||
|
/* assert(chk == 0); */ \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
add_shift_mulh (s[0], x, co, NULL, 0, 0); /* s0 = h * c; */
|
||||||
|
add_shift_mulh (c[0], x, si, NULL, 0, 0); /* c0 = h * s; */
|
||||||
|
add_shift_mulh (s[1], x, co, c[0], 1, 1); /* s1 = h * (c - c0/2); */
|
||||||
|
add_shift_mulh (c[1], x, si, s[0], 1, 0); /* c1 = h * (s + s0/2); */
|
||||||
|
add_shift_mulh (s[2], x, co, c[1], 1, 1); /* s2 = h * (c - c1/2); */
|
||||||
|
add_shift_mulh (c[2], x, si, s[1], 1, 0); /* c2 = h * (s + s1/2); */
|
||||||
|
add_shift_mulh (s[3], x, co, c[2], 0, 1); /* s3 = h * (c - c2); */
|
||||||
|
add_shift_mulh (c[3], x, si, s[2], 0, 0); /* c3 = h * (s + s2); */
|
||||||
|
summ (si, si, s, 0); /* s = s + (s0+2*s1+2*s2+s3)/6; */
|
||||||
|
summ (co, co, c, 1); /* c = c - (c0+2*c1+2*c2+c3)/6; */
|
||||||
|
}
|
||||||
|
#undef add_shift_mulh
|
||||||
|
#undef summ
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mpn_bitsize (const mp_limb_t *SRC_PTR, mp_size_t SIZE)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
for (i = SIZE - 1; i > 0; i--)
|
||||||
|
if (SRC_PTR[i] != 0)
|
||||||
|
break;
|
||||||
|
for (j = mpbpl - 1; j > 0; j--)
|
||||||
|
if ((SRC_PTR[i] & 1 << j) != 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
return i * 32 + j;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
mp1 si, co, x, ox, xt, s2, c2, s3, c3;
|
||||||
|
int i;
|
||||||
|
int sin_errors = 0, cos_errors = 0;
|
||||||
|
int sin_failures = 0, cos_failures = 0;
|
||||||
|
mp1 sin_maxerror, cos_maxerror;
|
||||||
|
int sin_maxerror_s = 0, cos_maxerror_s = 0;
|
||||||
|
const double sf = pow (2, mpbpl);
|
||||||
|
|
||||||
|
/* assert(mpbpl == mp_bits_per_limb); */
|
||||||
|
assert(FRAC / mpbpl * mpbpl == FRAC);
|
||||||
|
|
||||||
|
memset (sin_maxerror, 0, sizeof (mp1));
|
||||||
|
memset (cos_maxerror, 0, sizeof (mp1));
|
||||||
|
memset (xt, 0, sizeof (mp1));
|
||||||
|
xt[(FRAC - N2) / mpbpl] = 1 << (FRAC - N2) % mpbpl;
|
||||||
|
|
||||||
|
for (i = 0; i < 1 << N2; i++)
|
||||||
|
{
|
||||||
|
int s2s, s3s, c2s, c3s, j;
|
||||||
|
double ds2,dc2;
|
||||||
|
|
||||||
|
mpn_mul_1 (x, xt, SZ, i);
|
||||||
|
sincosx_mpn (si, co, x, i == 0 ? NULL : ox);
|
||||||
|
memcpy (ox, x, sizeof (mp1));
|
||||||
|
ds2 = sin (i / (double) (1 << N2));
|
||||||
|
dc2 = cos (i / (double) (1 << N2));
|
||||||
|
for (j = SZ-1; j >= 0; j--)
|
||||||
|
{
|
||||||
|
s2[j] = (mp_limb_t) ds2;
|
||||||
|
ds2 = (ds2 - s2[j]) * sf;
|
||||||
|
c2[j] = (mp_limb_t) dc2;
|
||||||
|
dc2 = (dc2 - c2[j]) * sf;
|
||||||
|
}
|
||||||
|
if (mpn_cmp (si, s2, SZ) >= 0)
|
||||||
|
mpn_sub_n (s3, si, s2, SZ);
|
||||||
|
else
|
||||||
|
mpn_sub_n (s3, s2, si, SZ);
|
||||||
|
if (mpn_cmp (co, c2, SZ) >= 0)
|
||||||
|
mpn_sub_n (c3, co, c2, SZ);
|
||||||
|
else
|
||||||
|
mpn_sub_n (c3, c2, co, SZ);
|
||||||
|
|
||||||
|
s2s = mpn_bitsize (s2, SZ);
|
||||||
|
s3s = mpn_bitsize (s3, SZ);
|
||||||
|
c2s = mpn_bitsize (c2, SZ);
|
||||||
|
c3s = mpn_bitsize (c3, SZ);
|
||||||
|
if (s3s > 1 && s2s - s3s < 54
|
||||||
|
|| c3s > 1 && c2s - c3s < 54
|
||||||
|
|| 0)
|
||||||
|
{
|
||||||
|
#if PRINT_ERRORS
|
||||||
|
printf ("%06x ", i * (0x100000 / (1 << N2)));
|
||||||
|
print_mpn_hex(si, (FRAC / 4) + 1);
|
||||||
|
putchar (' ');
|
||||||
|
print_mpn_hex (co, (FRAC / 4) + 1);
|
||||||
|
putchar ('\n');
|
||||||
|
fputs (" ", stdout);
|
||||||
|
print_mpn_hex (s2, (FRAC / 4) + 1);
|
||||||
|
putchar (' ');
|
||||||
|
print_mpn_hex (c2, (FRAC / 4) + 1);
|
||||||
|
putchar ('\n');
|
||||||
|
printf (" %c%c ",
|
||||||
|
s2s-s3s < 54 ? s2s - s3s == 53 ? 'e' : 'F' : 'P',
|
||||||
|
c2s-c3s < 54 ? c2s - c3s == 53 ? 'e' : 'F' : 'P');
|
||||||
|
print_mpn_hex (s3, (FRAC / 4) + 1);
|
||||||
|
putchar (' ');
|
||||||
|
print_mpn_hex (c3, (FRAC / 4) + 1);
|
||||||
|
putchar ('\n');
|
||||||
|
#endif
|
||||||
|
sin_errors += s2s - s3s == 53;
|
||||||
|
cos_errors += c2s - c3s == 53;
|
||||||
|
sin_failures += s2s - s3s < 53;
|
||||||
|
cos_failures += c2s - c3s < 53;
|
||||||
|
}
|
||||||
|
if (s3s >= sin_maxerror_s
|
||||||
|
&& mpn_cmp (s3, sin_maxerror, SZ) > 0)
|
||||||
|
{
|
||||||
|
memcpy (sin_maxerror, s3, sizeof (mp1));
|
||||||
|
sin_maxerror_s = s3s;
|
||||||
|
}
|
||||||
|
if (c3s >= cos_maxerror_s
|
||||||
|
&& mpn_cmp (c3, cos_maxerror, SZ) > 0)
|
||||||
|
{
|
||||||
|
memcpy (cos_maxerror, c3, sizeof (mp1));
|
||||||
|
cos_maxerror_s = c3s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check Range-Kutta against precomputed values of sin(1) and cos(1). */
|
||||||
|
memset (x, 0, sizeof (mp1));
|
||||||
|
x[FRAC / mpbpl] = 1 << FRAC % mpbpl;
|
||||||
|
sincosx_mpn (si, co, x, ox);
|
||||||
|
|
||||||
|
memset (s2, 0, sizeof (mp1));
|
||||||
|
memset (c2, 0, sizeof (mp1));
|
||||||
|
for (i = 0; i < 100 && i < FRAC / 4; i++)
|
||||||
|
{
|
||||||
|
s2[(FRAC - i * 4 - 4) / mpbpl] |= (strchr (hexdig, sin1[i]) - hexdig
|
||||||
|
<< (FRAC - i * 4 - 4) % mpbpl);
|
||||||
|
c2[(FRAC - i * 4 - 4) / mpbpl] |= (strchr (hexdig, cos1[i]) - hexdig
|
||||||
|
<< (FRAC - i * 4 - 4) % mpbpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mpn_cmp (si, s2, SZ) >= 0)
|
||||||
|
mpn_sub_n (s3, si, s2, SZ);
|
||||||
|
else
|
||||||
|
mpn_sub_n (s3, s2, si, SZ);
|
||||||
|
if (mpn_cmp (co, c2, SZ) >= 0)
|
||||||
|
mpn_sub_n (c3, co, c2, SZ);
|
||||||
|
else
|
||||||
|
mpn_sub_n (c3, c2, co, SZ);
|
||||||
|
|
||||||
|
printf ("sin:\n");
|
||||||
|
printf ("%d failures; %d errors; error rate %0.2f%%\n",
|
||||||
|
sin_failures, sin_errors, sin_errors * 100.0 / (double) (1 << N2));
|
||||||
|
fputs ("maximum error: ", stdout);
|
||||||
|
print_mpn_hex (sin_maxerror, (FRAC / 4) + 1);
|
||||||
|
fputs ("\nerror in sin(1): ", stdout);
|
||||||
|
print_mpn_hex (s3, (FRAC / 4) + 1);
|
||||||
|
|
||||||
|
fputs ("\n\ncos:\n", stdout);
|
||||||
|
printf ("%d failures; %d errors; error rate %0.2f%%\n",
|
||||||
|
cos_failures, cos_errors, cos_errors * 100.0 / (double) (1 << N2));
|
||||||
|
fputs ("maximum error: ", stdout);
|
||||||
|
print_mpn_hex (cos_maxerror, (FRAC / 4) + 1);
|
||||||
|
fputs ("\nerror in cos(1): ", stdout);
|
||||||
|
print_mpn_hex (c3, (FRAC / 4) + 1);
|
||||||
|
putchar ('\n');
|
||||||
|
|
||||||
|
return (sin_failures == 0 && cos_failures == 0) ? 0 : 1;
|
||||||
|
}
|
@ -1003,7 +1003,7 @@ cbrt_test (void)
|
|||||||
CHOOSE (5e-18L, 0, 0));
|
CHOOSE (5e-18L, 0, 0));
|
||||||
check_eps ("cbrt (8) == 2", FUNC(cbrt) (8), 2, CHOOSE (5e-17L, 0, 0));
|
check_eps ("cbrt (8) == 2", FUNC(cbrt) (8), 2, CHOOSE (5e-17L, 0, 0));
|
||||||
check_eps ("cbrt (-27) == -3", FUNC(cbrt) (-27.0), -3.0,
|
check_eps ("cbrt (-27) == -3", FUNC(cbrt) (-27.0), -3.0,
|
||||||
CHOOSE (3e-16L, 0, 0));
|
CHOOSE (3e-16L, 5e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1095,7 +1095,7 @@ exp_test (void)
|
|||||||
check_isinfp ("exp (+inf) == +inf", FUNC(exp) (plus_infty));
|
check_isinfp ("exp (+inf) == +inf", FUNC(exp) (plus_infty));
|
||||||
check ("exp (-inf) == 0", FUNC(exp) (minus_infty), 0);
|
check ("exp (-inf) == 0", FUNC(exp) (minus_infty), 0);
|
||||||
#endif
|
#endif
|
||||||
check_eps ("exp (1) == e", FUNC(exp) (1), M_E, CHOOSE (4e-18L, 0, 0));
|
check_eps ("exp (1) == e", FUNC(exp) (1), M_E, CHOOSE (4e-18L, 5e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1129,7 +1129,7 @@ expm1_test (void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
check_eps ("expm1 (1) == e-1", FUNC(expm1) (1), M_E - 1.0,
|
check_eps ("expm1 (1) == e-1", FUNC(expm1) (1), M_E - 1.0,
|
||||||
CHOOSE (4e-18L, 0, 0));
|
CHOOSE (4e-18L, 0, 2e-7));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4600,7 +4600,7 @@ static void
|
|||||||
inverse_functions (void)
|
inverse_functions (void)
|
||||||
{
|
{
|
||||||
inverse_func_pair_test ("asin(sin(x)) == x",
|
inverse_func_pair_test ("asin(sin(x)) == x",
|
||||||
FUNC(sin), FUNC(asin), 1.0, CHOOSE (2e-18L, 0, 1e-7L));
|
FUNC(sin), FUNC(asin), 1.0, CHOOSE (2e-18L, 0, 3e-7L));
|
||||||
inverse_func_pair_test ("sin(asin(x)) == x",
|
inverse_func_pair_test ("sin(asin(x)) == x",
|
||||||
FUNC(asin), FUNC(sin), 1.0, 0.0);
|
FUNC(asin), FUNC(sin), 1.0, 0.0);
|
||||||
|
|
||||||
@ -4706,14 +4706,14 @@ identities (void)
|
|||||||
identities1_test (-1, CHOOSE (1e-18L, 0, 1e-7));
|
identities1_test (-1, CHOOSE (1e-18L, 0, 1e-7));
|
||||||
|
|
||||||
identities2_test (0.2L, CHOOSE (1e-19L, 1e-16, 0));
|
identities2_test (0.2L, CHOOSE (1e-19L, 1e-16, 0));
|
||||||
identities2_test (0.9L, CHOOSE (0, 1e-15, 0));
|
identities2_test (0.9L, CHOOSE (0, 1e-15, 2e-7));
|
||||||
identities2_test (0, 0);
|
identities2_test (0, 0);
|
||||||
identities2_test (-1, CHOOSE (1e-18L, 1e-15, 0));
|
identities2_test (-1, CHOOSE (1e-18L, 1e-15, 2e-7));
|
||||||
|
|
||||||
identities3_test (0.2L, CHOOSE (1e-18L, 0, 1e-7));
|
identities3_test (0.2L, CHOOSE (1e-18L, 0, 1e-7));
|
||||||
identities3_test (0.9L, CHOOSE (1e-18L, 1e-15, 1e-6));
|
identities3_test (0.9L, CHOOSE (1e-18L, 1e-15, 1e-6));
|
||||||
identities3_test (0, CHOOSE (0, 0, 1e-6));
|
identities3_test (0, CHOOSE (0, 0, 1e-6));
|
||||||
identities3_test (-1, CHOOSE (1e-18L, 0, 1e-6));
|
identities3_test (-1, CHOOSE (1e-18L, 7e-16, 1e-6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,11 +26,17 @@ weak_alias (__progname_full, program_invocation_name)
|
|||||||
weak_alias (__progname, program_invocation_short_name)
|
weak_alias (__progname, program_invocation_short_name)
|
||||||
|
|
||||||
|
|
||||||
static void __init_misc (int argc, char **argv, char **envp)
|
#ifdef HAVE_GNU_LD
|
||||||
|
static
|
||||||
|
#endif /* HAVE_GNU_LD */
|
||||||
|
void __init_misc (int argc, char **argv, char **envp)
|
||||||
__attribute__ ((unused));
|
__attribute__ ((unused));
|
||||||
|
|
||||||
|
|
||||||
static void
|
#ifdef HAVE_GNU_LD
|
||||||
|
static
|
||||||
|
#endif /* HAVE_GNU_LD */
|
||||||
|
void
|
||||||
__init_misc (int argc, char **argv, char **envp)
|
__init_misc (int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
if (argv && argv[0])
|
if (argv && argv[0])
|
||||||
|
@ -22,10 +22,7 @@
|
|||||||
EXTERNS
|
EXTERNS
|
||||||
|
|
||||||
void
|
void
|
||||||
__libc_init (argc, argv, envp)
|
__libc_init (int argc, char **argv, char **envp)
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
char **envp;
|
|
||||||
{
|
{
|
||||||
CALLS
|
CALLS
|
||||||
|
|
||||||
|
@ -151,7 +151,6 @@ __bind_connect (dir_binding *dbp)
|
|||||||
|
|
||||||
if (dbp->use_auth)
|
if (dbp->use_auth)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_SECURE_RPC)
|
|
||||||
if (serv->key_type == NIS_PK_DH)
|
if (serv->key_type == NIS_PK_DH)
|
||||||
{
|
{
|
||||||
char netname[MAXNETNAMELEN+1];
|
char netname[MAXNETNAMELEN+1];
|
||||||
@ -168,7 +167,6 @@ __bind_connect (dir_binding *dbp)
|
|||||||
dbp->clnt->cl_auth = authunix_create_default ();
|
dbp->clnt->cl_auth = authunix_create_default ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
dbp->clnt->cl_auth = authunix_create_default ();
|
dbp->clnt->cl_auth = authunix_create_default ();
|
||||||
dbp->use_auth = TRUE;
|
dbp->use_auth = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -52,10 +52,8 @@ extern nis_error __do_niscall __P ((const_nis_name name, u_long prog,
|
|||||||
xdrproc_t xargs, caddr_t req,
|
xdrproc_t xargs, caddr_t req,
|
||||||
xdrproc_t xres, caddr_t resp,
|
xdrproc_t xres, caddr_t resp,
|
||||||
u_long flags));
|
u_long flags));
|
||||||
#if defined (HAVE_SECURE_RPC)
|
|
||||||
extern AUTH *authdes_pk_create __P ((const char *, const netobj *, u_int,
|
extern AUTH *authdes_pk_create __P ((const char *, const netobj *, u_int,
|
||||||
struct sockaddr *, des_block *));
|
struct sockaddr *, des_block *));
|
||||||
#endif
|
|
||||||
|
|
||||||
/* NIS+ cache */
|
/* NIS+ cache */
|
||||||
extern directory_obj *__cache_search __P ((const_nis_name name));
|
extern directory_obj *__cache_search __P ((const_nis_name name));
|
||||||
|
@ -25,10 +25,8 @@
|
|||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
#include <rpcsvc/yp.h>
|
#include <rpcsvc/yp.h>
|
||||||
#include <rpcsvc/ypclnt.h>
|
#include <rpcsvc/ypclnt.h>
|
||||||
#if defined (HAVE_SECURE_RPC)
|
|
||||||
#include <rpc/key_prot.h>
|
#include <rpc/key_prot.h>
|
||||||
extern int xdecrypt (char *, char *);
|
extern int xdecrypt (char *, char *);
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "nss-nis.h"
|
#include "nss-nis.h"
|
||||||
|
|
||||||
@ -39,7 +37,7 @@ _nss_nis_getpublickey (const char *netname, char *pkey)
|
|||||||
enum nss_status retval;
|
enum nss_status retval;
|
||||||
char *domain, *result;
|
char *domain, *result;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
pkey[0] = 0;
|
pkey[0] = 0;
|
||||||
|
|
||||||
if (netname == NULL)
|
if (netname == NULL)
|
||||||
@ -76,7 +74,6 @@ _nss_nis_getpublickey (const char *netname, char *pkey)
|
|||||||
enum nss_status
|
enum nss_status
|
||||||
_nss_nis_getsecretkey (const char *netname, char *skey, char *passwd)
|
_nss_nis_getsecretkey (const char *netname, char *skey, char *passwd)
|
||||||
{
|
{
|
||||||
#if defined (HAVE_SECURE_RPC)
|
|
||||||
enum nss_status retval;
|
enum nss_status retval;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char *domain, *result;
|
char *domain, *result;
|
||||||
@ -122,9 +119,6 @@ _nss_nis_getsecretkey (const char *netname, char *skey, char *passwd)
|
|||||||
buf[HEXKEYBYTES] = 0;
|
buf[HEXKEYBYTES] = 0;
|
||||||
strcpy (skey, buf);
|
strcpy (skey, buf);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
skey[0] = 0;
|
|
||||||
#endif
|
|
||||||
return NSS_STATUS_SUCCESS;
|
return NSS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,9 +48,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "mail_aliases.org_dir.");
|
p = __stpcpy (buf, "mail_aliases.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
|
@ -92,9 +92,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "ethers.org_dir.");
|
p = __stpcpy (buf, "ethers.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
@ -267,10 +267,10 @@ _nss_nisplus_getntohost_r (const struct ether_addr *addr,
|
|||||||
char buf[255 + tablename_len];
|
char buf[255 + tablename_len];
|
||||||
|
|
||||||
memset (&buf, '\0', sizeof (buf));
|
memset (&buf, '\0', sizeof (buf));
|
||||||
snprintf(buf, sizeof (buf), "[addr=%x:%x:%x:%x:%x:%x],ethers.org_dir",
|
sprintf(buf, "[addr=%x:%x:%x:%x:%x:%x],ethers.org_dir",
|
||||||
addr->ether_addr_octet[0], addr->ether_addr_octet[1],
|
addr->ether_addr_octet[0], addr->ether_addr_octet[1],
|
||||||
addr->ether_addr_octet[2], addr->ether_addr_octet[3],
|
addr->ether_addr_octet[2], addr->ether_addr_octet[3],
|
||||||
addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
|
addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
|
||||||
|
|
||||||
result = nis_list(buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
result = nis_list(buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
||||||
|
|
||||||
|
@ -43,9 +43,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "group.org_dir.");
|
p = __stpcpy (buf, "group.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
|
@ -98,8 +98,8 @@ _nss_nisplus_parse_hostent (nis_result *result, int af, struct hostent *host,
|
|||||||
if (NISENTRYLEN (0, 0, result) + 1 > room_left)
|
if (NISENTRYLEN (0, 0, result) + 1 > room_left)
|
||||||
goto no_more_room;
|
goto no_more_room;
|
||||||
|
|
||||||
p = stpncpy (first_unused, NISENTRYVAL (0, 0, result),
|
p = __stpncpy (first_unused, NISENTRYVAL (0, 0, result),
|
||||||
NISENTRYLEN (0, 0, result));
|
NISENTRYLEN (0, 0, result));
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
room_left -= (NISENTRYLEN (0, 0, result) + 1);
|
room_left -= (NISENTRYLEN (0, 0, result) + 1);
|
||||||
host->h_name = first_unused;
|
host->h_name = first_unused;
|
||||||
@ -115,8 +115,8 @@ _nss_nisplus_parse_hostent (nis_result *result, int af, struct hostent *host,
|
|||||||
goto no_more_room;
|
goto no_more_room;
|
||||||
|
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
p = stpncpy (p, NISENTRYVAL (i, 1, result),
|
p = __stpncpy (p, NISENTRYVAL (i, 1, result),
|
||||||
NISENTRYLEN (i, 1, result));
|
NISENTRYLEN (i, 1, result));
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
||||||
}
|
}
|
||||||
@ -176,9 +176,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "hosts.org_dir.");
|
p = __stpcpy (buf, "hosts.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
@ -415,7 +415,7 @@ _nss_nisplus_gethostbyaddr_r (const char *addr, int addrlen, int type,
|
|||||||
char buf[255 + tablename_len];
|
char buf[255 + tablename_len];
|
||||||
int retval, parse_res;
|
int retval, parse_res;
|
||||||
|
|
||||||
snprintf(buf, sizeof (buf) -1, "[addr=%s],%s",
|
sprintf (buf, "[addr=%s],%s",
|
||||||
inet_ntoa (*(struct in_addr *)addr), tablename_val);
|
inet_ntoa (*(struct in_addr *)addr), tablename_val);
|
||||||
result = nis_list(buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
result = nis_list(buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ _nss_nisplus_parse_netgroup (struct __netgrent *result, char *buffer,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result->val.triple.host = cp;
|
result->val.triple.host = cp;
|
||||||
cp = stpncpy (cp, NISENTRYVAL (position, 2, data),
|
cp = __stpncpy (cp, NISENTRYVAL (position, 2, data),
|
||||||
NISENTRYLEN (position, 2, data));
|
NISENTRYLEN (position, 2, data));
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
++cp;
|
++cp;
|
||||||
}
|
}
|
||||||
@ -103,8 +103,8 @@ _nss_nisplus_parse_netgroup (struct __netgrent *result, char *buffer,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result->val.triple.user = cp;
|
result->val.triple.user = cp;
|
||||||
cp = stpncpy (cp, NISENTRYVAL (position, 3, data),
|
cp = __stpncpy (cp, NISENTRYVAL (position, 3, data),
|
||||||
NISENTRYLEN (position, 3, data));
|
NISENTRYLEN (position, 3, data));
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
++cp;
|
++cp;
|
||||||
}
|
}
|
||||||
@ -114,8 +114,8 @@ _nss_nisplus_parse_netgroup (struct __netgrent *result, char *buffer,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result->val.triple.domain = cp;
|
result->val.triple.domain = cp;
|
||||||
cp = stpncpy (cp, NISENTRYVAL (position, 4, data),
|
cp = __stpncpy (cp, NISENTRYVAL (position, 4, data),
|
||||||
NISENTRYLEN (position, 4, data));
|
NISENTRYLEN (position, 4, data));
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ _nss_nisplus_parse_netent (nis_result *result, struct netent *network,
|
|||||||
goto no_more_room;
|
goto no_more_room;
|
||||||
|
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
p = stpncpy (p, NISENTRYVAL (i, 1, result),
|
p = __stpncpy (p, NISENTRYVAL (i, 1, result),
|
||||||
NISENTRYLEN (i, 1, result));
|
NISENTRYLEN (i, 1, result));
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
||||||
}
|
}
|
||||||
@ -149,9 +149,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "networks.org_dir.");
|
p = __stpcpy (buf, "networks.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
@ -366,8 +366,7 @@ _nss_nisplus_getnetbyaddr_r (const unsigned long addr, const int type,
|
|||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
|
|
||||||
in = inet_makeaddr (addr, 0);
|
in = inet_makeaddr (addr, 0);
|
||||||
snprintf(buf, sizeof (buf) - 1, "[addr=%s],%s",
|
sprintf (buf, "[addr=%s],%s", inet_ntoa (in), tablename_val);
|
||||||
inet_ntoa (in), tablename_len);
|
|
||||||
|
|
||||||
result = nis_list(buf, EXPAND_NAME, NULL, NULL);
|
result = nis_list(buf, EXPAND_NAME, NULL, NULL);
|
||||||
|
|
||||||
|
@ -85,8 +85,8 @@ _nss_nisplus_parse_protoent (nis_result * result, struct protoent *proto,
|
|||||||
if (NISENTRYLEN (i, 1, result) + 2 > room_left)
|
if (NISENTRYLEN (i, 1, result) + 2 > room_left)
|
||||||
goto no_more_room;
|
goto no_more_room;
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
p = stpncpy (p, NISENTRYVAL (i, 1, result),
|
p = __stpncpy (p, NISENTRYVAL (i, 1, result),
|
||||||
NISENTRYLEN (i, 1, result));
|
NISENTRYLEN (i, 1, result));
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
||||||
}
|
}
|
||||||
@ -143,9 +143,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "protocols.org_dir.");
|
p = __stpcpy (buf, "protocols.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
@ -327,7 +327,7 @@ _nss_nisplus_getprotobynumber_r (const int number, struct protoent *proto,
|
|||||||
nis_result *result;
|
nis_result *result;
|
||||||
char buf[46 + tablename_len];
|
char buf[46 + tablename_len];
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf), "[number=%d],%s", number, tablename_val);
|
sprintf (buf, "[number=%d],%s", number, tablename_val);
|
||||||
|
|
||||||
result = nis_list (buf, FOLLOW_LINKS | FOLLOW_PATH, NULL, NULL);
|
result = nis_list (buf, FOLLOW_LINKS | FOLLOW_PATH, NULL, NULL);
|
||||||
|
|
||||||
|
@ -25,10 +25,8 @@
|
|||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
#include <rpcsvc/nis.h>
|
#include <rpcsvc/nis.h>
|
||||||
#ifdef HAVE_SECURE_RPC
|
|
||||||
#include <rpc/key_prot.h>
|
#include <rpc/key_prot.h>
|
||||||
extern int xdecrypt (char *, char *);
|
extern int xdecrypt (char *, char *);
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <nss-nisplus.h>
|
#include <nss-nisplus.h>
|
||||||
|
|
||||||
@ -107,7 +105,6 @@ _nss_nisplus_getpublickey (const char *netname, char *pkey)
|
|||||||
enum nss_status
|
enum nss_status
|
||||||
_nss_nisplus_getsecretkey (const char *netname, char *skey, char *passwd)
|
_nss_nisplus_getsecretkey (const char *netname, char *skey, char *passwd)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SECURE_RPC
|
|
||||||
nis_result *res;
|
nis_result *res;
|
||||||
enum nss_status retval;
|
enum nss_status retval;
|
||||||
char buf[NIS_MAXNAMELEN+2];
|
char buf[NIS_MAXNAMELEN+2];
|
||||||
@ -179,9 +176,6 @@ _nss_nisplus_getsecretkey (const char *netname, char *skey, char *passwd)
|
|||||||
|
|
||||||
buf[HEXKEYBYTES] = 0;
|
buf[HEXKEYBYTES] = 0;
|
||||||
strcpy (skey, buf);
|
strcpy (skey, buf);
|
||||||
#else
|
|
||||||
skey[0] = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return NSS_STATUS_SUCCESS;
|
return NSS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "passwd.org_dir.");
|
p = __stpcpy (buf, "passwd.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
|
@ -82,8 +82,8 @@ _nss_nisplus_parse_rpcent (nis_result *result, struct rpcent *rpc,
|
|||||||
if (NISENTRYLEN (i, 1, result) + 2 > room_left)
|
if (NISENTRYLEN (i, 1, result) + 2 > room_left)
|
||||||
goto no_more_room;
|
goto no_more_room;
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
p = stpncpy (p, NISENTRYVAL (i, 1, result),
|
p = __stpncpy (p, NISENTRYVAL (i, 1, result),
|
||||||
NISENTRYLEN (i, 1, result));
|
NISENTRYLEN (i, 1, result));
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
||||||
}
|
}
|
||||||
@ -144,9 +144,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "rpc.org_dir.");
|
p = __stpcpy (buf, "rpc.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
@ -329,7 +329,7 @@ _nss_nisplus_getrpcbynumber_r (const int number, struct rpcent *rpc,
|
|||||||
nis_result *result;
|
nis_result *result;
|
||||||
char buf[100 + tablename_len];
|
char buf[100 + tablename_len];
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf), "[number=%d],%s", number, tablename_val);
|
sprintf (buf, "[number=%d],%s", number, tablename_val);
|
||||||
|
|
||||||
result = nis_list(buf, FOLLOW_LINKS | FOLLOW_PATH, NULL, NULL);
|
result = nis_list(buf, FOLLOW_LINKS | FOLLOW_PATH, NULL, NULL);
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ _nss_nisplus_parse_servent (nis_result *result, struct servent *serv,
|
|||||||
if (NISENTRYLEN (i, 1, result) + 2 > room_left)
|
if (NISENTRYLEN (i, 1, result) + 2 > room_left)
|
||||||
goto no_more_room;
|
goto no_more_room;
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
p = stpncpy (p, NISENTRYVAL (i, 1, result),
|
p = __stpncpy (p, NISENTRYVAL (i, 1, result),
|
||||||
NISENTRYLEN (i, 1, result));
|
NISENTRYLEN (i, 1, result));
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
room_left -= (NISENTRYLEN (i, 1, result) + 1);
|
||||||
}
|
}
|
||||||
@ -150,9 +150,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "services.org_dir.");
|
p = __stpcpy (buf, "services.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
@ -348,8 +348,8 @@ _nss_nisplus_getservbynumber_r (const int number, const char *protocol,
|
|||||||
nis_result *result;
|
nis_result *result;
|
||||||
char buf[60 + strlen (protocol) + tablename_len];
|
char buf[60 + strlen (protocol) + tablename_len];
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf), "[number=%d,proto=%s],%s",
|
sprintf (buf, "[number=%d,proto=%s],%s",
|
||||||
number, protocol, tablename_val);
|
number, protocol, tablename_val);
|
||||||
|
|
||||||
result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ _nss_create_tablename (void)
|
|||||||
char buf [40 + strlen (nis_local_directory ())];
|
char buf [40 + strlen (nis_local_directory ())];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = stpcpy (buf, "passwd.org_dir.");
|
p = __stpcpy (buf, "passwd.org_dir.");
|
||||||
p = stpcpy (p, nis_local_directory ());
|
p = __stpcpy (p, nis_local_directory ());
|
||||||
tablename_val = strdup (buf);
|
tablename_val = __strdup (buf);
|
||||||
if (tablename_val == NULL)
|
if (tablename_val == NULL)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
tablename_len = strlen (tablename_val);
|
tablename_len = strlen (tablename_val);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <bits/libc-lock.h>
|
#include <bits/libc-lock.h>
|
||||||
|
#include <rpc/auth.h>
|
||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
#include <rpcsvc/nis.h>
|
#include <rpcsvc/nis.h>
|
||||||
#include <rpcsvc/yp.h>
|
#include <rpcsvc/yp.h>
|
||||||
@ -627,7 +628,7 @@ yp_all (const char *indomain, const char *inmap,
|
|||||||
clnt = clnttcp_create (&clnt_sin, YPPROG, YPVERS, &clnt_sock, 0, 0);
|
clnt = clnttcp_create (&clnt_sin, YPPROG, YPVERS, &clnt_sock, 0, 0);
|
||||||
if (clnt == NULL)
|
if (clnt == NULL)
|
||||||
{
|
{
|
||||||
puts ("yp_all: clnttcp_create failed");
|
puts (_("yp_all: clnttcp_create failed"));
|
||||||
__libc_lock_unlock (ypbindlist_lock);
|
__libc_lock_unlock (ypbindlist_lock);
|
||||||
return YPERR_PMAP;
|
return YPERR_PMAP;
|
||||||
}
|
}
|
||||||
@ -787,7 +788,6 @@ int
|
|||||||
yp_update (char *domain, char *map, unsigned ypop,
|
yp_update (char *domain, char *map, unsigned ypop,
|
||||||
char *key, int keylen, char *data, int datalen)
|
char *key, int keylen, char *data, int datalen)
|
||||||
{
|
{
|
||||||
#if defined (HAVE_SECURE_RPC)
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
ypupdate_args update_args;
|
ypupdate_args update_args;
|
||||||
@ -872,7 +872,4 @@ again:
|
|||||||
return YPERR_RPC;
|
return YPERR_RPC;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
#else
|
|
||||||
return YPERR_YPERR;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,73 @@
|
|||||||
GLIBC_2.0 {
|
GLIBC_2.0 {
|
||||||
global:
|
global:
|
||||||
_nss_files_endaliasent; _nss_files_endetherent; _nss_files_endgrent;
|
_nss_files_setaliasent;
|
||||||
_nss_files_endhostent; _nss_files_endnetent; _nss_files_endnetgrent;
|
_nss_files_endaliasent;
|
||||||
_nss_files_endprotoent; _nss_files_endpwent; _nss_files_endrpcent;
|
_nss_files_getaliasbyname_r;
|
||||||
_nss_files_endservent; _nss_files_endspent; _nss_files_getaliasbyname_r;
|
_nss_files_getaliasent_r;
|
||||||
_nss_files_getaliasent_r; _nss_files_getetherent_r; _nss_files_getgrent_r;
|
|
||||||
_nss_files_getgrgid_r; _nss_files_getgrnam_r; _nss_files_gethostbyaddr_r;
|
_nss_files_setetherent;
|
||||||
_nss_files_gethostbyname2_r; _nss_files_gethostbyname_r;
|
_nss_files_endetherent;
|
||||||
_nss_files_gethostent_r; _nss_files_gethostton_r;
|
_nss_files_getetherent_r;
|
||||||
_nss_files_getnetbyaddr_r; _nss_files_getnetbyname_r;
|
_nss_files_parse_etherent;
|
||||||
_nss_files_getnetent_r; _nss_files_getnetgrent_r; _nss_files_getntohost_r;
|
|
||||||
_nss_files_getprotobyname_r; _nss_files_getprotobynumber_r;
|
_nss_files_setgrent;
|
||||||
_nss_files_getprotoent_r; _nss_files_getpwent_r; _nss_files_getpwnam_r;
|
_nss_files_endgrent;
|
||||||
_nss_files_getpwuid_r; _nss_files_getrpcbyname_r;
|
_nss_files_getgrent_r;
|
||||||
_nss_files_getrpcbynumber_r; _nss_files_getrpcent_r;
|
_nss_files_getgrgid_r;
|
||||||
_nss_files_getservbyname_r; _nss_files_getservbyport_r;
|
_nss_files_getgrnam_r;
|
||||||
_nss_files_getservent_r; _nss_files_getspent_r; _nss_files_getspnam_r;
|
|
||||||
_nss_files_parse_etherent; _nss_files_parse_netent;
|
_nss_files_sethostent;
|
||||||
_nss_files_parse_protoent; _nss_files_parse_rpcent;
|
_nss_files_endhostent;
|
||||||
_nss_files_parse_servent; _nss_files_setaliasent; _nss_files_setetherent;
|
_nss_files_gethostbyaddr_r;
|
||||||
_nss_files_setgrent; _nss_files_sethostent; _nss_files_setnetent;
|
_nss_files_gethostbyname2_r;
|
||||||
_nss_files_setnetgrent; _nss_files_setprotoent; _nss_files_setpwent;
|
_nss_files_gethostbyname_r;
|
||||||
_nss_files_setrpcent; _nss_files_setservent; _nss_files_setspent;
|
_nss_files_gethostent_r;
|
||||||
|
_nss_files_gethostton_r;
|
||||||
|
|
||||||
|
_nss_files_setnetent;
|
||||||
|
_nss_files_endnetent;
|
||||||
|
_nss_files_getnetbyaddr_r;
|
||||||
|
_nss_files_getnetbyname_r;
|
||||||
|
_nss_files_getnetent_r;
|
||||||
|
_nss_files_getntohost_r;
|
||||||
|
_nss_files_parse_netent;
|
||||||
|
|
||||||
|
_nss_files_setnetgrent;
|
||||||
|
_nss_files_endnetgrent;
|
||||||
|
_nss_files_getnetgrent_r;
|
||||||
|
|
||||||
|
_nss_files_setprotoent;
|
||||||
|
_nss_files_endprotoent;
|
||||||
|
_nss_files_getprotobyname_r;
|
||||||
|
_nss_files_getprotobynumber_r;
|
||||||
|
_nss_files_getprotoent_r;
|
||||||
|
_nss_files_parse_protoent;
|
||||||
|
|
||||||
|
_nss_files_setpwent;
|
||||||
|
_nss_files_endpwent;
|
||||||
|
_nss_files_getpwent_r;
|
||||||
|
_nss_files_getpwnam_r;
|
||||||
|
_nss_files_getpwuid_r;
|
||||||
|
|
||||||
|
_nss_files_setrpcent;
|
||||||
|
_nss_files_endrpcent;
|
||||||
|
_nss_files_getrpcbyname_r;
|
||||||
|
_nss_files_getrpcbynumber_r;
|
||||||
|
_nss_files_getrpcent_r;
|
||||||
|
_nss_files_parse_rpcent;
|
||||||
|
|
||||||
|
_nss_files_setservent;
|
||||||
|
_nss_files_endservent;
|
||||||
|
_nss_files_getservbyname_r;
|
||||||
|
_nss_files_getservbyport_r;
|
||||||
|
_nss_files_getservent_r;
|
||||||
|
_nss_files_parse_servent;
|
||||||
|
|
||||||
|
_nss_files_setspent;
|
||||||
|
_nss_files_endspent;
|
||||||
|
_nss_files_getspent_r;
|
||||||
|
_nss_files_getspnam_r;
|
||||||
|
|
||||||
_nss_netgroup_parseline;
|
_nss_netgroup_parseline;
|
||||||
|
|
||||||
local:
|
local:
|
||||||
|
@ -66,6 +66,9 @@ $(mo-installed): %.mo; $(do-install)
|
|||||||
.PHONY: linguas linguas.mo
|
.PHONY: linguas linguas.mo
|
||||||
linguas: $(ALL_LINGUAS:=.po)
|
linguas: $(ALL_LINGUAS:=.po)
|
||||||
linguas.mo: $(ALL_LINGUAS:=.mo)
|
linguas.mo: $(ALL_LINGUAS:=.mo)
|
||||||
|
|
||||||
|
realclean:
|
||||||
|
rm -f $(ALL_LINGUAS:=.mo)
|
||||||
|
|
||||||
# Copy the PO files from the translation coordinator's repository.
|
# Copy the PO files from the translation coordinator's repository.
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (_WINDOWS32) && !defined (__CYGWIN32__)
|
#if defined (WINDOWS32) && !defined (__CYGWIN32__)
|
||||||
/* It's not Unix, really. See? Capital letters. */
|
/* It's not Unix, really. See? Capital letters. */
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define getpid() GetCurrentProcessId()
|
#define getpid() GetCurrentProcessId()
|
||||||
@ -273,7 +273,9 @@ store_args_and_env (int argc, char *const *argv)
|
|||||||
original_argc = argc;
|
original_argc = argc;
|
||||||
original_argv = argv;
|
original_argv = argv;
|
||||||
}
|
}
|
||||||
|
# ifdef text_set_element
|
||||||
text_set_element (__libc_subinit, store_args_and_env);
|
text_set_element (__libc_subinit, store_args_and_env);
|
||||||
|
# endif /* text_set_element */
|
||||||
|
|
||||||
# define SWAP_FLAGS(ch1, ch2) \
|
# define SWAP_FLAGS(ch1, ch2) \
|
||||||
if (nonoption_flags_len > 0) \
|
if (nonoption_flags_len > 0) \
|
||||||
|
@ -433,6 +433,7 @@ extern __pid_t __bsd_getpgrp __P ((__pid_t __pid));
|
|||||||
/* Set the process group ID of the process matching PID to PGID.
|
/* Set the process group ID of the process matching PID to PGID.
|
||||||
If PID is zero, the current process's process group ID is set.
|
If PID is zero, the current process's process group ID is set.
|
||||||
If PGID is zero, the process ID of the process is used. */
|
If PGID is zero, the process ID of the process is used. */
|
||||||
|
extern int __setpgid __P ((__pid_t __pid, __pid_t __pgid));
|
||||||
extern int setpgid __P ((__pid_t __pid, __pid_t __pgid));
|
extern int setpgid __P ((__pid_t __pid, __pid_t __pgid));
|
||||||
|
|
||||||
/* Get the process group ID of process PID. */
|
/* Get the process group ID of process PID. */
|
||||||
@ -705,6 +706,8 @@ extern int revoke __P ((__const char *__file));
|
|||||||
is enabled, the system examines the user PC and increments
|
is enabled, the system examines the user PC and increments
|
||||||
SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero,
|
SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero,
|
||||||
disable profiling. Returns zero on success, -1 on error. */
|
disable profiling. Returns zero on success, -1 on error. */
|
||||||
|
extern int __profil __P ((unsigned short int *__sample_buffer, size_t __size,
|
||||||
|
size_t __offset, unsigned int __scale));
|
||||||
extern int profil __P ((unsigned short int *__sample_buffer, size_t __size,
|
extern int profil __P ((unsigned short int *__sample_buffer, size_t __size,
|
||||||
size_t __offset, unsigned int __scale));
|
size_t __offset, unsigned int __scale));
|
||||||
|
|
||||||
|
@ -468,7 +468,7 @@ read_len:
|
|||||||
while (len != 0) {
|
while (len != 0) {
|
||||||
char junk[PACKETSZ];
|
char junk[PACKETSZ];
|
||||||
|
|
||||||
n = (len > sizeof(junk)
|
n = ((size_t) len > sizeof(junk)
|
||||||
? sizeof(junk)
|
? sizeof(junk)
|
||||||
: len);
|
: len);
|
||||||
if ((n = read(s, junk, n)) > 0)
|
if ((n = read(s, junk, n)) > 0)
|
||||||
|
@ -30,7 +30,7 @@ char *
|
|||||||
fgets (s, n, stream)
|
fgets (s, n, stream)
|
||||||
char *s;
|
char *s;
|
||||||
int n;
|
int n;
|
||||||
register FILE *stream;
|
FILE *stream;
|
||||||
{
|
{
|
||||||
register char *p = s;
|
register char *p = s;
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ fgets (s, n, stream)
|
|||||||
i = stream->__get_limit - stream->__bufp;
|
i = stream->__get_limit - stream->__bufp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > n)
|
if (i > (size_t) n)
|
||||||
i = n;
|
i = n;
|
||||||
|
|
||||||
found = (char *) __memccpy ((void *) p, stream->__bufp, '\n', i);
|
found = (char *) __memccpy ((void *) p, stream->__bufp, '\n', i);
|
||||||
|
@ -73,8 +73,7 @@ unix_FILE _iob[] =
|
|||||||
In a Unix stdio FILE `_cnt' is the first element.
|
In a Unix stdio FILE `_cnt' is the first element.
|
||||||
In a GNU stdio or glued FILE, the first element is the magic number. */
|
In a GNU stdio or glued FILE, the first element is the magic number. */
|
||||||
int
|
int
|
||||||
_filbuf (file)
|
_filbuf (unix_FILE *file)
|
||||||
unix_FILE *file;
|
|
||||||
{
|
{
|
||||||
switch (++file->glue.magic) /* Compensate for Unix getc's decrement. */
|
switch (++file->glue.magic) /* Compensate for Unix getc's decrement. */
|
||||||
{
|
{
|
||||||
@ -95,9 +94,7 @@ _filbuf (file)
|
|||||||
|
|
||||||
/* Called by the Unix stdio `putc' macro. Much like getc, above. */
|
/* Called by the Unix stdio `putc' macro. Much like getc, above. */
|
||||||
int
|
int
|
||||||
_flsbuf (c, file)
|
_flsbuf (int c, unix_FILE *file)
|
||||||
int c;
|
|
||||||
unix_FILE *file;
|
|
||||||
{
|
{
|
||||||
/* Compensate for putc's decrement. */
|
/* Compensate for putc's decrement. */
|
||||||
switch (++file->glue.magic)
|
switch (++file->glue.magic)
|
||||||
|
@ -238,7 +238,7 @@ flushbuf (register FILE *fp, int c)
|
|||||||
else
|
else
|
||||||
__clearerr (fp);
|
__clearerr (fp);
|
||||||
|
|
||||||
if (fp->__get_limit - fp->__buffer < o)
|
if ((size_t) (fp->__get_limit - fp->__buffer) < o)
|
||||||
/* Oops. We didn't read enough (probably because we got EOF).
|
/* Oops. We didn't read enough (probably because we got EOF).
|
||||||
Forget we even mentioned it. */
|
Forget we even mentioned it. */
|
||||||
fp->__target += o;
|
fp->__target += o;
|
||||||
@ -280,7 +280,7 @@ flushbuf (register FILE *fp, int c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp->__bufp - fp->__buffer <= buffer_offset && flush_only)
|
if ((size_t) (fp->__bufp - fp->__buffer) <= buffer_offset && flush_only)
|
||||||
{
|
{
|
||||||
/* There is nothing new in the buffer, only data that
|
/* There is nothing new in the buffer, only data that
|
||||||
was read back aligned from the file. */
|
was read back aligned from the file. */
|
||||||
|
@ -169,7 +169,7 @@ lwupdate (FILE *stream, int c, struct line_wrap_data **wrapper_cookie)
|
|||||||
the end of the buffer. */
|
the end of the buffer. */
|
||||||
nl = stream->__bufp;
|
nl = stream->__bufp;
|
||||||
}
|
}
|
||||||
else if (d->point_col + (nl - buf) < d->rmargin)
|
else if ((size_t) d->point_col + (nl - buf) < d->rmargin)
|
||||||
{
|
{
|
||||||
/* The buffer contains a full line that fits within the maximum
|
/* The buffer contains a full line that fits within the maximum
|
||||||
line width. Reset point and scan the next line. */
|
line width. Reset point and scan the next line. */
|
||||||
|
@ -39,7 +39,7 @@ enlarge_buffer (register FILE *stream, int c)
|
|||||||
*info->bufsize = stream->__bufp - stream->__buffer;
|
*info->bufsize = stream->__bufp - stream->__buffer;
|
||||||
|
|
||||||
if (stream->__target != -1
|
if (stream->__target != -1
|
||||||
&& stream->__target > *info->bufsize)
|
&& (size_t) stream->__target > *info->bufsize)
|
||||||
/* Our target (where the buffer maps to) is always zero except when
|
/* Our target (where the buffer maps to) is always zero except when
|
||||||
the user just did a SEEK_END fseek. If he sought within the
|
the user just did a SEEK_END fseek. If he sought within the
|
||||||
buffer, we need do nothing and will zero the target below. If he
|
buffer, we need do nothing and will zero the target below. If he
|
||||||
|
@ -24,9 +24,7 @@
|
|||||||
/* Output-room function for obstack streams. */
|
/* Output-room function for obstack streams. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
grow (stream, c)
|
grow (FILE *stream, int c)
|
||||||
FILE *stream;
|
|
||||||
int c;
|
|
||||||
{
|
{
|
||||||
struct obstack *const obstack = (struct obstack *) stream->__cookie;
|
struct obstack *const obstack = (struct obstack *) stream->__cookie;
|
||||||
|
|
||||||
@ -34,7 +32,7 @@ grow (stream, c)
|
|||||||
of the buffer which the user has already written into. */
|
of the buffer which the user has already written into. */
|
||||||
obstack_blank_fast (obstack, - (stream->__put_limit - stream->__bufp));
|
obstack_blank_fast (obstack, - (stream->__put_limit - stream->__bufp));
|
||||||
|
|
||||||
if (stream->__target > obstack_object_size (obstack))
|
if ((size_t) stream->__target > obstack_object_size (obstack))
|
||||||
{
|
{
|
||||||
/* Our target (where the buffer maps to) is always zero except when
|
/* Our target (where the buffer maps to) is always zero except when
|
||||||
the user just did a SEEK_END fseek. If he sought within the
|
the user just did a SEEK_END fseek. If he sought within the
|
||||||
@ -83,10 +81,7 @@ grow (stream, c)
|
|||||||
There is no external state to munge. */
|
There is no external state to munge. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
seek (cookie, pos, whence)
|
seek (void *cookie, fpos_t *pos, int whence)
|
||||||
void *cookie;
|
|
||||||
fpos_t *pos;
|
|
||||||
int whence;
|
|
||||||
{
|
{
|
||||||
switch (whence)
|
switch (whence)
|
||||||
{
|
{
|
||||||
@ -110,8 +105,7 @@ seek (cookie, pos, whence)
|
|||||||
Only what has been written to the stream can be read back. */
|
Only what has been written to the stream can be read back. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
input (stream)
|
input (FILE *stream)
|
||||||
FILE *stream;
|
|
||||||
{
|
{
|
||||||
/* Re-sync with the obstack, growing the object if necessary. */
|
/* Re-sync with the obstack, growing the object if necessary. */
|
||||||
grow (stream, EOF);
|
grow (stream, EOF);
|
||||||
@ -126,9 +120,7 @@ input (stream)
|
|||||||
/* Initialize STREAM to talk to OBSTACK. */
|
/* Initialize STREAM to talk to OBSTACK. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_obstream (stream, obstack)
|
init_obstream (FILE *stream, struct obstack *obstack)
|
||||||
FILE *stream;
|
|
||||||
struct obstack *obstack;
|
|
||||||
{
|
{
|
||||||
stream->__mode.__write = 1;
|
stream->__mode.__write = 1;
|
||||||
stream->__mode.__read = 1;
|
stream->__mode.__read = 1;
|
||||||
|
@ -423,28 +423,38 @@ vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)
|
|||||||
}
|
}
|
||||||
#endif /* Optimizing. */
|
#endif /* Optimizing. */
|
||||||
|
|
||||||
#ifdef __USE_GNU
|
#if defined __USE_BSD || defined __USE_ISOC9X
|
||||||
/* Maximum chars of output to write in MAXLEN. */
|
/* Maximum chars of output to write in MAXLEN. */
|
||||||
extern int __snprintf __P ((char *__s, size_t __maxlen,
|
extern int __snprintf __P ((char *__s, size_t __maxlen,
|
||||||
__const char *__format, ...));
|
__const char *__format, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||||
extern int snprintf __P ((char *__s, size_t __maxlen,
|
extern int snprintf __P ((char *__s, size_t __maxlen,
|
||||||
__const char *__format, ...));
|
__const char *__format, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||||
|
|
||||||
extern int __vsnprintf __P ((char *__s, size_t __maxlen,
|
extern int __vsnprintf __P ((char *__s, size_t __maxlen,
|
||||||
__const char *__format, __gnuc_va_list __arg));
|
__const char *__format, __gnuc_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 0)));
|
||||||
extern int vsnprintf __P ((char *__s, size_t __maxlen,
|
extern int vsnprintf __P ((char *__s, size_t __maxlen,
|
||||||
__const char *__format, __gnuc_va_list __arg));
|
__const char *__format, __gnuc_va_list __arg))
|
||||||
|
__attribute__ ((__format__ (__printf__, 3, 0)));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __USE_GNU
|
||||||
/* Write formatted output to a string dynamically allocated with `malloc'.
|
/* Write formatted output to a string dynamically allocated with `malloc'.
|
||||||
Store the address of the string in *PTR. */
|
Store the address of the string in *PTR. */
|
||||||
extern int vasprintf __P ((char **__ptr, __const char *__f,
|
extern int vasprintf __P ((char **__ptr, __const char *__f,
|
||||||
__gnuc_va_list __arg));
|
__gnuc_va_list __arg))
|
||||||
extern int asprintf __P ((char **__ptr, __const char *__fmt, ...));
|
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||||
|
extern int asprintf __P ((char **__ptr, __const char *__fmt, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||||
|
|
||||||
/* Write formatted output to a file descriptor. */
|
/* Write formatted output to a file descriptor. */
|
||||||
extern int vdprintf __P ((int __fd, __const char *__fmt,
|
extern int vdprintf __P ((int __fd, __const char *__fmt,
|
||||||
__gnuc_va_list __arg));
|
__gnuc_va_list __arg))
|
||||||
extern int dprintf __P ((int __fd, __const char *__fmt, ...));
|
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||||
|
extern int dprintf __P ((int __fd, __const char *__fmt, ...))
|
||||||
|
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
|
|
||||||
/* Enlarge STREAM's buffer. */
|
/* Enlarge STREAM's buffer. */
|
||||||
static void
|
static void
|
||||||
enlarge_buffer (stream, c)
|
enlarge_buffer (FILE *stream, int c)
|
||||||
FILE *stream;
|
|
||||||
int c;
|
|
||||||
{
|
{
|
||||||
ptrdiff_t bufp_offset = stream->__bufp - stream->__buffer;
|
ptrdiff_t bufp_offset = stream->__bufp - stream->__buffer;
|
||||||
char *newbuf;
|
char *newbuf;
|
||||||
|
@ -30,7 +30,7 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
|
|||||||
strncat strncmp strncpy \
|
strncat strncmp strncpy \
|
||||||
strrchr strpbrk strsignal strspn strstr strtok \
|
strrchr strpbrk strsignal strspn strstr strtok \
|
||||||
strtok_r strxfrm memchr memcmp memmove memset \
|
strtok_r strxfrm memchr memcmp memmove memset \
|
||||||
bcopy bzero ffs stpcpy stpncpy \
|
mempcpy bcopy bzero ffs stpcpy stpncpy \
|
||||||
strcasecmp strncase strcasecmp_l strncase_l \
|
strcasecmp strncase strcasecmp_l strncase_l \
|
||||||
memccpy memcpy wordcopy strsep \
|
memccpy memcpy wordcopy strsep \
|
||||||
swab strfry memfrob memmem \
|
swab strfry memfrob memmem \
|
||||||
@ -40,17 +40,19 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
|
|||||||
envz basename \
|
envz basename \
|
||||||
strcoll_l strxfrm_l
|
strcoll_l strxfrm_l
|
||||||
|
|
||||||
tests := tester testcopy test-ffs tst-strlen stratcliff \
|
tests := tester inl-tester testcopy test-ffs tst-strlen \
|
||||||
tst-svc
|
stratcliff tst-svc
|
||||||
distribute := memcopy.h pagecopy.h tst-svc.expect
|
distribute := memcopy.h pagecopy.h tst-svc.expect
|
||||||
|
|
||||||
|
|
||||||
include ../Rules
|
include ../Rules
|
||||||
|
|
||||||
tester-ENV = LANGUAGE=C
|
tester-ENV = LANGUAGE=C
|
||||||
CFLAGS-tester.c = -fno-builtin -D__NO_STRING_INLINES
|
inl-tester-ENV = LANGUAGE=C
|
||||||
CFLAGS-tst-strlen.c = -fno-builtin -D__NO_STRING_INLINES
|
CFLAGS-tester.c = -fno-builtin
|
||||||
CFLAGS-stratcliff.c = -fno-builtin -D__NO_STRING_INLINES
|
CFLAGS-inl-tester.c = -fno-builtin
|
||||||
|
CFLAGS-tst-strlen.c = -fno-builtin
|
||||||
|
CFLAGS-stratcliff.c = -fno-builtin
|
||||||
|
|
||||||
tests: $(objpfx)tst-svc.out
|
tests: $(objpfx)tst-svc.out
|
||||||
cmp tst-svc.expect $(objpfx)tst-svc.out
|
cmp tst-svc.expect $(objpfx)tst-svc.out
|
||||||
|
292
string/bits/string2.h
Normal file
292
string/bits/string2.h
Normal file
@ -0,0 +1,292 @@
|
|||||||
|
/* Machine-independant string function optimizations.
|
||||||
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#ifndef _BITS_STRING2_H
|
||||||
|
#define _BITS_STRING2_H 1
|
||||||
|
|
||||||
|
/* Unlike the definitions in the header <bits/string.h> the
|
||||||
|
definitions contained here are not optimizing down to assembler
|
||||||
|
level. These optimizations are not always a good idea since this
|
||||||
|
means the code size increases a lot. Instead the definitions here
|
||||||
|
optimize some functions in a way which does not dramatically
|
||||||
|
increase the code size and which does not use assembler. The main
|
||||||
|
trick is to use GNU CC's `__builtin_constant_p' function.
|
||||||
|
|
||||||
|
Every function XXX which has a defined version in
|
||||||
|
<bits/string.h> must be accompanied by a have _HAVE_STRING_ARCH_XXX
|
||||||
|
to make sure we don't get redefinitions.
|
||||||
|
|
||||||
|
We must use here macros instead of inline functions since the
|
||||||
|
trick won't work with the later. */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
# define __STRING_INLINE inline
|
||||||
|
#else
|
||||||
|
# define __STRING_INLINE extern __inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* We need some more types. */
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Copy SRC to DEST. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strcpy
|
||||||
|
# define strcpy(dest, src) \
|
||||||
|
(__extension__ (__builtin_constant_p (src) \
|
||||||
|
? (strlen (src) + 1 <= 8 \
|
||||||
|
? __strcpy_small (dest, src, strlen (src) + 1) \
|
||||||
|
: (char *) memcpy (dest, src, strlen (src) + 1)) \
|
||||||
|
: strcpy (dest, src)))
|
||||||
|
|
||||||
|
__STRING_INLINE char *
|
||||||
|
__strcpy_small (char *__dest, __const char *__src, size_t __srclen)
|
||||||
|
{
|
||||||
|
register char *__tmp = __dest;
|
||||||
|
switch (__srclen)
|
||||||
|
{
|
||||||
|
case 7:
|
||||||
|
*((__uint16_t *) __tmp)++ = *((__uint16_t *) __src)++;
|
||||||
|
case 5:
|
||||||
|
*((__uint32_t *) __tmp)++ = *((__uint32_t *) __src)++;
|
||||||
|
*((unsigned char *) __tmp) = '\0';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
*((__uint32_t *) __tmp)++ = *((__uint32_t *) __src)++;
|
||||||
|
case 4:
|
||||||
|
*((__uint32_t *) __tmp) = *((__uint32_t *) __src);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
*((__uint32_t *) __tmp)++ = *((__uint32_t *) __src)++;
|
||||||
|
case 2:
|
||||||
|
*((__uint16_t *) __tmp) = *((__uint16_t *) __src);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
*((__uint16_t *) __tmp)++ = *((__uint16_t *) __src)++;
|
||||||
|
case 1:
|
||||||
|
*((unsigned char *) __tmp) = '\0';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return __dest;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Copy SRC to DEST, returning pointer to final NUL byte. */
|
||||||
|
#ifdef __USE_GNU
|
||||||
|
# ifndef _HAVE_STRING_ARCH_stpcpy
|
||||||
|
# define __stpcpy(dest, src) \
|
||||||
|
(__extension__ (__builtin_constant_p (src) \
|
||||||
|
? (strlen (src) + 1 <= 8 \
|
||||||
|
? __stpcpy_small (dest, src, strlen (src) + 1) \
|
||||||
|
: ((char *) __mempcpy (dest, src, strlen (src) + 1) - 1))\
|
||||||
|
: __stpcpy (dest, src)))
|
||||||
|
/* In glibc we use this function frequently but for namespace reasons
|
||||||
|
we have to use the name `__stpcpy'. */
|
||||||
|
# define stpcpy(dest, src) __stpcpy (dest, src)
|
||||||
|
|
||||||
|
__STRING_INLINE char *
|
||||||
|
__stpcpy_small (char *__dest, __const char *__src, size_t __srclen)
|
||||||
|
{
|
||||||
|
register char *__tmp = __dest;
|
||||||
|
switch (__srclen)
|
||||||
|
{
|
||||||
|
case 7:
|
||||||
|
*((__uint16_t *) __tmp)++ = *((__uint16_t *) __src)++;
|
||||||
|
case 5:
|
||||||
|
*((__uint32_t *) __tmp)++ = *((__uint32_t *) __src)++;
|
||||||
|
*((unsigned char *) __tmp) = '\0';
|
||||||
|
return __tmp;
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
*((__uint32_t *) __tmp)++ = *((__uint32_t *) __src)++;
|
||||||
|
case 4:
|
||||||
|
*((__uint32_t *) __tmp) = *((__uint32_t *) __src);
|
||||||
|
return __tmp + 3;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
*((__uint32_t *) __tmp)++ = *((__uint32_t *) __src)++;
|
||||||
|
case 2:
|
||||||
|
*((__uint16_t *) __tmp) = *((__uint16_t *) __src);
|
||||||
|
return __tmp + 1;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
*((__uint16_t *) __tmp)++ = *((__uint16_t *) __src)++;
|
||||||
|
case 1:
|
||||||
|
*((unsigned char *) __tmp) = '\0';
|
||||||
|
return __tmp;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* This should never happen. */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Copy no more than N characters of SRC to DEST. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strncpy
|
||||||
|
# if defined _HAVE_STRING_ARCH_memset && defined _HAVE_STRING_ARCH_mempcpy
|
||||||
|
# define strncpy(dest, src, n) \
|
||||||
|
(__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
|
||||||
|
? (strlen (src) + 1 >= ((size_t) (n)) \
|
||||||
|
? (char *) memcpy (dest, src, n) \
|
||||||
|
: (memset (__mempcpy (dest, src, strlen (src)), '\0', \
|
||||||
|
n - strlen (src)), \
|
||||||
|
dest)) \
|
||||||
|
: strncpy (dest, src, n)))
|
||||||
|
# else
|
||||||
|
# define strncpy(dest, src, n) \
|
||||||
|
(__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
|
||||||
|
? (strlen (src) + 1 >= ((size_t) (n)) \
|
||||||
|
? (char *) memcpy (dest, src, n) \
|
||||||
|
: strncpy (dest, src, n)) \
|
||||||
|
: strncpy (dest, src, n)))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Append no more than N characters from SRC onto DEST. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strncat
|
||||||
|
# ifdef _HAVE_STRING_ARCH_strchr
|
||||||
|
# define strncat(dest, src, n) \
|
||||||
|
(__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
|
||||||
|
? (strlen (src) < ((size_t) (n)) \
|
||||||
|
? strcat (dest, src) \
|
||||||
|
: (memcpy (strchr (dest, '\0'), src, n), dest)) \
|
||||||
|
: strncat (dest, src, n)))
|
||||||
|
# else
|
||||||
|
# define strncat(dest, src, n) \
|
||||||
|
(__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
|
||||||
|
? (strlen (src) < ((size_t) (n)) \
|
||||||
|
? strcat (dest, src) \
|
||||||
|
: strncat (dest, src, n)) \
|
||||||
|
: strncat (dest, src, n)))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Compare N characters of S1 and S2. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strncmp
|
||||||
|
# define strncmp(s1, s2, n) \
|
||||||
|
(__extension__ (__builtin_constant_p (s1) && strlen (s1) < ((size_t) (n)) \
|
||||||
|
? strcmp (s1, s2) \
|
||||||
|
: (__builtin_constant_p (s2) && strlen (s2) < ((size_t) (n))\
|
||||||
|
? strcmp (s1, s2) \
|
||||||
|
: strncmp (s1, s2, n))))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Return the length of the initial segment of S which
|
||||||
|
consists entirely of characters not in REJECT. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strcspn
|
||||||
|
# define strcspn(s, reject) \
|
||||||
|
(__extension__ (__builtin_constant_p (reject) \
|
||||||
|
? (((const char *) (reject))[0] == '\0' \
|
||||||
|
? strlen (s) \
|
||||||
|
: (((const char *) (reject))[1] == '\0' \
|
||||||
|
? __strcspn_c1 (s, ((((const char *) (reject))[0] \
|
||||||
|
& 0xff) << 8)) \
|
||||||
|
: strcspn (s, reject))) \
|
||||||
|
: strcspn (s, reject)))
|
||||||
|
|
||||||
|
__STRING_INLINE size_t
|
||||||
|
__strcspn_c1 (__const char *__s, char __reject)
|
||||||
|
{
|
||||||
|
register size_t __result = 0;
|
||||||
|
while (__s[__result] != '\0' && __s[__result] != __reject)
|
||||||
|
++__result;
|
||||||
|
return __result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Return the length of the initial segment of S which
|
||||||
|
consists entirely of characters in ACCEPT. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strspn
|
||||||
|
# define strspn(s, accept) \
|
||||||
|
(__extension__ (__builtin_constant_p (accept) \
|
||||||
|
? (((const char *) (accept))[0] == '\0' \
|
||||||
|
? 0 \
|
||||||
|
: (((const char *) (accept))[1] == '\0' \
|
||||||
|
? __strspn_c1 (s, ((const char *) (accept))[0]) \
|
||||||
|
: strspn (s, accept))) \
|
||||||
|
: strspn (s, accept)))
|
||||||
|
|
||||||
|
__STRING_INLINE size_t
|
||||||
|
__strspn_c1 (__const char *__s, char __accept)
|
||||||
|
{
|
||||||
|
register size_t __result = 0;
|
||||||
|
/* Please note that __accept never can be '\0'. */
|
||||||
|
while (__s[__result] == __accept)
|
||||||
|
++__result;
|
||||||
|
return __result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Find the first occurrence in S of any character in ACCEPT. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strpbrk
|
||||||
|
# define strpbrk(s, accept) \
|
||||||
|
(__extension__ (__builtin_constant_p (accept) \
|
||||||
|
? (((const char *) (accept))[0] == '\0' \
|
||||||
|
? NULL \
|
||||||
|
: (((const char *) (accept))[1] == '\0' \
|
||||||
|
? strchr (s, ((const char *) (accept))[0]) \
|
||||||
|
: strpbrk (s, accept))) \
|
||||||
|
: strpbrk (s, accept)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Find the first occurrence of NEEDLE in HAYSTACK. */
|
||||||
|
#ifndef _HAVE_STRING_ARCH_strstr
|
||||||
|
# define strstr(haystack, needle) \
|
||||||
|
(__extension__ (__builtin_constant_p (needle) \
|
||||||
|
? (((const char *) (needle))[0] == '\0' \
|
||||||
|
? haystack \
|
||||||
|
: (((const char *) (needle))[1] == '\0' \
|
||||||
|
? strchr (haystack, ((const char *) (needle))[0]) \
|
||||||
|
: strstr (haystack, needle))) \
|
||||||
|
: strstr (haystack, needle)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __USE_GNU
|
||||||
|
# ifndef _HAVE_STRING_ARCH_strnlen
|
||||||
|
extern __inline size_t
|
||||||
|
strnlen (__const char *__string, size_t __maxlen)
|
||||||
|
{
|
||||||
|
__const char *__end = (__const char *) memchr (__string, '\0', __maxlen);
|
||||||
|
return __end ? __end - __string : __maxlen;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#undef __STRING_INLINE
|
||||||
|
|
||||||
|
#endif /* bits/string2.h */
|
6
string/inl-tester.c
Normal file
6
string/inl-tester.c
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/* We want to test the inline functions here. */
|
||||||
|
|
||||||
|
#define DO_STRING_INLINES
|
||||||
|
#undef __USE_STRING_INLINES
|
||||||
|
#define __USE_STRING_INLINES 1
|
||||||
|
#include "tester.c"
|
@ -19,6 +19,11 @@
|
|||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#define _GNU_SOURCE 1
|
#define _GNU_SOURCE 1
|
||||||
|
|
||||||
|
/* Make sure we don't test the optimized inline functions if we want to
|
||||||
|
test the real implementation. */
|
||||||
|
#undef __USE_STRING_INLINES
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -171,6 +171,13 @@ extern char *strtok_r __P ((char *__s, __const char *__delim,
|
|||||||
HAYSTACK is HAYSTACKLEN bytes long. */
|
HAYSTACK is HAYSTACKLEN bytes long. */
|
||||||
extern __ptr_t memmem __P ((__const __ptr_t __haystack, size_t __haystacklen,
|
extern __ptr_t memmem __P ((__const __ptr_t __haystack, size_t __haystacklen,
|
||||||
__const __ptr_t __needle, size_t __needlelen));
|
__const __ptr_t __needle, size_t __needlelen));
|
||||||
|
|
||||||
|
/* Copy N bytes of SRC to DEST, return pointer to bytes after the
|
||||||
|
last written byte. */
|
||||||
|
extern __ptr_t __mempcpy __P ((__ptr_t __restrict __dest,
|
||||||
|
__const __ptr_t __restrict __src, size_t __n));
|
||||||
|
extern __ptr_t mempcpy __P ((__ptr_t __restrict __dest,
|
||||||
|
__const __ptr_t __restrict __src, size_t __n));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -274,21 +281,30 @@ extern char *basename __P ((__const char *__filename));
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Some functions might be implemented as optimized inline assembler
|
|
||||||
functions. Only include this file if we really want them. */
|
|
||||||
#if defined __USE_STRING_INLINES && defined __OPTIMIZE__
|
|
||||||
# include <bits/string.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Now provide some generic optimizations. */
|
|
||||||
#if defined __GNUC__ && __GNUC__ >= 2 && defined __OPTIMIZE__
|
#if defined __GNUC__ && __GNUC__ >= 2 && defined __OPTIMIZE__
|
||||||
extern __inline size_t
|
/* When using GNU CC we provide some optimized versions of selected
|
||||||
strnlen (__const char *__string, size_t __maxlen)
|
functions from this header. There are two kinds of optimizations:
|
||||||
{
|
|
||||||
__const char *__end = (__const char *) memchr (__string, '\0', __maxlen);
|
- machine-dependent optmizations, most probably using inline
|
||||||
return __end ? __end - __string : __maxlen;
|
assembler code; these could be quite expensive since the code
|
||||||
}
|
size could increase significantly.
|
||||||
|
These optimizations are not used unless the symbol
|
||||||
|
__USE_STRING_INLINES
|
||||||
|
is defined before including this header
|
||||||
|
|
||||||
|
- machine-independent optimizations which do not increase the
|
||||||
|
code size significantly and which optimize mainly situations
|
||||||
|
where one or more arguments are compile-time constants.
|
||||||
|
These optimizations are used always when the compiler is
|
||||||
|
taught to optimized. */
|
||||||
|
|
||||||
|
/* Get the machine-dependent optimizations if wanted. */
|
||||||
|
# ifdef __USE_STRING_INLINES
|
||||||
|
# include <bits/string.h>
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* These are generic optimizations which do not add too much inline code. */
|
||||||
|
# include <bits/string2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
@ -1,6 +1,32 @@
|
|||||||
|
/* Tester for string functions.
|
||||||
|
Copyright (C) 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 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. */
|
||||||
|
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Make sure we don't test the optimized inline functions if we want to
|
||||||
|
test the real implementation. */
|
||||||
|
#if !defined DO_STRING_INLINES
|
||||||
|
#undef __USE_STRING_INLINES
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -222,7 +248,7 @@ main (void)
|
|||||||
|
|
||||||
(void) strcpy (one, "abcdefgh");
|
(void) strcpy (one, "abcdefgh");
|
||||||
(void) strncpy (one, "xyz", 2);
|
(void) strncpy (one, "xyz", 2);
|
||||||
equal (one, "xycdefgh", 3); /* Copy cut by count. */
|
equal (one, "xycdefgh", 3); /* Copy cut by count. */
|
||||||
|
|
||||||
(void) strcpy (one, "abcdefgh");
|
(void) strcpy (one, "abcdefgh");
|
||||||
(void) strncpy (one, "xyz", 3); /* Copy cut just before NUL. */
|
(void) strncpy (one, "xyz", 3); /* Copy cut just before NUL. */
|
||||||
@ -231,7 +257,7 @@ main (void)
|
|||||||
(void) strcpy (one, "abcdefgh");
|
(void) strcpy (one, "abcdefgh");
|
||||||
(void) strncpy (one, "xyz", 4); /* Copy just includes NUL. */
|
(void) strncpy (one, "xyz", 4); /* Copy just includes NUL. */
|
||||||
equal (one, "xyz", 5);
|
equal (one, "xyz", 5);
|
||||||
equal (one+4, "efgh", 6); /* Wrote too much? */
|
equal (one+4, "efgh", 6); /* Wrote too much? */
|
||||||
|
|
||||||
(void) strcpy (one, "abcdefgh");
|
(void) strcpy (one, "abcdefgh");
|
||||||
(void) strncpy (one, "xyz", 5); /* Copy includes padding. */
|
(void) strncpy (one, "xyz", 5); /* Copy includes padding. */
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
/* Make sure we don't test the optimized inline functions if we want to
|
||||||
|
test the real implementation. */
|
||||||
|
#undef __USE_STRING_INLINES
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ struct ad_private
|
|||||||
* Create the client des authentication object
|
* Create the client des authentication object
|
||||||
*/
|
*/
|
||||||
AUTH *
|
AUTH *
|
||||||
authdes_create (const char *servername, u_int window,
|
authdes_create (const char *servername, u_int window,
|
||||||
struct sockaddr *syncaddr, des_block * ckey)
|
struct sockaddr *syncaddr, des_block * ckey)
|
||||||
/* servername - network name of server */
|
/* servername - network name of server */
|
||||||
/* window - time to live */
|
/* window - time to live */
|
||||||
@ -161,6 +161,7 @@ authdes_pk_create (const char *servername, netobj * pkey, u_int window,
|
|||||||
*/
|
*/
|
||||||
bcopy (namebuf, ad->ad_fullname, ad->ad_fullnamelen + 1);
|
bcopy (namebuf, ad->ad_fullname, ad->ad_fullnamelen + 1);
|
||||||
bcopy (servername, ad->ad_servername, ad->ad_servernamelen + 1);
|
bcopy (servername, ad->ad_servername, ad->ad_servernamelen + 1);
|
||||||
|
ad->ad_timediff.tv_sec = ad->ad_timediff.tv_usec = 0;
|
||||||
if (syncaddr != NULL)
|
if (syncaddr != NULL)
|
||||||
{
|
{
|
||||||
ad->ad_syncaddr = *syncaddr;
|
ad->ad_syncaddr = *syncaddr;
|
||||||
@ -198,11 +199,13 @@ failed:
|
|||||||
if (auth != NULL)
|
if (auth != NULL)
|
||||||
FREE (auth, sizeof (AUTH));
|
FREE (auth, sizeof (AUTH));
|
||||||
if (ad != NULL)
|
if (ad != NULL)
|
||||||
FREE (ad, sizeof (struct ad_private));
|
{
|
||||||
if (ad->ad_fullname != NULL)
|
FREE (ad, sizeof (struct ad_private));
|
||||||
FREE (ad->ad_fullname, ad->ad_fullnamelen + 1);
|
if (ad->ad_fullname != NULL)
|
||||||
if (ad->ad_servername != NULL)
|
FREE (ad->ad_fullname, ad->ad_fullnamelen + 1);
|
||||||
FREE (ad->ad_servername, ad->ad_servernamelen + 1);
|
if (ad->ad_servername != NULL)
|
||||||
|
FREE (ad->ad_servername, ad->ad_servernamelen + 1);
|
||||||
|
}
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@ static char sccsid[] = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
|
|||||||
|
|
||||||
#define MAX_MARSHEL_SIZE 20
|
#define MAX_MARSHEL_SIZE 20
|
||||||
|
|
||||||
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Authenticator operations routines
|
* Authenticator operations routines
|
||||||
*/
|
*/
|
||||||
|
@ -54,8 +54,6 @@ static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";
|
|||||||
#include <rpc/auth.h>
|
#include <rpc/auth.h>
|
||||||
#include <rpc/auth_unix.h>
|
#include <rpc/auth_unix.h>
|
||||||
|
|
||||||
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unix authenticator operations vector
|
* Unix authenticator operations vector
|
||||||
*/
|
*/
|
||||||
|
@ -46,8 +46,6 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
|
|||||||
#include <rpc/svc.h>
|
#include <rpc/svc.h>
|
||||||
#include <rpc/xdr.h>
|
#include <rpc/xdr.h>
|
||||||
|
|
||||||
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
|
|
||||||
|
|
||||||
#define MCALL_MSG_SIZE 24
|
#define MCALL_MSG_SIZE 24
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -58,8 +58,6 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <rpc/pmap_clnt.h>
|
#include <rpc/pmap_clnt.h>
|
||||||
|
|
||||||
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
|
|
||||||
|
|
||||||
#define MCALL_MSG_SIZE 24
|
#define MCALL_MSG_SIZE 24
|
||||||
|
|
||||||
struct ct_data
|
struct ct_data
|
||||||
|
@ -32,11 +32,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The original source is from the RPCSRC 4.0 package from Sun Microsystems.
|
* The original source is from the RPCSRC 4.0 package from Sun Microsystems.
|
||||||
* The Interface to keyserver protocoll 2 was added by
|
* The Interface to keyserver protocoll 2 was added by
|
||||||
* Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
|
* Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -52,21 +53,21 @@
|
|||||||
|
|
||||||
#define debug(msg) /* turn off debugging */
|
#define debug(msg) /* turn off debugging */
|
||||||
|
|
||||||
extern int _openchild (char *command, FILE ** fto, FILE ** ffrom);
|
extern int _openchild (char *command, FILE **fto, FILE **ffrom);
|
||||||
|
|
||||||
|
|
||||||
static int key_call (u_long, xdrproc_t xdr_arg, char *,
|
static int key_call (u_long, xdrproc_t xdr_arg, char *,
|
||||||
xdrproc_t xdr_rslt, char *);
|
xdrproc_t xdr_rslt, char *);
|
||||||
|
|
||||||
static struct timeval trytimeout = {KEY_TIMEOUT, 0};
|
static struct timeval trytimeout = {KEY_TIMEOUT, 0};
|
||||||
static struct timeval tottimeout = {KEY_TIMEOUT * KEY_NRETRY, 0};
|
static struct timeval tottimeout = {KEY_TIMEOUT *KEY_NRETRY, 0};
|
||||||
|
|
||||||
int
|
int
|
||||||
key_setsecret (char *secretkey)
|
key_setsecret (char *secretkey)
|
||||||
{
|
{
|
||||||
keystatus status;
|
keystatus status;
|
||||||
|
|
||||||
if (!key_call ((u_long) KEY_SET, (xdrproc_t) xdr_keybuf, secretkey,
|
if (!key_call ((u_long) KEY_SET, (xdrproc_t) xdr_keybuf, secretkey,
|
||||||
(xdrproc_t) xdr_keystatus, (char *) &status))
|
(xdrproc_t) xdr_keystatus, (char *) &status))
|
||||||
return -1;
|
return -1;
|
||||||
if (status != KEY_SUCCESS)
|
if (status != KEY_SUCCESS)
|
||||||
@ -102,14 +103,14 @@ key_secretkey_is_set (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
key_encryptsession (char *remotename, des_block * deskey)
|
key_encryptsession (char *remotename, des_block *deskey)
|
||||||
{
|
{
|
||||||
cryptkeyarg arg;
|
cryptkeyarg arg;
|
||||||
cryptkeyres res;
|
cryptkeyres res;
|
||||||
|
|
||||||
arg.remotename = remotename;
|
arg.remotename = remotename;
|
||||||
arg.deskey = *deskey;
|
arg.deskey = *deskey;
|
||||||
if (!key_call ((u_long) KEY_ENCRYPT, (xdrproc_t) xdr_cryptkeyarg,
|
if (!key_call ((u_long) KEY_ENCRYPT, (xdrproc_t) xdr_cryptkeyarg,
|
||||||
(char *) &arg, (xdrproc_t) xdr_cryptkeyres, (char *) &res))
|
(char *) &arg, (xdrproc_t) xdr_cryptkeyres, (char *) &res))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -123,7 +124,7 @@ key_encryptsession (char *remotename, des_block * deskey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
key_decryptsession (char *remotename, des_block * deskey)
|
key_decryptsession (char *remotename, des_block *deskey)
|
||||||
{
|
{
|
||||||
cryptkeyarg arg;
|
cryptkeyarg arg;
|
||||||
cryptkeyres res;
|
cryptkeyres res;
|
||||||
@ -143,8 +144,8 @@ key_decryptsession (char *remotename, des_block * deskey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
key_encryptsession_pk (char *remotename, netobj * remotekey,
|
key_encryptsession_pk (char *remotename, netobj *remotekey,
|
||||||
des_block * deskey)
|
des_block *deskey)
|
||||||
{
|
{
|
||||||
cryptkeyarg2 arg;
|
cryptkeyarg2 arg;
|
||||||
cryptkeyres res;
|
cryptkeyres res;
|
||||||
@ -152,7 +153,7 @@ key_encryptsession_pk (char *remotename, netobj * remotekey,
|
|||||||
arg.remotename = remotename;
|
arg.remotename = remotename;
|
||||||
arg.remotekey = *remotekey;
|
arg.remotekey = *remotekey;
|
||||||
arg.deskey = *deskey;
|
arg.deskey = *deskey;
|
||||||
if (!key_call ((u_long) KEY_ENCRYPT_PK, (xdrproc_t) xdr_cryptkeyarg2,
|
if (!key_call ((u_long) KEY_ENCRYPT_PK, (xdrproc_t) xdr_cryptkeyarg2,
|
||||||
(char *) &arg, (xdrproc_t) xdr_cryptkeyres, (char *) &res))
|
(char *) &arg, (xdrproc_t) xdr_cryptkeyres, (char *) &res))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -166,8 +167,8 @@ key_encryptsession_pk (char *remotename, netobj * remotekey,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
key_decryptsession_pk (char *remotename, netobj * remotekey,
|
key_decryptsession_pk (char *remotename, netobj *remotekey,
|
||||||
des_block * deskey)
|
des_block *deskey)
|
||||||
{
|
{
|
||||||
cryptkeyarg2 arg;
|
cryptkeyarg2 arg;
|
||||||
cryptkeyres res;
|
cryptkeyres res;
|
||||||
@ -175,7 +176,7 @@ key_decryptsession_pk (char *remotename, netobj * remotekey,
|
|||||||
arg.remotename = remotename;
|
arg.remotename = remotename;
|
||||||
arg.remotekey = *remotekey;
|
arg.remotekey = *remotekey;
|
||||||
arg.deskey = *deskey;
|
arg.deskey = *deskey;
|
||||||
if (!key_call ((u_long) KEY_DECRYPT_PK, (xdrproc_t) xdr_cryptkeyarg2,
|
if (!key_call ((u_long) KEY_DECRYPT_PK, (xdrproc_t) xdr_cryptkeyarg2,
|
||||||
(char *) &arg, (xdrproc_t) xdr_cryptkeyres, (char *) &res))
|
(char *) &arg, (xdrproc_t) xdr_cryptkeyres, (char *) &res))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -189,7 +190,7 @@ key_decryptsession_pk (char *remotename, netobj * remotekey,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
key_gendes (des_block * key)
|
key_gendes (des_block *key)
|
||||||
{
|
{
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
CLIENT *client;
|
CLIENT *client;
|
||||||
@ -222,7 +223,7 @@ key_setnet (struct key_netstarg *arg)
|
|||||||
{
|
{
|
||||||
keystatus status;
|
keystatus status;
|
||||||
|
|
||||||
if (!key_call ((u_long) KEY_NET_PUT, (xdrproc_t) xdr_key_netstarg,
|
if (!key_call ((u_long) KEY_NET_PUT, (xdrproc_t) xdr_key_netstarg,
|
||||||
(char *) arg,(xdrproc_t) xdr_keystatus, (char *) &status))
|
(char *) arg,(xdrproc_t) xdr_keystatus, (char *) &status))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -235,7 +236,7 @@ key_setnet (struct key_netstarg *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
key_get_conv (char *pkey, des_block * deskey)
|
key_get_conv (char *pkey, des_block *deskey)
|
||||||
{
|
{
|
||||||
cryptkeyres res;
|
cryptkeyres res;
|
||||||
|
|
||||||
@ -273,7 +274,7 @@ key_call (u_long proc, xdrproc_t xdr_arg, char *arg,
|
|||||||
XDR xdrrslt;
|
XDR xdrrslt;
|
||||||
FILE *fargs;
|
FILE *fargs;
|
||||||
FILE *frslt;
|
FILE *frslt;
|
||||||
void (*osigchild) (int);
|
sigset_t oldmask, mask;
|
||||||
union wait status;
|
union wait status;
|
||||||
int pid;
|
int pid;
|
||||||
int success;
|
int success;
|
||||||
@ -281,9 +282,6 @@ key_call (u_long proc, xdrproc_t xdr_arg, char *arg,
|
|||||||
uid_t euid;
|
uid_t euid;
|
||||||
static char MESSENGER[] = "/usr/etc/keyenvoy";
|
static char MESSENGER[] = "/usr/etc/keyenvoy";
|
||||||
|
|
||||||
success = 1;
|
|
||||||
osigchild = signal (SIGCHLD, SIG_IGN);
|
|
||||||
|
|
||||||
if (proc == KEY_ENCRYPT_PK && __key_encryptsession_pk_LOCAL)
|
if (proc == KEY_ENCRYPT_PK && __key_encryptsession_pk_LOCAL)
|
||||||
{
|
{
|
||||||
cryptkeyres *res;
|
cryptkeyres *res;
|
||||||
@ -306,6 +304,11 @@ key_call (u_long proc, xdrproc_t xdr_arg, char *arg,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
success = 1;
|
||||||
|
sigemptyset (&mask);
|
||||||
|
sigaddset (&mask, SIGCHLD);
|
||||||
|
sigprocmask (SIG_BLOCK, &mask, &oldmask);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are going to exec a set-uid program which makes our effective uid
|
* We are going to exec a set-uid program which makes our effective uid
|
||||||
* zero, and authenticates us with our real uid. We need to make the
|
* zero, and authenticates us with our real uid. We need to make the
|
||||||
@ -320,6 +323,7 @@ key_call (u_long proc, xdrproc_t xdr_arg, char *arg,
|
|||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
{
|
{
|
||||||
debug ("open_streams");
|
debug ("open_streams");
|
||||||
|
sigprocmask(SIG_SETMASK, &oldmask, NULL);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
xdrstdio_create (&xdrargs, fargs, XDR_ENCODE);
|
xdrstdio_create (&xdrargs, fargs, XDR_ENCODE);
|
||||||
@ -337,27 +341,26 @@ key_call (u_long proc, xdrproc_t xdr_arg, char *arg,
|
|||||||
debug ("xdr rslt");
|
debug ("xdr rslt");
|
||||||
success = 0;
|
success = 0;
|
||||||
}
|
}
|
||||||
|
fclose(frslt);
|
||||||
|
|
||||||
#ifdef NOTDEF
|
wait_again:
|
||||||
/*
|
if (wait4(pid, &status, 0, NULL) < 0)
|
||||||
* WARNING! XXX
|
|
||||||
* The original code appears first. wait4 returns only after the process
|
|
||||||
* with the requested pid terminates. The effect of using wait() instead
|
|
||||||
* has not been determined.
|
|
||||||
*/
|
|
||||||
fclose (frslt);
|
|
||||||
if (wait4 (pid, &status, 0, NULL) < 0 || status.w_retcode != 0)
|
|
||||||
{
|
{
|
||||||
debug ("wait4");
|
if (errno == EINTR)
|
||||||
success = 0;
|
goto wait_again;
|
||||||
|
debug("wait4");
|
||||||
|
if (errno == ECHILD || errno == ESRCH)
|
||||||
|
perror("wait");
|
||||||
|
else
|
||||||
|
success = 0;
|
||||||
}
|
}
|
||||||
#endif /* def NOTDEF */
|
else
|
||||||
if (wait (&status) < 0 || status.w_retcode != 0)
|
if (status.w_retcode)
|
||||||
{
|
{
|
||||||
debug ("wait");
|
debug("wait4 1");
|
||||||
success = 0;
|
success = 0;
|
||||||
}
|
}
|
||||||
signal (SIGCHLD, osigchild);
|
sigprocmask(SIG_SETMASK, &oldmask, NULL);
|
||||||
|
|
||||||
return (success);
|
return (success);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
|
||||||
static char sccsid[] = "@(#)openchild.c 2.3 88/08/15 4.0 RPCSRC; from 1.7 88/02/08 SMI";
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||||
* unrestricted use provided that this legend is included on all tape
|
* unrestricted use provided that this legend is included on all tape
|
||||||
@ -46,8 +43,6 @@ static char sccsid[] = "@(#)openchild.c 2.3 88/08/15 4.0 RPCSRC; from 1.7 88/02/
|
|||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
#include <rpc/clnt.h>
|
#include <rpc/clnt.h>
|
||||||
|
|
||||||
static char SHELL[] = "/bin/sh";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* returns pid, or -1 for failure
|
* returns pid, or -1 for failure
|
||||||
*/
|
*/
|
||||||
@ -58,13 +53,12 @@ _openchild (char *command, FILE ** fto, FILE ** ffrom)
|
|||||||
int pid;
|
int pid;
|
||||||
int pdto[2];
|
int pdto[2];
|
||||||
int pdfrom[2];
|
int pdfrom[2];
|
||||||
char *com;
|
|
||||||
|
|
||||||
if (pipe (pdto) < 0)
|
if (pipe (pdto) < 0)
|
||||||
goto error1;
|
goto error1;
|
||||||
if (pipe (pdfrom) < 0)
|
if (pipe (pdfrom) < 0)
|
||||||
goto error2;
|
goto error2;
|
||||||
switch (pid = vfork ())
|
switch (pid = fork ())
|
||||||
{
|
{
|
||||||
case -1:
|
case -1:
|
||||||
goto error3;
|
goto error3;
|
||||||
@ -77,13 +71,12 @@ _openchild (char *command, FILE ** fto, FILE ** ffrom)
|
|||||||
dup (pdto[0]);
|
dup (pdto[0]);
|
||||||
close (1);
|
close (1);
|
||||||
dup (pdfrom[1]);
|
dup (pdfrom[1]);
|
||||||
|
fflush (stderr);
|
||||||
for (i = _rpc_dtablesize () - 1; i >= 3; i--)
|
for (i = _rpc_dtablesize () - 1; i >= 3; i--)
|
||||||
close (i);
|
close (i);
|
||||||
com = malloc (strlen (command) + 6);
|
fflush (stderr);
|
||||||
if (com == NULL)
|
execlp (command, command, 0);
|
||||||
_exit (~0);
|
perror ("exec");
|
||||||
sprintf (com, "exec %s", command);
|
|
||||||
execl (SHELL, basename (SHELL), "-c", com, NULL);
|
|
||||||
_exit (~0);
|
_exit (~0);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -99,7 +99,7 @@ struct AUTH {
|
|||||||
struct auth_ops {
|
struct auth_ops {
|
||||||
void (*ah_nextverf) __P ((AUTH *));
|
void (*ah_nextverf) __P ((AUTH *));
|
||||||
int (*ah_marshal) __P ((AUTH *, XDR *)); /* nextverf & serialize */
|
int (*ah_marshal) __P ((AUTH *, XDR *)); /* nextverf & serialize */
|
||||||
int (*ah_validate) __P ((AUTH *, struct opaque_auth *));
|
int (*ah_validate) __P ((AUTH *, struct opaque_auth *));
|
||||||
/* validate verifier */
|
/* validate verifier */
|
||||||
int (*ah_refresh) __P ((AUTH *)); /* refresh credentials */
|
int (*ah_refresh) __P ((AUTH *)); /* refresh credentials */
|
||||||
void (*ah_destroy) __P ((AUTH *)); /* destroy this structure */
|
void (*ah_destroy) __P ((AUTH *)); /* destroy this structure */
|
||||||
@ -163,7 +163,7 @@ extern AUTH *authunix_create __P ((char *__machname, __uid_t __uid,
|
|||||||
__gid_t *__aup_gids));
|
__gid_t *__aup_gids));
|
||||||
extern AUTH *authunix_create_default __P ((void));
|
extern AUTH *authunix_create_default __P ((void));
|
||||||
extern AUTH *authnone_create __P ((void));
|
extern AUTH *authnone_create __P ((void));
|
||||||
extern AUTH *authdes_create __P ((const char *__servername, u_int __window,
|
extern AUTH *authdes_create __P ((const char *__servername, u_int __window,
|
||||||
struct sockaddr *__syncaddr,
|
struct sockaddr *__syncaddr,
|
||||||
des_block *__ckey));
|
des_block *__ckey));
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ extern AUTH *authdes_create __P ((const char *__servername, u_int __window,
|
|||||||
extern int getnetname __P ((char *));
|
extern int getnetname __P ((char *));
|
||||||
extern int host2netname __P ((char *, __const char *, __const char *));
|
extern int host2netname __P ((char *, __const char *, __const char *));
|
||||||
extern int user2netname __P ((char *, __const uid_t, __const char *));
|
extern int user2netname __P ((char *, __const uid_t, __const char *));
|
||||||
extern int netname2user __P ((__const char *, uid_t *, gid_t *, int *,
|
extern int netname2user __P ((__const char *, uid_t *, gid_t *, int *,
|
||||||
gid_t *));
|
gid_t *));
|
||||||
extern int netname2host __P ((__const char *, char *, __const int));
|
extern int netname2host __P ((__const char *, char *, __const int));
|
||||||
|
|
||||||
@ -200,11 +200,11 @@ extern int key_setsecret __P ((char *));
|
|||||||
extern int key_secretkey_is_set __P ((void));
|
extern int key_secretkey_is_set __P ((void));
|
||||||
extern int key_get_conv __P ((char *, des_block *));
|
extern int key_get_conv __P ((char *, des_block *));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XDR an opaque authentication struct.
|
||||||
|
*/
|
||||||
|
extern bool_t xdr_opaque_auth __P ((XDR *, struct opaque_auth *));
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
/* This is for compiling the glibc NIS+ code with DES auth. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
#define HAVE_SECURE_RPC 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* rpc/auth.h */
|
#endif /* rpc/auth.h */
|
||||||
|
@ -42,8 +42,6 @@ static char sccsid[] = "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
|
|
||||||
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XDR a call message
|
* XDR a call message
|
||||||
*/
|
*/
|
||||||
|
@ -21,10 +21,6 @@ ifeq ($(subdir),gmon)
|
|||||||
sysdep_routines += _mcount
|
sysdep_routines += _mcount
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),setjmp)
|
|
||||||
sysdep_routines += setjmp_aux
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(subdir),gnulib)
|
ifeq ($(subdir),gnulib)
|
||||||
sysdep_routines += $(divrem)
|
sysdep_routines += $(divrem)
|
||||||
endif
|
endif
|
||||||
@ -45,6 +41,6 @@ endif
|
|||||||
|
|
||||||
divrem := divl divq reml remq
|
divrem := divl divq reml remq
|
||||||
|
|
||||||
# For now, build everything with full IEEE math support.
|
# For now, build everything with full IEEE math support.
|
||||||
# TODO: build separate libm and libm-ieee.
|
# TODO: build separate libm and libm-ieee.
|
||||||
sysdep-CFLAGS += -mieee
|
sysdep-CFLAGS += -mieee
|
||||||
|
59
sysdeps/alpha/__longjmp.S
Normal file
59
sysdeps/alpha/__longjmp.S
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/* Copyright (C) 1992, 1994, 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 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. */
|
||||||
|
|
||||||
|
#define __ASSEMBLY__
|
||||||
|
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include <bits/setjmp.h>
|
||||||
|
|
||||||
|
|
||||||
|
ENTRY(__longjmp)
|
||||||
|
#ifdef PROF
|
||||||
|
ldgp gp, 0(pv)
|
||||||
|
.set noat
|
||||||
|
lda AT, _mcount
|
||||||
|
jsr AT, (AT), _mcount
|
||||||
|
.set at
|
||||||
|
.prologue 1
|
||||||
|
#else
|
||||||
|
.prologue 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
mov a1, v0
|
||||||
|
ldq s0, JB_S0*8(a0)
|
||||||
|
ldq s1, JB_S1*8(a0)
|
||||||
|
ldq s2, JB_S2*8(a0)
|
||||||
|
ldq s3, JB_S3*8(a0)
|
||||||
|
ldq s4, JB_S4*8(a0)
|
||||||
|
ldq s5, JB_S5*8(a0)
|
||||||
|
ldq ra, JB_PC*8(a0)
|
||||||
|
ldq fp, JB_FP*8(a0)
|
||||||
|
ldq t0, JB_SP*8(a0)
|
||||||
|
ldt $f2, JB_F2*8(a0)
|
||||||
|
ldt $f3, JB_F3*8(a0)
|
||||||
|
ldt $f4, JB_F4*8(a0)
|
||||||
|
ldt $f5, JB_F5*8(a0)
|
||||||
|
ldt $f6, JB_F6*8(a0)
|
||||||
|
ldt $f7, JB_F7*8(a0)
|
||||||
|
ldt $f8, JB_F8*8(a0)
|
||||||
|
ldt $f9, JB_F9*8(a0)
|
||||||
|
cmoveq v0, 1, v0
|
||||||
|
mov t0, sp
|
||||||
|
ret
|
||||||
|
|
||||||
|
END(__longjmp)
|
@ -1,92 +0,0 @@
|
|||||||
/* Copyright (C) 1992, 1994, 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 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. */
|
|
||||||
|
|
||||||
/* Global register vars must come before any function defn. */
|
|
||||||
|
|
||||||
register long int
|
|
||||||
r9 asm ("$9"), r10 asm ("$10"), r11 asm ("$11"), r12 asm ("$12"),
|
|
||||||
r13 asm ("$13"), r14 asm ("$14");
|
|
||||||
|
|
||||||
register long int *fp asm ("$15"), *sp asm ("$30"), *retpc asm ("$26");
|
|
||||||
|
|
||||||
#if 1 /* XXX */
|
|
||||||
register double
|
|
||||||
f2 asm ("$f2"), f3 asm ("$f3"), f4 asm ("$f4"), f5 asm ("$f5"),
|
|
||||||
f6 asm ("$f6"), f7 asm ("$f7"), f8 asm ("$f8"), f9 asm ("$f9");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <setjmp.h>
|
|
||||||
|
|
||||||
|
|
||||||
/* Jump to the position specified by ENV, causing the
|
|
||||||
setjmp call there to return VAL, or 1 if VAL is 0. */
|
|
||||||
void
|
|
||||||
__longjmp (__jmp_buf env, int val)
|
|
||||||
{
|
|
||||||
register long int retval asm ("$0");
|
|
||||||
|
|
||||||
/* Restore the integer registers. */
|
|
||||||
r9 = env[0].__9;
|
|
||||||
r10 = env[0].__10;
|
|
||||||
r11 = env[0].__11;
|
|
||||||
r12 = env[0].__12;
|
|
||||||
r13 = env[0].__13;
|
|
||||||
r14 = env[0].__14;
|
|
||||||
|
|
||||||
#if 1 /* XXX */
|
|
||||||
/* Restore the floating point registers. */
|
|
||||||
f2 = env[0].__f2;
|
|
||||||
f3 = env[0].__f3;
|
|
||||||
f4 = env[0].__f4;
|
|
||||||
f5 = env[0].__f5;
|
|
||||||
f6 = env[0].__f6;
|
|
||||||
f7 = env[0].__f7;
|
|
||||||
f8 = env[0].__f8;
|
|
||||||
f9 = env[0].__f9;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set the return PC to that of setjmp's caller. */
|
|
||||||
retpc = env[0].__pc;
|
|
||||||
|
|
||||||
/* Restore the FP and SP of setjmp's caller. */
|
|
||||||
fp = env[0].__fp;
|
|
||||||
sp = env[0].__sp;
|
|
||||||
|
|
||||||
/* Return VAL (or 1 if VAL is zero) to setjmp's caller.
|
|
||||||
|
|
||||||
We use an asm here rather than a normal C return statement
|
|
||||||
just in case the compiler wanted to do some stack frobnication
|
|
||||||
in the function epilogue. Since we have already restored
|
|
||||||
precisely the FP and SP the desired environment needs,
|
|
||||||
we must avoid the compiler doing anything with the stack. */
|
|
||||||
|
|
||||||
|
|
||||||
asm volatile
|
|
||||||
("cmoveq %1, 1, %0\n\t" /* $0 = val ?: 1; */
|
|
||||||
"ret $31, (%2), 1" /* return $0 */
|
|
||||||
: "=r" (retval)
|
|
||||||
/* The "0" constraint should force VAL into $0. */
|
|
||||||
: "0" (val), "r" (retpc));
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
/* The loop is just to avoid `volatile function does return' warnings.
|
|
||||||
The instruction will only be executed once. */
|
|
||||||
asm volatile ("");
|
|
||||||
}
|
|
||||||
}
|
|
@ -17,30 +17,57 @@
|
|||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
typedef struct
|
/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
|
||||||
{
|
We use an array of 'long int' instead, to make writing the
|
||||||
/* Integer registers:
|
assembler easier. Naturally, user code should not depend on
|
||||||
$0 is the return value;
|
either representation. */
|
||||||
$1-$8, $22-$25, $28 are call-used;
|
|
||||||
$9-$14 we save here;
|
|
||||||
$15 is the FP and we save it here;
|
|
||||||
$16-$21 are input arguments (call-used);
|
|
||||||
$26 is the return PC and we save it here;
|
|
||||||
$27 is the procedure value (i.e., the address of __setjmp);
|
|
||||||
$29 is the global pointer, which the caller will reconstruct
|
|
||||||
from the return address restored in $26;
|
|
||||||
$30 is the stack pointer and we save it here;
|
|
||||||
$31 is always zero. */
|
|
||||||
long int __9, __10, __11, __12, __13, __14;
|
|
||||||
long int *__pc, *__fp, *__sp;
|
|
||||||
|
|
||||||
#if 1 /* XXX need predefine for TARGET_FPREGS */
|
/*
|
||||||
/* Floating-point registers:
|
* Integer registers:
|
||||||
$f0 is the floating return value;
|
* $0 is the return value (va);
|
||||||
$f1, $f10-$f15, $f22-$f30 are call-used;
|
* $1-$8, $22-$25, $28 are call-used (t0-t7, t8-t11, at);
|
||||||
$f2-$f9 we save here;
|
* $9-$14 we save here (s0-s5);
|
||||||
$f16-$21 are input args (call-used);
|
* $15 is the FP and we save it here (fp or s6);
|
||||||
$f31 is always zero. */
|
* $16-$21 are input arguments (call-used) (a0-a5);
|
||||||
double __f2, __f3, __f4, __f5, __f6, __f7, __f8, __f9;
|
* $26 is the return PC and we save it here (ra);
|
||||||
#endif /* Have FP regs. */
|
* $27 is the procedure value (i.e., the address of __setjmp) (pv or t12);
|
||||||
} __jmp_buf[1];
|
* $29 is the global pointer, which the caller will reconstruct
|
||||||
|
* from the return address restored in $26 (gp);
|
||||||
|
* $30 is the stack pointer and we save it here (sp);
|
||||||
|
* $31 is always zero (zero).
|
||||||
|
*
|
||||||
|
* Floating-point registers:
|
||||||
|
* $f0 is the floating return value;
|
||||||
|
* $f1, $f10-$f15, $f22-$f30 are call-used;
|
||||||
|
* $f2-$f9 we save here;
|
||||||
|
* $f16-$21 are input args (call-used);
|
||||||
|
* $f31 is always zero.
|
||||||
|
*
|
||||||
|
* Note that even on Alpha hardware that does not have an FPU (there
|
||||||
|
* isn't such a thing currently) it is required to implement the FP
|
||||||
|
* registers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(__USE_MISC) || defined(__ASSEMBLY__)
|
||||||
|
#define JB_S0 0
|
||||||
|
#define JB_S1 1
|
||||||
|
#define JB_S2 2
|
||||||
|
#define JB_S3 3
|
||||||
|
#define JB_S4 4
|
||||||
|
#define JB_S5 5
|
||||||
|
#define JB_PC 6
|
||||||
|
#define JB_FP 7
|
||||||
|
#define JB_SP 8
|
||||||
|
#define JB_F2 9
|
||||||
|
#define JB_F3 10
|
||||||
|
#define JB_F4 11
|
||||||
|
#define JB_F5 12
|
||||||
|
#define JB_F6 13
|
||||||
|
#define JB_F7 14
|
||||||
|
#define JB_F8 15
|
||||||
|
#define JB_F9 16
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
typedef long int __jmp_buf[17];
|
||||||
|
#endif
|
||||||
|
@ -1,39 +1 @@
|
|||||||
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Alpha version.
|
/* _setjmp is in setjmp.S */
|
||||||
Copyright (C) 1994, 1996 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 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. */
|
|
||||||
|
|
||||||
/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
|
|
||||||
We cannot do it in C because it must be a tail-call, so frame-unwinding
|
|
||||||
in setjmp doesn't clobber the state restored by longjmp. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
ENTRY(_setjmp)
|
|
||||||
ldgp $29,0($27)
|
|
||||||
#ifdef PROF
|
|
||||||
.set noat
|
|
||||||
lda AT, _mcount
|
|
||||||
jsr AT, (AT), _mcount
|
|
||||||
.set at
|
|
||||||
#endif
|
|
||||||
.prologue 1
|
|
||||||
bis $31, $31, $17 /* Pass a second argument of zero. */
|
|
||||||
jmp $31, __sigsetjmp /* Call __sigsetjmp. */
|
|
||||||
END(_setjmp)
|
|
||||||
|
|
||||||
strong_alias_asm(_setjmp, __setjmp)
|
|
||||||
|
@ -1,37 +1 @@
|
|||||||
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Alpha version.
|
/* setjmp is in setjmp.S */
|
||||||
Copyright (C) 1994, 1996 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 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. */
|
|
||||||
|
|
||||||
/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
|
|
||||||
We cannot do it in C because it must be a tail-call, so frame-unwinding
|
|
||||||
in setjmp doesn't clobber the state restored by longjmp. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
ENTRY(setjmp)
|
|
||||||
ldgp $29, 0($27)
|
|
||||||
#ifdef PROF
|
|
||||||
.set noat
|
|
||||||
lda AT, _mcount
|
|
||||||
jsr AT, (AT), _mcount
|
|
||||||
.set at
|
|
||||||
#endif
|
|
||||||
.prologue 1
|
|
||||||
bis $31, 1, $17 /* Pass a second argument of one. */
|
|
||||||
jmp $31, __sigsetjmp /* Call __sigsetjmp. */
|
|
||||||
END(setjmp)
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
|
/* Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,13 +16,21 @@
|
|||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#include <sysdep.h>
|
#define __ASSEMBLY__
|
||||||
|
|
||||||
/* The function __sigsetjmp_aux saves all the registers, but it can't
|
#include <sysdep.h>
|
||||||
reliably access the stack or frame pointers, so we pass them in as
|
#include <bits/setjmp.h>
|
||||||
extra arguments. */
|
|
||||||
ENTRY (__sigsetjmp)
|
.ent __sigsetjmp
|
||||||
ldgp $29, 0($27)
|
.global __sigsetjmp
|
||||||
|
__sigsetjmp:
|
||||||
|
ldgp gp, 0(pv)
|
||||||
|
|
||||||
|
$sigsetjmp_local:
|
||||||
|
subq sp, 16, sp
|
||||||
|
.frame sp, 16, ra, 0
|
||||||
|
stq ra, 0(sp)
|
||||||
|
.mask 0x04000000, -16
|
||||||
#ifdef PROF
|
#ifdef PROF
|
||||||
.set noat
|
.set noat
|
||||||
lda AT, _mcount
|
lda AT, _mcount
|
||||||
@ -31,8 +39,48 @@ ENTRY (__sigsetjmp)
|
|||||||
#endif
|
#endif
|
||||||
.prologue 1
|
.prologue 1
|
||||||
|
|
||||||
bis $30, $30, $18 /* Pass SP as 3rd arg. */
|
stq s0, JB_S0*8(a0)
|
||||||
bis $15, $15, $19 /* Pass FP as 4th arg. */
|
stq s1, JB_S1*8(a0)
|
||||||
jmp $31, __sigsetjmp_aux /* Call __sigsetjmp_aux. */
|
stq s2, JB_S2*8(a0)
|
||||||
|
stq s3, JB_S3*8(a0)
|
||||||
|
stq s4, JB_S4*8(a0)
|
||||||
|
stq s5, JB_S5*8(a0)
|
||||||
|
stq ra, JB_PC*8(a0)
|
||||||
|
addq sp, 16, t0
|
||||||
|
stq fp, JB_FP*8(a0)
|
||||||
|
stq t0, JB_SP*8(a0)
|
||||||
|
stt $f2, JB_F2*8(a0)
|
||||||
|
stt $f3, JB_F3*8(a0)
|
||||||
|
stt $f4, JB_F4*8(a0)
|
||||||
|
stt $f5, JB_F5*8(a0)
|
||||||
|
stt $f6, JB_F6*8(a0)
|
||||||
|
stt $f7, JB_F7*8(a0)
|
||||||
|
stt $f8, JB_F8*8(a0)
|
||||||
|
stt $f9, JB_F9*8(a0)
|
||||||
|
|
||||||
END(__sigsetjmp)
|
/* Call to C to (potentially) save our signal mask. */
|
||||||
|
jsr ra, __sigjmp_save
|
||||||
|
|
||||||
|
ldq ra, 0(sp)
|
||||||
|
addq sp, 16, sp
|
||||||
|
ret
|
||||||
|
|
||||||
|
END(__sigsetjmp)
|
||||||
|
|
||||||
|
/* Put these traditional entry points in the same file so that we can
|
||||||
|
elide much of the nonsense in trying to jmp to the real function. */
|
||||||
|
|
||||||
|
ENTRY(_setjmp)
|
||||||
|
ldgp gp, 0(pv)
|
||||||
|
mov 0, a1
|
||||||
|
br $sigsetjmp_local
|
||||||
|
END(_setjmp)
|
||||||
|
|
||||||
|
ENTRY(setjmp)
|
||||||
|
ldgp gp, 0(pv)
|
||||||
|
mov 1, a1
|
||||||
|
br $sigsetjmp_local
|
||||||
|
END(setjmp)
|
||||||
|
|
||||||
|
weak_extern(_setjmp)
|
||||||
|
weak_extern(setjmp)
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
/* Copyright (C) 1992, 1994, 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 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. */
|
|
||||||
|
|
||||||
/* Global register decls must come before any function defn. */
|
|
||||||
|
|
||||||
register long int
|
|
||||||
r9 asm ("$9"), r10 asm ("$10"), r11 asm ("$11"), r12 asm ("$12"),
|
|
||||||
r13 asm ("$13"), r14 asm ("$14");
|
|
||||||
|
|
||||||
register long int *fp asm ("$15"), *sp asm ("$30"), *retpc asm ("$26");
|
|
||||||
|
|
||||||
#if 1 /* XXX */
|
|
||||||
register double
|
|
||||||
f2 asm ("$f2"), f3 asm ("$f3"), f4 asm ("$f4"), f5 asm ("$f5"),
|
|
||||||
f6 asm ("$f6"), f7 asm ("$f7"), f8 asm ("$f8"), f9 asm ("$f9");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <setjmp.h>
|
|
||||||
|
|
||||||
|
|
||||||
/* Save the current program position in ENV and return 0. */
|
|
||||||
int
|
|
||||||
__sigsetjmp_aux (sigjmp_buf env, int savemask, long int *sp, long int *fp)
|
|
||||||
{
|
|
||||||
/* Save the integer registers. */
|
|
||||||
env[0].__jmpbuf[0].__9 = r9;
|
|
||||||
env[0].__jmpbuf[0].__10 = r10;
|
|
||||||
env[0].__jmpbuf[0].__11 = r11;
|
|
||||||
env[0].__jmpbuf[0].__12 = r12;
|
|
||||||
env[0].__jmpbuf[0].__13 = r13;
|
|
||||||
env[0].__jmpbuf[0].__14 = r14;
|
|
||||||
|
|
||||||
#if 1 /* XXX */
|
|
||||||
/* Save the floating point registers. */
|
|
||||||
env[0].__jmpbuf[0].__f2 = f2;
|
|
||||||
env[0].__jmpbuf[0].__f3 = f3;
|
|
||||||
env[0].__jmpbuf[0].__f4 = f4;
|
|
||||||
env[0].__jmpbuf[0].__f5 = f5;
|
|
||||||
env[0].__jmpbuf[0].__f6 = f6;
|
|
||||||
env[0].__jmpbuf[0].__f7 = f7;
|
|
||||||
env[0].__jmpbuf[0].__f8 = f8;
|
|
||||||
env[0].__jmpbuf[0].__f9 = f9;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Save the return address of our caller, where longjmp will jump to. */
|
|
||||||
env[0].__jmpbuf[0].__pc = retpc;
|
|
||||||
|
|
||||||
/* Save the FP and SP of our caller. The __sigsetjmp entry point
|
|
||||||
simply puts these in the argument registers for us to fetch. */
|
|
||||||
env[0].__jmpbuf[0].__fp = fp;
|
|
||||||
env[0].__jmpbuf[0].__sp = sp;
|
|
||||||
|
|
||||||
/* Save the signal mask if requested. */
|
|
||||||
__sigjmp_save (env, savemask);
|
|
||||||
|
|
||||||
retpc = env[0].__jmpbuf[0].__pc; /* restore ra, ugly... */
|
|
||||||
|
|
||||||
/* Return to the original caller of __sigsetjmp. */
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -50,6 +50,8 @@ struct crypt_data
|
|||||||
int direction, initialized;
|
int direction, initialized;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern char *__crypt_r __P ((__const char *__key, __const char *__salt,
|
||||||
|
struct crypt_data *__data));
|
||||||
extern char *crypt_r __P ((__const char *__key, __const char *__salt,
|
extern char *crypt_r __P ((__const char *__key, __const char *__salt,
|
||||||
struct crypt_data *__data));
|
struct crypt_data *__data));
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,11 +18,12 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/*
|
#undef __memccpy
|
||||||
* Copy no more than N bytes of SRC to DEST, stopping when C is found.
|
#undef memccpy
|
||||||
* Return the position in DEST one byte past where C was copied,
|
|
||||||
* or NULL if C was not found in the first N bytes of SRC.
|
/* Copy no more than N bytes of SRC to DEST, stopping when C is found.
|
||||||
*/
|
Return the position in DEST one byte past where C was copied, or
|
||||||
|
NULL if C was not found in the first N bytes of SRC. */
|
||||||
void *
|
void *
|
||||||
__memccpy (dest, src, c, n)
|
__memccpy (dest, src, c, n)
|
||||||
void *dest; const void *src;
|
void *dest; const void *src;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user