summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-06-24 21:10:52 +0000
committerjhb <jhb@FreeBSD.org>2009-06-24 21:10:52 +0000
commit6f52fe78fb1fc421bc6abb38286a4483aac9cdc0 (patch)
tree9bcf2215ae277f261cc7bf33f2dde8db38fe41c4 /sys/compat/svr4
parentce189363a0ec4e65f27076207a88142a8554bfbb (diff)
downloadFreeBSD-src-6f52fe78fb1fc421bc6abb38286a4483aac9cdc0.zip
FreeBSD-src-6f52fe78fb1fc421bc6abb38286a4483aac9cdc0.tar.gz
Change the ABI of some of the structures used by the SYSV IPC API:
- The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned short. - The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned short. - The mode member of struct ipc_perm is now mode_t instead of unsigned short (this is merely a style bug). - The rather dubious padding fields for ABI compat with SV/I386 have been removed from struct msqid_ds and struct semid_ds. - The shm_segsz member of struct shmid_ds is now a size_t instead of an int. This removes the need for the shm_bsegsz member in struct shmid_kernel and should allow for complete support of SYSV SHM regions >= 2GB. - The shm_nattch member of struct shmid_ds is now an int instead of a short. - The shm_internal member of struct shmid_ds is now gone. The internal VM object pointer for SHM regions has been moved into struct shmid_kernel. - The existing __semctl(), msgctl(), and shmctl() system call entries are now marked COMPAT7 and new versions of those system calls which support the new ABI are now present. - The new system calls are assigned to the FBSD-1.1 version in libc. The FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls. - A simplistic framework for tagging system calls with compatibility symbol versions has been added to libc. Version tags are added to system calls by adding an appropriate __sym_compat() entry to src/lib/libc/incldue/compat.h. [1] PR: kern/16195 kern/113218 bin/129855 Reviewed by: arch@, rwatson Discussed with: kan, kib [1]
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_ipc.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/sys/compat/svr4/svr4_ipc.c b/sys/compat/svr4/svr4_ipc.c
index 317239c..658c6d6 100644
--- a/sys/compat/svr4/svr4_ipc.c
+++ b/sys/compat/svr4/svr4_ipc.c
@@ -169,13 +169,12 @@ bsd_to_svr4_semid_ds(bds, sds)
const struct semid_ds *bds;
struct svr4_semid_ds *sds;
{
+ bzero(sds, sizeof(*sds));
bsd_to_svr4_ipc_perm(&bds->sem_perm, &sds->sem_perm);
sds->sem_base = (struct svr4_sem *) bds->sem_base;
sds->sem_nsems = bds->sem_nsems;
sds->sem_otime = bds->sem_otime;
- sds->sem_pad1 = bds->sem_pad1;
sds->sem_ctime = bds->sem_ctime;
- sds->sem_pad2 = bds->sem_pad2;
}
static void
@@ -187,9 +186,7 @@ svr4_to_bsd_semid_ds(sds, bds)
bds->sem_base = (struct sem *) bds->sem_base;
bds->sem_nsems = sds->sem_nsems;
bds->sem_otime = sds->sem_otime;
- bds->sem_pad1 = sds->sem_pad1;
bds->sem_ctime = sds->sem_ctime;
- bds->sem_pad2 = sds->sem_pad2;
}
struct svr4_sys_semctl_args {
@@ -350,6 +347,7 @@ bsd_to_svr4_msqid_ds(bds, sds)
const struct msqid_ds *bds;
struct svr4_msqid_ds *sds;
{
+ bzero(sds, sizeof(*sds));
bsd_to_svr4_ipc_perm(&bds->msg_perm, &sds->msg_perm);
sds->msg_first = (struct svr4_msg *) bds->msg_first;
sds->msg_last = (struct svr4_msg *) bds->msg_last;
@@ -359,18 +357,8 @@ bsd_to_svr4_msqid_ds(bds, sds)
sds->msg_lspid = bds->msg_lspid;
sds->msg_lrpid = bds->msg_lrpid;
sds->msg_stime = bds->msg_stime;
- sds->msg_pad1 = bds->msg_pad1;
sds->msg_rtime = bds->msg_rtime;
- sds->msg_pad2 = bds->msg_pad2;
sds->msg_ctime = bds->msg_ctime;
- sds->msg_pad3 = bds->msg_pad3;
-
- /* use the padding for the rest of the fields */
- {
- const short *pad = (const short *) bds->msg_pad4;
- sds->msg_cv = pad[0];
- sds->msg_qnum_cv = pad[1];
- }
}
static void
@@ -387,18 +375,8 @@ svr4_to_bsd_msqid_ds(sds, bds)
bds->msg_lspid = sds->msg_lspid;
bds->msg_lrpid = sds->msg_lrpid;
bds->msg_stime = sds->msg_stime;
- bds->msg_pad1 = sds->msg_pad1;
bds->msg_rtime = sds->msg_rtime;
- bds->msg_pad2 = sds->msg_pad2;
bds->msg_ctime = sds->msg_ctime;
- bds->msg_pad3 = sds->msg_pad3;
-
- /* use the padding for the rest of the fields */
- {
- short *pad = (short *) bds->msg_pad4;
- pad[0] = sds->msg_cv;
- pad[1] = sds->msg_qnum_cv;
- }
}
struct svr4_sys_msgsnd_args {
@@ -543,20 +521,18 @@ bsd_to_svr4_shmid_ds(bds, sds)
const struct shmid_ds *bds;
struct svr4_shmid_ds *sds;
{
+ bzero(sds, sizeof(*sds));
bsd_to_svr4_ipc_perm(&bds->shm_perm, &sds->shm_perm);
sds->shm_segsz = bds->shm_segsz;
sds->shm_lkcnt = 0;
sds->shm_lpid = bds->shm_lpid;
sds->shm_cpid = bds->shm_cpid;
- sds->shm_amp = bds->shm_internal;
+ sds->shm_amp = 0;
sds->shm_nattch = bds->shm_nattch;
sds->shm_cnattch = 0;
sds->shm_atime = bds->shm_atime;
- sds->shm_pad1 = 0;
sds->shm_dtime = bds->shm_dtime;
- sds->shm_pad2 = 0;
sds->shm_ctime = bds->shm_ctime;
- sds->shm_pad3 = 0;
}
static void
@@ -568,7 +544,6 @@ svr4_to_bsd_shmid_ds(sds, bds)
bds->shm_segsz = sds->shm_segsz;
bds->shm_lpid = sds->shm_lpid;
bds->shm_cpid = sds->shm_cpid;
- bds->shm_internal = sds->shm_amp;
bds->shm_nattch = sds->shm_nattch;
bds->shm_atime = sds->shm_atime;
bds->shm_dtime = sds->shm_dtime;
OpenPOWER on IntegriCloud