From df4ef2ab9c0899b2670067cd97e58f7eb2913e00 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 6 Jan 1997 22:07:28 +0000 Subject: update from main archive 960105 --- sysdeps/alpha/dl-machine.h | 13 +- sysdeps/generic/abort.c | 20 ++- sysdeps/generic/gnu/types.h | 19 +-- sysdeps/generic/selectbits.h | 29 ++++ sysdeps/generic/speed.c | 45 +++--- sysdeps/i386/selectbits.h | 57 ++++++++ sysdeps/mach/sys/syscall.h | 1 + sysdeps/mach/syscall.h | 1 - sysdeps/posix/bsd_signal.c | 50 ------- sysdeps/posix/signal.c | 15 +- sysdeps/posix/sigpause.c | 5 +- sysdeps/posix/sysv_signal.c | 58 ++++++++ sysdeps/stub/libc-lock.h | 20 ++- sysdeps/stub/sigpause.c | 12 ++ sysdeps/stub/sys/syscall.h | 2 + sysdeps/stub/syscall.h | 2 - sysdeps/unix/Makefile | 15 +- sysdeps/unix/bsd/poll.c | 28 ++-- sysdeps/unix/bsd/sun/sunos4/tcsetattr.c | 29 ++-- sysdeps/unix/bsd/tcdrain.c | 28 ++-- sysdeps/unix/bsd/tcflow.c | 34 ++--- sysdeps/unix/bsd/tcflush.c | 28 ++-- sysdeps/unix/bsd/tcgetpgrp.c | 35 ++--- sysdeps/unix/bsd/tcsendbrk.c | 33 ++--- sysdeps/unix/bsd/tcsetpgrp.c | 35 ++--- sysdeps/unix/getdents.c | 28 ++-- sysdeps/unix/siglist.c | 86 ++++++----- sysdeps/unix/sysdep.h | 2 +- sysdeps/unix/sysv/getdents.c | 36 ++--- sysdeps/unix/sysv/i386/sigreturn.S | 28 ++-- sysdeps/unix/sysv/linux/Dist | 1 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/Dist | 2 + sysdeps/unix/sysv/linux/alpha/gnu/types.h | 89 ++++++++++++ sysdeps/unix/sysv/linux/alpha/ioctl-types.h | 123 ++++++++++++++++ sysdeps/unix/sysv/linux/alpha/kernel_termios.h | 18 +++ sysdeps/unix/sysv/linux/alpha/sys/acct.h | 66 +++++++++ sysdeps/unix/sysv/linux/alpha/termbits.h | 188 +++++++++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/ustat.c | 32 +++++ sysdeps/unix/sysv/linux/alpha/xmknod.c | 46 ++++++ sysdeps/unix/sysv/linux/direntry.h | 17 ++- sysdeps/unix/sysv/linux/getdents.c | 105 ++++++++++++++ sysdeps/unix/sysv/linux/gnu/types.h | 78 +++++----- sysdeps/unix/sysv/linux/ioctl-types.h | 49 ++++++- sysdeps/unix/sysv/linux/kernel_termios.h | 13 ++ sysdeps/unix/sysv/linux/net/if.h | 147 ++++++++++++++++++- sysdeps/unix/sysv/linux/netinet/in.h | 147 ++++++++++++++----- sysdeps/unix/sysv/linux/siglist.h | 84 ++++++----- sysdeps/unix/sysv/linux/sigset.h | 89 ++++++++++++ sysdeps/unix/sysv/linux/sigsuspend.c | 10 +- sysdeps/unix/sysv/linux/socketbits.h | 138 +++++++++++++++++- sysdeps/unix/sysv/linux/statfsbuf.h | 37 ++++- sysdeps/unix/sysv/linux/sys/acct.h | 35 ++++- sysdeps/unix/sysv/linux/sys/ptrace.h | 4 +- sysdeps/unix/sysv/linux/sys/syscall.h | 35 +++++ sysdeps/unix/sysv/linux/sys/sysmacros.h | 11 +- sysdeps/unix/sysv/linux/syscall.h | 35 ----- sysdeps/unix/sysv/linux/syscalls.list | 4 +- sysdeps/unix/sysv/linux/tcgetattr.c | 56 ++++++-- sysdeps/unix/sysv/linux/tcsetattr.c | 73 +++++++++- sysdeps/unix/sysv/linux/termbits.h | 161 ++++++++++++++++++++- sysdeps/unix/sysv/linux/ustat.c | 32 +++++ sysdeps/unix/sysv/linux/ustatbits.h | 29 +++- sysdeps/unix/sysv/linux/xmknod.c | 48 +++++++ sysdeps/unix/sysv/sco3.2.4/sys/syscall.h | 125 ++++++++++++++++ sysdeps/unix/sysv/sco3.2.4/syscall.h | 125 ---------------- sysdeps/unix/xmknod.c | 34 ++--- 67 files changed, 2439 insertions(+), 643 deletions(-) create mode 100644 sysdeps/generic/selectbits.h create mode 100644 sysdeps/i386/selectbits.h create mode 100644 sysdeps/mach/sys/syscall.h delete mode 100644 sysdeps/mach/syscall.h delete mode 100644 sysdeps/posix/bsd_signal.c create mode 100644 sysdeps/posix/sysv_signal.c create mode 100644 sysdeps/stub/sys/syscall.h delete mode 100644 sysdeps/stub/syscall.h create mode 100644 sysdeps/unix/sysv/linux/alpha/gnu/types.h create mode 100644 sysdeps/unix/sysv/linux/alpha/ioctl-types.h create mode 100644 sysdeps/unix/sysv/linux/alpha/kernel_termios.h create mode 100644 sysdeps/unix/sysv/linux/alpha/sys/acct.h create mode 100644 sysdeps/unix/sysv/linux/alpha/termbits.h create mode 100644 sysdeps/unix/sysv/linux/alpha/ustat.c create mode 100644 sysdeps/unix/sysv/linux/alpha/xmknod.c create mode 100644 sysdeps/unix/sysv/linux/getdents.c create mode 100644 sysdeps/unix/sysv/linux/kernel_termios.h create mode 100644 sysdeps/unix/sysv/linux/sigset.h create mode 100644 sysdeps/unix/sysv/linux/sys/syscall.h delete mode 100644 sysdeps/unix/sysv/linux/syscall.h create mode 100644 sysdeps/unix/sysv/linux/ustat.c create mode 100644 sysdeps/unix/sysv/linux/xmknod.c create mode 100644 sysdeps/unix/sysv/sco3.2.4/sys/syscall.h delete mode 100644 sysdeps/unix/sysv/sco3.2.4/syscall.h (limited to 'sysdeps') diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index 78c5071b4e..1d01f035ea 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Alpha version. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson . @@ -14,9 +14,9 @@ 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. */ + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* This was written in the absence of an ABI -- don't expect it to remain unchanged. */ @@ -43,7 +43,12 @@ elf_machine_matches_host (Elf64_Word e_machine) static inline Elf64_Addr elf_machine_dynamic (void) { +#ifdef AXP_MULTI_GOT_LD return (Elf64_Addr) &_DYNAMIC; +#else + register Elf64_Addr *gp __asm__ ("$29"); + return gp[-4096]; +#endif } /* Return the run-time load address of the shared object. */ diff --git a/sysdeps/generic/abort.c b/sysdeps/generic/abort.c index 366a543791..14c182b411 100644 --- a/sysdeps/generic/abort.c +++ b/sysdeps/generic/abort.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,11 +20,12 @@ #include #include #include +#include #include /* Try to get a machine dependent instruction which will make the program crash. This is used in case everything else fails. */ -#include "abort-instr.h" +#include #ifndef ABORT_INSTRUCTION /* No such instruction is available. */ # define ABORT_INSTRUCTION @@ -46,7 +47,7 @@ abort (void) sigset_t sigs; /* First acquire the lock. */ - __libc_lock_lock (lock); + __libc_lock_lock_recursive (lock); /* Now it's for sure we are alone. But recursive calls are possible. */ @@ -70,8 +71,19 @@ abort (void) /* Send signal which possibly calls a user handler. */ if (stage == 2) { - ++stage; + /* This stage is special: we must allow repeated calls of + `abort' when a user defined handler for SIGABRT is installed. + This is risky since the `raise' implementation might also + fail but I don't see another possiblity. */ + int save_stage = stage; + + stage = 0; + __libc_lock_unlock_recursive (lock); + raise (SIGABRT); + + __libc_lock_lock_recursive (lock); + stage = save_stage + 1; } /* There was a handler installed. Now remove it. */ diff --git a/sysdeps/generic/gnu/types.h b/sysdeps/generic/gnu/types.h index acd817bcab..85f17a4fb1 100644 --- a/sysdeps/generic/gnu/types.h +++ b/sysdeps/generic/gnu/types.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 94, 95, 96, 97 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,17 +29,17 @@ typedef unsigned long __u_long; #ifdef __GNUC__ typedef unsigned long long int __u_quad_t; typedef long long int __quad_t; -typedef __quad_t *__qaddr_t; #else typedef struct { - long val[2]; + long __val[2]; } __quad_t; typedef struct { - __u_long val[2]; + __u_long __val[2]; } __u_quad_t; #endif +typedef __quad_t *__qaddr_t; typedef int __dev_t; /* Type of device numbers. */ typedef unsigned int __uid_t; /* Type of user identifications. */ typedef unsigned int __gid_t; /* Type of group identifications. */ @@ -72,17 +72,10 @@ typedef long int __key_t; /* Type of an IPC key */ typedef struct { - /* Some braindead old software uses this member name. */ + /* XPG4.2 requires this member name. */ unsigned long int fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS]; } __fd_set; -typedef unsigned long __fd_mask; - -/* This line MUST be split! Otherwise m4 will not change it. */ -#define __FD_ZERO(set) \ - ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) -#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) +typedef unsigned long int __fd_mask; #endif /* gnu/types.h */ diff --git a/sysdeps/generic/selectbits.h b/sysdeps/generic/selectbits.h new file mode 100644 index 0000000000..e2bdf6049e --- /dev/null +++ b/sysdeps/generic/selectbits.h @@ -0,0 +1,29 @@ +/* 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 _SELECTBITS_H +#define _SELECTBITS_H 1 + +/* This line MUST be split! Otherwise m4 will not change it. */ +#define __FD_ZERO(set) \ + ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) +#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) +#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) +#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) + +#endif /* selectbits.h */ diff --git a/sysdeps/generic/speed.c b/sysdeps/generic/speed.c index 229c0665e2..52e89508c0 100644 --- a/sysdeps/generic/speed.c +++ b/sysdeps/generic/speed.c @@ -1,45 +1,47 @@ /* `struct termios' speed frobnication functions. 4.4 BSD/generic GNU version. -Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #include #include /* Return the output baud rate stored in *TERMIOS_P. */ speed_t -DEFUN(cfgetospeed, (termios_p), CONST struct termios *termios_p) +cfgetospeed (termios_p) + const struct termios *termios_p; { return termios_p->__ospeed; } /* Return the input baud rate stored in *TERMIOS_P. */ speed_t -DEFUN(cfgetispeed, (termios_p), CONST struct termios *termios_p) +cfgetispeed (termios_p) + const struct termios *termios_p; { return termios_p->__ispeed; } /* Set the output baud rate stored in *TERMIOS_P to SPEED. */ int -DEFUN(cfsetospeed, (termios_p, speed), - struct termios *termios_p AND speed_t speed) +cfsetospeed (termios_p, speed) + struct termios *termios_p; + speed_t speed; { if (termios_p == NULL) { @@ -53,8 +55,9 @@ DEFUN(cfsetospeed, (termios_p, speed), /* Set the input baud rate stored in *TERMIOS_P to SPEED. */ int -DEFUN(cfsetispeed, (termios_p, speed), - struct termios *termios_p AND speed_t speed) +cfsetispeed (termios_p, speed) + struct termios *termios_p; + speed_t speed; { if (termios_p == NULL) { diff --git a/sysdeps/i386/selectbits.h b/sysdeps/i386/selectbits.h new file mode 100644 index 0000000000..973ecad58e --- /dev/null +++ b/sysdeps/i386/selectbits.h @@ -0,0 +1,57 @@ +/* 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 _SELECTBITS_H +#define _SELECTBITS_H 1 + +#if defined __GNUC__ && __GNUC__ >= 2 + +#define __FD_ZERO(fdsetp) \ + __asm__ __volatile__ ("cld ; rep ; stosl" \ + : "=m" (*(__fd_set *) (fdsetp)) \ + : "a" (0), "c" (sizeof (__fd_set) \ + / sizeof (__fd_mask)), \ + "D" ((__fd_set *) (fdsetp)) \ + :"cx","di") +#define __FD_SET(fd, fdsetp) \ + __asm__ __volatile__ ("btsl %1,%0" \ + : "=m" (*(__fd_set *) (fdsetp)) \ + : "r" ((int) (fd))) +#define __FD_CLR(fd, fdsetp) \ + __asm__ __volatile__ ("btrl %1,%0" \ + : "=m" (*(__fd_set *) (fdsetp)) \ + : "r" ((int) (fd))) +#define __FD_ISSET(fd, fdsetp) \ + (__extension__ \ + ({unsigned char __result; \ + __asm__ __volatile__ ("btl %1,%2 ; setb %0" \ + : "=q" (__result) \ + : "r" ((int) (fd)), "m" (*(__fd_set *) (fdsetp))); \ + __result; })) + +#else /* ! GNU CC */ + +#define __FD_ZERO(set) \ + ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set))) +#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) +#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) +#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) + +#endif /* GNU CC */ + +#endif /* selectbits.h */ diff --git a/sysdeps/mach/sys/syscall.h b/sysdeps/mach/sys/syscall.h new file mode 100644 index 0000000000..6e4ed4d64e --- /dev/null +++ b/sysdeps/mach/sys/syscall.h @@ -0,0 +1 @@ +/* The Mach syscalls are in . */ diff --git a/sysdeps/mach/syscall.h b/sysdeps/mach/syscall.h deleted file mode 100644 index 6e4ed4d64e..0000000000 --- a/sysdeps/mach/syscall.h +++ /dev/null @@ -1 +0,0 @@ -/* The Mach syscalls are in . */ diff --git a/sysdeps/posix/bsd_signal.c b/sysdeps/posix/bsd_signal.c deleted file mode 100644 index 4941485c0d..0000000000 --- a/sysdeps/posix/bsd_signal.c +++ /dev/null @@ -1,50 +0,0 @@ -/* X/Open compatibility function. - Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include -#include - - -sigset_t _sigintr; /* Set by siginterrupt. */ - -/* Set the handler for the signal SIG to HANDLER, - returning the old handler, or SIG_ERR on error. */ -__sighandler_t -bsd_signal (sig, handler) - int sig; - __sighandler_t handler; -{ - struct sigaction act, oact; - - /* Check signal extents to protect __sigismember. */ - if (handler == SIG_ERR || sig < 1 || sig >= NSIG) - { - __set_errno (EINVAL); - return SIG_ERR; - } - - act.sa_handler = handler; - if (__sigemptyset (&act.sa_mask) < 0) - return SIG_ERR; - act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART; - if (__sigaction (sig, &act, &oact) < 0) - return SIG_ERR; - - return oact.sa_handler; -} diff --git a/sysdeps/posix/signal.c b/sysdeps/posix/signal.c index 25e7cab617..2e0cf64de3 100644 --- a/sysdeps/posix/signal.c +++ b/sysdeps/posix/signal.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. +/* BSD-like signal function. + Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,10 +21,12 @@ #include +sigset_t _sigintr; /* Set by siginterrupt. */ + /* Set the handler for the signal SIG to HANDLER, returning the old handler, or SIG_ERR on error. */ __sighandler_t -signal (sig, handler) +__bsd_signal (sig, handler) int sig; __sighandler_t handler; { @@ -39,12 +42,12 @@ signal (sig, handler) act.sa_handler = handler; if (__sigemptyset (&act.sa_mask) < 0) return SIG_ERR; - act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT; - act.sa_flags &= ~SA_RESTART; + act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART; if (__sigaction (sig, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; } - -weak_alias (signal, ssignal) +weak_alias (__bsd_signal, bsd_signal) +weak_alias (__bsd_signal, signal) +weak_alias (__bsd_signal, ssignal) diff --git a/sysdeps/posix/sigpause.c b/sysdeps/posix/sigpause.c index 8b820ecad9..414019a40d 100644 --- a/sysdeps/posix/sigpause.c +++ b/sysdeps/posix/sigpause.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 @@ __sigpause (sig_or_mask, is_sig) { /* The modern X/Open implementation is requested. */ if (sigprocmask (0, NULL, &set) < 0 - /* Yes, we call `sigaddset' and not `__sigaddset'. */ + /* Yes, we call `sigdelset' and not `__sigdelset'. */ || sigdelset (&set, sig_or_mask) < 0) return -1; } @@ -66,4 +66,5 @@ __default_sigpause (mask) { return __sigpause (mask, 0); } +#undef sigpause weak_alias (__default_sigpause, sigpause) diff --git a/sysdeps/posix/sysv_signal.c b/sysdeps/posix/sysv_signal.c new file mode 100644 index 0000000000..2b6d5f9d56 --- /dev/null +++ b/sysdeps/posix/sysv_signal.c @@ -0,0 +1,58 @@ +/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +/* Tolerate non-threads versions of Posix */ +#ifndef SA_ONESHOT +#define SA_ONESHOT 0 +#endif +#ifndef SA_NOMASK +#define SA_NOMASK 0 +#endif +#ifndef SA_INTERRUPT +#define SA_INTERRUPT 0 +#endif + +/* Set the handler for the signal SIG to HANDLER, + returning the old handler, or SIG_ERR on error. */ +__sighandler_t +__sysv_signal (sig, handler) + int sig; + __sighandler_t handler; +{ + struct sigaction act, oact; + + /* Check signal extents to protect __sigismember. */ + if (handler == SIG_ERR || sig < 1 || sig >= NSIG) + { + __set_errno (EINVAL); + return SIG_ERR; + } + + act.sa_handler = handler; + if (__sigemptyset (&act.sa_mask) < 0) + return SIG_ERR; + act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT; + act.sa_flags &= ~SA_RESTART; + if (__sigaction (sig, &act, &oact) < 0) + return SIG_ERR; + + return oact.sa_handler; +} diff --git a/sysdeps/stub/libc-lock.h b/sysdeps/stub/libc-lock.h index 63ea622cc4..724b6e59d4 100644 --- a/sysdeps/stub/libc-lock.h +++ b/sysdeps/stub/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. Stub version. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,6 +33,10 @@ /* Define an initialized lock variable NAME with storage class CLASS. */ #define __libc_lock_define_initialized(CLASS,NAME) +/* Define an initialized recursive lock variable NAME with storage + class CLASS. */ +#define __libc_lock_define_initialized_recursive(CLASS,NAME) + /* Initialize the named lock variable, leaving it in a consistent, unlocked state. */ #define __libc_lock_init(NAME) @@ -45,15 +49,27 @@ called on a lock variable before the containing storage is reused. */ #define __libc_lock_fini(NAME) +/* Finalize recursive named lock. */ +#define __libc_lock_fini_recursive(NAME) + /* Lock the named lock variable. */ #define __libc_lock_lock(NAME) -/* Try tp lock the named lock variable. */ +/* Lock the recursive named lock variable. */ +#define __libc_lock_lock_recursive(NAME) + +/* Try to lock the named lock variable. */ #define __libc_lock_trylock(NAME) 0 +/* Try to lock the recursive named lock variable. */ +#define __libc_lock_trylock_recursive(NAME) 0 + /* Unlock the named lock variable. */ #define __libc_lock_unlock(NAME) +/* Unlock the recursive named lock variable. */ +#define __libc_lock_unlock_recursive(NAME) + /* Start critical region with cleanup. */ #define __libc_cleanup_region_start(FCT, ARG) diff --git a/sysdeps/stub/sigpause.c b/sysdeps/stub/sigpause.c index 5e68899ed8..3525e3536f 100644 --- a/sysdeps/stub/sigpause.c +++ b/sysdeps/stub/sigpause.c @@ -28,3 +28,15 @@ __sigpause (sig_or_mask, is_sig) return -1; } stub_warning (__sigpause) + + +int __default_sigpause __P ((int mask)); +int +__default_sigpause (mask) + int mask; +{ + __set_errno (ENOSYS); + return -1; +} +weak_alias (__default_sigpause, sigpause) +stub_warning (sigpause) diff --git a/sysdeps/stub/sys/syscall.h b/sysdeps/stub/sys/syscall.h new file mode 100644 index 0000000000..719bd08904 --- /dev/null +++ b/sysdeps/stub/sys/syscall.h @@ -0,0 +1,2 @@ +/* For Unix-like systems, this file should contain definitions + of macros SYS_call for each system call, giving the call numbers. */ diff --git a/sysdeps/stub/syscall.h b/sysdeps/stub/syscall.h deleted file mode 100644 index 719bd08904..0000000000 --- a/sysdeps/stub/syscall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* For Unix-like systems, this file should contain definitions - of macros SYS_call for each system call, giving the call numbers. */ diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile index a7bfa39c27..15993b34ac 100644 --- a/sysdeps/unix/Makefile +++ b/sysdeps/unix/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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 @@ -12,9 +12,9 @@ # Library General Public License for more details. # You should have received a copy of the GNU Library General Public -# License along with the GNU C Library; see the file COPYING.LIB. If -# not, write to the Free Software Foundation, Inc., 675 Mass Ave, -# Cambridge, MA 02139, USA. +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. # The unix-specific configure fragment writes `unix-generated' in config.make. config-generated := $(config-generated) $(unix-generated) @@ -227,9 +227,9 @@ endif endif # stdio-common ifeq (,$(filter-out $(sysdep_dir)/stub/ $(common-objpfx),\ - $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/syscall.h)))))) + $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/sys/syscall.h)))))) -# The syscall code assumes a file that defines macros +# The syscall code assumes a file that defines macros # `SYS_call' for syscall `call'. Variations on this I have seen include: # it's in ; # it's in ; @@ -246,7 +246,8 @@ syscall.h := $(firstword $(wildcard $(addprefix $(sysincludedir)/, \ ifdef syscall.h # Transmogrify any of several formats of the file into the one we want. -$(common-objpfx)syscall.h: $(syscall.h) +$(common-objpfx)sys/syscall.h: $(syscall.h) + -mkdir $(common-objpfx)sys tr '[A-Z]' '[a-z]' < $< | \ sed -e 's/[ ]sys_/ /' \ -e 's/^#define[ ]*\([a-z0-9_]*\)[ ]*/#define SYS_\1 /' \ diff --git a/sysdeps/unix/bsd/poll.c b/sysdeps/unix/bsd/poll.c index 4cccfe3b35..972cd011f1 100644 --- a/sysdeps/unix/bsd/poll.c +++ b/sysdeps/unix/bsd/poll.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c b/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c index f825d41ab8..da30f7b4c2 100644 --- a/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c +++ b/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c @@ -1,23 +1,22 @@ -/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include -#include #include #include diff --git a/sysdeps/unix/bsd/tcdrain.c b/sysdeps/unix/bsd/tcdrain.c index 84bc06813d..1620eeda89 100644 --- a/sysdeps/unix/bsd/tcdrain.c +++ b/sysdeps/unix/bsd/tcdrain.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* 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 free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/unix/bsd/tcflow.c b/sysdeps/unix/bsd/tcflow.c index 04895a0648..e21efcabb8 100644 --- a/sysdeps/unix/bsd/tcflow.c +++ b/sysdeps/unix/bsd/tcflow.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ +/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/unix/bsd/tcflush.c b/sysdeps/unix/bsd/tcflush.c index 9806aaf435..3a88191d0c 100644 --- a/sysdeps/unix/bsd/tcflush.c +++ b/sysdeps/unix/bsd/tcflush.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/unix/bsd/tcgetpgrp.c b/sysdeps/unix/bsd/tcgetpgrp.c index b41f005375..afa24fbd31 100644 --- a/sysdeps/unix/bsd/tcgetpgrp.c +++ b/sysdeps/unix/bsd/tcgetpgrp.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -24,10 +23,12 @@ Cambridge, MA 02139, USA. */ /* Return the foreground process group ID of FD. */ pid_t -DEFUN(tcgetpgrp, (fd), int fd) +tcgetpgrp (fd) + int fd; { int pgrp; - if (__ioctl(fd, TIOCGPGRP, &pgrp) < 0) + + if (__ioctl (fd, TIOCGPGRP, &pgrp) < 0) return (pid_t) -1; return (pid_t) pgrp; } diff --git a/sysdeps/unix/bsd/tcsendbrk.c b/sysdeps/unix/bsd/tcsendbrk.c index 574f442b7b..8e63163af1 100644 --- a/sysdeps/unix/bsd/tcsendbrk.c +++ b/sysdeps/unix/bsd/tcsendbrk.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -29,7 +28,9 @@ Cambridge, MA 02139, USA. */ /* Send zero bits on FD. */ int -DEFUN(tcsendbreak, (fd, duration), int fd AND int duration) +tcsendbreak (fd, duration) + int fd; + int duration; { struct timeval delay; diff --git a/sysdeps/unix/bsd/tcsetpgrp.c b/sysdeps/unix/bsd/tcsetpgrp.c index e5da8b3f8c..cfb695a4f1 100644 --- a/sysdeps/unix/bsd/tcsetpgrp.c +++ b/sysdeps/unix/bsd/tcsetpgrp.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -24,7 +23,9 @@ Cambridge, MA 02139, USA. */ /* Set the foreground process group ID of FD set PGRP_ID. */ int -DEFUN(tcsetpgrp, (fd, pgrp_id), int fd AND pid_t pgrp_id) +tcsetpgrp (fd, pgrp_id) + int fd; + pid_t pgrp_id; { - return __ioctl(fd, TIOCSPGRP, &pgrp_id); + return __ioctl (fd, TIOCSPGRP, &pgrp_id); } diff --git a/sysdeps/unix/getdents.c b/sysdeps/unix/getdents.c index 6dec0dc5b5..e356e96d71 100644 --- a/sysdeps/unix/getdents.c +++ b/sysdeps/unix/getdents.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/unix/siglist.c b/sysdeps/unix/siglist.c index c904e7f38d..4e69530715 100644 --- a/sysdeps/unix/siglist.c +++ b/sysdeps/unix/siglist.c @@ -1,4 +1,21 @@ -#include +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is 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 #ifndef HAVE_GNU_LD @@ -7,40 +24,39 @@ /* This is a list of all known signal numbers. */ -CONST char *CONST _sys_siglist[] = +const char *const _sys_siglist[] = { - "Signal 0", - "Hangup", - "Interrupt", - "Quit", - "Illegal instruction", - "Trace/BPT trap", - "IOT trap", - "EMT trap", - "Floating point exception", - "Killed", - "Bus error", - "Segmentation fault", - "Bad system call", - "Broken pipe", - "Alarm clock", - "Terminated", - "Urgent I/O condition", - "Stopped (signal)", - "Stopped", - "Continued", - "Child exited", - "Stopped (tty input)", - "Stopped (tty output)", - "I/O possible", - "Cputime limit exceeded", - "Filesize limit exceeded", - "Virtual timer expired", - "Profiling timer expired", - "Window changed", - "Resource lost", - "User defined signal 1", - "User defined signal 2", + N_("Signal 0"), + N_("Hangup"), + N_("Interrupt"), + N_("Quit"), + N_("Illegal instruction"), + N_("Trace/BPT trap"), + N_("IOT trap"), + N_("EMT trap"), + N_("Floating point exception"), + N_("Killed"), + N_("Bus error"), + N_("Segmentation fault"), + N_("Bad system call"), + N_("Broken pipe"), + N_("Alarm clock"), + N_("Terminated"), + N_("Urgent I/O condition"), + N_("Stopped (signal)"), + N_("Stopped"), + N_("Continued"), + N_("Child exited"), + N_("Stopped (tty input)"), + N_("Stopped (tty output)"), + N_("I/O possible"), + N_("Cputime limit exceeded"), + N_("Filesize limit exceeded"), + N_("Virtual timer expired"), + N_("Profiling timer expired"), + N_("Window changed"), + N_("Resource lost"), + N_("User defined signal 1"), + N_("User defined signal 2"), NULL }; - diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h index f18b2656b1..dc8c0b34d2 100644 --- a/sysdeps/unix/sysdep.h +++ b/sysdeps/unix/sysdep.h @@ -18,7 +18,7 @@ #include -#include +#include #define HAVE_SYSCALLS /* Note that using a `PASTE' macro loses. */ diff --git a/sysdeps/unix/sysv/getdents.c b/sysdeps/unix/sysv/getdents.c index bb6c812647..109f29a2b1 100644 --- a/sysdeps/unix/sysv/getdents.c +++ b/sysdeps/unix/sysv/getdents.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1993, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -25,8 +24,11 @@ Cambridge, MA 02139, USA. */ extern int __getdents __P ((int fd, char *buf, size_t nbytes)); int -DEFUN(__getdirentries, (fd, buf, nbytes, basep), - int fd AND char *buf AND size_t nbytes AND off_t *basep) +__getdirentries (fd, buf, nbytes, basep) + int fd; + char *buf; + size_t nbytes; + off_t *basep; { if (basep) *basep = __lseek (fd, (off_t) 0, SEEK_CUR); diff --git a/sysdeps/unix/sysv/i386/sigreturn.S b/sysdeps/unix/sysv/i386/sigreturn.S index be1c6b89bf..8477bbd075 100644 --- a/sysdeps/unix/sysv/i386/sigreturn.S +++ b/sysdeps/unix/sysv/i386/sigreturn.S @@ -1,20 +1,20 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist index 425fb589f7..766d96a110 100644 --- a/sysdeps/unix/sysv/linux/Dist +++ b/sysdeps/unix/sysv/linux/Dist @@ -1,4 +1,5 @@ init-first.h +kernel_termios.h llseek.c siglist.h sysctl.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index c03d966a61..97fb5f14a5 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -13,7 +13,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \ sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h # Generate the list of SYS_* macros for the system calls (__NR_* macros). -$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/syscall.h +$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h rm -f $(@:.h=.d) echo > $(@:.d=.h).new \ '/* Generated at libc build time from kernel syscall list. */' diff --git a/sysdeps/unix/sysv/linux/alpha/Dist b/sysdeps/unix/sysv/linux/alpha/Dist index d898d041a2..a15f181ff6 100644 --- a/sysdeps/unix/sysv/linux/alpha/Dist +++ b/sysdeps/unix/sysv/linux/alpha/Dist @@ -4,3 +4,5 @@ ioperm.c init-first.h clone.S sys/io.h +kernel_termios.h +sys/acct.h diff --git a/sysdeps/unix/sysv/linux/alpha/gnu/types.h b/sysdeps/unix/sysv/linux/alpha/gnu/types.h new file mode 100644 index 0000000000..5c1e407423 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/gnu/types.h @@ -0,0 +1,89 @@ +/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 _GNU_TYPES_H +#define _GNU_TYPES_H 1 + +#include + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short __u_short; +typedef unsigned int __u_int; +typedef unsigned long __u_long; +#ifdef __GNUC__ +typedef unsigned long long int __u_quad_t; +typedef long long int __quad_t; +#else +typedef struct + { + long int __val[2]; + } __quad_t; +typedef struct + { + __u_long __val[2]; + } __u_quad_t; +#endif +typedef __quad_t *__qaddr_t; + +typedef __u_long __dev_t; /* Type of device numbers. */ +typedef __u_int __uid_t; /* Type of user identifications. */ +typedef __u_int __gid_t; /* Type of group identifications. */ +typedef __u_int __ino_t; /* Type of file serial numbers. */ +typedef __u_int __mode_t; /* Type of file attribute bitmasks. */ +typedef __u_int __nlink_t; /* Type of file link counts. */ +typedef long int __off_t; /* Type of file sizes and offsets. */ +typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ +typedef int __pid_t; /* Type of process identifications. */ +typedef long int __ssize_t; /* Type of a byte count, or error. */ + +typedef struct + { + int __val[2]; + } __fsid_t; /* Type of file system IDs. */ + +/* Everythin' else. */ +typedef int __daddr_t; /* The type of a disk address. */ +typedef char *__caddr_t; +typedef long int __time_t; +typedef long int __swblk_t; /* Type of a swap block maybe? */ + +typedef long int __clock_t; + +/* One element in the file descriptor mask array. */ +typedef unsigned int __fd_mask; + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + +/* 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)) + +/* fd_set for select and pselect. */ +typedef struct + { + /* XPG4.2 requires this member name. */ + __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; + } __fd_set; + + +typedef int __key_t; + +#endif /* gnu/types.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/ioctl-types.h b/sysdeps/unix/sysv/linux/alpha/ioctl-types.h new file mode 100644 index 0000000000..c51310f4cd --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/ioctl-types.h @@ -0,0 +1,123 @@ +/* Structure types for pre-termios terminal ioctls. Linux version. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is 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 _IOCTL_TYPES_H +#define _IOCTL_TYPES_H 1 + +/* Get definition of constants for use with `ioctl'. */ +#include + + +#define FIOCLEX _IO('f', 1) +#define FIONCLEX _IO('f', 2) +#define FIOASYNC _IOW('f', 125, int) +#define FIONBIO _IOW('f', 126, int) +#define FIONREAD _IOR('f', 127, int) +#define TIOCINQ FIONREAD + +#define TIOCGETP _IOR('t', 8, struct sgttyb) +#define TIOCSETP _IOW('t', 9, struct sgttyb) +#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */ + +#define TIOCSETC _IOW('t', 17, struct tchars) +#define TIOCGETC _IOR('t', 18, struct tchars) +#define TCGETS _IOR('t', 19, struct termios) +#define TCSETS _IOW('t', 20, struct termios) +#define TCSETSW _IOW('t', 21, struct termios) +#define TCSETSF _IOW('t', 22, struct termios) + +#define TCGETA _IOR('t', 23, struct termio) +#define TCSETA _IOW('t', 24, struct termio) +#define TCSETAW _IOW('t', 25, struct termio) +#define TCSETAF _IOW('t', 28, struct termio) + +#define TCSBRK _IO('t', 29) +#define TCXONC _IO('t', 30) +#define TCFLSH _IO('t', 31) + +#define TIOCSWINSZ _IOW('t', 103, struct winsize) +#define TIOCGWINSZ _IOR('t', 104, struct winsize) +#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ +#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ +#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ + +#define TIOCGLTC _IOR('t', 116, struct ltchars) +#define TIOCSLTC _IOW('t', 117, struct ltchars) +#define TIOCSPGRP _IOW('t', 118, int) +#define TIOCGPGRP _IOR('t', 119, int) + +#define TIOCEXCL 0x540C +#define TIOCNXCL 0x540D +#define TIOCSCTTY 0x540E + +#define TIOCSTI 0x5412 +#define TIOCMGET 0x5415 +#define TIOCMBIS 0x5416 +#define TIOCMBIC 0x5417 +#define TIOCMSET 0x5418 +# define TIOCM_LE 0x001 +# define TIOCM_DTR 0x002 +# define TIOCM_RTS 0x004 +# define TIOCM_ST 0x008 +# define TIOCM_SR 0x010 +# define TIOCM_CTS 0x020 +# define TIOCM_CAR 0x040 +# define TIOCM_RNG 0x080 +# define TIOCM_DSR 0x100 +# define TIOCM_CD TIOCM_CAR +# define TIOCM_RI TIOCM_RNG + +#define TIOCGSOFTCAR 0x5419 +#define TIOCSSOFTCAR 0x541A +#define TIOCLINUX 0x541C +#define TIOCCONS 0x541D +#define TIOCGSERIAL 0x541E +#define TIOCSSERIAL 0x541F +#define TIOCPKT 0x5420 +# define TIOCPKT_DATA 0 +# define TIOCPKT_FLUSHREAD 1 +# define TIOCPKT_FLUSHWRITE 2 +# define TIOCPKT_STOP 4 +# define TIOCPKT_START 8 +# define TIOCPKT_NOSTOP 16 +# define TIOCPKT_DOSTOP 32 + + +#define TIOCNOTTY 0x5422 +#define TIOCSETD 0x5423 +#define TIOCGETD 0x5424 +#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ +#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ + +#define TIOCSERCONFIG 0x5453 +#define TIOCSERGWILD 0x5454 +#define TIOCSERSWILD 0x5455 +#define TIOCGLCKTRMIOS 0x5456 +#define TIOCSLCKTRMIOS 0x5457 +#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ +#define TIOCSERGETLSR 0x5459 /* Get line status register */ + /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ +# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ +#define TIOCSERGETMULTI 0x545A /* Get multiport config */ +#define TIOCSERSETMULTI 0x545B /* Set multiport config */ + +#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ +#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ + +#endif /* ioctl-types.h */ diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_termios.h b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h new file mode 100644 index 0000000000..cb030e4de4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h @@ -0,0 +1,18 @