about summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/pwrite.c3
-rw-r--r--sysdeps/posix/sigblock.c6
-rw-r--r--sysdeps/posix/sigsetmask.c6
-rw-r--r--sysdeps/posix/sigvec.c10
4 files changed, 14 insertions, 11 deletions
diff --git a/sysdeps/posix/pwrite.c b/sysdeps/posix/pwrite.c
index 65806a2e68..ef4a021881 100644
--- a/sysdeps/posix/pwrite.c
+++ b/sysdeps/posix/pwrite.c
@@ -54,4 +54,7 @@ __pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
 
   return result;
 }
+
+#ifndef __pwrite
 weak_alias (__pwrite, pwrite)
+#endif
diff --git a/sysdeps/posix/sigblock.c b/sysdeps/posix/sigblock.c
index 777710b08a..efc559dcbc 100644
--- a/sysdeps/posix/sigblock.c
+++ b/sysdeps/posix/sigblock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 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
@@ -35,7 +35,7 @@ __sigblock (mask)
   else if (sizeof (unsigned long int) == sizeof (set))
     *(unsigned long int *) &set = (unsigned int) mask;
   else
-    for (sig = 1; sig < NSIG; ++sig)
+    for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; ++sig)
       if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0)
 	return -1;
 
@@ -47,7 +47,7 @@ __sigblock (mask)
   else if (sizeof (unsigned long int) == sizeof (oset))
     mask = *(unsigned long int*) &oset;
   else
-    for (sig = 1, mask = 0; sig < NSIG; ++sig)
+    for (sig = 1, mask = 0; sig < NSIG && sig <= sizeof (mask) * 8; ++sig)
       if (__sigismember (&oset, sig))
 	mask |= sigmask (sig);
 
diff --git a/sysdeps/posix/sigsetmask.c b/sysdeps/posix/sigsetmask.c
index 034719870d..fbbdafa3c9 100644
--- a/sysdeps/posix/sigsetmask.c
+++ b/sysdeps/posix/sigsetmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 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
@@ -34,7 +34,7 @@ __sigsetmask (int mask)
   else if (sizeof (unsigned long int) == sizeof (set))
     *(unsigned long int *) &set = (unsigned int) mask;
   else
-    for (sig = 1; sig < NSIG; ++sig)
+    for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; ++sig)
       if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0)
 	return -1;
 
@@ -46,7 +46,7 @@ __sigsetmask (int mask)
   else if (sizeof (unsigned long int) == sizeof (oset))
     mask = *(unsigned long int *) &oset;
   else
-    for (sig = 1, mask = 0; sig < NSIG; ++sig)
+    for (sig = 1, mask = 0; sig < NSIG && sig <= sizeof (mask) * 8; ++sig)
       if (__sigismember (&oset, sig))
 	mask |= sigmask (sig);
 
diff --git a/sysdeps/posix/sigvec.c b/sysdeps/posix/sigvec.c
index 59d30f2d29..12285fad66 100644
--- a/sysdeps/posix/sigvec.c
+++ b/sysdeps/posix/sigvec.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
@@ -62,7 +62,7 @@ convert_mask (set, mask)
       if (__sigemptyset (set) < 0)
 	return -1;
 
-      for (sig = 1; sig < NSIG; ++sig)
+      for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; ++sig)
 	if ((mask & sigmask (sig)) && __sigaddset (set, sig) < 0)
 	  return -1;
     }
@@ -138,9 +138,9 @@ __sigvec (sig, vec, ovec)
       else if (sizeof (unsigned long int) == sizeof (sigset_t))
 	mask = *(unsigned long int *) &old.sa_mask;
       else
-	for (i = 1; i < NSIG; ++i)
-	  if (__sigismember(&old.sa_mask, i))
-	    mask |= sigmask(i);
+	for (i = 1; i < NSIG && i <= sizeof (mask) * 8; ++i)
+	  if (__sigismember (&old.sa_mask, i))
+	    mask |= sigmask (i);
 
       ovec->sv_mask = mask;
       ovec->sv_flags = 0;