From da2d1bc5adf49352232ad0514e79fbd5dcae08e8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 10 Feb 1998 20:06:30 +0000 Subject: Update. 1998-02-10 23:57 Ulrich Drepper * misc/tst-efgcvt.c: Add more tests. * misc/efgcvt_r.c: Correct result for above new tests. 1998-02-06 17:22 H.J. Lu * misc/efgcvt_r.c (fcvt_r, ecvt_r): Correctly handle NDIGIT <= 0. 1998-02-10 16:48 Philip Blundell * Makerules (install-no-libc.a-nosubdir): Don't install-bin (etc) if the programs weren't built. 1998-02-09 10:12 Philip Blundell * sysdeps/libm-ieee754/s_exp2.c (__ieee754_exp2): If we don't have FE_TONEAREST, soldier on regardless and do the best we can. * sysdeps/libm-ieee754/s_exp2f.c (__ieee754_exp2f): likewise. 1998-02-5 17:20 Philip Blundell * sysdeps/standalone/filedesc.h: Define __need_FOPEN_MAX, not _STDIO_H, before including . * sysdeps/standalone/arm/bits/errno.h (EOVERFLOW): Added. * io/fts.c (fts_build): Don't try to use d_type if it doesn't exist. * sysdeps/arm/sys/ucontext.h: New file. 1998-02-04 10:11 Philip Blundell * manual/stdio.texi (Formatted Output Functions): Explicitly say that the return value from snprintf() does not count the terminating NUL as a character. 1998-02-10 16:57 Ulrich Drepper * manual/users.texi: Rewrite to describe correct POSIX behaviour, add description for sete[ug]id and general cleanup. Patch by Zack Weinberg . 1998-01-04 Andreas Schwab * Makefile (parent-clean): Don't remove makefile fragments here. (postclean): New variable. (clean): Remove makefile fragments here. (realclean distclean): Likewise. Pass sysdep-subdirs to sub-make. (generated): Add isomac and isomanc.out. * Makeconfig ($(common-objpfx)soversions.mk): Don't generate if avoid-generated is set. (postclean-generated): Add soversion.mk. ($(common-objpfx)version.mk): Don't include if avoid-generated is set. * Makerules: Still need to include $(+sysdir_pfx)sysd-Makefile if avoid-generated is set. (common-generated): Add libc.so and libc.so$(libc.so-version). (generated): Add versioned libraries. (common-mostlyclean): Also remove %.so and %_pic.a. * csu/Makefile (generated): Add abi-tag.h. * db2/Makefile (extra-objs): Add getlong.o. * elf/Makefile (generated): Add ld.so, ldd and $(rtld-installed-name). (others): Add ldconfig here instead of ldconfig.o to extra-objs. * malloc/Makefile (generated): Add mtrace. * po/Makefile: Don't include version.mk, not needed any more. * sunrpc/Makefile (generated): Add rpc-proto.d and rpcgen. * sysdeps/unix/Makefile: Fix local_lim.h -> bits/local_lim.h, syscall.h -> sys/syscall.h. (common-generated): Add s-proto.d. (postclean-generated): Add sysd-syscalls. * localedata/Makefile (test-output): Add all output files. (generated): Add test-input and test-output. (generated-dirs): Add all the dirs. 1998-01-04 Andreas Schwab * Makefile (test-output, generated, generated-dirs): New variables. 1998-02-10 16:57 Ulrich Drepper * resolv/nss_dns/dns-host.c: Various code cleanups. 1998-02-09 08:10 H.J. Lu * resolv/gethnamaddr.c (getanswer): Fix the PTR/CNAME bug. From Philip Blundell . * resolv/nss_dns/dns-host.c (getanswer_r): Ditto. 1998-02-08 Andreas Jaeger * libc.map: Add .rem, .div, .mul, .udiv, .umul, .urem for Sparc. Suggested by debian/sparc porters. 1998-02-07 Andreas Jaeger * misc/tst-efgcvt.c: Totally rewritten, added a lot of new tests for ecvt and fcvt. 1998-02-10 16:32 Ulrich Drepper * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Use __xstat and __fxstat instead of stat and fstat. Use namespace clean __stpcpy. * signal/signal.h: Always define sigset_t if __need_sigset_t is defined even if __USE_POSIX is not defined. 1998-02-02 20:51 Zack Weinberg * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Correct last patch to support obsolete tty major numbers correctly. 1998-02-02 08:47 H.J. Lu * login/Makefile ($(inst_libexecdir)/pt_chown): Make the target directory first and ignore install error. * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Substract 128 from ptyno and fix a typo for the BSD style pty. 1998-02-01 Andreas Schwab * sysdeps/unix/Makefile ($(common-objpfx)s-proto.d): Depend on all syscalls.list's. 1998-02-01 Andreas Schwab * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add getresuid and getresgid. * sysdeps/unix/sysv/linux/getresuid.c: New file. * sysdeps/unix/sysv/linux/getresgid.c: New file. * sysdeps/unix/sysv/linux/syscalls.list: Remove getres[ug]id, add s_getres[ug]id. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Add getres[ug]id. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/syscalls.list: Likewise. 1998-02-02 08:11 H.J. Lu * nscd/grpcache.c: Include . 1998-02-01 16:01 H.J. Lu * stdlib/atoll.c: Fix comments. * sysdeps/posix/ttyname.c: Ignore stdin/stdout/stderr. * sysdeps/posix/ttyname_r.c: Ditto. 1998-02-03 Andreas Schwab * io/sys/stat.h: Define S_IFLNK and S_IFSOCK if __USE_BSD or __USE_MISC, independent of __USE_UNIX98. 1998-02-10 19:18 Ulrich Drepper * sysdeps/unix/sysv/linux/i386/sigaction.c (__libc_missing_rt_sigs): Rename from __libc_have_rt_sigs and leave as COMMON data. 1998-02-04 11:58 Richard Henderson * Makeconfig (CFLAGS-.os): Kill -fno-common. * Makerules (libc.so): Prelink libc_pic.a, allocating commons. * libc.map (GLIBC_2.1): Add Linux/Alpha tv64 symbols. * elf/rtld.map: New file. Needed to define the GLIBC_2.* version symbols. * include/libc-symbols.h (symbol_version, default_symbol_version): Provide asm versions and correct !DO_VERSIONING versions. * sysdeps/unix/make-syscalls.sh: Recognize version symbols in the weak symbol list. * sysdeps/unix/sysv/linux/sigaction.c (__libc_missing_rt_sigs): Rename from __libc_have_rt_sigs and leave as COMMON data. * sysdeps/unix/sysv/linux/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. 1998-02-04 16:41 Zack Weinberg * sunrpc/Makefile: Correct dependencies of rpcgen. 1998-02-10 03:00 Ulrich Drepper * nscd/Makefile: Fix test for available linuxthreads add-on. Patch by Zack Weinberg . 1998-02-05 Andreas Jaeger * sysdeps/unix/sysv/linux/syscalls.list: Fix typo in lchown. 1998-02-03 Andreas Jaeger * sysdeps/gnu/Makefile: Respect with-cvs variable. * manual/errno.texi (Error Messages): Correct description of strerror_r. Pointed out by jonas@bagge.se. 1998-01-29 Andreas Jaeger * manual/socket.texi (Host Address Functions): Clarify description of inet_network. 1998-02-07 Andreas Schwab * sysdeps/unix/grantpt.c (argv): Move const to toplevel. (grantpt): Delete superfluous cast. 1998-02-06 Andreas Schwab * Makefile ($(inst_slibdir)/libc-$(version).so): Depend on elf/ldso_install instead of elf/subdir_install. (elf/ldso_install): New target. * elf/Makefile (ldso_install): New target. 1998-02-07 Andreas Schwab * sysdeps/unix/sysv/linux/powerpc/socket.S: Really do the change of 1998-01-06. 1998-02-07 Andreas Schwab * string/bits/string2.h (strcmp): Use __string2_1bptr_p only for constant expressions. 1998-02-07 Andreas Schwab * nss/test-netdb.c: Include for gethostname and "nss.h" for __nss_configure_lookup. (output_hostent): Remove unused variable. 1998-02-07 Andreas Schwab * string/tst-inlcall.c: Fix format string. 1998-02-09 Andreas Jaeger * inet/netinet/in.h: Rename second parameter of bindresvport to avoid buggy gcc warning. [PR libc/412] --- sysdeps/arm/sys/ucontext.h | 95 ++++++++++++++++++++++ sysdeps/gnu/Makefile | 4 +- sysdeps/libm-ieee754/s_exp2.c | 5 +- sysdeps/libm-ieee754/s_exp2f.c | 5 +- sysdeps/posix/ttyname.c | 5 +- sysdeps/posix/ttyname_r.c | 5 +- sysdeps/standalone/arm/bits/errno.h | 3 +- sysdeps/standalone/filedesc.h | 4 +- sysdeps/unix/Makefile | 16 ++-- sysdeps/unix/grantpt.c | 4 +- sysdeps/unix/make-syscalls.sh | 39 ++++++++- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/syscalls.list | 3 + sysdeps/unix/sysv/linux/getresgid.c | 39 +++++++++ sysdeps/unix/sysv/linux/getresuid.c | 39 +++++++++ sysdeps/unix/sysv/linux/i386/sigaction.c | 8 +- sysdeps/unix/sysv/linux/mips/syscalls.list | 3 + sysdeps/unix/sysv/linux/powerpc/socket.S | 10 ++- sysdeps/unix/sysv/linux/powerpc/syscalls.list | 3 + sysdeps/unix/sysv/linux/ptsname.c | 27 +++--- sysdeps/unix/sysv/linux/sigaction.c | 8 +- sysdeps/unix/sysv/linux/sigpending.c | 10 +-- sysdeps/unix/sysv/linux/sigprocmask.c | 10 +-- sysdeps/unix/sysv/linux/sigsuspend.c | 10 +-- .../unix/sysv/linux/sparc/sparc64/syscalls.list | 3 + sysdeps/unix/sysv/linux/syscalls.list | 6 +- 26 files changed, 304 insertions(+), 62 deletions(-) create mode 100644 sysdeps/arm/sys/ucontext.h create mode 100644 sysdeps/unix/sysv/linux/getresgid.c create mode 100644 sysdeps/unix/sysv/linux/getresuid.c (limited to 'sysdeps') diff --git a/sysdeps/arm/sys/ucontext.h b/sysdeps/arm/sys/ucontext.h new file mode 100644 index 0000000000..70af80fa47 --- /dev/null +++ b/sysdeps/arm/sys/ucontext.h @@ -0,0 +1,95 @@ +/* Copyright (C) 1998 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. */ + +/* System V/ARM ABI compliant context switching support. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include +#include + +typedef int greg_t; + +/* Number of general registers. */ +#define NGREG 16 + +/* Container for all general registers. */ +typedef greg_t gregset_t[NGREG]; + +/* Number of each register is the `gregset_t' array. */ +enum +{ + R0 = 0, +#define R0 R0 + R1 = 1, +#define R1 R1 + R2 = 2, +#define R2 R2 + R3 = 3, +#define R3 R3 + R4 = 4, +#define R4 R4 + R5 = 5, +#define R5 R5 + R6 = 6, +#define R6 R6 + R7 = 7, +#define R7 R7 + R8 = 8, +#define R8 R8 + R9 = 9, +#define R9 R9 + R10 = 10, +#define R10 R10 + R11 = 11, +#define R11 R11 + R12 = 12, +#define R12 R12 + R13 = 13, +#define R13 R13 + R14 = 14, +#define R14 R14 + R15 = 15, +#define R15 R15 +}; + +/* Structure to describe FPU registers. */ +typedef struct fpregset + { + } fpregset_t; + +/* Context to describe whole processor state. */ +typedef struct + { + gregset_t gregs; + fpregset_t fpregs; + } mcontext_t; + +/* Userlevel context. */ +typedef struct ucontext + { + unsigned long int uc_flags; + struct ucontext *uc_links; + __sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + long int uc_filler[5]; + } ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile index d9d36429b7..e491fa2be4 100644 --- a/sysdeps/gnu/Makefile +++ b/sysdeps/gnu/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998 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,4 +25,6 @@ $(..)sysdeps/gnu/errlist.c: $(..)sysdeps/gnu/errlist.awk \ # Make it unwritable so noone will edit it by mistake. -chmod a-w $@-tmp mv -f $@-tmp $@ +ifeq ($(with-cvs),yes) test ! -d CVS || cvs commit -m'Regenerated from $^' $@ +endif diff --git a/sysdeps/libm-ieee754/s_exp2.c b/sysdeps/libm-ieee754/s_exp2.c index e10fae5492..fc3fd2507b 100644 --- a/sysdeps/libm-ieee754/s_exp2.c +++ b/sysdeps/libm-ieee754/s_exp2.c @@ -1,5 +1,5 @@ /* Double-precision floating point 2^x. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Geoffrey Keating @@ -54,7 +54,10 @@ __ieee754_exp2 (double x) fenv_t oldenv; feholdexcept (&oldenv); +#ifdef FE_TONEAREST + /* If we don't have this, it's too bad. */ fesetround (FE_TONEAREST); +#endif /* 1. Argument reduction. Choose integers ex, -256 <= t < 256, and some real diff --git a/sysdeps/libm-ieee754/s_exp2f.c b/sysdeps/libm-ieee754/s_exp2f.c index 92c1f16c5a..05e79c9f5a 100644 --- a/sysdeps/libm-ieee754/s_exp2f.c +++ b/sysdeps/libm-ieee754/s_exp2f.c @@ -1,5 +1,5 @@ /* Single-precision floating point 2^x. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Geoffrey Keating @@ -55,7 +55,10 @@ __ieee754_exp2f (float x) fenv_t oldenv; feholdexcept (&oldenv); +#ifdef FE_TONEAREST + /* If we don't have this, it's too bad. */ fesetround (FE_TONEAREST); +#endif /* 1. Argument reduction. Choose integers ex, -128 <= t < 128, and some real diff --git a/sysdeps/posix/ttyname.c b/sysdeps/posix/ttyname.c index 6a046ea652..5ad45ae2a6 100644 --- a/sysdeps/posix/ttyname.c +++ b/sysdeps/posix/ttyname.c @@ -55,7 +55,10 @@ getttyname (fd, mydev, myino, save, dostat) } while ((d = readdir (dirstream)) != NULL) - if ((ino_t) d->d_fileno == myino || *dostat) + if (((ino_t) d->d_fileno == myino || *dostat) + && strcmp (d->d_name, "stdin") + && strcmp (d->d_name, "stdout") + && strcmp (d->d_name, "stderr")) { size_t dlen = _D_ALLOC_NAMLEN (d); if (sizeof (dev) + dlen > namelen) diff --git a/sysdeps/posix/ttyname_r.c b/sysdeps/posix/ttyname_r.c index ad747ad35b..ae427f1aef 100644 --- a/sysdeps/posix/ttyname_r.c +++ b/sysdeps/posix/ttyname_r.c @@ -59,7 +59,10 @@ getttyname_r (fd, buf, buflen, mydev, myino, save, dostat) } while ((d = readdir (dirstream)) != NULL) - if ((ino_t) d->d_fileno == myino || *dostat) + if (((ino_t) d->d_fileno == myino || *dostat) + && strcmp (d->d_name, "stdin") + && strcmp (d->d_name, "stdout") + && strcmp (d->d_name, "stderr")) { char *cp; size_t needed = _D_EXACT_NAMLEN (d) + 1; diff --git a/sysdeps/standalone/arm/bits/errno.h b/sysdeps/standalone/arm/bits/errno.h index 373d701bc3..7d628b1a2d 100644 --- a/sysdeps/standalone/arm/bits/errno.h +++ b/sysdeps/standalone/arm/bits/errno.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1996, 1997, 1998 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 @@ -57,6 +57,7 @@ # define ENOSPC 29 # define EEXIST 30 # define EBUSY 31 +# define EOVERFLOW 32 #endif #define __set_errno(val) errno = (val) diff --git a/sysdeps/standalone/filedesc.h b/sysdeps/standalone/filedesc.h index d6a12a606a..088c3bbacb 100644 --- a/sysdeps/standalone/filedesc.h +++ b/sysdeps/standalone/filedesc.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. This file is part of the GNU C Library. @@ -26,7 +26,7 @@ #ifndef __FILEDESC_h #define __FILEDESC_h -#define _STDIO_H +#define __need_FOPEN_MAX #include #ifndef __DECLARE_FILE_DESCRIPTORS__ diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile index f8cdb0277a..4863556332 100644 --- a/sysdeps/unix/Makefile +++ b/sysdeps/unix/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 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 @@ -38,8 +38,8 @@ $(common-objpfx)bits/local_lim.h: $(common-objpfx)mk-local_lim $(common-objpfx)mk-local_lim: $(sysdep_dir)/unix/mk-local_lim.c $(common-objdir-compile) -before-compile := $(before-compile) $(common-objpfx)bits/local_lim.h -common-generated := $(common-generated) local_lim.h mk-local_lim +before-compile += $(common-objpfx)bits/local_lim.h +common-generated += bits/local_lim.h mk-local_lim endif @@ -263,8 +263,8 @@ $(common-objpfx)sys/syscall.h: $(syscall.h) > $@-tmp mv $@-tmp $@ -before-compile := $(before-compile) $(common-objpfx)syscall.h -common-generated := $(common-generated) syscall.h +before-compile += $(common-objpfx)sys/syscall.h +common-generated += sys/syscall.h endif @@ -304,7 +304,11 @@ ifndef no_deps endif endif -$(common-objpfx)s-proto.d: $(common-objpfx)%.d: $(..)sysdeps/unix/%.S +$(common-objpfx)s-proto.d: $(common-objpfx)%.d: $(..)sysdeps/unix/%.S \ + $(wildcard $(+sysdep_dirs:%=%/syscalls.list)) $(+make-deps) +common-generated += s-proto.d +postclean-generated += sysd-syscalls + endif diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c index 4837a7a128..5625c165b4 100644 --- a/sysdeps/unix/grantpt.c +++ b/sysdeps/unix/grantpt.c @@ -36,7 +36,7 @@ /* This "generic Unix" implementation works because we provide the program /usr/libexec/pt_chown, and it only depends on ptsname() working. */ static const char helper[] = LIBEXECDIR "/pt_chown"; -static const char *argv[] = { "pt_chown", NULL }; +static char *const argv[] = { "pt_chown", NULL }; int grantpt (fd) @@ -71,7 +71,7 @@ grantpt (fd) if (dup2 (fd, PTY_FD) == -1) _exit (FAIL_EBADF); - execve (helper, (char *const *) argv, 0); + execve (helper, argv, 0); _exit (FAIL_EXEC); } else diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh index f00ce5bf37..74b15231bf 100644 --- a/sysdeps/unix/make-syscalls.sh +++ b/sysdeps/unix/make-syscalls.sh @@ -64,9 +64,44 @@ EOF echo ' ret'; \\ echo 'PSEUDO_END($strong)'; \\" - # Append any weak aliases defined for this syscall function. + # Append any weak aliases or versions defined for this syscall function. + + # A shortcoming in the current gas is that it will only allow one + # version-alias per symbol. So we create new strong aliases as needed. + vcount="" + for name in $weak; do - echo " echo 'weak_alias ($strong, $name)'; \\" + case $name in + *@@*) + base=`echo $name | sed 's/@.*//'` + ver=`echo $name | sed 's/@.*//'` + if test -z "$vcount" ; then + source=$strong + vcount=1 + else + source="${strong}_${vcount}" + vcount=`expr $vcount + 1` + echo " echo 'strong_alias ($strong, $source)'; \\" + fi + echo " echo 'default_symbol_version($source, $base, $ver)'; \\" + ;; + *@*) + base=`echo $name | sed 's/@.*//'` + ver=`echo $name | sed 's/.*@//'` + if test -z "$vcount" ; then + source=$strong + vcount=1 + else + source="${strong}_${vcount}" + vcount=`expr $vcount + 1` + echo " echo 'strong_alias ($strong, $source)'; \\" + fi + echo " echo 'symbol_version($source, $base, $ver)'; \\" + ;; + *) + echo " echo 'weak_alias ($strong, $name)'; \\" + ;; + esac done # And finally, pipe this all into the compiler. diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 0dece5642a..5173b2122d 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -9,7 +9,7 @@ CPPFLAGS += -DHAVE_LLSEEK=1 endif ifeq ($(subdir),misc) -sysdep_routines += sysctl clone llseek +sysdep_routines += sysctl clone llseek getresuid getresgid sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \ sys/io.h sys/klog.h sys/kdaemon.h \ diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 3166531d2b..59c0cb8a09 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -54,6 +54,9 @@ shutdown - shutdown 2 __shutdown shutdown socketpair - socketpair 4 __socketpair socketpair sysctl - _sysctl 6 sysctl +getresuid - getresuid 3 getresuid +getresgid - getresgid 3 getresuid + # access pci space protected from machine checks: pciconfig_read EXTRA pciconfig_read 5 pciconfig_read pciconfig_write EXTRA pciconfig_write 5 pciconfig_write diff --git a/sysdeps/unix/sysv/linux/getresgid.c b/sysdeps/unix/sysv/linux/getresgid.c new file mode 100644 index 0000000000..2fe461a787 --- /dev/null +++ b/sysdeps/unix/sysv/linux/getresgid.c @@ -0,0 +1,39 @@ +/* Copyright (C) 1998 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 +#include + +#include + +extern int __syscall_getresgid (__kernel_gid_t *rgid, __kernel_gid_t *egid, + __kernel_gid_t *sgid); + +int +getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) +{ + __kernel_gid_t k_rgid, k_egid, k_sgid; + + if (__syscall_getresgid (&k_rgid, &k_egid, &k_sgid) < 0) + return -1; + + *rgid = (gid_t) k_rgid; + *egid = (gid_t) k_egid; + *sgid = (gid_t) k_sgid; + return 0; +} diff --git a/sysdeps/unix/sysv/linux/getresuid.c b/sysdeps/unix/sysv/linux/getresuid.c new file mode 100644 index 0000000000..89b8fa7cfe --- /dev/null +++ b/sysdeps/unix/sysv/linux/getresuid.c @@ -0,0 +1,39 @@ +/* Copyright (C) 1998 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 +#include + +#include + +extern int __syscall_getresuid (__kernel_uid_t *ruid, __kernel_uid_t *euid, + __kernel_uid_t *suid); + +int +getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) +{ + __kernel_uid_t k_ruid, k_euid, k_suid; + + if (__syscall_getresuid (&k_ruid, &k_euid, &k_suid) < 0) + return -1; + + *ruid = (uid_t) k_ruid; + *euid = (uid_t) k_euid; + *suid = (uid_t) k_suid; + return 0; +} diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c index 90818c1dff..6e26a5e6e2 100644 --- a/sysdeps/unix/sysv/linux/i386/sigaction.c +++ b/sysdeps/unix/sysv/linux/i386/sigaction.c @@ -1,5 +1,5 @@ /* POSIX.1 `sigaction' call for Linux/i386. - Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 1997, 1998 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 @@ -33,7 +33,7 @@ extern int __syscall_rt_sigaction (int, const struct sigaction *, /* The variable is shared between all wrappers around signal handling functions which have RT equivalents. */ -int __libc_have_rt_sigs = -1; +int __libc_missing_rt_sigs; /* If ACT is not NULL, change the action for SIG to *ACT. @@ -45,7 +45,7 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact) int result; /* First try the RT signals. */ - if (__libc_have_rt_sigs) + if (!__libc_missing_rt_sigs) { struct sigaction nact, *nactp; @@ -69,7 +69,7 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact) if (result >= 0 || errno != ENOSYS) return result; - __libc_have_rt_sigs = 0; + __libc_missing_rt_sigs = 1; } if (act) diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index d026910ee2..c00ee6bed4 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -34,6 +34,9 @@ shutdown - shutdown 2 __shutdown shutdown socket - socket 3 __socket socket socketpair - socketpair 4 __socketpair socketpair +getresuid - getresuid 3 getresuid +getresgid - getresgid 3 getresuid + # # There are defined locally because the caller is also defined in this dir. # diff --git a/sysdeps/unix/sysv/linux/powerpc/socket.S b/sysdeps/unix/sysv/linux/powerpc/socket.S index 681f7e6445..d6306bbf01 100644 --- a/sysdeps/unix/sysv/linux/powerpc/socket.S +++ b/sysdeps/unix/sysv/linux/powerpc/socket.S @@ -41,8 +41,12 @@ #define stackblock 20 +#ifndef __socket +#define __socket P(__,socket) +#endif + .text -ENTRY(P(__,socket)) +ENTRY(__socket) stwu %r1,-48(%r1) #if NARGS >= 1 stw %r3,stackblock(%r1) @@ -76,6 +80,6 @@ ENTRY(P(__,socket)) DO_CALL(SYS_ify(socketcall)) addi %r1,%r1,48 PSEUDO_RET -PSEUDO_END (P(__,socket)) +PSEUDO_END (__socket) -weak_alias (P(__,socket), socket) +weak_alias (__socket, socket) diff --git a/sysdeps/unix/sysv/linux/powerpc/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/syscalls.list index 7883d70719..c5f7725269 100644 --- a/sysdeps/unix/sysv/linux/powerpc/syscalls.list +++ b/sysdeps/unix/sysv/linux/powerpc/syscalls.list @@ -1,3 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names s_llseek llseek _llseek 5 __sys_llseek + +getresuid - getresuid 3 getresuid +getresgid - getresgid 3 getresuid diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c index 04feadd436..77b6d80ac8 100644 --- a/sysdeps/unix/sysv/linux/ptsname.c +++ b/sysdeps/unix/sysv/linux/ptsname.c @@ -31,10 +31,10 @@ #include /* Given the file descriptor of a master pty, return the pathname - of the associated slave. */ + of the associated slave. */ static char namebuf[PTYNAMELEN]; -extern const char __ptyname1[], __ptyname2[]; /* defined in getpt.c */ +extern const char __ptyname1[], __ptyname2[]; /* Defined in getpt.c. */ char * ptsname (fd) @@ -57,7 +57,7 @@ __ptsname_r (fd, buf, len) static int tiocgptn_works = 1; if (tiocgptn_works) { - if (!ioctl (fd, TIOCGPTN, &ptyno)) + if (ioctl (fd, TIOCGPTN, &ptyno) == 0) goto gotit; else { @@ -70,10 +70,12 @@ __ptsname_r (fd, buf, len) #endif /* /dev/ptmx will make it into the kernel before 32 bit dev_t, so this should be safe. */ - if (fstat (fd, &st)) + if (__fxstat (_STAT_VER, fd, &st)) return 0; ptyno = minor (st.st_rdev); + if (major (st.st_rdev) == 4) + ptyno -= 128; #ifdef TIOCGPTN gotit: @@ -82,27 +84,24 @@ gotit: the SVr4 way. */ idbuf[5] = '\0'; - stpcpy (stpcpy (nbuf, "/dev/pts/"), - _itoa_word (ptyno, &idbuf[4], 10, 0)); - if (!stat (nbuf, &st)) - { - strncpy (buf, nbuf, len); - return buf; - } + __stpcpy (__stpcpy (nbuf, "/dev/pts/"), + _itoa_word (ptyno, &idbuf[4], 10, 0)); + if (!__xstat (_STAT_VER, nbuf, &st)) + return strncpy (buf, nbuf, len); else if (errno != ENOENT) return NULL; /* ...and the BSD way. */ + nbuf[5] = 't'; nbuf[7] = 'y'; nbuf[8] = __ptyname1[ptyno / 16]; nbuf[9] = __ptyname2[ptyno % 16]; nbuf[10] = '\0'; - if (stat (nbuf, &st)) + if (__xstat (_STAT_VER, nbuf, &st)) return NULL; - strncpy (buf, nbuf, len); - return buf; + return strncpy (buf, nbuf, len); } weak_alias (__ptsname_r, ptsname_r) diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c index 6b3d69d451..510cbe7040 100644 --- a/sysdeps/unix/sysv/linux/sigaction.c +++ b/sysdeps/unix/sysv/linux/sigaction.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998 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 @@ -31,7 +31,7 @@ extern int __syscall_rt_sigaction (int, const struct sigaction *, /* The variable is shared between all wrappers around signal handling functions which have RT equivalents. */ -int __libc_have_rt_sigs = -1; +int __libc_missing_rt_sigs; /* If ACT is not NULL, change the action for SIG to *ACT. @@ -46,7 +46,7 @@ __sigaction (sig, act, oact) int error; /* First try the RT signals. */ - if (__libc_have_rt_sigs) + if (!__libc_missing_rt_sigs) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ @@ -55,7 +55,7 @@ __sigaction (sig, act, oact) if (result >= 0 || errno != ENOSYS) return result; - __libc_have_rt_sigs = 0; + __libc_missing_rt_sigs = 1; } if (act) diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c index fade020d26..4d5514a1bc 100644 --- a/sysdeps/unix/sysv/linux/sigpending.c +++ b/sysdeps/unix/sysv/linux/sigpending.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998 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 +25,8 @@ extern int __syscall_rt_sigpending (sigset_t *, size_t); /* The variable is shared between all wrappers around signal handling - functions which have RT equivalents. It is defined in sigaction.c. */ -extern int __libc_have_rt_sigs; + functions which have RT equivalents. */ +int __libc_missing_rt_sigs; /* Change the set of blocked signals to SET, @@ -36,7 +36,7 @@ sigpending (set) sigset_t *set; { /* First try the RT signals. */ - if (__libc_have_rt_sigs) + if (!__libc_missing_rt_sigs) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ @@ -45,7 +45,7 @@ sigpending (set) if (result >= 0 || errno != ENOSYS) return result; - __libc_have_rt_sigs = 0; + __libc_missing_rt_sigs = 1; } return __syscall_sigpending (set); diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c index 63889a61dd..476f46a8e6 100644 --- a/sysdeps/unix/sysv/linux/sigprocmask.c +++ b/sysdeps/unix/sysv/linux/sigprocmask.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998 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 +25,8 @@ extern int __syscall_rt_sigprocmask (int, const sigset_t *, sigset_t *, size_t); /* The variable is shared between all wrappers around signal handling - functions which have RT equivalents. It is defined in sigaction.c. */ -extern int __libc_have_rt_sigs; + functions which have RT equivalents. */ +int __libc_missing_rt_sigs; /* Get and/or change the set of blocked signals. */ @@ -37,7 +37,7 @@ __sigprocmask (how, set, oset) sigset_t *oset; { /* First try the RT signals. */ - if (__libc_have_rt_sigs) + if (!__libc_missing_rt_sigs) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ @@ -46,7 +46,7 @@ __sigprocmask (how, set, oset) if (result >= 0 || errno != ENOSYS) return result; - __libc_have_rt_sigs = 0; + __libc_missing_rt_sigs = 1; } return __syscall_sigprocmask (how, set, oset); diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c index 8d8fa8e709..197015401d 100644 --- a/sysdeps/unix/sysv/linux/sigsuspend.c +++ b/sysdeps/unix/sysv/linux/sigsuspend.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998 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 +25,8 @@ extern int __syscall_rt_sigsuspend (const sigset_t *, size_t); /* The variable is shared between all wrappers around signal handling - functions which have RT equivalents. It is defined in sigaction.c. */ -extern int __libc_have_rt_sigs; + functions which have RT equivalents. */ +int __libc_missing_rt_sigs; /* Change the set of blocked signals to SET, @@ -36,7 +36,7 @@ __sigsuspend (set) const sigset_t *set; { /* First try the RT signals. */ - if (__libc_have_rt_sigs) + if (!__libc_missing_rt_sigs) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ @@ -45,7 +45,7 @@ __sigsuspend (set) if (result >= 0 || errno != ENOSYS) return result; - __libc_have_rt_sigs = 0; + __libc_missing_rt_sigs = 1; } return __syscall_sigsuspend (0, 0, set->__val[0]); diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index 3f62a7cd53..5da202541f 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -30,3 +30,6 @@ sendto - sendto 6 __libc_sendto __sendto sendto setsockopt - setsockopt 5 __setsockopt setsockopt shutdown - shutdown 2 __shutdown shutdown socketpair - socketpair 4 __socketpair socketpair + +getresuid - getresuid 3 getresuid +getresgid - getresgid 3 getresuid diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 3f1491f7bd..6bcd6dab18 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -13,15 +13,13 @@ geteuid - geteuid 0 __geteuid geteuid getpgid - getpgid 1 __getpgid getpgid getpgrp - getpgrp 0 getpgrp getppid - getppid 0 __getppid getppid -getresgid EXTRA getresgid 3 getresgid -getresuid EXTRA getresuid 3 getresuid getsid - getsid 1 getsid init_module EXTRA init_module 5 init_module ioperm - ioperm 3 ioperm iopl - iopl 1 iopl ipc msgget ipc 5 __ipc klogctl EXTRA syslog 3 klogctl -lchown EXATR lchown 3 __lchown lchown +lchown EXTRA lchown 3 __lchown lchown mlock EXTRA mlock 2 __mlock mlock mlockall EXTRA mlockall 1 __mlockall mlockall mount EXTRA mount 5 __mount mount @@ -44,6 +42,8 @@ rt_sigsuspend - rt_sigsuspend 2 __syscall_rt_sigsuspend rt_sigtimedwait - rt_sigtimedwait 4 __syscall_rt_sigtimedwait s_getdents EXTRA getdents 3 __getdents s_getpriority getpriority getpriority 2 __syscall_getpriority +s_getresgid getresgid getresgid 3 __syscall_getresgid +s_getresuid getresuid getresuid 3 __syscall_getresuid s_poll poll poll 3 __syscall_poll s_pread64 EXTRA pread 5 __syscall_pread64 s_ptrace ptrace ptrace 4 __syscall_ptrace -- cgit 1.4.1