diff options
Diffstat (limited to 'sysdeps')
43 files changed, 529 insertions, 248 deletions
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index bc93087066..cd4f86a69c 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -204,8 +204,8 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup, #nop); #else #define ELF_MACHINE_RUNTIME_TRAMPOLINE \ - TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \ - strong_alias (_dl_runtime_resolve, _dl_runtime_profile); + TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup, imb); \ + strong_alias (_dl_runtime_resolve, _dl_runtime_profile, #nop); #endif /* Initial entry point code for the dynamic linker. diff --git a/sysdeps/generic/_G_config.h b/sysdeps/generic/_G_config.h index fc102c23a4..f670d4cf04 100644 --- a/sysdeps/generic/_G_config.h +++ b/sysdeps/generic/_G_config.h @@ -48,6 +48,9 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); #define _G_HAVE_PRINTF_FP 1 #define _G_HAVE_MMAP 1 #define _G_HAVE_LONG_DOUBLE_IO 1 +#define _G_HAVE_IO_FILE_OPEN 1 + +#define _G_IO_IO_FILE_VERSION 0x20001 /* This is defined by <bits/stat.h> if `st_blksize' exists. */ #define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) @@ -60,7 +63,7 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); #define _G_VTABLE_LABEL_HAS_LENGTH 1 -#if defined (__cplusplus) || defined (__STDC__) +#if defined __cplusplus || defined __STDC__ # define _G_ARGS(ARGLIST) ARGLIST #else # define _G_ARGS(ARGLIST) () diff --git a/sysdeps/generic/bits/siginfo.h b/sysdeps/generic/bits/siginfo.h index 35d9d69892..5a223e373b 100644 --- a/sysdeps/generic/bits/siginfo.h +++ b/sysdeps/generic/bits/siginfo.h @@ -17,10 +17,21 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _SIGNAL_H +#if !defined _SIGNAL_H && !defined __need_siginfo_t # error "Never include this file directly. Use <signal.h> instead" #endif +#if (!defined __have_siginfo_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t)) +# define __have_siginfo_t 1 + +/* Type for data associated with a signal. */ +typedef union sigval + { + int sival_int; + void *sival_ptr; + } sigval_t; + typedef struct siginfo { int si_signo; /* Signal number. */ @@ -41,15 +52,15 @@ typedef struct siginfo enum { SI_ASYNCIO = -4, /* Sent by AIO completion. */ -#define SI_ASYNCIO SI_ASYNCIO +# define SI_ASYNCIO SI_ASYNCIO SI_MESGQ, /* Sent by real time mesq state change. */ -#define SI_MESGQ SI_MESGQ +# define SI_MESGQ SI_MESGQ SI_TIMER, /* Sent by timer expiration. */ -#define SI_TIMER SI_TIMER +# define SI_TIMER SI_TIMER SI_QUEUE, /* Sent by sigqueue. */ -#define SI_QUEUE SI_QUEUE +# define SI_QUEUE SI_QUEUE SI_USER /* Sent by kill, sigsend, raise. */ -#define SI_USER SI_USER +# define SI_USER SI_USER }; @@ -57,111 +68,117 @@ enum enum { ILL_ILLOPC = 1, /* Illegal opcode. */ -#define ILL_ILLOPC ILL_ILLOPC +# define ILL_ILLOPC ILL_ILLOPC ILL_ILL_OPN, /* Illegal operand. */ -#define ILL_ILLOPN ILL_ILLOPN +# define ILL_ILLOPN ILL_ILLOPN ILL_ILLADR, /* Illegal addressing mode. */ -#define ILL_ILLADR ILL_ILLADR +# define ILL_ILLADR ILL_ILLADR ILL_ILLTRP, /* Illegal trap. */ -#define ILL_ILLTRP ILL_ILLTRP +# define ILL_ILLTRP ILL_ILLTRP ILL_PRVOPC, /* Privileged opcode. */ -#define ILL_PRVOPC ILL_PRVOPC +# define ILL_PRVOPC ILL_PRVOPC ILL_PRVREG, /* Privileged register. */ -#define ILL_PRVREG ILL_PRVREG +# define ILL_PRVREG ILL_PRVREG ILL_COPROC, /* Coprocessor error. */ -#define ILL_COPROC ILL_COPROC +# define ILL_COPROC ILL_COPROC ILL_BADSTK /* Internal stack error. */ -#define ILL_BADSTK ILL_BADSTK +# define ILL_BADSTK ILL_BADSTK }; /* `si_code' values for SIGFPE signal. */ enum { FPE_INTDIV = 1, /* Integer divide by zero. */ -#define FPE_INTDIV FPE_INTDIV +# define FPE_INTDIV FPE_INTDIV FPE_INTOVF, /* Integer overflow. */ -#define FPE_INTOVF FPE_INTOVF +# define FPE_INTOVF FPE_INTOVF FPE_FLTDIV, /* Floating point divide by zero. */ -#define FPE_FLTDIV FPE_FLTDIV +# define FPE_FLTDIV FPE_FLTDIV FPE_FLTOVF, /* Floating point overflow. */ -#define FPE_FLTOVF FPE_FLTOVF +# define FPE_FLTOVF FPE_FLTOVF FPE_FLTUND, /* Floating point underflow. */ -#define FPE_FLTUND FPE_FLTUND +# define FPE_FLTUND FPE_FLTUND FPE_FLTRES, /* Floating point inexact result. */ -#define FPE_FLTRES FPE_FLTRES +# define FPE_FLTRES FPE_FLTRES FPE_FLTINV, /* Floating point invalid operation. */ -#define FPE_FLTINV FPE_FLTINV +# define FPE_FLTINV FPE_FLTINV FPE_FLTSUB /* Subscript out of range. */ -#define FPE_FLTSUB FPE_FLTSUB +# define FPE_FLTSUB FPE_FLTSUB }; /* `si_code' values for SIGSEGV signal. */ enum { SEGV_MAPERR = 1, /* Address not mapped to object. */ -#define SEGV_MAPERR SEGV_MAPERR +# define SEGV_MAPERR SEGV_MAPERR SEGV_ACCERR /* Invalid permissions for mapped object. */ -#define SEGV_ACCERR SEGV_ACCERR +# define SEGV_ACCERR SEGV_ACCERR }; /* `si_code' values for SIGBUS signal. */ enum { BUS_ADRALN = 1, /* Invalid address alignment. */ -#define BUS_ADRALN BUS_ADRALN +# define BUS_ADRALN BUS_ADRALN BUS_ADRERR, /* Non-existant physical address. */ -#define BUS_ADRERR BUS_ADRERR +# define BUS_ADRERR BUS_ADRERR BUS_OBJERR /* Object specific hardware error. */ -#define BUS_OBJERR BUS_OBJERR +# define BUS_OBJERR BUS_OBJERR }; /* `si_code' values for SIGTRAP signal. */ enum { TRAP_BRKPT = 1, /* Process breakpoint. */ -#define TRAP_BRKPT TRAP_BRKPT +# define TRAP_BRKPT TRAP_BRKPT TRAP_TRACE /* Process trace trap. */ -#define TRAP_TRACE TRAP_TRACE +# define TRAP_TRACE TRAP_TRACE }; /* `si_code' values for SIGCHLD signal. */ enum { CLD_EXITED = 1, /* Child has exited. */ -#define CLD_EXITED CLD_EXITED +# define CLD_EXITED CLD_EXITED CLD_KILLED, /* Child was killed. */ -#define CLD_KILLED CLD_KILLED +# define CLD_KILLED CLD_KILLED CLD_DUMPED, /* Child terminated abnormally. */ -#define CLD_DUMPED CLD_DUMPED +# define CLD_DUMPED CLD_DUMPED CLD_TRAPPED, /* Traced child has trapped. */ -#define CLD_TRAPPED CLD_TRAPPED +# define CLD_TRAPPED CLD_TRAPPED CLD_STOPPED, /* Child has stopped. */ -#define CLD_STOPPED CLD_STOPPED +# define CLD_STOPPED CLD_STOPPED CLD_CONTINUED /* Stopped child has continued. */ -#define CLD_CONTINUED CLD_CONTINUED +# define CLD_CONTINUED CLD_CONTINUED }; /* `si_code' values for SIGPOLL signal. */ enum { POLL_IN = 1, /* Data input available. */ -#define POLL_IN POLL_IN +# define POLL_IN POLL_IN POLL_OUT, /* Output buffers available. */ -#define POLL_OUT POLL_OUT +# define POLL_OUT POLL_OUT POLL_MSG, /* Input message available. */ -#define POLL_MSG POLL_MSG +# define POLL_MSG POLL_MSG POLL_ERR, /* I/O error. */ -#define POLL_ERR POLL_ERR +# define POLL_ERR POLL_ERR POLL_PRI, /* High priority input available. */ -#define POLL_PRI POLL_PRI +# define POLL_PRI POLL_PRI POLL_HUP /* Device disconnected. */ -#define POLL_HUP POLL_HUP +# define POLL_HUP POLL_HUP }; +# undef __need_siginfo_t +#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ + + +#if defined _SIGNAL_H && !defined __have_sigevent_t +# define __have_sigevent_t 1 /* Structure to transport application-defined values with signals. */ -#define SIGEV_MAX_SIZE 64 -#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3) +# define SIGEV_MAX_SIZE 64 +# define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3) typedef struct sigevent { @@ -176,9 +193,11 @@ typedef struct sigevent enum { SIGEV_SIGNAL = 0, /* Notify via signal. */ -#define SIGEV_SIGNAL SIGEV_SIGNAL +# define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ -#define SIGEV_NONE SIGEV_NONE +# define SIGEV_NONE SIGEV_NONE SIGEV_THREAD /* Deliver via thread creation. */ -#define SIGEV_THREAD SIGEV_THREAD +# define SIGEV_THREAD SIGEV_THREAD }; + +#endif /* have _SIGNAL_H. */ diff --git a/sysdeps/generic/bits/types.h b/sysdeps/generic/bits/types.h index 51fadd196e..5315a092ac 100644 --- a/sysdeps/generic/bits/types.h +++ b/sysdeps/generic/bits/types.h @@ -69,6 +69,7 @@ typedef long int __rlim_t; /* Type for resource measurement. */ typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */ typedef __quad_t __ino64_t; /* Type for file serial numbers. */ typedef __loff_t __off64_t; /* Type of file izes and offsets. */ +typedef unsigned int __id_t; /* General type for IDs. */ /* Everythin' else. */ typedef long int __daddr_t; /* The type of a disk address. */ @@ -85,7 +86,7 @@ typedef long int __key_t; /* Type of an IPC key */ /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (sizeof (unsigned long int) * 8) #define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) (1 << ((d) % __NFDBITS)) +#define __FDMASK(d) ((unsigned long int) 1 << ((d) % __NFDBITS)) typedef struct { diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c index b71ad54e55..b2ae75cc9e 100644 --- a/sysdeps/generic/dl-sysdep.c +++ b/sysdeps/generic/dl-sysdep.c @@ -40,7 +40,6 @@ extern void _end; extern void ENTRY_POINT (void); ElfW(Addr) _dl_base_addr; -uid_t __libc_uid; int __libc_enable_secure; int __libc_multiple_libcs; /* Defining this here avoids the inclusion of init-first. */ @@ -131,7 +130,6 @@ _dl_sysdep_start (void **start_argptr, SEE (EUID, euid); SEE (EGID, egid); - __libc_uid = uid; __libc_enable_secure = uid != euid || gid != egid; if (_dl_pagesize == 0) diff --git a/sysdeps/generic/enbl-secure.c b/sysdeps/generic/enbl-secure.c index 3520ad5fb0..3f3fe23c54 100644 --- a/sysdeps/generic/enbl-secure.c +++ b/sysdeps/generic/enbl-secure.c @@ -27,7 +27,7 @@ int __libc_enable_secure = 1; /* We often need the UID. */ -uid_t __libc_uid; +extern uid_t __libc_uid; void __libc_init_secure (void) diff --git a/sysdeps/generic/sigqueue.c b/sysdeps/generic/sigqueue.c index c6af1d7021..684800eb2a 100644 --- a/sysdeps/generic/sigqueue.c +++ b/sysdeps/generic/sigqueue.c @@ -19,6 +19,7 @@ #include <errno.h> #include <signal.h> +#include <sys/types.h> int __sigqueue (pid_t pid, int sig, const union sigval val) diff --git a/sysdeps/generic/sys/param.h b/sysdeps/generic/sys/param.h index 1dafdda403..0e10a0ea94 100644 --- a/sysdeps/generic/sys/param.h +++ b/sysdeps/generic/sys/param.h @@ -8,6 +8,7 @@ #include <limits.h> #define MAXSYMLINKS 1 +#define MAXPATHLEN 256 /* Macros for min/max. */ #define MIN(a,b) (((a)<(b))?(a):(b)) diff --git a/sysdeps/generic/waitid.c b/sysdeps/generic/waitid.c new file mode 100644 index 0000000000..8843977a01 --- /dev/null +++ b/sysdeps/generic/waitid.c @@ -0,0 +1,33 @@ +/* Stub version of waitid. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <sys/wait.h> + +int +waitid (idtype, id, infop, options) + idtype_t idtype; + id_t id; + siginfo_t *infop; + int options; +{ + __set_errno (ENOSYS); + return -1; +} diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index c347a515a4..2aaa5b7617 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -338,7 +338,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, { const char *strtab; - strtab = ((void *) map->l_addr + strtab = ((const char *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr); _dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", ": Symbol `", strtab + refsym->st_name, diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h index 5823055c30..10e2b4ee33 100644 --- a/sysdeps/i386/fpu/bits/mathinline.h +++ b/sysdeps/i386/fpu/bits/mathinline.h @@ -110,8 +110,6 @@ __result; }) # endif /* __i686__ */ -/* XXX Argh!!! More compiler errors. */ -#if 0 /* Test for negative number. Used in the signbit() macro. */ __MATH_INLINE int __signbitf (float __x) @@ -130,7 +128,6 @@ __signbitl (long double __x) return (__u.__i[2] & 0x8000) != 0; } #endif -#endif /* The gcc, version 2.7 or below, has problems with all this inlining @@ -534,8 +531,7 @@ __inline_mathcode (acosh, __x, \ __inline_mathcode (atanh, __x, \ register long double __y = __fabsl (__x); \ - return (-0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * \ - __sgn1l (__x))) + return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x)) /* The argument range of the inline version of hypotl is slightly reduced. */ @@ -581,7 +577,7 @@ __inline_mathcode2 (drem, __x, __y, \ /* This function is used in the `isfinite' macro. */ -__MATH_INLINE int __finite (double __x); +__MATH_INLINE int __finite (double __x) __attribute__ ((__const__)); __MATH_INLINE int __finite (double __x) { @@ -615,12 +611,14 @@ __inline_mathcode (__acosh1p, __x, \ /* This code is used internally in the GNU libc. */ -#if 0 -/* XXX I hate compiler bugs. The current version produces wrong code - if this optimization is used. */ #ifdef __LIBC_INTERNAL_MATH_INLINES __inline_mathop (__ieee754_sqrt, "fsqrt") -#endif +__inline_mathcode2 (__ieee754_atan2, __y, __x, + register long double __value; + __asm __volatile__ ("fpatan\n\t" + : "=t" (__value) + : "0" (__x), "u" (__y) : "st(1)"); + return __value;) #endif #endif /* __GNUC__ */ diff --git a/sysdeps/libm-ieee754/s_cacoshf.c b/sysdeps/libm-ieee754/s_cacoshf.c index bcfebea123..6aa33e5a48 100644 --- a/sysdeps/libm-ieee754/s_cacoshf.c +++ b/sysdeps/libm-ieee754/s_cacoshf.c @@ -21,6 +21,7 @@ #include <complex.h> #include <math.h> +#include "math_private.h" __complex__ float __cacoshf (__complex__ float x) @@ -66,6 +67,7 @@ __cacoshf (__complex__ float x) } else { +#if 1 __complex__ float y; __real__ y = (__real__ x - __imag__ x) * (__real__ x + __imag__ x) - 1.0; @@ -77,6 +79,19 @@ __cacoshf (__complex__ float x) __imag__ y += __imag__ x; res = __clogf (y); +#else + float re2 = __real__ x * __real__ x; + float im2 = __imag__ x * __imag__ x; + float sq = re2 - im2 - 1.0; + float ro = __ieee754_sqrtf (sq * sq + 4 * re2 * im2); + float a = __ieee754_sqrtf ((sq + ro) / 2.0); + float b = __ieee754_sqrtf ((-sq + ro) / 2.0); + + __real__ res = 0.5 * __ieee754_logf (re2 + __real__ x * 2 * a + + im2 + __imag__ x * 2 * b + + ro); + __imag__ res = __ieee754_atan2f (__imag__ x + b, __real__ x + a); +#endif } return res; diff --git a/sysdeps/libm-ieee754/s_catan.c b/sysdeps/libm-ieee754/s_catan.c index bab87e95a8..a3fc9ad3e8 100644 --- a/sysdeps/libm-ieee754/s_catan.c +++ b/sysdeps/libm-ieee754/s_catan.c @@ -69,7 +69,7 @@ __catan (__complex__ double x) den = 1 - r2 - __imag__ x * __imag__ x; - __real__ res = 0.5 * __atan ((2.0 * __real__ x) / den); + __real__ res = 0.5 * __ieee754_atan2 (2.0 * __real__ x, den); num = __imag__ x + 1.0; num = r2 + num * num; diff --git a/sysdeps/libm-ieee754/s_catanf.c b/sysdeps/libm-ieee754/s_catanf.c index 92bdac9ec8..18881cd6c9 100644 --- a/sysdeps/libm-ieee754/s_catanf.c +++ b/sysdeps/libm-ieee754/s_catanf.c @@ -69,7 +69,7 @@ __catanf (__complex__ float x) den = 1 - r2 - __imag__ x * __imag__ x; - __real__ res = 0.5 * __atanf ((2.0 * __real__ x) / den); + __real__ res = 0.5 * __ieee754_atan2f (2.0 * __real__ x, den); num = __imag__ x + 1.0; num = r2 + num * num; diff --git a/sysdeps/libm-ieee754/s_catanh.c b/sysdeps/libm-ieee754/s_catanh.c index 6c4b10e3db..0cb852a069 100644 --- a/sysdeps/libm-ieee754/s_catanh.c +++ b/sysdeps/libm-ieee754/s_catanh.c @@ -62,17 +62,17 @@ __catanh (__complex__ double x) i2 = __imag__ x * __imag__ x; - num = 1.0 - __real__ x; + num = 1.0 + __real__ x; num = i2 + num * num; - den = 1.0 + __real__ x; + den = 1.0 - __real__ x; den = i2 + den * den; - __real__ res = 0.25 * __ieee754_log (num / den); + __real__ res = 0.25 * (__ieee754_log (num) - __ieee754_log (den)); den = 1 - __real__ x * __real__ x - i2; - __imag__ res = 0.5 * __atan ((2.0 * __imag__ x) / den); + __imag__ res = 0.5 * __ieee754_atan2 (2.0 * __imag__ x, den); } return res; diff --git a/sysdeps/libm-ieee754/s_catanhf.c b/sysdeps/libm-ieee754/s_catanhf.c index 5d195be905..ac0ed17edb 100644 --- a/sysdeps/libm-ieee754/s_catanhf.c +++ b/sysdeps/libm-ieee754/s_catanhf.c @@ -62,17 +62,17 @@ __catanhf (__complex__ float x) i2 = __imag__ x * __imag__ x; - num = 1.0 - __real__ x; + num = 1.0 + __real__ x; num = i2 + num * num; - den = 1.0 + __real__ x; + den = 1.0 - __real__ x; den = i2 + den * den; - __real__ res = 0.25 * __ieee754_logf (num / den); + __real__ res = 0.25 * (__ieee754_logf (num) - __ieee754_logf (den)); den = 1 - __real__ x * __real__ x - i2; - __imag__ res = 0.5 * __atanf ((2.0 * __imag__ x) / den); + __imag__ res = 0.5 * __ieee754_atan2f (2.0 * __imag__ x, den); } return res; diff --git a/sysdeps/libm-ieee754/s_catanhl.c b/sysdeps/libm-ieee754/s_catanhl.c index d8396a7961..693799639a 100644 --- a/sysdeps/libm-ieee754/s_catanhl.c +++ b/sysdeps/libm-ieee754/s_catanhl.c @@ -62,17 +62,17 @@ __catanhl (__complex__ long double x) i2 = __imag__ x * __imag__ x; - num = 1.0 - __real__ x; + num = 1.0 + __real__ x; num = i2 + num * num; - den = 1.0 + __real__ x; + den = 1.0 - __real__ x; den = i2 + den * den; - __real__ res = 0.25 * __ieee754_logl (num / den); + __real__ res = 0.25 * (__ieee754_logl (num) - __ieee754_logl (den)); den = 1 - __real__ x * __real__ x - i2; - __imag__ res = 0.5 * __atanl ((2.0 * __imag__ x) / den); + __imag__ res = 0.5 * __ieee754_atan2l (2.0 * __imag__ x, den); } return res; diff --git a/sysdeps/libm-ieee754/s_catanl.c b/sysdeps/libm-ieee754/s_catanl.c index 2fd8a4fa08..1da7c6c008 100644 --- a/sysdeps/libm-ieee754/s_catanl.c +++ b/sysdeps/libm-ieee754/s_catanl.c @@ -69,7 +69,7 @@ __catanl (__complex__ long double x) den = 1 - r2 - __imag__ x * __imag__ x; - __real__ res = 0.5 * __atanl ((2.0 * __real__ x) / den); + __real__ res = 0.5 * __ieee754_atan2l (2.0 * __real__ x, den); num = __imag__ x + 1.0; num = r2 + num * num; diff --git a/sysdeps/libm-ieee754/s_clog10.c b/sysdeps/libm-ieee754/s_clog10.c index 5a9de75733..7b2e474b8f 100644 --- a/sysdeps/libm-ieee754/s_clog10.c +++ b/sysdeps/libm-ieee754/s_clog10.c @@ -44,7 +44,7 @@ __clog10 (__complex__ double x) /* Neither real nor imaginary part is NaN. */ __real__ result = __ieee754_log10 (__ieee754_hypot (__real__ x, __imag__ x)); - __imag__ result = __ieee754_atan2 (__imag__ x, __real__ x); + __imag__ result = M_LOG10E * __ieee754_atan2 (__imag__ x, __real__ x); } else { diff --git a/sysdeps/libm-ieee754/s_clog10f.c b/sysdeps/libm-ieee754/s_clog10f.c index 4e2fa83edf..bc4094b8ba 100644 --- a/sysdeps/libm-ieee754/s_clog10f.c +++ b/sysdeps/libm-ieee754/s_clog10f.c @@ -44,7 +44,7 @@ __clog10f (__complex__ float x) /* Neither real nor imaginary part is NaN. */ __real__ result = __ieee754_log10f (__ieee754_hypotf (__real__ x, __imag__ x)); - __imag__ result = __ieee754_atan2f (__imag__ x, __real__ x); + __imag__ result = M_LOG10E * __ieee754_atan2f (__imag__ x, __real__ x); } else { diff --git a/sysdeps/libm-ieee754/s_clog10l.c b/sysdeps/libm-ieee754/s_clog10l.c index bf7d394c42..70940f6863 100644 --- a/sysdeps/libm-ieee754/s_clog10l.c +++ b/sysdeps/libm-ieee754/s_clog10l.c @@ -1,4 +1,4 @@ -/* Compute complex natural logarithm. +/* Compute complex base 10 logarithm. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -44,7 +44,7 @@ __clog10l (__complex__ long double x) /* Neither real nor imaginary part is NaN. */ __real__ result = __ieee754_log10l (__ieee754_hypotl (__real__ x, __imag__ x)); - __imag__ result = __ieee754_atan2l (__imag__ x, __real__ x); + __imag__ result = M_LOG10E * __ieee754_atan2l (__imag__ x, __real__ x); } else { diff --git a/sysdeps/m68k/fpu/bits/fenv.h b/sysdeps/m68k/fpu/bits/fenv.h index a11e0724f1..b1608b9ddc 100644 --- a/sysdeps/m68k/fpu/bits/fenv.h +++ b/sysdeps/m68k/fpu/bits/fenv.h @@ -64,8 +64,9 @@ typedef unsigned int fexcept_t; corresponds to the layout of the block written by `fmovem'. */ typedef struct { - fexcept_t control_register; - fexcept_t status_register; + unsigned int control_register; + unsigned int status_register; + unsigned int instruction_address; } fenv_t; diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h index 827a8d603d..034b6f8294 100644 --- a/sysdeps/m68k/fpu/bits/mathinline.h +++ b/sysdeps/m68k/fpu/bits/mathinline.h @@ -138,13 +138,20 @@ __inline_mathop(__tan, tan) __inline_mathop(__tanh, tanh) __inline_mathop(__fabs, abs) +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X __inline_mathop(__rint, int) __inline_mathop(__expm1, etoxm1) __inline_mathop(__log1p, lognp1) +#endif + +#ifdef __USE_MISC __inline_mathop(__significand, getman) +#endif +#ifdef __USE_ISOC9X __inline_mathop(__log2, log2) __inline_mathop(__trunc, intrz) +#endif #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ @@ -272,8 +279,18 @@ __m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \ __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \ : "dmi" (__ctrl_reg)); \ return __result; \ -} \ - \ +} + +__inline_functions(double,) +#if defined __USE_MISC || defined __USE_ISOC9X +__inline_functions(float,f) +__inline_functions(long double,l) +#endif +#undef __inline_functions + +#ifdef __USE_MISC + +# define __inline_functions(float_type, s) \ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \ { \ /* There is no branch-condition for infinity, \ @@ -284,14 +301,6 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \ return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \ } \ \ -__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \ -{ \ - char __result; \ - __asm("ftst%.x %1\n" \ - "fsun %0" : "=dm" (__result) : "f" (__value)); \ - return __result; \ -} \ - \ __m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \ { \ /* There is no branch-condition for infinity, so we must extract and \ @@ -302,6 +311,44 @@ __m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \ return (__fpsr & (3 << 24)) == 0; \ } \ \ +__m81_defun (float_type, __CONCAT(__scalbn,s), \ + (float_type __x, int __n)) \ +{ \ + float_type __result; \ + __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \ + return __result; \ +} + +__inline_functions(double,) +__inline_functions(float,f) +__inline_functions(long double,l) +# undef __inline_functions + +#endif /* Use misc. */ + +#if defined __USE_MISC || defined __USE_XOPEN + +# define __inline_functions(float_type, s) \ +__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \ +{ \ + char __result; \ + __asm("ftst%.x %1\n" \ + "fsun %0" : "=dm" (__result) : "f" (__value)); \ + return __result; \ +} + +__inline_functions(double,) +# ifdef __USE_MISC +__inline_functions(float,f) +__inline_functions(long double,l) +# endif +# undef __inline_functions + +#endif + +#ifdef __USE_ISOC9X + +# define __inline_functions(float_type, s) \ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \ { \ /* There is no branch-condition for the sign bit, so we must extract \ @@ -312,14 +359,6 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \ return (__fpsr >> 27) & 1; \ } \ \ -__m81_defun (float_type, __CONCAT(__scalbn,s), \ - (float_type __x, int __n)) \ -{ \ - float_type __result; \ - __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \ - return __result; \ -} \ - \ __m81_defun (float_type, __CONCAT(__scalbln,s), \ (float_type __x, long int __n)) \ { \ @@ -347,14 +386,6 @@ __m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \ return __result; \ } \ \ -__m81_inline void \ -__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \ - float_type *__cosx) \ -{ \ - __asm ("fsincos%.x %2,%1:%0" \ - : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ -} \ - \ __m81_inline float_type \ __m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \ float_type __z) \ @@ -362,11 +393,30 @@ __m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \ return (__x * __y) + __z; \ } -/* This defines the three variants of the inline functions. */ __inline_functions (double,) __inline_functions (float,f) __inline_functions (long double,l) -#undef __inline_functions +# undef __inline_functions + +#endif /* Use ISO C9x */ + +#ifdef __USE_GNU + +# define __inline_functions(float_type, s) \ +__m81_inline void \ +__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \ + float_type *__cosx) \ +{ \ + __asm ("fsincos%.x %2,%1:%0" \ + : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \ +} + +__inline_functions (double,) +__inline_functions (float,f) +__inline_functions (long double,l) +# undef __inline_functions + +#endif #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ diff --git a/sysdeps/m68k/fpu/fegetenv.c b/sysdeps/m68k/fpu/fegetenv.c index 59f743aecf..b437b7ef8a 100644 --- a/sysdeps/m68k/fpu/fegetenv.c +++ b/sysdeps/m68k/fpu/fegetenv.c @@ -23,5 +23,5 @@ void fegetenv (fenv_t *envp) { - __asm__ ("fmovem%.l %/fpcr/%/fpsr,%0" : "=m" (*envp)); + __asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp)); } diff --git a/sysdeps/m68k/fpu/feholdexcpt.c b/sysdeps/m68k/fpu/feholdexcpt.c index d8e2d8a8a1..e36617d962 100644 --- a/sysdeps/m68k/fpu/feholdexcpt.c +++ b/sysdeps/m68k/fpu/feholdexcpt.c @@ -26,7 +26,7 @@ feholdexcept (fenv_t *envp) fexcept_t fpcr, fpsr; /* Store the environment. */ - __asm__ ("fmovem%.l %/fpcr/%/fpsr,%0" : "=m" (*envp)); + __asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp)); /* Now clear all exceptions. */ fpsr = envp->status_register & ~FE_ALL_EXCEPT; diff --git a/sysdeps/m68k/fpu/fesetenv.c b/sysdeps/m68k/fpu/fesetenv.c index 8b4d6b0f88..6dd131b888 100644 --- a/sysdeps/m68k/fpu/fesetenv.c +++ b/sysdeps/m68k/fpu/fesetenv.c @@ -29,7 +29,7 @@ fesetenv (const fenv_t *envp) values which we do not want to come from the saved environment. Therefore, we get the current environment and replace the values we want to use from the environment specified by the parameter. */ - __asm__ ("fmovem%.l %/fpcr/%/fpsr,%0" : "=m" (*&temp)); + __asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*&temp)); temp.status_register &= ~FE_ALL_EXCEPT; temp.control_register &= ~((FE_ALL_EXCEPT << 6) | FE_UPWARD); @@ -44,5 +44,5 @@ fesetenv (const fenv_t *envp) temp.status_register |= envp->status_register & FE_ALL_EXCEPT; } - __asm__ __volatile__ ("fmovem%.l %0,%/fpcr/%/fpsr" : : "m" (temp)); + __asm__ __volatile__ ("fmovem%.l %0,%/fpcr/%/fpsr/%/fpiar" : : "m" (*&temp)); } diff --git a/sysdeps/posix/waitid.c b/sysdeps/posix/waitid.c new file mode 100644 index 0000000000..a36883a8d2 --- /dev/null +++ b/sysdeps/posix/waitid.c @@ -0,0 +1,118 @@ +/* Pseudo implementation of waitid. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <signal.h> +#include <sys/wait.h> +#include <sys/types.h> + +#include <assert.h> + +int +waitid (idtype, id, infop, options) + idtype_t idtype; + id_t id; + siginfo_t *infop; + int options; +{ + pid_t pid, child; + int status; + + switch (idtype) + { + case P_PID: + if(id <= 0) + goto invalid; + pid = (pid_t) id; + break; + case P_PGID: + if (id < 0 || id == 1) + goto invalid; + pid = (pid_t) -id; + break; + case P_ALL: + pid = -1; + break; + default: + invalid: + __set_errno (EINVAL); + return -1; + } + + /* Technically we're supposed to return EFAULT if infop is bogus, + but that would involve mucking with signals, which is + too much hassle. User will have to deal with SIGSEGV/SIGBUS. + We just check for a null pointer. */ + + if (infop == NULL) + { + __set_errno (EFAULT); + return -1; + } + + child = waitpid (pid, &status, options); + + if (child == -1) + /* `waitpid' set `errno' for us. */ + return -1; + + if (child == 0) + { + /* The WHOHANG bit in OPTIONS is set and there are children available + but none has a status for us. The XPG docs do not mention this + case so we clear the `siginfo_t' struct and return succesfully. */ + infop->si_signo = 0; + infop->si_code = 0; + return 0; + } + + /* Decode the status field and set infop members... */ + infop->si_signo = SIGCHLD; + infop->si_pid = child; + infop->si_errno = 0; + + if (WIFEXITED (status)) + { + infop->si_code = CLD_EXITED; + infop->si_status = WEXITSTATUS (status); + } + else if (WIFSIGNALED (status)) + { + infop->si_code = WCOREDUMP (status) ? CLD_DUMPED : CLD_KILLED; + infop->si_status = WTERMSIG (status); + } + else if (WIFSTOPPED (status)) + { + infop->si_code = CLD_STOPPED; + infop->si_status = WSTOPSIG (status); + } +#ifdef WIFCONTINUED + else if (WIFCONTINUED (status)) + { + infop->si_code = CLD_CONTINUED; + infop->si_status = SIGCONT; + } +#endif + else + /* Can't happen. */ + assert (! "What?"); + + return 0; +} diff --git a/sysdeps/standalone/arm/bits/errno.h b/sysdeps/standalone/arm/bits/errno.h index 97dbbd9ce3..391f92548f 100644 --- a/sysdeps/standalone/arm/bits/errno.h +++ b/sysdeps/standalone/arm/bits/errno.h @@ -52,6 +52,13 @@ # define EISDIR 24 # define EOPNOTSUPP 25 /* Operation not supported. */ # define ENOTTY 26 +# define EAGAIN 27 +# define EIO 28 +# define ENOSPC 29 +# define EEXIST 30 #endif #define __set_errno(val) errno = (val) + +/* Function to get address of global `errno' variable. */ +extern int *__errno_location __P ((void)) __attribute__ ((__const__)); diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 6903e0b6cd..27684ef3fe 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -67,6 +67,12 @@ endif ifeq ($(subdir),stdio-common) # Just disable the auto generation in sysdeps/generic inhibit-siglist := yes + +ifeq ($(versioning),yes) +aux += oldsiglist +endif + +shared-only-routines += oldsiglist endif ifeq ($(subdir),inet) @@ -111,8 +117,7 @@ endif ifeq ($(subdir),signal) sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \ - rt_sigqueueinfo rt_sigaction rt_sigpending \ - rt_sigreturn + rt_sigqueueinfo rt_sigaction rt_sigpending endif common-generated += bits/stdio_lim.h bits/stdio_lim.d diff --git a/sysdeps/unix/sysv/linux/_G_config.h b/sysdeps/unix/sysv/linux/_G_config.h index 9ad897644e..5dda3d71db 100644 --- a/sysdeps/unix/sysv/linux/_G_config.h +++ b/sysdeps/unix/sysv/linux/_G_config.h @@ -48,6 +48,9 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); #define _G_HAVE_PRINTF_FP 1 #define _G_HAVE_MMAP 1 #define _G_HAVE_LONG_DOUBLE_IO 1 +#define _G_HAVE_IO_FILE_OPEN 1 + +#define _G_IO_IO_FILE_VERSION 0x20001 #define _G_OPEN64 open64 #define _G_LSEEK64 lseek64 @@ -66,7 +69,7 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); #define _G_VTABLE_LABEL_PREFIX_ID __vt_ -#if defined (__cplusplus) || defined (__STDC__) +#if defined __cplusplus || defined __STDC__ # define _G_ARGS(ARGLIST) ARGLIST #else # define _G_ARGS(ARGLIST) () diff --git a/sysdeps/unix/sysv/linux/alpha/bits/types.h b/sysdeps/unix/sysv/linux/alpha/bits/types.h index b9e6dd779a..9acdf0c490 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/types.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/types.h @@ -62,6 +62,7 @@ typedef __uint32_t __fsblkcnt_t; /* Type to count file system blocks. */ typedef __uint64_t __fsblkcnt64_t; /* "" (LFS) */ typedef __uint64_t __fsfilcnt_t; /* Type to count file system inodes. */ typedef __uint64_t __fsfilcnt64_t; /* "" (LFS) */ +typedef __uint32_t __id_t; /* General type for IDs. */ typedef struct { @@ -90,7 +91,7 @@ typedef unsigned long int __fd_mask; /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * sizeof (__fd_mask)) #define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) (1 << ((d) % __NFDBITS)) +#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) /* fd_set for select and pselect. */ typedef struct diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h index 900bff4aab..6f8bc9bcd4 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h @@ -1,6 +1,6 @@ /* This is the sigaction struction from the Linux 2.1.20 kernel. */ -struct kernel_sigaction { +struct old_kernel_sigaction { __sighandler_t sa_handler; unsigned long sa_mask; unsigned int sa_flags; diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h index 42030abc4f..503465b3bf 100644 --- a/sysdeps/unix/sysv/linux/bits/siginfo.h +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h @@ -17,12 +17,23 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _SIGNAL_H +#if !defined _SIGNAL_H && !defined __need_siginfo_t # error "Never include this file directly. Use <signal.h> instead" #endif -#define SI_MAX_SIZE 128 -#define SI_PAD_SIZE ((SI_MAX_SIZE / sizeof (int)) - 3) +#if (!defined __have_siginfo_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t)) +# define __have_siginfo_t 1 + +/* Type for data associated with a signal. */ +typedef union sigval + { + int sival_int; + void *sival_ptr; + } sigval_t; + +# define SI_MAX_SIZE 128 +# define SI_PAD_SIZE ((SI_MAX_SIZE / sizeof (int)) - 3) typedef struct siginfo { @@ -83,17 +94,17 @@ typedef struct siginfo /* X/Open requires some more fields with fixed names. */ -#define si_pid _sifields._kill.si_pid -#define si_uid _sifields._kill.si_uid -#define si_status _sifields._sigchld.si_status -#define si_utime _sifields._sigchld.si_utime -#define si_stime _sifields._sigchld.si_stime -#define si_value _sifields._rt.si_sigval -#define si_int _sifields._rt.si_sigval.sival_int -#define si_ptr _sifields._rt.si_sigval.sival_ptr -#define si_addr _sifields._sigfault.si_addr -#define si_band _sifields._sigpoll.si_band -#define si_fd _sifields._sigpoll.si_fd +# define si_pid _sifields._kill.si_pid +# define si_uid _sifields._kill.si_uid +# define si_status _sifields._sigchld.si_status +# define si_utime _sifields._sigchld.si_utime +# define si_stime _sifields._sigchld.si_stime +# define si_value _sifields._rt.si_sigval +# define si_int _sifields._rt.si_sigval.sival_int +# define si_ptr _sifields._rt.si_sigval.sival_ptr +# define si_addr _sifields._sigfault.si_addr +# define si_band _sifields._sigpoll.si_band +# define si_fd _sifields._sigpoll.si_fd /* Values for `si_code'. Positive values are reserved for kernel-generated @@ -101,15 +112,15 @@ typedef struct siginfo enum { SI_ASYNCIO = -4, /* Sent by AIO completion. */ -#define SI_ASYNCIO SI_ASYNCIO +# define SI_ASYNCIO SI_ASYNCIO SI_MESGQ, /* Sent by real time mesq state change. */ -#define SI_MESGQ SI_MESGQ +# define SI_MESGQ SI_MESGQ SI_TIMER, /* Sent by timer expiration. */ -#define SI_TIMER SI_TIMER +# define SI_TIMER SI_TIMER SI_QUEUE, /* Sent by sigqueue. */ -#define SI_QUEUE SI_QUEUE +# define SI_QUEUE SI_QUEUE SI_USER /* Sent by kill, sigsend, raise. */ -#define SI_USER SI_USER +# define SI_USER SI_USER }; @@ -117,111 +128,117 @@ enum enum { ILL_ILLOPC = 1, /* Illegal opcode. */ -#define ILL_ILLOPC ILL_ILLOPC +# define ILL_ILLOPC ILL_ILLOPC ILL_ILL_OPN, /* Illegal operand. */ -#define ILL_ILLOPN ILL_ILLOPN +# define ILL_ILLOPN ILL_ILLOPN ILL_ILLADR, /* Illegal addressing mode. */ -#define ILL_ILLADR ILL_ILLADR +# define ILL_ILLADR ILL_ILLADR ILL_ILLTRP, /* Illegal trap. */ -#define ILL_ILLTRP ILL_ILLTRP +# define ILL_ILLTRP ILL_ILLTRP ILL_PRVOPC, /* Privileged opcode. */ -#define ILL_PRVOPC ILL_PRVOPC +# define ILL_PRVOPC ILL_PRVOPC ILL_PRVREG, /* Privileged register. */ -#define ILL_PRVREG ILL_PRVREG +# define ILL_PRVREG ILL_PRVREG ILL_COPROC, /* Coprocessor error. */ -#define ILL_COPROC ILL_COPROC +# define ILL_COPROC ILL_COPROC ILL_BADSTK /* Internal stack error. */ -#define ILL_BADSTK ILL_BADSTK +# define ILL_BADSTK ILL_BADSTK }; /* `si_code' values for SIGFPE signal. */ enum { FPE_INTDIV = 1, /* Integer divide by zero. */ -#define FPE_INTDIV FPE_INTDIV +# define FPE_INTDIV FPE_INTDIV FPE_INTOVF, /* Integer overflow. */ -#define FPE_INTOVF FPE_INTOVF +# define FPE_INTOVF FPE_INTOVF FPE_FLTDIV, /* Floating point divide by zero. */ -#define FPE_FLTDIV FPE_FLTDIV +# define FPE_FLTDIV FPE_FLTDIV FPE_FLTOVF, /* Floating point overflow. */ -#define FPE_FLTOVF FPE_FLTOVF +# define FPE_FLTOVF FPE_FLTOVF FPE_FLTUND, /* Floating point underflow. */ -#define FPE_FLTUND FPE_FLTUND +# define FPE_FLTUND FPE_FLTUND FPE_FLTRES, /* Floating point inexact result. */ -#define FPE_FLTRES FPE_FLTRES +# define FPE_FLTRES FPE_FLTRES FPE_FLTINV, /* Floating point invalid operation. */ -#define FPE_FLTINV FPE_FLTINV +# define FPE_FLTINV FPE_FLTINV FPE_FLTSUB /* Subscript out of range. */ -#define FPE_FLTSUB FPE_FLTSUB +# define FPE_FLTSUB FPE_FLTSUB }; /* `si_code' values for SIGSEGV signal. */ enum { SEGV_MAPERR = 1, /* Address not mapped to object. */ -#define SEGV_MAPERR SEGV_MAPERR +# define SEGV_MAPERR SEGV_MAPERR SEGV_ACCERR /* Invalid permissions for mapped object. */ -#define SEGV_ACCERR SEGV_ACCERR +# define SEGV_ACCERR SEGV_ACCERR }; /* `si_code' values for SIGBUS signal. */ enum { BUS_ADRALN = 1, /* Invalid address alignment. */ -#define BUS_ADRALN BUS_ADRALN +# define BUS_ADRALN BUS_ADRALN BUS_ADRERR, /* Non-existant physical address. */ -#define BUS_ADRERR BUS_ADRERR +# define BUS_ADRERR BUS_ADRERR BUS_OBJERR /* Object specific hardware error. */ -#define BUS_OBJERR BUS_OBJERR +# define BUS_OBJERR BUS_OBJERR }; /* `si_code' values for SIGTRAP signal. */ enum { TRAP_BRKPT = 1, /* Process breakpoint. */ -#define TRAP_BRKPT TRAP_BRKPT +# define TRAP_BRKPT TRAP_BRKPT TRAP_TRACE /* Process trace trap. */ -#define TRAP_TRACE TRAP_TRACE +# define TRAP_TRACE TRAP_TRACE }; /* `si_code' values for SIGCHLD signal. */ enum { CLD_EXITED = 1, /* Child has exited. */ -#define CLD_EXITED CLD_EXITED +# define CLD_EXITED CLD_EXITED CLD_KILLED, /* Child was killed. */ -#define CLD_KILLED CLD_KILLED +# define CLD_KILLED CLD_KILLED CLD_DUMPED, /* Child terminated abnormally. */ -#define CLD_DUMPED CLD_DUMPED +# define CLD_DUMPED CLD_DUMPED CLD_TRAPPED, /* Traced child has trapped. */ -#define CLD_TRAPPED CLD_TRAPPED +# define CLD_TRAPPED CLD_TRAPPED CLD_STOPPED, /* Child has stopped. */ -#define CLD_STOPPED CLD_STOPPED +# define CLD_STOPPED CLD_STOPPED CLD_CONTINUED /* Stopped child has continued. */ -#define CLD_CONTINUED CLD_CONTINUED +# define CLD_CONTINUED CLD_CONTINUED }; /* `si_code' values for SIGPOLL signal. */ enum { POLL_IN = 1, /* Data input available. */ -#define POLL_IN POLL_IN +# define POLL_IN POLL_IN POLL_OUT, /* Output buffers available. */ -#define POLL_OUT POLL_OUT +# define POLL_OUT POLL_OUT POLL_MSG, /* Input message available. */ -#define POLL_MSG POLL_MSG +# define POLL_MSG POLL_MSG POLL_ERR, /* I/O error. */ -#define POLL_ERR POLL_ERR +# define POLL_ERR POLL_ERR POLL_PRI, /* High priority input available. */ -#define POLL_PRI POLL_PRI +# define POLL_PRI POLL_PRI POLL_HUP /* Device disconnected. */ -#define POLL_HUP POLL_HUP +# define POLL_HUP POLL_HUP }; +# undef __need_siginfo_t +#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ + + +#if defined _SIGNAL_H && !defined __have_sigevent_t +# define __have_sigevent_t 1 /* Structure to transport application-defined values with signals. */ -#define SIGEV_MAX_SIZE 64 -#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3) +# define SIGEV_MAX_SIZE 64 +# define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3) typedef struct sigevent { @@ -242,16 +259,18 @@ typedef struct sigevent } sigevent_t; /* POSIX names to access some of the members. */ -#define sigev_notify_function _sigev_un._sigev_thread._function -#define sigev_notify_attributes _sigev_un._sigev_thread._attribute +# define sigev_notify_function _sigev_un._sigev_thread._function +# define sigev_notify_attributes _sigev_un._sigev_thread._attribute /* `sigev_notify' values. */ enum { SIGEV_SIGNAL = 0, /* Notify via signal. */ -#define SIGEV_SIGNAL SIGEV_SIGNAL +# define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ -#define SIGEV_NONE SIGEV_NONE +# define SIGEV_NONE SIGEV_NONE SIGEV_THREAD /* Deliver via thread creation. */ -#define SIGEV_THREAD SIGEV_THREAD +# define SIGEV_THREAD SIGEV_THREAD }; + +#endif /* have _SIGNAL_H. */ diff --git a/sysdeps/unix/sysv/linux/bits/types.h b/sysdeps/unix/sysv/linux/bits/types.h index daa94336de..dec60e244b 100644 --- a/sysdeps/unix/sysv/linux/bits/types.h +++ b/sysdeps/unix/sysv/linux/bits/types.h @@ -67,6 +67,7 @@ typedef int __pid_t; /* Type of process identifications. */ typedef int __ssize_t; /* Type of a byte count, or error. */ typedef long int __rlim_t; /* Type of resource counts. */ typedef __quad_t __rlim64_t; /* Type of resource counts (LFS). */ +typedef __u_int __id_t; /* General type for ID. */ typedef struct { @@ -90,7 +91,7 @@ typedef unsigned long int __fd_mask; /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * sizeof (__fd_mask)) #define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) (1 << ((d) % __NFDBITS)) +#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) /* fd_set for select and pselect. */ typedef struct diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c index 505b8ddcfe..3a172288b6 100644 --- a/sysdeps/unix/sysv/linux/init-first.c +++ b/sysdeps/unix/sysv/linux/init-first.c @@ -24,6 +24,7 @@ #include <init-first.h> #include <sys/types.h> +extern void __libc_init_secure (void); extern void __libc_init (int, char **, char **); extern void __libc_global_ctors (void); @@ -42,8 +43,9 @@ int __libc_multiple_libcs = 1; int __libc_argc; char **__libc_argv; -/* We often need the PID. Cache this value. */ +/* We often need the UID and PID. Cache these values. */ pid_t __libc_pid = 0xf00baa; +uid_t __libc_uid = 0xf00baa; static void @@ -71,6 +73,10 @@ init (int argc, char **argv, char **envp) __libc_argv = argv; __environ = envp; +#ifndef PIC + __libc_init_secure (); +#endif + __libc_init (argc, argv, envp); /* This is a hack to make the special getopt in GNU libc working. */ diff --git a/sysdeps/unix/sysv/linux/net/if_slip.h b/sysdeps/unix/sysv/linux/net/if_slip.h index 2670427dbe..4686bc5da1 100644 --- a/sysdeps/unix/sysv/linux/net/if_slip.h +++ b/sysdeps/unix/sysv/linux/net/if_slip.h @@ -1,6 +1,25 @@ -#ifndef __NET_SLIP_H -#define __NET_SLIP_H 1 +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _NET_IF_SLIP_H +#define _NET_IF_SLIP_H 1 + +/* We can use the kernel header. */ #include <linux/if_slip.h> -#endif +#endif /* net/if_slip.h. */ diff --git a/sysdeps/unix/sysv/linux/oldsiglist.c b/sysdeps/unix/sysv/linux/oldsiglist.c new file mode 100644 index 0000000000..e9c933f9b3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/oldsiglist.c @@ -0,0 +1,21 @@ +#include <stddef.h> +#include <signal.h> + +const char * const __old_sys_siglist[32] = +{ +#define init_sig(sig, abbrev, desc) [sig] desc, +#include "siglist.h" +#undef init_sig +}; + +const char * const __old_sys_sigabbrev[32] = +{ +#define init_sig(sig, abbrev, desc) [sig] abbrev, +#include "siglist.h" +#undef init_sig +}; + +strong_alias (__old_sys_siglist, _old_sys_siglist) +symbol_version (__old_sys_siglist, _sys_siglist, GLIBC_2.0); +symbol_version (_old_sys_siglist, sys_siglist, GLIBC_2.0); +symbol_version (__old_sys_sigabbrev, sys_sigabbrev, GLIBC_2.0); diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c index 1412c381d0..3eb721454e 100644 --- a/sysdeps/unix/sysv/linux/sigaction.c +++ b/sysdeps/unix/sysv/linux/sigaction.c @@ -16,6 +16,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <errno.h> #include <signal.h> /* The difference here is that the sigaction structure used in the @@ -23,10 +24,10 @@ translate it here. */ #include <kernel_sigaction.h> -extern int __syscall_sigaction (int, const struct kernel_sigaction *, - struct kernel_sigaction *); -extern int __syscall_rt_signal (int, const struct sigaction *, - struct sigaction *, size_t); +extern int __syscall_sigaction (int, const struct old_kernel_sigaction *, + struct old_kernel_sigaction *); +extern int __syscall_rt_sigaction (int, const struct sigaction *, + struct sigaction *, size_t); /* The variable is shared between all wrappers around signal handling functions which have RT equivalents. It is defined in sigsuspend.c. */ diff --git a/sysdeps/unix/sysv/linux/siglist.c b/sysdeps/unix/sysv/linux/siglist.c index c054e81999..9f42cc0a87 100644 --- a/sysdeps/unix/sysv/linux/siglist.c +++ b/sysdeps/unix/sysv/linux/siglist.c @@ -1,19 +1,26 @@ #include <stddef.h> #include <signal.h> -const char * const _sys_siglist[NSIG] = +const char * const __new_sys_siglist[NSIG] = { #define init_sig(sig, abbrev, desc) [sig] desc, #include "siglist.h" #undef init_sig }; -const char * const _sys_sigabbrev[NSIG] = +const char * const __new_sys_sigabbrev[NSIG] = { #define init_sig(sig, abbrev, desc) [sig] abbrev, #include "siglist.h" #undef init_sig }; +#ifdef DO_VERSIONING +strong_alias (__new_sys_siglist, _new_sys_siglist) +default_symbol_version (__new_sys_siglist, _sys_siglist, GLIBC_2.1); +default_symbol_version (_new_sys_siglist, sys_siglist, GLIBC_2.1); +default_symbol_version (__new_sys_sigabbrev, sys_sigabbrev, GLIBC_2.1); +#else weak_alias(_sys_siglist, sys_siglist) weak_alias(_sys_sigabbrev, sys_sigabbrev) +#endif diff --git a/sysdeps/unix/sysv/linux/sigqueue.c b/sysdeps/unix/sysv/linux/sigqueue.c index a88cd88f66..53e66af176 100644 --- a/sysdeps/unix/sysv/linux/sigqueue.c +++ b/sysdeps/unix/sysv/linux/sigqueue.c @@ -44,6 +44,8 @@ __sigqueue (pid, sig, val) __libc_pid = __getpid (); info.si_pid = __libc_pid; + if (__libc_uid ==0xf00baa) + __libc_pid = __getuid (); info.si_uid = __libc_uid; info.si_value = val; diff --git a/sysdeps/unix/sysv/linux/sigreturn.c b/sysdeps/unix/sysv/linux/sigreturn.c index 540dfdf388..6b3116fef2 100644 --- a/sysdeps/unix/sysv/linux/sigreturn.c +++ b/sysdeps/unix/sysv/linux/sigreturn.c @@ -1,51 +1,3 @@ -/* Copyright (C) 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 <errno.h> -#include <signal.h> -#include <unistd.h> - -extern int __syscall_sigreturn (struct sigcontext *); -extern int __syscall_rt_sigreturn (struct sigcontext *, size_t); - -/* The variable is shared between all wrappers around signal handling - functions which have RT equivalents. It is defined in sigsuspend.c. */ -extern int __libc_have_rt_sigs; - - -/* Get and/or change the set of blocked signals. */ -int -__sigreturn (scp) - struct sigcontext *scp; -{ - /* First try the RT signals. */ - if (__libc_have_rt_sigs) - { - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - int result = __syscall_rt_sigreturn (scp, _NSIG / 8); - - if (result >= 0 || errno != ENOSYS) - return result; - - __libc_have_rt_sigs = 0; - } - - return __syscall_sigreturn (scp); -} -weak_alias (__sigprocmask, sigprocmask) +/* The sigreturn syscall cannot be explicitly called on Linux, only + implicitly by returning from a signal handler. */ +#include <sysdeps/generic/sigreturn.c> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h index a417928863..0c421fb7a7 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h @@ -54,6 +54,7 @@ typedef int __pid_t; /* Type of process identifications. */ typedef long long int __ssize_t; /* Type of a byte count, or error. */ typedef long int __rlim_t; /* Type of resource counts. */ typedef long int __rlim64_t; /* Type of resource counts (LFS). */ +typedef __u_int __id_t; /* General type for IDs. */ typedef struct { @@ -82,7 +83,7 @@ typedef unsigned long int __fd_mask; /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * sizeof (__fd_mask)) #define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) (1 << ((d) % __NFDBITS)) +#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) /* fd_set for select and pselect. */ typedef struct diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index ed760af2ab..16538cee73 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -39,7 +39,6 @@ rt_sigaction - rt_sigaction 4 __syscall_rt_sigaction rt_sigpending - rt_sigpending 2 __syscall_rt_sigpending rt_sigprocmask - rt_sigprocmask 4 __syscall_rt_sigprocmask rt_sigqueueinfo - rt_sigqueueinfo 3 __syscall_rt_sigqueueinfo -rt_sigreturn - rt_sigreturn 1 __syscall_rt_sigreturn rt_sigsuspend - rt_sigsuspend 2 __syscall_rt_sigsuspend rt_sigtimedwait - rt_sigtimedwait 4 __syscall_rt_sigtimedwait s_getdents EXTRA getdents 3 __getdents @@ -52,7 +51,6 @@ s_reboot EXTRA reboot 3 __syscall_reboot s_sigaction sigaction sigaction 3 __syscall_sigaction s_sigpending EXTRA sigpending 1 __syscall_sigpending s_sigprocmask EXTRA sigprocmask 3 __syscall_sigprocmask -s_sigreturn sigreturn sigreturn 1 __syscall_sigreturn s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend s_sysctl sysctl _sysctl 1 __syscall__sysctl s_ustat ustat ustat 2 __syscall_ustat |