diff --git a/lib/libc/sys/shmat.2 b/lib/libc/sys/shmat.2 index 31e2a80d5091..b992d41a67ad 100644 --- a/lib/libc/sys/shmat.2 +++ b/lib/libc/sys/shmat.2 @@ -40,9 +40,9 @@ .In sys/ipc.h .In sys/shm.h .Ft void * -.Fn shmat "int shmid" "void *addr" "int flag" +.Fn shmat "int shmid" "const void *addr" "int flag" .Ft int -.Fn shmdt "void *addr" +.Fn shmdt "const void *addr" .Sh DESCRIPTION The .Fn shmat diff --git a/lib/libc/sys/shmget.2 b/lib/libc/sys/shmget.2 index e27ad0d3ce92..5d8bc5a9a179 100644 --- a/lib/libc/sys/shmget.2 +++ b/lib/libc/sys/shmget.2 @@ -39,7 +39,7 @@ .In sys/ipc.h .In sys/shm.h .Ft int -.Fn shmget "key_t key" "int size" "int flag" +.Fn shmget "key_t key" "size_t size" "int flag" .Sh DESCRIPTION Based on the values of .Fa key diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index cd3e46892f7d..03c87946d124 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -361,11 +361,11 @@ int msgflg); } 227 MNOSTD BSD { int msgrcv(int msqid, void *msgp, size_t msgsz, \ long msgtyp, int msgflg); } -228 MNOSTD BSD { int shmat(int shmid, void *shmaddr, int shmflg); } +228 MNOSTD BSD { int shmat(int shmid, const void *shmaddr, int shmflg); } 229 MNOSTD BSD { int shmctl(int shmid, int cmd, \ struct shmid_ds *buf); } -230 MNOSTD BSD { int shmdt(void *shmaddr); } -231 MNOSTD BSD { int shmget(key_t key, int size, int shmflg); } +230 MNOSTD BSD { int shmdt(const void *shmaddr); } +231 MNOSTD BSD { int shmget(key_t key, size_t size, int shmflg); } ; 232 MSTD POSIX { int clock_gettime(clockid_t clock_id, \ struct timespec *tp); } diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index e04531094075..406e753a2fda 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -240,7 +240,7 @@ shm_delete_mapping(struct vmspace *vm, struct shmmap_state *shmmap_s) #ifndef _SYS_SYSPROTO_H_ struct shmdt_args { - void *shmaddr; + const void *shmaddr; }; #endif @@ -284,7 +284,7 @@ done2: #ifndef _SYS_SYSPROTO_H_ struct shmat_args { int shmid; - void *shmaddr; + const void *shmaddr; int shmflg; }; #endif diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 6d66384bbaf6..a56e40d442d5 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -105,12 +105,17 @@ void shmfork(struct proc *, struct proc *); #include +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + __BEGIN_DECLS int shmsys(int, ...); -void *shmat(int, void *, int); -int shmget(key_t, int, int); +void *shmat(int, const void *, int); +int shmget(key_t, size_t, int); int shmctl(int, int, struct shmid_ds *); -int shmdt(void *); +int shmdt(const void *); __END_DECLS #endif /* !_KERNEL */