diff options
author | alfred <alfred@FreeBSD.org> | 2003-01-25 21:27:37 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2003-01-25 21:27:37 +0000 |
commit | cea829ec35c9b61d78309fe3a379e2b8197f84b8 (patch) | |
tree | 671060016998bec8e8923706ed43d1bbbc63044f | |
parent | 30ac5984d126569a472f855cfde9f99e9cf018c8 (diff) | |
download | FreeBSD-src-cea829ec35c9b61d78309fe3a379e2b8197f84b8.zip FreeBSD-src-cea829ec35c9b61d78309fe3a379e2b8197f84b8.tar.gz |
Bring semop() closer the the opengroup standards.
PR: 47471
Submitted by: Craig Rodrigues <rodrigc@attbi.com>
-rw-r--r-- | lib/libc/sys/semop.2 | 2 | ||||
-rw-r--r-- | sys/kern/syscalls.master | 2 | ||||
-rw-r--r-- | sys/kern/sysv_sem.c | 7 | ||||
-rw-r--r-- | sys/sys/sem.h | 13 |
4 files changed, 18 insertions, 6 deletions
diff --git a/lib/libc/sys/semop.2 b/lib/libc/sys/semop.2 index 174cee2..70c712b 100644 --- a/lib/libc/sys/semop.2 +++ b/lib/libc/sys/semop.2 @@ -38,7 +38,7 @@ .In sys/ipc.h .In sys/sem.h .Ft int -.Fn semop "int semid" "struct sembuf *array" "unsigned nops" +.Fn semop "int semid" "struct sembuf *array" "size_t nops" .Sh DESCRIPTION The .Fn semop diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 2bcbe9d..cd3e468 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -352,7 +352,7 @@ union semun *arg); } 221 MNOSTD BSD { int semget(key_t key, int nsems, int semflg); } 222 MNOSTD BSD { int semop(int semid, struct sembuf *sops, \ - u_int nsops); } + size_t nsops); } 223 UNIMPL NOHIDE semconfig 224 MNOSTD BSD { int msgctl(int msqid, int cmd, \ struct msqid_ds *buf); } diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index f27d167..ed7f2c4 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -858,7 +858,7 @@ done2: struct semop_args { int semid; struct sembuf *sops; - u_int nsops; + size_t nsops; }; #endif @@ -871,14 +871,15 @@ semop(td, uap) struct semop_args *uap; { int semid = uap->semid; - u_int nsops = uap->nsops; + size_t nsops = uap->nsops; struct sembuf *sops; struct semid_ds *semaptr; struct sembuf *sopptr = 0; struct sem *semptr = 0; struct sem_undo *suptr; struct mtx *sema_mtxp; - int i, j, error; + size_t i, j; + int error; int do_wakeup, do_undos; DPRINTF(("call to semop(%d, 0x%x, %u)\n", semid, sops, nsops)); diff --git a/sys/sys/sem.h b/sys/sys/sem.h index 7f6a818..e5f5daf 100644 --- a/sys/sys/sem.h +++ b/sys/sys/sem.h @@ -96,12 +96,23 @@ void semexit(struct proc *p); #ifndef _KERNEL #include <sys/cdefs.h> +#include <sys/_types.h> + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif __BEGIN_DECLS int semsys(int, ...); int semctl(int, int, int, ...); int semget(key_t, int, int); -int semop(int, struct sembuf *,unsigned); +int semop(int, struct sembuf *,size_t); __END_DECLS #endif /* !_KERNEL */ |