diff options
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux/shmat.c')
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/shmat.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/shmat.c b/libc/sysdeps/unix/sysv/linux/shmat.c index cb5aa50bd..bac1b290a 100644 --- a/libc/sysdeps/unix/sysv/linux/shmat.c +++ b/libc/sysdeps/unix/sysv/linux/shmat.c @@ -23,7 +23,6 @@ #include <sysdep.h> #include <unistd.h> #include <sys/syscall.h> -#include <bp-checks.h> /* Attach the shared memory segment associated with SHMID to the data segment of the calling process. SHMADDR and SHMFLG determine how @@ -37,26 +36,17 @@ shmat (shmid, shmaddr, shmflg) { INTERNAL_SYSCALL_DECL(err); unsigned long resultvar; - void *__unbounded raddr; - -#if __BOUNDED_POINTERS__ - size_t length = ~0; - struct shmid_ds shmds; - /* It's unfortunate that we need to make another system call to get - the shared memory segment length... */ - if (shmctl (shmid, IPC_STAT, &shmds) == 0) - length = shmds.shm_segsz; -#endif + void *raddr; resultvar = INTERNAL_SYSCALL (ipc, err, 5, IPCOP_shmat, shmid, shmflg, - (long int) __ptrvalue (&raddr), - __ptrvalue ((void *) shmaddr)); + (long int) &raddr, + (void *) shmaddr); if (INTERNAL_SYSCALL_ERROR_P (resultvar, err)) { __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err)); return (void *) -1l; } - return BOUNDED_N (raddr, length); + return raddr; } |