about summary refs log tree commit diff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
committerUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
commitdf4ef2ab9c0899b2670067cd97e58f7eb2913e00 (patch)
tree4cb343b5ba9ccdc9c0b96144412567b6a4eda0ee /sysdeps/generic
parent6f9e7002f38ae778b3ff2f586a3e5766382228e9 (diff)
downloadglibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.tar.gz
glibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.tar.xz
glibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.zip
update from main archive 960105 cvs/libc-970107 cvs/libc-970106
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/abort.c20
-rw-r--r--sysdeps/generic/gnu/types.h19
-rw-r--r--sysdeps/generic/selectbits.h29
-rw-r--r--sysdeps/generic/speed.c45
4 files changed, 75 insertions, 38 deletions
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 <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 /* 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 <abort-instr.h>
 #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 <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <termios.h>
 
 /* 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)
     {