about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-02-07 12:50:11 +0000
committerUlrich Drepper <drepper@redhat.com>1999-02-07 12:50:11 +0000
commite518937a3a87560561f4988dc69094324e17e723 (patch)
tree4ad7f1f538fecd3f9820b036ce088e385ec25bc8 /sysdeps
parent8d8c6efa78d0eb67138bddf96415c2b80a4c820c (diff)
downloadglibc-e518937a3a87560561f4988dc69094324e17e723.tar.gz
glibc-e518937a3a87560561f4988dc69094324e17e723.tar.xz
glibc-e518937a3a87560561f4988dc69094324e17e723.zip
Update.
1999-02-07  Ulrich Drepper  <drepper@cygnus.com>

	* Versions.def: New version GLIBC_2.1.1 for libc.
	* stdlib/Versions: Add _Exit, imaxdiv, and imaxdiv to GLIBC_2.1.1.
	* stdlib/labs.c: Moved to...
	* sysdeps/generic/labs.c: ...here.
	* stdlib/llabs.c: Moved to...
	* sysdeps/generic/llabs.c: ...here.
	* stdlib/stdlib.h: Allow definition of ldiv_t and lldiv_t in other
	header.  Declare _Exit.
	* sysdeps/generic/_exit.c: Add alias _Exit.
	* sysdeps/mach/hurd/_exit.c: Likewise.
	* sysdeps/standalone/i386/force_cpu386/_exit.c: Likewise.
	* sysdeps/standalone/i960/nindy960/_exit.c: Likewise.
	* sysdeps/standalone/m68k/m68020/mvme136/_exit.c: Likewise.
	* sysdeps/unix/_exit.c: Likewise.
	* sysdeps/wordsize-32/inttypes.h: Define imaxdiv_t and declare
	imaxdiv and imaxabs.  Declare lldiv_t if necessary.
	* sysdeps/wordsize-64/inttypes.h: Likewise.
	* sysdeps/wordsize-32/llabs.c: New file.
	* sysdeps/wordsize-32/lldiv.c: New file.
	* sysdeps/wordsize-64/labs.c: New file.
	* sysdeps/wordsize-64/ldiv.c: New file.
	* manual/arith.texi: Document imaxabs, imaxdiv_t, and imaxdiv.
	* manual/startup.texi: Document _Exit.

1999-02-07  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* nscd/cache.c: Include <arpa/inet.h> for inet_ntop.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/_exit.c3
-rw-r--r--sysdeps/generic/labs.c29
-rw-r--r--sysdeps/generic/llabs.c31
-rw-r--r--sysdeps/mach/hurd/_exit.c3
-rw-r--r--sysdeps/standalone/i386/force_cpu386/_exit.c3
-rw-r--r--sysdeps/standalone/i960/nindy960/_exit.c3
-rw-r--r--sysdeps/standalone/m68k/m68020/mvme136/_exit.c3
-rw-r--r--sysdeps/unix/_exit.S3
-rw-r--r--sysdeps/wordsize-32/inttypes.h47
-rw-r--r--sysdeps/wordsize-32/llabs.c23
-rw-r--r--sysdeps/wordsize-32/lldiv.c23
-rw-r--r--sysdeps/wordsize-64/inttypes.h46
-rw-r--r--sysdeps/wordsize-64/labs.c23
-rw-r--r--sysdeps/wordsize-64/ldiv.c23
14 files changed, 255 insertions, 8 deletions
diff --git a/sysdeps/generic/_exit.c b/sysdeps/generic/_exit.c
index 5fb4366e49..4bd6ddf4f2 100644
--- a/sysdeps/generic/_exit.c
+++ b/sysdeps/generic/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 94, 95, 96, 97, 99 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
@@ -29,6 +29,7 @@ _exit (status)
   status &= 0xff;
   abort ();
 }
+weak_alias (_exit, _Exit)
 
 stub_warning (_exit)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/labs.c b/sysdeps/generic/labs.c
new file mode 100644
index 0000000000..8c490c0312
--- /dev/null
+++ b/sysdeps/generic/labs.c
@@ -0,0 +1,29 @@
+/* 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 distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <stdlib.h>
+
+#undef	labs
+
+
+/* Return the absolute value of I.  */
+long int
+labs (long int i)
+{
+  return i < 0 ? -i : i;
+}
diff --git a/sysdeps/generic/llabs.c b/sysdeps/generic/llabs.c
new file mode 100644
index 0000000000..4d3576e1a1
--- /dev/null
+++ b/sysdeps/generic/llabs.c
@@ -0,0 +1,31 @@
+/* `long long int' absolute value.
+   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 <stdlib.h>
+
+#undef	llabs
+
+
+/* Return the absolute value of I.  */
+long long int
+llabs (i)
+     long long int i;
+{
+  return i < 0 ? -i : i;
+}
diff --git a/sysdeps/mach/hurd/_exit.c b/sysdeps/mach/hurd/_exit.c
index 2780146e60..9d207b1267 100644
--- a/sysdeps/mach/hurd/_exit.c
+++ b/sysdeps/mach/hurd/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 94, 95, 96, 97, 99 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
@@ -52,3 +52,4 @@ _exit (status)
 {
   _hurd_exit (W_EXITCODE (status, 0));
 }
+weak_alias (_exit, _Exit)
diff --git a/sysdeps/standalone/i386/force_cpu386/_exit.c b/sysdeps/standalone/i386/force_cpu386/_exit.c
index 455dc0e7b8..5f9e5e3116 100644
--- a/sysdeps/standalone/i386/force_cpu386/_exit.c
+++ b/sysdeps/standalone/i386/force_cpu386/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
      On-Line Applications Research Corporation.
@@ -36,6 +36,7 @@ _exit (status)
   /* status is ignored */
   Bsp_cleanup();
 }
+weak_alias (_exit, _Exit)
 
 #ifdef	 HAVE_GNU_LD
 
diff --git a/sysdeps/standalone/i960/nindy960/_exit.c b/sysdeps/standalone/i960/nindy960/_exit.c
index e56dcc07a4..8ca6e78e80 100644
--- a/sysdeps/standalone/i960/nindy960/_exit.c
+++ b/sysdeps/standalone/i960/nindy960/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
      On-Line Applications Research Corporation.
@@ -43,6 +43,7 @@ _exit (status)
   *  application if the user types "go".
   */
 }
+weak_alias (_exit, _Exit)
 
 
 #ifdef	 HAVE_GNU_LD
diff --git a/sysdeps/standalone/m68k/m68020/mvme136/_exit.c b/sysdeps/standalone/m68k/m68020/mvme136/_exit.c
index d45e52d41d..ecd93db129 100644
--- a/sysdeps/standalone/m68k/m68020/mvme136/_exit.c
+++ b/sysdeps/standalone/m68k/m68020/mvme136/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
      On-Line Applications Research Corporation.
@@ -47,3 +47,4 @@ _exit (status)
   M68Kvec[ 45 ] = __exit_trap;   /* install exit_trap handler */
   asm volatile( "trap #13" );  /* insures SUPV mode */
 }
+weak_alias (_exit, _Exit)
diff --git a/sysdeps/unix/_exit.S b/sysdeps/unix/_exit.S
index dfdeebd908..da502c76a6 100644
--- a/sysdeps/unix/_exit.S
+++ b/sysdeps/unix/_exit.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1997, 1999 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
@@ -21,3 +21,4 @@
 PSEUDO (_exit, exit, 1)
 	/* Shouldn't get here.  */
 PSEUDO_END(_exit)
+weak_alias (_exit, _Exit)
diff --git a/sysdeps/wordsize-32/inttypes.h b/sysdeps/wordsize-32/inttypes.h
index 5897fdab19..e80036bd24 100644
--- a/sysdeps/wordsize-32/inttypes.h
+++ b/sysdeps/wordsize-32/inttypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 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
@@ -251,6 +251,28 @@
 
 __BEGIN_DECLS
 
+/* We have to define the `uintmax_t' type using `lldiv_t'.  */
+#ifndef _STDLIB_H
+/* Returned by `lldiv'.  */
+__extension__ typedef struct
+  {
+    long long int quot;		/* Quotient.  */
+    long long int rem;		/* Remainder.  */
+  } lldiv_t;
+# define __lldiv_t_defined	1
+#endif
+
+/* Returned by `imaxdiv'.  */
+typedef lldiv_t imaxdiv_t;
+
+
+/* Compute absolute value of N.  */
+extern intmax_t imaxabs __P ((intmax_t __n)) __attribute__ ((__const__));
+
+/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
+extern imaxdiv_t imaxdiv __P ((intmax_t __numer, intmax_t __denom))
+     __attribute__ ((__const__));
+
 /* Like `strtol' but convert to `intmax_t'.  */
 extern intmax_t strtoimax __P ((__const char *__restrict __nptr,
 				char **__restrict __endptr, int __base));
@@ -269,6 +291,29 @@ extern uintmax_t wcstoumax __P ((__const wchar_t * __restrict __nptr,
 
 #ifdef __USE_EXTERN_INLINES
 
+/* We ant to use the appropriate functions from <stdlib.h> but cannot
+   assume the header is read already.  */
+__extension__ extern long long int llabs __P ((long long int __x))
+     __attribute__ ((__const__));
+__extension__ extern lldiv_t lldiv __P ((long long int __numer,
+					 long long int __denom))
+     __attribute__ ((__const__));
+
+
+/* Compute absolute value of N.  */
+extern __inline intmax_t
+imaxabs (intmax_t __n) __THROW
+{
+  return llabs (__n);
+}
+
+/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
+extern __inline imaxdiv_t
+imaxdiv (intmax_t __numer, intmax_t __denom) __THROW
+{
+  return lldiv (__numer, __denom);
+}
+
 /* Like `strtol' but convert to `intmax_t'.  */
 # ifndef __strtoll_internal_defined
 __extension__
diff --git a/sysdeps/wordsize-32/llabs.c b/sysdeps/wordsize-32/llabs.c
new file mode 100644
index 0000000000..f335fb0ec3
--- /dev/null
+++ b/sysdeps/wordsize-32/llabs.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1999 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 <inttypes.h>
+
+#include <sysdeps/generic/llabs.c>
+
+weak_alias (llabs, imaxabs)
diff --git a/sysdeps/wordsize-32/lldiv.c b/sysdeps/wordsize-32/lldiv.c
new file mode 100644
index 0000000000..f666ad8331
--- /dev/null
+++ b/sysdeps/wordsize-32/lldiv.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1999 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 <inttypes.h>
+
+#include <sysdeps/generic/lldiv.c>
+
+weak_alias (lldiv, imaxdiv)
diff --git a/sysdeps/wordsize-64/inttypes.h b/sysdeps/wordsize-64/inttypes.h
index f37221b640..a3763c7880 100644
--- a/sysdeps/wordsize-64/inttypes.h
+++ b/sysdeps/wordsize-64/inttypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 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
@@ -251,6 +251,28 @@
 
 __BEGIN_DECLS
 
+/* We have to define the `uintmax_t' type using `ldiv_t'.  */
+#ifndef _STDLIB_H
+/* Returned by `ldiv'.  */
+typedef struct
+  {
+    long int quot;		/* Quotient.  */
+    long int rem;		/* Remainder.  */
+  } ldiv_t;
+# define __ldiv_t_defined	1
+#endif
+
+/* Returned by `imaxdiv'.  */
+typedef ldiv_t imaxdiv_t;
+
+
+/* Compute absolute value of N.  */
+extern intmax_t imaxabs __P ((intmax_t __n)) __attribute__ ((__const__));
+
+/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
+extern imaxdiv_t imaxdiv __P ((intmax_t __numer, intmax_t __denom))
+     __attribute__ ((__const__));
+
 /* Like `strtol' but convert to `intmax_t'.  */
 extern intmax_t strtoimax __P ((__const char *__restrict __nptr,
 				char **__restrict __endptr, int __base));
@@ -269,6 +291,28 @@ extern uintmax_t wcstoumax __P ((__const wchar_t * __restrict __nptr,
 
 #ifdef __USE_EXTERN_INLINES
 
+/* We ant to use the appropriate functions from <stdlib.h> but cannot
+   assume the header is read already.  */
+__extension__ extern long int labs __P ((long int __x))
+     __attribute__ ((__const__));
+__extension__ extern ldiv_t ldiv __P ((long int __numer, long int __denom))
+     __attribute__ ((__const__));
+
+
+/* Compute absolute value of N.  */
+extern __inline intmax_t
+imaxabs (intmax_t __n) __THROW
+{
+  return labs (__n);
+}
+
+/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
+extern __inline imaxdiv_t
+imaxdiv (intmax_t __numer, intmax_t __denom) __THROW
+{
+  return ldiv (__numer, __denom);
+}
+
 /* Like `strtol' but convert to `intmax_t'.  */
 # ifndef __strtol_internal_defined
 extern long int __strtol_internal __P ((__const char *__restrict __nptr,
diff --git a/sysdeps/wordsize-64/labs.c b/sysdeps/wordsize-64/labs.c
new file mode 100644
index 0000000000..6ff9835a38
--- /dev/null
+++ b/sysdeps/wordsize-64/labs.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1999 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 <inttypes.h>
+
+#include <sysdeps/generic/labs.c>
+
+weak_alias (labs, imaxabs)
diff --git a/sysdeps/wordsize-64/ldiv.c b/sysdeps/wordsize-64/ldiv.c
new file mode 100644
index 0000000000..f42f327850
--- /dev/null
+++ b/sysdeps/wordsize-64/ldiv.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1999 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 <inttypes.h>
+
+#include <sysdeps/generic/ldiv.c>
+
+weak_alias (ldiv, imaxdiv)