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/generic/abort.c | 20 ++++++++++++++++---- sysdeps/generic/gnu/types.h | 19 ++++++------------- sysdeps/generic/selectbits.h | 29 ++++++++++++++++++++++++++++ sysdeps/generic/speed.c | 45 +++++++++++++++++++++++--------------------- 4 files changed, 75 insertions(+), 38 deletions(-) create mode 100644 sysdeps/generic/selectbits.h (limited to 'sysdeps/generic') 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) { -- cgit 1.4.1