c6d234
commit 2e8a5c8c46f0a897a2629131eb86d1cae8321234
c6d234
Author: Joseph Myers <joseph@codesourcery.com>
c6d234
Date:   Thu Jan 31 22:59:04 2013 +0000
c6d234
c6d234
    Remove bp-semctl.h and CHECK_SEMCTL.
c6d234
c6d234
Conflicts:
c6d234
	sysdeps/generic/bp-semctl.h
c6d234
c6d234
Copyright header change; file removed manually.
c6d234
c6d234
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/semctl.c b/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
c6d234
index 0e59ee27af5d25cd..0d28667bf84b57bc 100644
c6d234
--- a/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
c6d234
+++ b/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
c6d234
@@ -33,10 +33,6 @@ union semun
c6d234
   struct seminfo *__buf;	/* buffer for IPC_INFO */
c6d234
 };
c6d234
 
c6d234
-#include <bp-checks.h>
c6d234
-#include <bp-semctl.h>
c6d234
-
c6d234
-
c6d234
 int
c6d234
 __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
 {
c6d234
@@ -51,7 +47,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
   va_end (ap);
c6d234
 
c6d234
   return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
c6d234
+			 arg.array);
c6d234
 }
c6d234
 
c6d234
 #include <shlib-compat.h>
c6d234
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
c6d234
index 3c1c9106420bd67b..7c7d7caafe5db9bf 100644
c6d234
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
c6d234
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
c6d234
@@ -30,9 +30,6 @@ union semun
c6d234
   struct seminfo *__buf;	/* buffer for IPC_INFO */
c6d234
 };
c6d234
 
c6d234
-#include <bp-checks.h>
c6d234
-#include <bp-semctl.h>		/* definition of CHECK_SEMCTL needs union semum */
c6d234
-
c6d234
 int __semctl (int semid, int semnum, int cmd, ...);
c6d234
 
c6d234
 int
c6d234
@@ -49,7 +46,7 @@ __semctl (int semid, int semnum, int cmd, ...)
c6d234
   va_end (ap);
c6d234
 
c6d234
   return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
c6d234
+			 arg.array);
c6d234
 }
c6d234
 
c6d234
 #include <shlib-compat.h>
c6d234
diff --git a/sysdeps/generic/bp-semctl.h b/sysdeps/generic/bp-semctl.h
c6d234
deleted file mode 100644
c6d234
index af132837cc40bcc9..0000000000000000
c6d234
--- a/sysdeps/generic/bp-semctl.h
c6d234
+++ /dev/null
c6d234
@@ -1,66 +0,0 @@
c6d234
-/* Bounded-pointer checking macros for C.
c6d234
-   Copyright (C) 2000 Free Software Foundation, Inc.
c6d234
-   This file is part of the GNU C Library.
c6d234
-   Contributed by Greg McGary <greg@mcgary.org>
c6d234
-
c6d234
-   The GNU C Library is free software; you can redistribute it and/or
c6d234
-   modify it under the terms of the GNU Lesser General Public
c6d234
-   License as published by the Free Software Foundation; either
c6d234
-   version 2.1 of the License, or (at your option) any later version.
c6d234
-
c6d234
-   The GNU C Library is distributed in the hope that it will be useful,
c6d234
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
c6d234
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
c6d234
-   Lesser General Public License for more details.
c6d234
-
c6d234
-   You should have received a copy of the GNU Lesser General Public
c6d234
-   License along with the GNU C Library; if not, see
c6d234
-   <http://www.gnu.org/licenses/>.  */
c6d234
-
c6d234
-#ifndef _bp_semctl_h_
c6d234
-#define _bp_semctl_h_ 1
c6d234
-
c6d234
-#if __BOUNDED_POINTERS__
c6d234
-
c6d234
-# define CHECK_SEMCTL(ARGP, SEMID, CMD) check_semctl (ARGP, SEMID, CMD)
c6d234
-
c6d234
-union semun *__unbounded
c6d234
-check_semctl (union semun *arg, int semid, int cmd)
c6d234
-{
c6d234
-  int ipc64 = (cmd & __IPC_64);
c6d234
-
c6d234
-  switch (cmd & ~__IPC_64)
c6d234
-    {
c6d234
-    case IPC_STAT:
c6d234
-    case IPC_SET:
c6d234
-      (void) CHECK_1 (arg->buf);
c6d234
-      break;
c6d234
-
c6d234
-    case GETALL:
c6d234
-    case SETALL:
c6d234
-      {
c6d234
-	struct semid_ds ds;
c6d234
-	union semun un = { .buf = &ds };
c6d234
-	unsigned int length = ~0;
c6d234
-
c6d234
-	/* It's unfortunate that we need to make a recursive
c6d234
-	   system call to get the size of the semaphore set...  */
c6d234
-	if (semctl (semid, 0, IPC_STAT | ipc64, un) == 0)
c6d234
-	  length = ds.sem_nsems;
c6d234
-	(void) CHECK_N (arg->array, length);
c6d234
-	break;
c6d234
-      }
c6d234
-
c6d234
-    case IPC_INFO:
c6d234
-      (void) CHECK_1 (arg->__buf);
c6d234
-      break;
c6d234
-    }
c6d234
-
c6d234
-  return __ptrvalue (arg);
c6d234
-}
c6d234
-
c6d234
-#else
c6d234
-# define CHECK_SEMCTL(ARGP, SEMID, CMD) (ARGP)
c6d234
-#endif
c6d234
-
c6d234
-#endif /* _bp_semctl_h_ */
c6d234
diff --git a/sysdeps/unix/sysv/linux/i386/semctl.c b/sysdeps/unix/sysv/linux/i386/semctl.c
c6d234
index 5e2d9480598e56c4..c340e57f0e6899c0 100644
c6d234
--- a/sysdeps/unix/sysv/linux/i386/semctl.c
c6d234
+++ b/sysdeps/unix/sysv/linux/i386/semctl.c
c6d234
@@ -49,9 +49,6 @@ union semun
c6d234
   struct __old_semid_ds *__old_buf;
c6d234
 };
c6d234
 
c6d234
-#include <bp-checks.h>
c6d234
-#include <bp-semctl.h>		/* definition of CHECK_SEMCTL needs union semum */
c6d234
-
c6d234
 /* Return identifier for array of NSEMS semaphores associated with
c6d234
    KEY.  */
c6d234
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
c6d234
@@ -75,7 +72,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
c6d234
   va_end (ap);
c6d234
 
c6d234
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd));
c6d234
+			 &arg;;
c6d234
 }
c6d234
 compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
c6d234
 #endif
c6d234
@@ -94,7 +91,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
   va_end (ap);
c6d234
 
c6d234
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
c6d234
+			 &arg;;
c6d234
 }
c6d234
 
c6d234
 versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
c6d234
diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
c6d234
index 2d28cf661e9b3ad0..bae5a8d28306e653 100644
c6d234
--- a/sysdeps/unix/sysv/linux/semctl.c
c6d234
+++ b/sysdeps/unix/sysv/linux/semctl.c
c6d234
@@ -51,9 +51,6 @@ union semun
c6d234
   struct __old_semid_ds *__old_buf;
c6d234
 };
c6d234
 
c6d234
-#include <bp-checks.h>
c6d234
-#include <bp-semctl.h>		/* definition of CHECK_SEMCTL needs union semum */
c6d234
-
c6d234
 /* Return identifier for array of NSEMS semaphores associated with
c6d234
    KEY.  */
c6d234
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
c6d234
@@ -92,7 +89,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
c6d234
   va_end (ap);
c6d234
 
c6d234
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd));
c6d234
+			 &arg;;
c6d234
 }
c6d234
 compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
c6d234
 #endif
c6d234
@@ -127,7 +124,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
 
c6d234
 #if __ASSUME_IPC64 > 0
c6d234
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
c6d234
+			 &arg;;
c6d234
 #else
c6d234
   switch (cmd)
c6d234
     {
c6d234
@@ -137,7 +134,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
       break;
c6d234
     default:
c6d234
       return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
c6d234
-			     CHECK_SEMCTL (&arg, semid, cmd));
c6d234
+			     &arg;;
c6d234
     }
c6d234
 
c6d234
   {
c6d234
@@ -148,7 +145,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
     /* Unfortunately there is no way how to find out for sure whether
c6d234
        we should use old or new semctl.  */
c6d234
     result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
c6d234
-			     CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
c6d234
+			     &arg;;
c6d234
     if (result != -1 || errno != EINVAL)
c6d234
       return result;
c6d234
 
c6d234
@@ -168,7 +165,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
 	  }
c6d234
       }
c6d234
     result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
c6d234
-			     CHECK_SEMCTL (&arg, semid, cmd));
c6d234
+			     &arg;;
c6d234
     if (result != -1 && cmd != IPC_SET)
c6d234
       {
c6d234
 	memset(buf, 0, sizeof(*buf));
c6d234
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c b/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
c6d234
index 464f0b502d65c52a..9dac28c4f1cb4657 100644
c6d234
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
c6d234
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
c6d234
@@ -50,9 +50,6 @@ union semun
c6d234
   struct __old_semid_ds *__old_buf;
c6d234
 };
c6d234
 
c6d234
-#include <bp-checks.h>
c6d234
-#include <bp-semctl.h>		/* definition of CHECK_SEMCTL needs union semum */
c6d234
-
c6d234
 /* Return identifier for array of NSEMS semaphores associated with
c6d234
    KEY.  */
c6d234
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
c6d234
@@ -87,7 +84,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
c6d234
     }
c6d234
 
c6d234
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd));
c6d234
+			 &arg;;
c6d234
 }
c6d234
 compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
c6d234
 #endif
c6d234
@@ -117,7 +114,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
c6d234
     }
c6d234
 
c6d234
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
c6d234
+			 &arg;;
c6d234
 }
c6d234
 
c6d234
 versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
c6d234
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c b/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
c6d234
index 3ac389e5b178a01d..658db0e8d91afa88 100644
c6d234
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
c6d234
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
c6d234
@@ -33,9 +33,6 @@ union semun
c6d234
   struct seminfo *__buf;	/* buffer for IPC_INFO */
c6d234
 };
c6d234
 
c6d234
-#include <bp-checks.h>
c6d234
-#include <bp-semctl.h>		/* definition of CHECK_SEMCTL needs union semum */
c6d234
-
c6d234
 /* Return identifier for array of NSEMS semaphores associated with
c6d234
    KEY.  */
c6d234
 
c6d234
@@ -53,5 +50,5 @@ semctl (int semid, int semnum, int cmd, ...)
c6d234
   va_end (ap);
c6d234
 
c6d234
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
c6d234
-			 CHECK_SEMCTL (&arg, semid, cmd)->array);
c6d234
+			 arg.array);
c6d234
 }