diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-09-11 12:09:10 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-09-11 12:09:10 +0000 |
commit | 9a0a462ceb4ab96c909b182f3052de2ef13fbe3a (patch) | |
tree | 59456497b6acefe69aab04fc28c38ea38852ccc7 /sysdeps/generic | |
parent | 26b4d7667169f8db26fd8194b3c498ec58e50f90 (diff) | |
download | glibc-9a0a462ceb4ab96c909b182f3052de2ef13fbe3a.tar.gz glibc-9a0a462ceb4ab96c909b182f3052de2ef13fbe3a.tar.xz glibc-9a0a462ceb4ab96c909b182f3052de2ef13fbe3a.zip |
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.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/crypt.h | 2 | ||||
-rw-r--r-- | sysdeps/generic/memccpy.c | 11 | ||||
-rw-r--r-- | sysdeps/generic/memchr.c | 5 | ||||
-rw-r--r-- | sysdeps/generic/memcmp.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/memmem.c | 1 | ||||
-rw-r--r-- | sysdeps/generic/memmove.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/mempcpy.c | 66 | ||||
-rw-r--r-- | sysdeps/generic/strcat.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strchr.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strcmp.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/strcpy.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strcspn.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strlen.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strncat.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strncmp.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/strncpy.c | 1 | ||||
-rw-r--r-- | sysdeps/generic/strpbrk.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strrchr.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/strsep.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strspn.c | 1 | ||||
-rw-r--r-- | sysdeps/generic/strstr.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strtok.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/strtok_r.c | 1 | ||||
-rw-r--r-- | sysdeps/generic/sysd-stdio.c | 33 |
24 files changed, 120 insertions, 37 deletions
diff --git a/sysdeps/generic/crypt.h b/sysdeps/generic/crypt.h index 3f8f960140..c14554c829 100644 --- a/sysdeps/generic/crypt.h +++ b/sysdeps/generic/crypt.h @@ -50,6 +50,8 @@ struct crypt_data 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, struct crypt_data *__data)); #endif diff --git a/sysdeps/generic/memccpy.c b/sysdeps/generic/memccpy.c index 6d85a791c6..44a874a954 100644 --- a/sysdeps/generic/memccpy.c +++ b/sysdeps/generic/memccpy.c @@ -18,11 +18,12 @@ #include <string.h> -/* - * 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. - */ +#undef __memccpy +#undef memccpy + +/* 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 * __memccpy (dest, src, c, n) void *dest; const void *src; diff --git a/sysdeps/generic/memchr.c b/sysdeps/generic/memchr.c index 60276e9942..c8926c7b38 100644 --- a/sysdeps/generic/memchr.c +++ b/sysdeps/generic/memchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and commentary by Jim Blandy (jimb@ai.mit.edu); @@ -47,9 +47,10 @@ #include <sys/types.h> +#undef memchr -/* Search no more than N bytes of S for C. */ +/* Search no more than N bytes of S for C. */ __ptr_t memchr (s, c, n) const __ptr_t s; diff --git a/sysdeps/generic/memcmp.c b/sysdeps/generic/memcmp.c index 9dac13fc91..8fa371192c 100644 --- a/sysdeps/generic/memcmp.c +++ b/sysdeps/generic/memcmp.c @@ -34,6 +34,8 @@ #include <string.h> #endif +#undef memcmp + #ifdef _LIBC #include <memcopy.h> diff --git a/sysdeps/generic/memmem.c b/sysdeps/generic/memmem.c index 8163709686..9e4e342237 100644 --- a/sysdeps/generic/memmem.c +++ b/sysdeps/generic/memmem.c @@ -19,6 +19,7 @@ #include <stddef.h> #include <string.h> +#undef memmem /* Return the first occurrence of NEEDLE in HAYSTACK. */ void * diff --git a/sysdeps/generic/memmove.c b/sysdeps/generic/memmove.c index f4a900973d..4115aa31c7 100644 --- a/sysdeps/generic/memmove.c +++ b/sysdeps/generic/memmove.c @@ -29,12 +29,14 @@ #define a1const #define a2 src /* Second arg is SRC. */ #define a2const const +#undef memmove #endif #if !defined(RETURN) || !defined(rettype) #define RETURN(s) return (s) /* Return DEST. */ #define rettype void * #endif + rettype memmove (a1, a2, len) a1const void *a1; diff --git a/sysdeps/generic/mempcpy.c b/sysdeps/generic/mempcpy.c new file mode 100644 index 0000000000..43873405c5 --- /dev/null +++ b/sysdeps/generic/mempcpy.c @@ -0,0 +1,66 @@ +/* Copy memory to memory until the specified number of bytes + has been copied, return pointer to following byte. + Overlap is NOT handled correctly. + Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Torbjorn Granlund (tege@sics.se). + + 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 <string.h> +#include <memcopy.h> +#include <pagecopy.h> + +#undef mempcpy + +void * +__mempcpy (dstpp, srcpp, len) + void *dstpp; + const void *srcpp; + size_t len; +{ + unsigned long int dstp = (long int) dstpp; + unsigned long int srcp = (long int) srcpp; + + /* Copy from the beginning to the end. */ + + /* If there not too few bytes to copy, use word copy. */ + if (len >= OP_T_THRES) + { + /* Copy just a few bytes to make DSTP aligned. */ + len -= (-dstp) % OPSIZ; + BYTE_COPY_FWD (dstp, srcp, (-dstp) % OPSIZ); + + /* Copy whole pages from SRCP to DSTP by virtual address manipulation, + as much as possible. */ + + PAGE_COPY_FWD_MAYBE (dstp, srcp, len, len); + + /* Copy from SRCP to DSTP taking advantage of the known alignment of + DSTP. Number of bytes remaining is put in the third argument, + i.e. in LEN. This number may vary from machine to machine. */ + + WORD_COPY_FWD (dstp, srcp, len, len); + + /* Fall out and copy the tail. */ + } + + /* There are just a few bytes to copy. Use byte memory operations. */ + BYTE_COPY_FWD (dstp, srcp, len); + + return (void *) dstp; +} +weak_alias (__mempcpy, mempcpy) diff --git a/sysdeps/generic/strcat.c b/sysdeps/generic/strcat.c index 05abd01eff..d8dbab2192 100644 --- a/sysdeps/generic/strcat.c +++ b/sysdeps/generic/strcat.c @@ -19,6 +19,8 @@ #include <string.h> #include <memcopy.h> +#undef strcat + /* Append SRC on the end of DEST. */ char * strcat (dest, src) diff --git a/sysdeps/generic/strchr.c b/sysdeps/generic/strchr.c index d9e58a85a7..3663382556 100644 --- a/sysdeps/generic/strchr.c +++ b/sysdeps/generic/strchr.c @@ -22,9 +22,9 @@ #include <string.h> +#undef strchr /* Find the first occurrence of C in S. */ - char * strchr (s, c) const char *s; diff --git a/sysdeps/generic/strcmp.c b/sysdeps/generic/strcmp.c index a8d9db1bc9..62e55f56ab 100644 --- a/sysdeps/generic/strcmp.c +++ b/sysdeps/generic/strcmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 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 @@ -19,6 +19,8 @@ #include <string.h> #include <memcopy.h> +#undef strcmp + /* Compare S1 and S2, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ diff --git a/sysdeps/generic/strcpy.c b/sysdeps/generic/strcpy.c index fc6beb27fd..cb260cf85a 100644 --- a/sysdeps/generic/strcpy.c +++ b/sysdeps/generic/strcpy.c @@ -20,6 +20,8 @@ #include <string.h> #include <memcopy.h> +#undef strcpy + /* Copy SRC to DEST. */ char * strcpy (dest, src) diff --git a/sysdeps/generic/strcspn.c b/sysdeps/generic/strcspn.c index d7d59b250b..3630a13332 100644 --- a/sysdeps/generic/strcspn.c +++ b/sysdeps/generic/strcspn.c @@ -29,6 +29,8 @@ # endif #endif +#undef strcspn + /* Return the length of the maximum initial segment of S which contains no characters from REJECT. */ size_t diff --git a/sysdeps/generic/strlen.c b/sysdeps/generic/strlen.c index 37dc9ed20c..1fb8b1c97c 100644 --- a/sysdeps/generic/strlen.c +++ b/sysdeps/generic/strlen.c @@ -20,10 +20,10 @@ #include <string.h> +#undef strlen /* Return the length of the null-terminated string STR. Scan for the null terminator quickly by testing four bytes at a time. */ - size_t strlen (str) const char *str; diff --git a/sysdeps/generic/strncat.c b/sysdeps/generic/strncat.c index 1233f8b54b..ae9f5e1be3 100644 --- a/sysdeps/generic/strncat.c +++ b/sysdeps/generic/strncat.c @@ -24,6 +24,8 @@ typedef char reg_char; #endif +#undef strncat + char * strncat (s1, s2, n) char *s1; diff --git a/sysdeps/generic/strncmp.c b/sysdeps/generic/strncmp.c index eea64389f8..6e5dabebcd 100644 --- a/sysdeps/generic/strncmp.c +++ b/sysdeps/generic/strncmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 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 @@ -19,6 +19,8 @@ #include <string.h> #include <memcopy.h> +#undef strncmp + /* Compare no more than N characters of S1 and S2, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or diff --git a/sysdeps/generic/strncpy.c b/sysdeps/generic/strncpy.c index 06f5cec2ed..24c7269b09 100644 --- a/sysdeps/generic/strncpy.c +++ b/sysdeps/generic/strncpy.c @@ -19,6 +19,7 @@ #include <string.h> #include <memcopy.h> +#undef strncpy char * strncpy (s1, s2, n) diff --git a/sysdeps/generic/strpbrk.c b/sysdeps/generic/strpbrk.c index 3b533e1b87..a49d2b145b 100644 --- a/sysdeps/generic/strpbrk.c +++ b/sysdeps/generic/strpbrk.c @@ -24,6 +24,8 @@ # include <string.h> #endif +#undef strpbrk + /* Find the first occurrence in S of any character in ACCEPT. */ char * strpbrk (s, accept) diff --git a/sysdeps/generic/strrchr.c b/sysdeps/generic/strrchr.c index db5549b922..98839ea4c4 100644 --- a/sysdeps/generic/strrchr.c +++ b/sysdeps/generic/strrchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 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 @@ -18,6 +18,8 @@ #include <string.h> +#undef strrchr + /* Find the last occurrence of C in S. */ char * strrchr (const char *s, int c) diff --git a/sysdeps/generic/strsep.c b/sysdeps/generic/strsep.c index b2c7e90c39..b5ea6ead9d 100644 --- a/sysdeps/generic/strsep.c +++ b/sysdeps/generic/strsep.c @@ -18,6 +18,8 @@ #include <string.h> +#undef strsep + char * __strsep (char **stringp, const char *delim) { diff --git a/sysdeps/generic/strspn.c b/sysdeps/generic/strspn.c index 9d2fe63848..5f64a6f756 100644 --- a/sysdeps/generic/strspn.c +++ b/sysdeps/generic/strspn.c @@ -18,6 +18,7 @@ #include <string.h> +#undef strspn /* Return the length of the maximum initial segment of S which contains only characters in ACCEPT. */ diff --git a/sysdeps/generic/strstr.c b/sysdeps/generic/strstr.c index 85774d3491..03d6c8e5fc 100644 --- a/sysdeps/generic/strstr.c +++ b/sysdeps/generic/strstr.c @@ -36,6 +36,8 @@ typedef unsigned chartype; +#undef strstr + char * strstr (phaystack, pneedle) const char *phaystack; diff --git a/sysdeps/generic/strtok.c b/sysdeps/generic/strtok.c index 5eb0ee6f07..b366653cb3 100644 --- a/sysdeps/generic/strtok.c +++ b/sysdeps/generic/strtok.c @@ -21,6 +21,8 @@ static char *olds = NULL; +#undef strtok + /* Parse S into tokens separated by characters in DELIM. If S is NULL, the last string strtok() was called with is used. For example: diff --git a/sysdeps/generic/strtok_r.c b/sysdeps/generic/strtok_r.c index 3b7d202a6c..44430dae40 100644 --- a/sysdeps/generic/strtok_r.c +++ b/sysdeps/generic/strtok_r.c @@ -19,6 +19,7 @@ #include <string.h> +#undef strtok_r /* Parse S into tokens separated by characters in DELIM. If S is NULL, the saved pointer in SAVE_PTR is used as diff --git a/sysdeps/generic/sysd-stdio.c b/sysdeps/generic/sysd-stdio.c index f5147bb3aa..9818f84c5c 100644 --- a/sysdeps/generic/sysd-stdio.c +++ b/sysdeps/generic/sysd-stdio.c @@ -28,10 +28,7 @@ /* Read N bytes into BUF from COOKIE. */ int -__stdio_read (cookie, buf, n) - void *cookie; - register char *buf; - register size_t n; +__stdio_read (void *cookie, char *buf, size_t n;) { const int fd = (int) cookie; #if defined (EINTR) && defined (EINTR_REPEAT) @@ -58,10 +55,7 @@ __stdio_read (cookie, buf, n) /* Write N bytes from BUF to COOKIE. */ int -__stdio_write (cookie, buf, n) - void *cookie; - register const char *buf; - register size_t n; +__stdio_write (void *cookie, const char *buf, size_t n) { const int fd = (int) cookie; register size_t written = 0; @@ -92,10 +86,7 @@ __stdio_write (cookie, buf, n) The new file position is stored in *POS. Returns zero if successful, nonzero if not. */ int -__stdio_seek (cookie, pos, whence) - void *cookie; - fpos_t *pos; - int whence; +__stdio_seek (void *cookie, fpos_t *pos, int whence) { off_t new; new = __lseek ((int) cookie, (off_t) *pos, whence); @@ -108,8 +99,7 @@ __stdio_seek (cookie, pos, whence) /* Close COOKIE. */ int -__stdio_close (cookie) - void *cookie; +__stdio_close (void *cookie) { return __close ((int) cookie); } @@ -118,8 +108,7 @@ __stdio_close (cookie) or -1 for errors. If COOKIE does not relate to any POSIX.1 file descriptor, this should return -1 with errno set to EOPNOTSUPP. */ int -__stdio_fileno (cookie) - void *cookie; +__stdio_fileno (void *cookie) { return (int) cookie; } @@ -127,10 +116,7 @@ __stdio_fileno (cookie) /* Open the given file with the mode given in the __io_mode argument. */ int -__stdio_open (filename, m, cookieptr) - const char *filename; - __io_mode m; - void **cookieptr; +__stdio_open (const char *filename, __io_mode m, void **cookieptr) { int fd; int mode; @@ -164,11 +150,8 @@ __stdio_open (filename, m, cookieptr) /* Open FILENAME with the mode in M. Use the same magic cookie already in *COOKIEPTR if possible, closing the old cookie with CLOSEFN. */ int -__stdio_reopen (filename, m, cookieptr, closefn) - const char *filename; - __io_mode m; - void **cookieptr; - __io_close_fn closefn; +__stdio_reopen (const char *filename, __io_mode m, void **cookieptr, + __io_close_fn closefn) { void *newcookie; |