summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/dl-machine.h5
-rw-r--r--sysdeps/generic/dl-cache.c2
-rw-r--r--sysdeps/generic/enbl-secure.c31
-rw-r--r--sysdeps/generic/memcopy.h26
-rw-r--r--sysdeps/generic/stpncpy.c53
-rw-r--r--sysdeps/generic/strcasecmp.c22
-rw-r--r--sysdeps/generic/strcat.c37
-rw-r--r--sysdeps/generic/strchr.c15
-rw-r--r--sysdeps/generic/strcpy.c36
-rw-r--r--sysdeps/generic/strcspn.c21
-rw-r--r--sysdeps/generic/strlen.c40
-rw-r--r--sysdeps/generic/strncase.c53
-rw-r--r--sysdeps/generic/strncat.c41
-rw-r--r--sysdeps/generic/strncpy.c35
-rw-r--r--sysdeps/generic/strpbrk.c9
-rw-r--r--sysdeps/generic/strsep.c34
-rw-r--r--sysdeps/generic/strspn.c39
-rw-r--r--sysdeps/generic/strstr.c12
-rw-r--r--sysdeps/generic/strtok.c34
-rw-r--r--sysdeps/generic/strtok_r.c34
-rw-r--r--sysdeps/i386/dl-machine.h14
-rw-r--r--sysdeps/m68k/dl-machine.h24
-rw-r--r--sysdeps/mach/sleep.c32
-rw-r--r--sysdeps/mips/dl-machine.h8
-rw-r--r--sysdeps/posix/sleep.c32
-rw-r--r--sysdeps/stub/sleep.c31
-rw-r--r--sysdeps/unix/sysv/linux/sleep.c5
27 files changed, 399 insertions, 326 deletions
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h
index b735e15ae3..316f717e01 100644
--- a/sysdeps/alpha/dl-machine.h
+++ b/sysdeps/alpha/dl-machine.h
@@ -324,7 +324,8 @@ elf_alpha_fix_plt(struct link_map *l,
static inline void
elf_machine_rela (struct link_map *map,
const Elf64_Rela *reloc,
- const Elf64_Sym *sym)
+ const Elf64_Sym *sym,
+ const hash_name_pair *version)
{
Elf64_Addr * const reloc_addr = (void *)(map->l_addr + reloc->r_offset);
unsigned long const r_info = ELF64_R_TYPE (reloc->r_info);
@@ -355,7 +356,7 @@ elf_machine_rela (struct link_map *map,
{
Elf64_Addr loadbase, sym_value;
- loadbase = RESOLVE (&sym,
+ loadbase = RESOLVE (&sym, version,
r_info == R_ALPHA_JMP_SLOT ? DL_LOOKUP_NOPLT : 0);
sym_value = sym ? loadbase + sym->st_value : 0;
diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c
index 09cb857506..7b471787f4 100644
--- a/sysdeps/generic/dl-cache.c
+++ b/sysdeps/generic/dl-cache.c
@@ -28,7 +28,7 @@ extern void *_dl_sysdep_read_whole_file (const char *filename,
int mmap_prot);
#ifndef LD_SO_CACHE
-#define LD_SO_CACHE "/etc/ld.so.cache"
+# define LD_SO_CACHE "/etc/ld.so.cache"
#endif
#define CACHEMAGIC "ld.so-1.7.0"
diff --git a/sysdeps/generic/enbl-secure.c b/sysdeps/generic/enbl-secure.c
index b7530a8437..b4c8e00017 100644
--- a/sysdeps/generic/enbl-secure.c
+++ b/sysdeps/generic/enbl-secure.c
@@ -1,21 +1,21 @@
/* Define and initialize the `__libc_enable_secure' flag. Generic version.
-Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* This file is used in the static libc. For the shared library,
dl-sysdep.c defines and initializes __libc_enable_secure. */
@@ -26,7 +26,8 @@ Cambridge, MA 02139, USA. */
/* Safest assumption, if somehow the initializer isn't run. */
int __libc_enable_secure = 1;
-static void __attribute__ ((unused, constructor))
+static void
+__attribute__ ((unused, constructor))
init_secure (void)
{
__libc_enable_secure = (__geteuid () != __getuid () ||
diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h
index 262b8aae4c..bc0e8533e2 100644
--- a/sysdeps/generic/memcopy.h
+++ b/sysdeps/generic/memcopy.h
@@ -1,21 +1,21 @@
/* memcopy.h -- definitions for memory copy functions. Generic C version.
- Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
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 free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* The strategy of the memory functions is:
diff --git a/sysdeps/generic/stpncpy.c b/sysdeps/generic/stpncpy.c
index c821e95419..8303f6e5fc 100644
--- a/sysdeps/generic/stpncpy.c
+++ b/sysdeps/generic/stpncpy.c
@@ -1,34 +1,46 @@
-/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* This is almost copied from strncpy.c, written by Torbjorn Granlund. */
-#include <ansidecl.h>
-#include <string.h>
-#include <memcopy.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#ifdef _LIBC
+# include <string.h>
+#else
+# include <sys/types.h>
+#endif
+
+#ifndef weak_alias
+# define __stpncpy stpncpy
+#endif
/* Copy no more than N characters of SRC to DEST, returning the address of
the terminating '\0' in DEST, if any, or else DEST + N. */
char *
-DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n)
+__stpncpy (dest, src, n)
+ char *dest;
+ const char *src;
+ size_t n;
{
- reg_char c;
+ char c;
char *s = dest;
if (n >= 4)
@@ -82,5 +94,6 @@ DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n)
return dest - 1;
}
-
+#ifdef weak_alias
weak_alias (__stpncpy, stpncpy)
+#endif
diff --git a/sysdeps/generic/strcasecmp.c b/sysdeps/generic/strcasecmp.c
index 7fe63d3340..cca51f3dc9 100644
--- a/sysdeps/generic/strcasecmp.c
+++ b/sysdeps/generic/strcasecmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,17 +16,27 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <ctype.h>
+#include <string.h>
+
+#ifndef weak_alias
+# define __strcasecmp strcasecmp
+#endif
/* Compare S1 and S2, ignoring case, returning less than, equal to or
greater than zero if S1 is lexicographically less than,
equal to or greater than S2. */
int
-__strcasecmp (const char *s1, const char *s2)
+__strcasecmp (s1, s2)
+ const char *s1;
+ const char *s2;
{
- register const unsigned char *p1 = (const unsigned char *) s1;
- register const unsigned char *p2 = (const unsigned char *) s2;
+ const unsigned char *p1 = (const unsigned char *) s1;
+ const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
if (p1 == p2)
@@ -43,4 +53,6 @@ __strcasecmp (const char *s1, const char *s2)
return c1 - c2;
}
+#ifdef weak_alias
weak_alias (__strcasecmp, strcasecmp)
+#endif
diff --git a/sysdeps/generic/strcat.c b/sysdeps/generic/strcat.c
index b4b5536971..05abd01eff 100644
--- a/sysdeps/generic/strcat.c
+++ b/sysdeps/generic/strcat.c
@@ -1,31 +1,32 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <string.h>
#include <memcopy.h>
/* Append SRC on the end of DEST. */
char *
-DEFUN(strcat, (dest, src), char *dest AND CONST char *src)
+strcat (dest, src)
+ char *dest;
+ const char *src;
{
- register char *s1 = dest;
- register CONST char *s2 = src;
+ char *s1 = dest;
+ const char *s2 = src;
reg_char c;
/* Find the end of the string. */
diff --git a/sysdeps/generic/strchr.c b/sysdeps/generic/strchr.c
index 11c7bdff64..d9e58a85a7 100644
--- a/sysdeps/generic/strchr.c
+++ b/sysdeps/generic/strchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se) and
bug fix and commentary by Jim Blandy (jimb@ai.mit.edu);
@@ -20,17 +20,18 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <string.h>
/* Find the first occurrence of C in S. */
char *
-DEFUN(strchr, (s, c), CONST char *s AND int c)
+strchr (s, c)
+ const char *s;
+ int c;
{
- CONST unsigned char *char_ptr;
- CONST unsigned long int *longword_ptr;
+ const unsigned char *char_ptr;
+ const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask;
c = (unsigned char) c;
@@ -41,7 +42,7 @@ DEFUN(strchr, (s, c), CONST char *s AND int c)
& (sizeof (longword) - 1)) != 0;
++char_ptr)
if (*char_ptr == c)
- return (PTR) char_ptr;
+ return (void *) char_ptr;
else if (*char_ptr == '\0')
return NULL;
@@ -134,7 +135,7 @@ DEFUN(strchr, (s, c), CONST char *s AND int c)
/* Which of the bytes was C or zero?
If none of them were, it was a misfire; continue the search. */
- CONST unsigned char *cp = (CONST unsigned char *) (longword_ptr - 1);
+ const unsigned char *cp = (const unsigned char *) (longword_ptr - 1);
if (*cp == c)
return (char *) cp;
diff --git a/sysdeps/generic/strcpy.c b/sysdeps/generic/strcpy.c
index 0a7c2a88f7..fc6beb27fd 100644
--- a/sysdeps/generic/strcpy.c
+++ b/sysdeps/generic/strcpy.c
@@ -1,33 +1,34 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <stddef.h>
#include <string.h>
#include <memcopy.h>
/* Copy SRC to DEST. */
char *
-DEFUN(strcpy, (dest, src), char *dest AND CONST char *src)
+strcpy (dest, src)
+ char *dest;
+ const char *src;
{
reg_char c;
char *s = (char *) src;
- CONST ptrdiff_t off = dest - src - 1;
+ const ptrdiff_t off = dest - src - 1;
do
{
@@ -38,4 +39,3 @@ DEFUN(strcpy, (dest, src), char *dest AND CONST char *src)
return dest;
}
-
diff --git a/sysdeps/generic/strcspn.c b/sysdeps/generic/strcspn.c
index 0cacfffd31..d7d59b250b 100644
--- a/sysdeps/generic/strcspn.c
+++ b/sysdeps/generic/strcspn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,16 +16,27 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <string.h>
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined _LIBC || HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef strchr
+# define strchr index
+# endif
+#endif
/* Return the length of the maximum initial segment of S
which contains no characters from REJECT. */
size_t
strcspn (s, reject)
- register const char *s;
- register const char *reject;
+ const char *s;
+ const char *reject;
{
- register size_t count = 0;
+ size_t count = 0;
while (*s != '\0')
if (strchr (reject, *s++) == NULL)
diff --git a/sysdeps/generic/strlen.c b/sysdeps/generic/strlen.c
index 5e8d360c9a..37dc9ed20c 100644
--- a/sysdeps/generic/strlen.c
+++ b/sysdeps/generic/strlen.c
@@ -1,24 +1,23 @@
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc.
Written by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se);
commentary by Jim Blandy (jimb@ai.mit.edu).
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <string.h>
@@ -26,10 +25,11 @@ Cambridge, MA 02139, USA. */
the null terminator quickly by testing four bytes at a time. */
size_t
-DEFUN(strlen, (str), CONST char *str)
+strlen (str)
+ const char *str;
{
- CONST char *char_ptr;
- CONST unsigned long int *longword_ptr;
+ const char *char_ptr;
+ const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, himagic, lomagic;
/* Handle the first few characters by reading one character at a time.
@@ -48,9 +48,9 @@ DEFUN(strlen, (str), CONST char *str)
/* Bits 31, 24, 16, and 8 of this number are zero. Call these bits
the "holes." Note that there is a hole just to the left of
each byte, with an extra at the end:
-
+
bits: 01111110 11111110 11111110 11111111
- bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
+ bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
The 1-bits make sure that carries propagate to the next 0-bit.
The 0-bits provide holes for carries to fall into. */
@@ -123,7 +123,7 @@ DEFUN(strlen, (str), CONST char *str)
/* Which of the bytes was the zero? If none of them were, it was
a misfire; continue the search. */
- CONST char *cp = (CONST char *) (longword_ptr - 1);
+ const char *cp = (const char *) (longword_ptr - 1);
if (cp[0] == 0)
return cp - str;
diff --git a/sysdeps/generic/strncase.c b/sysdeps/generic/strncase.c
index ffc50ff50f..b0b1044777 100644
--- a/sysdeps/generic/strncase.c
+++ b/sysdeps/generic/strncase.c
@@ -1,35 +1,42 @@
-/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Compare at most N characters of two strings without taking care for
+ the case.
+ Copyright (C) 1992, 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. */
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
#include <string.h>
#include <ctype.h>
+#ifndef weak_alias
+# define __strncasecmp strncasecmp
+#endif
+
/* Compare no more than N characters of S1 and S2,
ignoring case, returning less than, equal to or
greater than zero if S1 is lexicographically less
than, equal to or greater than S2. */
int
-DEFUN(__strncasecmp, (s1, s2, n),
- CONST char *s1 AND CONST char *s2 AND size_t n)
+__strncasecmp (s1, s2, n)
+ const char *s1;
+ const char *s2;
+ size_t n;
{
- register CONST unsigned char *p1 = (CONST unsigned char *) s1;
- register CONST unsigned char *p2 = (CONST unsigned char *) s2;
+ const unsigned char *p1 = (const unsigned char *) s1;
+ const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
if (p1 == p2 || n == 0)
@@ -45,4 +52,6 @@ DEFUN(__strncasecmp, (s1, s2, n),
return c1 - c2;
}
+#ifdef weak_alias
weak_alias (__strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/generic/strncat.c b/sysdeps/generic/strncat.c
index 09463b36b8..1233f8b54b 100644
--- a/sysdeps/generic/strncat.c
+++ b/sysdeps/generic/strncat.c
@@ -1,27 +1,34 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <string.h>
-#include <memcopy.h>
+
+#ifdef _LIBC
+# include <memcopy.h>
+#else
+typedef char reg_char;
+#endif
char *
-DEFUN(strncat, (s1, s2, n), char *s1 AND CONST char *s2 AND size_t n)
+strncat (s1, s2, n)
+ char *s1;
+ const char *s2;
+ size_t n;
{
reg_char c;
char *s = s1;
diff --git a/sysdeps/generic/strncpy.c b/sysdeps/generic/strncpy.c
index 460e0baca4..06f5cec2ed 100644
--- a/sysdeps/generic/strncpy.c
+++ b/sysdeps/generic/strncpy.c
@@ -1,27 +1,30 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <string.h>
#include <memcopy.h>
+
char *
-DEFUN(strncpy, (s1, s2, n), char *s1 AND CONST char *s2 AND size_t n)
+strncpy (s1, s2, n)
+ char *s1;
+ const char *s2;
+ size_t n;
{
reg_char c;
char *s = s1;
diff --git a/sysdeps/generic/strpbrk.c b/sysdeps/generic/strpbrk.c
index 75b2ed1440..3b533e1b87 100644
--- a/sysdeps/generic/strpbrk.c
+++ b/sysdeps/generic/strpbrk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,13 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#if defined _LIBC || defined HAVE_CONFIG_H
+# include <string.h>
+#endif
/* Find the first occurrence in S of any character in ACCEPT. */
char *
diff --git a/sysdeps/generic/strsep.c b/sysdeps/generic/strsep.c
index 15c5891044..d17e53a772 100644
--- a/sysdeps/generic/strsep.c
+++ b/sysdeps/generic/strsep.c
@@ -1,20 +1,20 @@
-/* Copyright (C) 1992, 1993, 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. */
+/* Copyright (C) 1992, 1993, 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. */
#include <string.h>
diff --git a/sysdeps/generic/strspn.c b/sysdeps/generic/strspn.c
index 89b45ad300..9d2fe63848 100644
--- a/sysdeps/generic/strspn.c
+++ b/sysdeps/generic/strspn.c
@@ -1,33 +1,34 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <string.h>
/* Return the length of the maximum initial segment
of S which contains only characters in ACCEPT. */
size_t
-DEFUN(strspn, (s, accept), CONST char *s AND CONST char *accept)
+strspn (s, accept)
+ const char *s;
+ const char *accept;
{
- register CONST char *p;
- register CONST char *a;
- register size_t count = 0;
+ const char *p;
+ const char *a;
+ size_t count = 0;
for (p = s; *p != '\0'; ++p)
{
diff --git a/sysdeps/generic/strstr.c b/sysdeps/generic/strstr.c
index d8d0b84813..85774d3491 100644
--- a/sysdeps/generic/strstr.c
+++ b/sysdeps/generic/strstr.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
+/* Return the offset of one string within another.
+ Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,8 +26,13 @@
*
* Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
-#include <string.h>
-#include <sys/types.h>
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined _LIBC || defined HAVE_STRING_H
+# include <string.h>
+#endif
typedef unsigned chartype;
diff --git a/sysdeps/generic/strtok.c b/sysdeps/generic/strtok.c
index 1e96fec01f..5eb0ee6f07 100644
--- a/sysdeps/generic/strtok.c
+++ b/sysdeps/generic/strtok.c
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 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. */
+/* 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
+ 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>
diff --git a/sysdeps/generic/strtok_r.c b/sysdeps/generic/strtok_r.c
index fb68ad8c98..3b7d202a6c 100644
--- a/sysdeps/generic/strtok_r.c
+++ b/sysdeps/generic/strtok_r.c
@@ -1,21 +1,21 @@
/* Reentrant string tokenizer. Generic version.
-Copyright (C) 1991, 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. */
+ 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
+ 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>
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 9af800cd48..570e0d9066 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -203,8 +203,8 @@ _dl_start_user:\n\
MAP is the object containing the reloc. */
static inline void
-elf_machine_rel (struct link_map *map,
- const Elf32_Rel *reloc, const Elf32_Sym *sym)
+elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+ const Elf32_Sym *sym, const hash_name_pair *version)
{
Elf32_Addr *const reloc_addr = (void *) (map->l_addr + reloc->r_offset);
Elf32_Addr loadbase;
@@ -212,15 +212,15 @@ elf_machine_rel (struct link_map *map,
switch (ELF32_R_TYPE (reloc->r_info))
{
case R_386_COPY:
- loadbase = RESOLVE (&sym, DL_LOOKUP_NOEXEC);
+ loadbase = RESOLVE (&sym, version, DL_LOOKUP_NOEXEC);
memcpy (reloc_addr, (void *) (loadbase + sym->st_value), sym->st_size);
break;
case R_386_GLOB_DAT:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*reloc_addr = sym ? (loadbase + sym->st_value) : 0;
break;
case R_386_JMP_SLOT:
- loadbase = RESOLVE (&sym, DL_LOOKUP_NOPLT);
+ loadbase = RESOLVE (&sym, version, DL_LOOKUP_NOPLT);
*reloc_addr = sym ? (loadbase + sym->st_value) : 0;
break;
case R_386_32:
@@ -241,7 +241,7 @@ elf_machine_rel (struct link_map *map,
built-in definitions used while loading those libraries. */
undo = map->l_addr + sym->st_value;
#endif
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*reloc_addr += (sym ? (loadbase + sym->st_value) : 0) - undo;
break;
}
@@ -252,7 +252,7 @@ elf_machine_rel (struct link_map *map,
*reloc_addr += map->l_addr;
break;
case R_386_PC32:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*reloc_addr += ((sym ? (loadbase + sym->st_value) : 0) -
(Elf32_Addr) reloc_addr);
break;
diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h
index a4b1edcdd9..95a8342574 100644
--- a/sysdeps/m68k/dl-machine.h
+++ b/sysdeps/m68k/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -199,8 +199,8 @@ _dl_start_user:
MAP is the object containing the reloc. */
static inline void
-elf_machine_rela (struct link_map *map,
- const Elf32_Rela *reloc, const Elf32_Sym *sym)
+elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
+ const Elf32_Sym *sym, const hash_name_pair *version)
{
Elf32_Addr *const reloc_addr = (void *) (map->l_addr + reloc->r_offset);
Elf32_Addr loadbase;
@@ -208,29 +208,29 @@ elf_machine_rela (struct link_map *map,
switch (ELF32_R_TYPE (reloc->r_info))
{
case R_68K_COPY:
- loadbase = RESOLVE (&sym, DL_LOOKUP_NOEXEC);
+ loadbase = RESOLVE (&sym, version, DL_LOOKUP_NOEXEC);
memcpy (reloc_addr, (void *) (loadbase + sym->st_value), sym->st_size);
break;
case R_68K_GLOB_DAT:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*reloc_addr = sym ? (loadbase + sym->st_value) : 0;
break;
case R_68K_JMP_SLOT:
- loadbase = RESOLVE (&sym, DL_LOOKUP_NOPLT);
+ loadbase = RESOLVE (&sym, version, DL_LOOKUP_NOPLT);
*reloc_addr = sym ? (loadbase + sym->st_value) : 0;
break;
case R_68K_8:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*(char *) reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend);
break;
case R_68K_16:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*(short *) reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend);
break;
case R_68K_32:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend);
break;
@@ -238,17 +238,17 @@ elf_machine_rela (struct link_map *map,
*reloc_addr = map->l_addr + reloc->r_addend;
break;
case R_68K_PC8:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*(char *) reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend - (Elf32_Addr) reloc_addr);
break;
case R_68K_PC16:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*(short *) reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend - (Elf32_Addr) reloc_addr);
break;
case R_68K_PC32:
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend - (Elf32_Addr) reloc_addr);
break;
diff --git a/sysdeps/mach/sleep.c b/sysdeps/mach/sleep.c
index 0e613d3eec..7d04412968 100644
--- a/sysdeps/mach/sleep.c
+++ b/sysdeps/mach/sleep.c
@@ -1,22 +1,21 @@
-/* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1992, 1993, 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 free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <signal.h>
#include <time.h>
#include <unistd.h>
@@ -28,7 +27,7 @@ Cambridge, MA 02139, USA. */
There is no return value to indicate error, but if `sleep' returns
SECONDS, it probably didn't work. */
unsigned int
-DEFUN(sleep, (seconds), unsigned int seconds)
+__sleep (unsigned int seconds)
{
time_t before, after;
mach_port_t recv;
@@ -43,3 +42,4 @@ DEFUN(sleep, (seconds), unsigned int seconds)
return seconds - (after - before);
}
+weak_alias (__sleep, sleep)
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index 9e80426ee3..a4a02bfd97 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. MIPS version.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
@@ -422,8 +422,8 @@ _dl_start_user:\n\
MAP is the object containing the reloc. */
static inline void
-elf_machine_rel (struct link_map *map,
- const ElfW(Rel) *reloc, const ElfW(Sym) *sym)
+elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
+ const ElfW(Sym) *sym, const hash_name_pair *version)
{
ElfW(Addr) *const reloc_addr = (void *) (map->l_addr + reloc->r_offset);
ElfW(Addr) loadbase, undo;
@@ -454,7 +454,7 @@ elf_machine_rel (struct link_map *map,
else
#endif
undo = 0;
- loadbase = RESOLVE (&sym, 0);
+ loadbase = RESOLVE (&sym, version, 0);
*reloc_addr += (sym ? (loadbase + sym->st_value) : 0) - undo;
}
break;
diff --git a/sysdeps/posix/sleep.c b/sysdeps/posix/sleep.c
index fd63a4bf69..e6d8de45ad 100644
--- a/sysdeps/posix/sleep.c
+++ b/sysdeps/posix/sleep.c
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <signal.h>
#include <time.h>
@@ -39,8 +39,7 @@ sleep_handler (sig)
signal afterwards is undefined. There is no return value to indicate
error, but if `sleep' returns SECONDS, it probably didn't work. */
unsigned int
-sleep (seconds)
- unsigned int seconds;
+__sleep (unsigned int seconds)
{
unsigned int remaining, slept;
time_t before, after;
@@ -105,3 +104,4 @@ sleep (seconds)
return slept > seconds ? 0 : seconds - slept;
}
+weak_alias (__sleep, sleep)
diff --git a/sysdeps/stub/sleep.c b/sysdeps/stub/sleep.c
index 9ba448f586..fdc8b28887 100644
--- a/sysdeps/stub/sleep.c
+++ b/sysdeps/stub/sleep.c
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <signal.h>
#include <time.h>
@@ -29,11 +29,12 @@ Cambridge, MA 02139, USA. */
signal afterwards is undefined. There is no return value to indicate
error, but if `sleep' returns SECONDS, it probably didn't work. */
unsigned int
-sleep (seconds)
+__sleep (seconds)
unsigned int seconds;
{
__set_errno (ENOSYS);
return seconds;
}
+weak_alias (__sleep, sleep)
stub_warning (sleep)
diff --git a/sysdeps/unix/sysv/linux/sleep.c b/sysdeps/unix/sysv/linux/sleep.c
index 626c47ff7c..f67403f694 100644
--- a/sysdeps/unix/sysv/linux/sleep.c
+++ b/sysdeps/unix/sysv/linux/sleep.c
@@ -1,5 +1,5 @@
/* Implementation of the POSIX sleep function using nanosleep.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -22,7 +22,7 @@
#include <unistd.h>
unsigned int
-sleep (unsigned int seconds)
+__sleep (unsigned int seconds)
{
struct timespec ts = { tv_sec: (long int) seconds, tv_nsec: 0 };
unsigned int result;
@@ -35,3 +35,4 @@ sleep (unsigned int seconds)
return result;
}
+weak_alias (__sleep, sleep)