summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2003-01-25 21:33:05 +0000
committeralfred <alfred@FreeBSD.org>2003-01-25 21:33:05 +0000
commit28e8e60e36c2d950d4ebf7b406f2401ccb63c0c1 (patch)
tree565a9f0b99f068635c74c8de66bf023c628f73a5
parent918ae76f60cdf7c75ca92bd430114118502aa7fe (diff)
downloadFreeBSD-src-28e8e60e36c2d950d4ebf7b406f2401ccb63c0c1.zip
FreeBSD-src-28e8e60e36c2d950d4ebf7b406f2401ccb63c0c1.tar.gz
Bring shm functions closer the the opengroup standards.
PR: 47469 Submitted by: Craig Rodrigues <rodrigc@attbi.com>
-rw-r--r--lib/libc/sys/shmat.24
-rw-r--r--lib/libc/sys/shmget.22
-rw-r--r--sys/kern/syscalls.master6
-rw-r--r--sys/kern/sysv_shm.c4
-rw-r--r--sys/sys/shm.h11
5 files changed, 16 insertions, 11 deletions
diff --git a/lib/libc/sys/shmat.2 b/lib/libc/sys/shmat.2
index 31e2a80..b992d41 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 e27ad0d..5d8bc5a 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 cd3e468..03c8794 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 e045310..406e753 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 6d66384..a56e40d 100644
--- a/sys/sys/shm.h
+++ b/sys/sys/shm.h
@@ -105,12 +105,17 @@ void shmfork(struct proc *, struct proc *);
#include <sys/cdefs.h>
+#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 */
OpenPOWER on IntegriCloud