diff options
author | jhb <jhb@FreeBSD.org> | 2006-07-08 19:51:38 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-07-08 19:51:38 +0000 |
commit | 5e8693a9761d7a5f4bb3b200c9218a2ad3223215 (patch) | |
tree | 50e5dbd1552ef725ecb5f25f6453ca31d8d3b39c /sys/sys | |
parent | f7c9fd2027eb791acb31a33df08af462cc6322a4 (diff) | |
download | FreeBSD-src-5e8693a9761d7a5f4bb3b200c9218a2ad3223215.zip FreeBSD-src-5e8693a9761d7a5f4bb3b200c9218a2ad3223215.tar.gz |
Rework kern_semctl a bit to always assume the UIO_SYSSPACE case. This
mostly consists of pushing a few copyin's and copyout's up into
__semctl() as all the other callers were already doing the UIO_SYSSPACE
case. This also changes kern_semctl() to set the return value in a passed
in pointer to a register_t rather than td->td_retval[0] directly so that
callers can only set td->td_retval[0] if all the various copyout's succeed.
As a result of these changes, kern_semctl() no longer does copyin/copyout
(except for GETALL/SETALL) so simplify the locking to acquire the semakptr
mutex before the MAC check and hold it all the way until the end of the
big switch statement. The GETALL/SETALL cases have to temporarily drop it
while they do copyin/malloc and copyout. Also, simplify the SETALL case to
remove handling for a non-existent race condition.
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/syscallsubr.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index c7a0cd5..faf6f93 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -126,7 +126,7 @@ int kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg); int kern_sched_rr_get_interval(struct thread *td, pid_t pid, struct timespec *ts); int kern_semctl(struct thread *td, int semid, int semnum, int cmd, - union semun *arg, enum uio_seg bufseg); + union semun *arg, register_t *rval); int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp); int kern_sendfile(struct thread *td, struct sendfile_args *uap, |