FreeBSD Bugzilla – Attachment 188945 Details for
Bug 224443
exp-run: SysV IPC API cleanup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch revising SysV IPC APIs
D13538.diff.txt (text/plain), 22.89 KB, created by
Brooks Davis
on 2017-12-19 02:58:17 UTC
(
hide
)
Description:
Patch revising SysV IPC APIs
Filename:
MIME Type:
Creator:
Brooks Davis
Created:
2017-12-19 02:58:17 UTC
Size:
22.89 KB
patch
obsolete
>Index: contrib/sendmail/include/sm/os/sm_os_freebsd.h >=================================================================== >--- contrib/sendmail/include/sm/os/sm_os_freebsd.h >+++ contrib/sendmail/include/sm/os/sm_os_freebsd.h >@@ -34,7 +34,7 @@ > # define SM_CONF_SHM 1 > #endif /* SM_CONF_SHM */ > #ifndef SM_CONF_SEM >-# define SM_CONF_SEM 1 >+# define SM_CONF_SEM 2 > #endif /* SM_CONF_SEM */ > #ifndef SM_CONF_MSG > # define SM_CONF_MSG 1 >Index: lib/libc/gen/semctl.c >=================================================================== >--- lib/libc/gen/semctl.c >+++ lib/libc/gen/semctl.c >@@ -34,6 +34,7 @@ > #ifndef NO_COMPAT7 > #define _WANT_SEMUN_OLD > #endif >+#define _WANT_SEMUN > > #include <sys/types.h> > #include <sys/ipc.h> >Index: lib/libc/sys/msgctl.2 >=================================================================== >--- lib/libc/sys/msgctl.2 >+++ lib/libc/sys/msgctl.2 >@@ -63,8 +63,8 @@ > .Bd -literal > struct msqid_ds { > struct ipc_perm msg_perm; /* msg queue permission bits */ >- struct msg *msg_first; /* first message in the queue */ >- struct msg *msg_last; /* last message in the queue */ >+ struct msg *kmsg_first; /* kernel data, don't use */ >+ struct msg *kmsg_last; /* kernel data, don't use */ > msglen_t msg_cbytes; /* number of bytes in use on the queue */ > msgqnum_t msg_qnum; /* number of msgs in the queue */ > msglen_t msg_qbytes; /* max # of bytes on the queue */ >Index: lib/libc/sys/semctl.2 >=================================================================== >--- lib/libc/sys/semctl.2 >+++ lib/libc/sys/semctl.2 >@@ -145,7 +145,7 @@ > .Bd -literal > struct semid_ds { > struct ipc_perm sem_perm; /* operation permission struct */ >- struct sem *sem_base; /* pointer to first semaphore in set */ >+ struct sem *ksem_base; /* kernel data, don't use */ > u_short sem_nsems; /* number of sems in set */ > time_t sem_otime; /* last operation time */ > time_t sem_ctime; /* last change time */ >Index: sys/compat/freebsd32/freebsd32_ipc.h >=================================================================== >--- sys/compat/freebsd32/freebsd32_ipc.h >+++ sys/compat/freebsd32/freebsd32_ipc.h >@@ -43,7 +43,7 @@ > > struct semid_ds32 { > struct ipc_perm32 sem_perm; >- uint32_t sem_base; >+ uint32_t ksem_base; > unsigned short sem_nsems; > int32_t sem_otime; > int32_t sem_ctime; >@@ -57,8 +57,8 @@ > > struct msqid_ds32 { > struct ipc_perm32 msg_perm; >- uint32_t msg_first; >- uint32_t msg_last; >+ uint32_t kmsg_first; >+ uint32_t kmsg_last; > uint32_t msg_cbytes; > uint32_t msg_qnum; > uint32_t msg_qbytes; >@@ -111,7 +111,7 @@ > > struct semid_ds32_old { > struct ipc_perm32_old sem_perm; >- uint32_t sem_base; >+ uint32_t ksem_base; > unsigned short sem_nsems; > int32_t sem_otime; > int32_t sem_pad1; >@@ -122,8 +122,8 @@ > > struct msqid_ds32_old { > struct ipc_perm32_old msg_perm; >- uint32_t msg_first; >- uint32_t msg_last; >+ uint32_t kmsg_first; >+ uint32_t kmsg_last; > uint32_t msg_cbytes; > uint32_t msg_qnum; > uint32_t msg_qbytes; >Index: sys/compat/linux/linux_ipc.c >=================================================================== >--- sys/compat/linux/linux_ipc.c >+++ sys/compat/linux/linux_ipc.c >@@ -160,8 +160,8 @@ > > struct l_msqid_ds { > struct l_ipc_perm msg_perm; >- l_uintptr_t msg_first; /* first message on queue,unused */ >- l_uintptr_t msg_last; /* last message in queue,unused */ >+ l_uintptr_t kmsg_first; /* first message on queue,unused */ >+ l_uintptr_t kmsg_last; /* last message in queue,unused */ > l_time_t msg_stime; /* last msgsnd time */ > l_time_t msg_rtime; /* last msgrcv time */ > l_time_t msg_ctime; /* last change time */ >@@ -178,7 +178,7 @@ > struct l_ipc_perm sem_perm; > l_time_t sem_otime; > l_time_t sem_ctime; >- l_uintptr_t sem_base; >+ l_uintptr_t ksem_base; > l_uintptr_t sem_pending; > l_uintptr_t sem_pending_last; > l_uintptr_t undo; >Index: sys/i386/ibcs2/ibcs2_ipc.h >=================================================================== >--- sys/i386/ibcs2/ibcs2_ipc.h >+++ sys/i386/ibcs2/ibcs2_ipc.h >@@ -45,8 +45,8 @@ > > struct ibcs2_msqid_ds { > struct ibcs2_ipc_perm msg_perm; >- struct msg *msg_first; >- struct msg *msg_last; >+ struct msg *kmsg_first; >+ struct msg *kmsg_last; > u_short msg_cbytes; > u_short msg_qnum; > u_short msg_qbytes; >@@ -59,7 +59,7 @@ > > struct ibcs2_semid_ds { > struct ibcs2_ipc_perm sem_perm; >- struct ibcs2_sem *sem_base; >+ struct ibcs2_sem *ksem_base; > u_short sem_nsems; > ibcs2_time_t sem_otime; > ibcs2_time_t sem_ctime; >Index: sys/i386/ibcs2/ibcs2_ipc.c >=================================================================== >--- sys/i386/ibcs2/ibcs2_ipc.c >+++ sys/i386/ibcs2/ibcs2_ipc.c >@@ -74,8 +74,8 @@ > struct ibcs2_msqid_ds *ibp; > { > cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm); >- ibp->msg_first = bp->msg_first; >- ibp->msg_last = bp->msg_last; >+ ibp->kmsg_first = bp->kmsg_first; >+ ibp->kmsg_last = bp->kmsg_last; > ibp->msg_cbytes = (u_short)bp->msg_cbytes; > ibp->msg_qnum = (u_short)bp->msg_qnum; > ibp->msg_qbytes = (u_short)bp->msg_qbytes; >@@ -93,8 +93,8 @@ > struct msqid_ds *bp; > { > cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm); >- bp->msg_first = ibp->msg_first; >- bp->msg_last = ibp->msg_last; >+ bp->kmsg_first = ibp->kmsg_first; >+ bp->kmsg_last = ibp->kmsg_last; > bp->msg_cbytes = ibp->msg_cbytes; > bp->msg_qnum = ibp->msg_qnum; > bp->msg_qbytes = ibp->msg_qbytes; >@@ -284,7 +284,7 @@ > struct ibcs2_semid_ds *ibp; > { > cvt_perm2iperm(&bp->sem_perm, &ibp->sem_perm); >- ibp->sem_base = (struct ibcs2_sem *)bp->sem_base; >+ ibp->ksem_base = (struct ibcs2_sem *)bp->ksem_base; > ibp->sem_nsems = bp->sem_nsems; > ibp->sem_otime = bp->sem_otime; > ibp->sem_ctime = bp->sem_ctime; >@@ -297,7 +297,7 @@ > struct semid_ds *bp; > { > cvt_iperm2perm(&ibp->sem_perm, &bp->sem_perm); >- bp->sem_base = (struct sem *)ibp->sem_base; >+ bp->ksem_base = (struct sem *)ibp->ksem_base; > bp->sem_nsems = ibp->sem_nsems; > bp->sem_otime = ibp->sem_otime; > bp->sem_ctime = ibp->sem_ctime; >Index: sys/kern/sysv_msg.c >=================================================================== >--- sys/kern/sysv_msg.c >+++ sys/kern/sysv_msg.c >@@ -425,7 +425,7 @@ > msqkptr->cred = NULL; > > /* Free the message headers */ >- msghdr = msqkptr->u.msg_first; >+ msghdr = msqkptr->u.kmsg_first; > while (msghdr != NULL) { > struct msg *msghdr_tmp; > >@@ -573,7 +573,7 @@ > * thread cannot free a certain msghdr. The msq will get > * into an inconsistent state. > */ >- for (msghdr = msqkptr->u.msg_first; msghdr != NULL; >+ for (msghdr = msqkptr->u.kmsg_first; msghdr != NULL; > msghdr = msghdr->msg_next) { > error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr); > if (error != 0) >@@ -731,8 +731,8 @@ > msqkptr->cred = crhold(cred); > /* Make sure that the returned msqid is unique */ > msqkptr->u.msg_perm.seq = (msqkptr->u.msg_perm.seq + 1) & 0x7fff; >- msqkptr->u.msg_first = NULL; >- msqkptr->u.msg_last = NULL; >+ msqkptr->u.kmsg_first = NULL; >+ msqkptr->u.kmsg_last = NULL; > msqkptr->u.msg_cbytes = 0; > msqkptr->u.msg_qnum = 0; > msqkptr->u.msg_qbytes = msginfo.msgmnb; >@@ -1079,14 +1079,14 @@ > /* > * Put the message into the queue > */ >- if (msqkptr->u.msg_first == NULL) { >- msqkptr->u.msg_first = msghdr; >- msqkptr->u.msg_last = msghdr; >+ if (msqkptr->u.kmsg_first == NULL) { >+ msqkptr->u.kmsg_first = msghdr; >+ msqkptr->u.kmsg_last = msghdr; > } else { >- msqkptr->u.msg_last->msg_next = msghdr; >- msqkptr->u.msg_last = msghdr; >+ msqkptr->u.kmsg_last->msg_next = msghdr; >+ msqkptr->u.kmsg_last = msghdr; > } >- msqkptr->u.msg_last->msg_next = NULL; >+ msqkptr->u.kmsg_last->msg_next = NULL; > > msqkptr->u.msg_cbytes += msghdr->msg_ts; > msqkptr->u.msg_qnum++; >@@ -1194,7 +1194,7 @@ > msghdr = NULL; > while (msghdr == NULL) { > if (msgtyp == 0) { >- msghdr = msqkptr->u.msg_first; >+ msghdr = msqkptr->u.kmsg_first; > if (msghdr != NULL) { > if (msgsz < msghdr->msg_ts && > (msgflg & MSG_NOERROR) == 0) { >@@ -1210,21 +1210,21 @@ > if (error != 0) > goto done2; > #endif >- if (msqkptr->u.msg_first == msqkptr->u.msg_last) { >- msqkptr->u.msg_first = NULL; >- msqkptr->u.msg_last = NULL; >+ if (msqkptr->u.kmsg_first == msqkptr->u.kmsg_last) { >+ msqkptr->u.kmsg_first = NULL; >+ msqkptr->u.kmsg_last = NULL; > } else { >- msqkptr->u.msg_first = msghdr->msg_next; >- if (msqkptr->u.msg_first == NULL) >+ msqkptr->u.kmsg_first = msghdr->msg_next; >+ if (msqkptr->u.kmsg_first == NULL) > panic("msg_first/last screwed up #1"); > } > } > } else { > struct msg *previous; > struct msg **prev; > > previous = NULL; >- prev = &(msqkptr->u.msg_first); >+ prev = &(msqkptr->u.kmsg_first); > while ((msghdr = *prev) != NULL) { > /* > * Is this message's type an exact match or is >@@ -1256,20 +1256,20 @@ > goto done2; > #endif > *prev = msghdr->msg_next; >- if (msghdr == msqkptr->u.msg_last) { >+ if (msghdr == msqkptr->u.kmsg_last) { > if (previous == NULL) { > if (prev != >- &msqkptr->u.msg_first) >- panic("msg_first/last screwed up #2"); >- msqkptr->u.msg_first = >+ &msqkptr->u.kmsg_first) >+ panic("kmsg_first/last screwed up #2"); >+ msqkptr->u.kmsg_first = > NULL; >- msqkptr->u.msg_last = >+ msqkptr->u.kmsg_last = > NULL; > } else { > if (prev == >- &msqkptr->u.msg_first) >- panic("msg_first/last screwed up #3"); >- msqkptr->u.msg_last = >+ &msqkptr->u.kmsg_first) >+ panic("kmsg_first/last screwed up #3"); >+ msqkptr->u.kmsg_last = > previous; > } > } >@@ -1674,8 +1674,8 @@ > if (error) > return (error); > freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm); >- PTRIN_CP(msqbuf32, msqbuf, msg_first); >- PTRIN_CP(msqbuf32, msqbuf, msg_last); >+ PTRIN_CP(msqbuf32, msqbuf, kmsg_first); >+ PTRIN_CP(msqbuf32, msqbuf, kmsg_last); > CP(msqbuf32, msqbuf, msg_cbytes); > CP(msqbuf32, msqbuf, msg_qnum); > CP(msqbuf32, msqbuf, msg_qbytes); >@@ -1691,8 +1691,8 @@ > if (uap->cmd == IPC_STAT) { > bzero(&msqbuf32, sizeof(msqbuf32)); > freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm); >- PTROUT_CP(msqbuf, msqbuf32, msg_first); >- PTROUT_CP(msqbuf, msqbuf32, msg_last); >+ PTROUT_CP(msqbuf, msqbuf32, kmsg_first); >+ PTROUT_CP(msqbuf, msqbuf32, kmsg_last); > CP(msqbuf, msqbuf32, msg_cbytes); > CP(msqbuf, msqbuf32, msg_qnum); > CP(msqbuf, msqbuf32, msg_qbytes); >@@ -1719,8 +1719,8 @@ > if (error) > return (error); > freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm); >- PTRIN_CP(msqbuf32, msqbuf, msg_first); >- PTRIN_CP(msqbuf32, msqbuf, msg_last); >+ PTRIN_CP(msqbuf32, msqbuf, kmsg_first); >+ PTRIN_CP(msqbuf32, msqbuf, kmsg_last); > CP(msqbuf32, msqbuf, msg_cbytes); > CP(msqbuf32, msqbuf, msg_qnum); > CP(msqbuf32, msqbuf, msg_qbytes); >@@ -1735,8 +1735,8 @@ > return (error); > if (uap->cmd == IPC_STAT) { > freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm); >- PTROUT_CP(msqbuf, msqbuf32, msg_first); >- PTROUT_CP(msqbuf, msqbuf32, msg_last); >+ PTROUT_CP(msqbuf, msqbuf32, kmsg_first); >+ PTROUT_CP(msqbuf, msqbuf32, kmsg_last); > CP(msqbuf, msqbuf32, msg_cbytes); > CP(msqbuf, msqbuf32, msg_qnum); > CP(msqbuf, msqbuf32, msg_qbytes); >@@ -1844,8 +1844,8 @@ > if (error) > return (error); > ipcperm_old2new(&msqold.msg_perm, &msqbuf.msg_perm); >- CP(msqold, msqbuf, msg_first); >- CP(msqold, msqbuf, msg_last); >+ CP(msqold, msqbuf, kmsg_first); >+ CP(msqold, msqbuf, kmsg_last); > CP(msqold, msqbuf, msg_cbytes); > CP(msqold, msqbuf, msg_qnum); > CP(msqold, msqbuf, msg_qbytes); >@@ -1861,8 +1861,8 @@ > if (uap->cmd == IPC_STAT) { > bzero(&msqold, sizeof(msqold)); > ipcperm_new2old(&msqbuf.msg_perm, &msqold.msg_perm); >- CP(msqbuf, msqold, msg_first); >- CP(msqbuf, msqold, msg_last); >+ CP(msqbuf, msqold, kmsg_first); >+ CP(msqbuf, msqold, kmsg_last); > CP(msqbuf, msqold, msg_cbytes); > CP(msqbuf, msqold, msg_qnum); > CP(msqbuf, msqold, msg_qbytes); >Index: sys/kern/sysv_sem.c >=================================================================== >--- sys/kern/sysv_sem.c >+++ sys/kern/sysv_sem.c >@@ -286,7 +286,7 @@ > semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK); > > for (i = 0; i < seminfo.semmni; i++) { >- sema[i].u.sem_base = 0; >+ sema[i].u.ksem_base = 0; > sema[i].u.sem_perm.mode = 0; > sema[i].u.sem_perm.seq = 0; > #ifdef MAC >@@ -575,15 +575,15 @@ > wakeup(semakptr); > for (i = 0; i < seminfo.semmni; i++) { > if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && >- sema[i].u.sem_base > semakptr->u.sem_base) >+ sema[i].u.ksem_base > semakptr->u.ksem_base) > mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); > } >- for (i = semakptr->u.sem_base - sem; i < semtot; i++) >+ for (i = semakptr->u.ksem_base - sem; i < semtot; i++) > sem[i] = sem[i + semakptr->u.sem_nsems]; > for (i = 0; i < seminfo.semmni; i++) { > if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && >- sema[i].u.sem_base > semakptr->u.sem_base) { >- sema[i].u.sem_base -= semakptr->u.sem_nsems; >+ sema[i].u.ksem_base > semakptr->u.ksem_base) { >+ sema[i].u.ksem_base -= semakptr->u.sem_nsems; > mtx_unlock(&sema_mtx[i]); > } > } >@@ -801,7 +801,7 @@ > error = EINVAL; > goto done2; > } >- *rval = semakptr->u.sem_base[semnum].semncnt; >+ *rval = semakptr->u.ksem_base[semnum].semncnt; > break; > > case GETPID: >@@ -813,7 +813,7 @@ > error = EINVAL; > goto done2; > } >- *rval = semakptr->u.sem_base[semnum].sempid; >+ *rval = semakptr->u.ksem_base[semnum].sempid; > break; > > case GETVAL: >@@ -825,7 +825,7 @@ > error = EINVAL; > goto done2; > } >- *rval = semakptr->u.sem_base[semnum].semval; >+ *rval = semakptr->u.ksem_base[semnum].semval; > break; > > case GETALL: >@@ -859,7 +859,7 @@ > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > goto done2; > for (i = 0; i < semakptr->u.sem_nsems; i++) >- array[i] = semakptr->u.sem_base[i].semval; >+ array[i] = semakptr->u.ksem_base[i].semval; > mtx_unlock(sema_mtxp); > error = copyout(array, arg->array, count * sizeof(*array)); > mtx_lock(sema_mtxp); >@@ -874,7 +874,7 @@ > error = EINVAL; > goto done2; > } >- *rval = semakptr->u.sem_base[semnum].semzcnt; >+ *rval = semakptr->u.ksem_base[semnum].semzcnt; > break; > > case SETVAL: >@@ -890,7 +890,7 @@ > error = ERANGE; > goto done2; > } >- semakptr->u.sem_base[semnum].semval = arg->val; >+ semakptr->u.ksem_base[semnum].semval = arg->val; > SEMUNDO_LOCK(); > semundo_clear(semidx, semnum); > SEMUNDO_UNLOCK(); >@@ -920,7 +920,7 @@ > error = ERANGE; > break; > } >- semakptr->u.sem_base[i].semval = usval; >+ semakptr->u.ksem_base[i].semval = usval; > } > SEMUNDO_LOCK(); > semundo_clear(semidx, -1); >@@ -1051,16 +1051,16 @@ > sema[semid].u.sem_nsems = nsems; > sema[semid].u.sem_otime = 0; > sema[semid].u.sem_ctime = time_second; >- sema[semid].u.sem_base = &sem[semtot]; >+ sema[semid].u.ksem_base = &sem[semtot]; > semtot += nsems; >- bzero(sema[semid].u.sem_base, >- sizeof(sema[semid].u.sem_base[0])*nsems); >+ bzero(sema[semid].u.ksem_base, >+ sizeof(sema[semid].u.ksem_base[0])*nsems); > #ifdef MAC > mac_sysvsem_create(cred, &sema[semid]); > #endif > mtx_unlock(&sema_mtx[semid]); > DPRINTF(("sembase = %p, next = %p\n", >- sema[semid].u.sem_base, &sem[semtot])); >+ sema[semid].u.ksem_base, &sem[semtot])); > } else { > DPRINTF(("didn't find it and wasn't asked to create it\n")); > error = ENOENT; >@@ -1203,12 +1203,12 @@ > > for (i = 0; i < nsops; i++) { > sopptr = &sops[i]; >- semptr = &semakptr->u.sem_base[sopptr->sem_num]; >+ semptr = &semakptr->u.ksem_base[sopptr->sem_num]; > > DPRINTF(( >- "semop: semakptr=%p, sem_base=%p, " >+ "semop: semakptr=%p, ksem_base=%p, " > "semptr=%p, sem[%d]=%d : op=%d, flag=%s\n", >- semakptr, semakptr->u.sem_base, semptr, >+ semakptr, semakptr->u.ksem_base, semptr, > sopptr->sem_num, semptr->semval, sopptr->sem_op, > (sopptr->sem_flg & IPC_NOWAIT) ? > "nowait" : "wait")); >@@ -1250,7 +1250,7 @@ > */ > DPRINTF(("semop: rollback 0 through %d\n", i-1)); > for (j = 0; j < i; j++) >- semakptr->u.sem_base[sops[j].sem_num].semval -= >+ semakptr->u.ksem_base[sops[j].sem_num].semval -= > sops[j].sem_op; > > /* If we detected an error, return it */ >@@ -1289,10 +1289,10 @@ > > /* > * Renew the semaphore's pointer after wakeup since >- * during msleep sem_base may have been modified and semptr >+ * during msleep ksem_base may have been modified and semptr > * is not valid any more > */ >- semptr = &semakptr->u.sem_base[sopptr->sem_num]; >+ semptr = &semakptr->u.ksem_base[sopptr->sem_num]; > > /* > * The semaphore is still alive. Readjust the count of >@@ -1361,7 +1361,7 @@ > } > > for (j = 0; j < nsops; j++) >- semakptr->u.sem_base[sops[j].sem_num].semval -= >+ semakptr->u.ksem_base[sops[j].sem_num].semval -= > sops[j].sem_op; > > DPRINTF(("error = %d from semundo_adjust\n", error)); >@@ -1374,7 +1374,7 @@ > /* We're definitely done - set the sempid's and time */ > for (i = 0; i < nsops; i++) { > sopptr = &sops[i]; >- semptr = &semakptr->u.sem_base[sopptr->sem_num]; >+ semptr = &semakptr->u.ksem_base[sopptr->sem_num]; > semptr->sempid = td->td_proc->p_pid; > } > semakptr->u.sem_otime = time_second; >@@ -1457,13 +1457,13 @@ > suptr->un_proc, suptr->un_ent[ix].un_id, > suptr->un_ent[ix].un_num, > suptr->un_ent[ix].un_adjval, >- semakptr->u.sem_base[semnum].semval)); >+ semakptr->u.ksem_base[semnum].semval)); > >- if (adjval < 0 && semakptr->u.sem_base[semnum].semval < >+ if (adjval < 0 && semakptr->u.ksem_base[semnum].semval < > -adjval) >- semakptr->u.sem_base[semnum].semval = 0; >+ semakptr->u.ksem_base[semnum].semval = 0; > else >- semakptr->u.sem_base[semnum].semval += adjval; >+ semakptr->u.ksem_base[semnum].semval += adjval; > > wakeup(semakptr); > DPRINTF(("semexit: back from wakeup\n")); >@@ -1764,7 +1764,7 @@ > if (error) > return (error); > ipcperm_old2new(&dsold.sem_perm, &dsbuf.sem_perm); >- CP(dsold, dsbuf, sem_base); >+ CP(dsold, dsbuf, ksem_base); > CP(dsold, dsbuf, sem_nsems); > CP(dsold, dsbuf, sem_otime); > CP(dsold, dsbuf, sem_ctime); >@@ -1789,7 +1789,7 @@ > case IPC_STAT: > bzero(&dsold, sizeof(dsold)); > ipcperm_new2old(&dsbuf.sem_perm, &dsold.sem_perm); >- CP(dsbuf, dsold, sem_base); >+ CP(dsbuf, dsold, ksem_base); > CP(dsbuf, dsold, sem_nsems); > CP(dsbuf, dsold, sem_otime); > CP(dsbuf, dsold, sem_ctime); >@@ -1861,7 +1861,7 @@ > if (error) > return (error); > freebsd32_ipcperm_old_in(&dsbuf32.sem_perm, &dsbuf.sem_perm); >- PTRIN_CP(dsbuf32, dsbuf, sem_base); >+ PTRIN_CP(dsbuf32, dsbuf, ksem_base); > CP(dsbuf32, dsbuf, sem_nsems); > CP(dsbuf32, dsbuf, sem_otime); > CP(dsbuf32, dsbuf, sem_ctime); >@@ -1886,7 +1886,7 @@ > case IPC_STAT: > bzero(&dsbuf32, sizeof(dsbuf32)); > freebsd32_ipcperm_old_out(&dsbuf.sem_perm, &dsbuf32.sem_perm); >- PTROUT_CP(dsbuf, dsbuf32, sem_base); >+ PTROUT_CP(dsbuf, dsbuf32, ksem_base); > CP(dsbuf, dsbuf32, sem_nsems); > CP(dsbuf, dsbuf32, sem_otime); > CP(dsbuf, dsbuf32, sem_ctime); >@@ -1933,7 +1933,7 @@ > if (error) > return (error); > freebsd32_ipcperm_in(&dsbuf32.sem_perm, &dsbuf.sem_perm); >- PTRIN_CP(dsbuf32, dsbuf, sem_base); >+ PTRIN_CP(dsbuf32, dsbuf, ksem_base); > CP(dsbuf32, dsbuf, sem_nsems); > CP(dsbuf32, dsbuf, sem_otime); > CP(dsbuf32, dsbuf, sem_ctime); >@@ -1958,7 +1958,7 @@ > case IPC_STAT: > bzero(&dsbuf32, sizeof(dsbuf32)); > freebsd32_ipcperm_out(&dsbuf.sem_perm, &dsbuf32.sem_perm); >- PTROUT_CP(dsbuf, dsbuf32, sem_base); >+ PTROUT_CP(dsbuf, dsbuf32, ksem_base); > CP(dsbuf, dsbuf32, sem_nsems); > CP(dsbuf, dsbuf32, sem_otime); > CP(dsbuf, dsbuf32, sem_ctime); >Index: sys/sys/msg.h >=================================================================== >--- sys/sys/msg.h >+++ sys/sys/msg.h >@@ -63,8 +63,8 @@ > defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) > struct msqid_ds_old { > struct ipc_perm_old msg_perm; /* msg queue permission bits */ >- struct msg *msg_first; /* first message in the queue */ >- struct msg *msg_last; /* last message in the queue */ >+ struct msg *kmsg_first; /* first message in the queue */ >+ struct msg *kmsg_last; /* last message in the queue */ > msglen_t msg_cbytes; /* number of bytes in use on the queue */ > msgqnum_t msg_qnum; /* number of msgs in the queue */ > msglen_t msg_qbytes; /* max # of bytes on the queue */ >@@ -88,8 +88,8 @@ > > struct msqid_ds { > struct ipc_perm msg_perm; /* msg queue permission bits */ >- struct msg *msg_first; /* first message in the queue */ >- struct msg *msg_last; /* last message in the queue */ >+ struct msg *kmsg_first; /* first message in the queue */ >+ struct msg *kmsg_last; /* last message in the queue */ > msglen_t msg_cbytes; /* number of bytes in use on the queue */ > msgqnum_t msg_qnum; /* number of msgs in the queue */ > msglen_t msg_qbytes; /* max # of bytes on the queue */ >@@ -100,23 +100,6 @@ > time_t msg_ctime; /* time of last msgctl() */ > }; > >-#if __BSD_VISIBLE >-/* >- * Structure describing a message. The SVID doesn't suggest any >- * particular name for this structure. There is a reference in the >- * msgop man page that reads "The structure mymsg is an example of what >- * this user defined buffer might look like, and includes the following >- * members:". This sentence is followed by two lines equivalent >- * to the mtype and mtext field declarations below. It isn't clear >- * if "mymsg" refers to the name of the structure type or the name of an >- * instance of the structure... >- */ >-struct mymsg { >- long mtype; /* message type (+ve integer) */ >- char mtext[1]; /* message body */ >-}; >-#endif >- > #ifdef _KERNEL > > struct msg { >Index: sys/sys/sem.h >=================================================================== >--- sys/sys/sem.h >+++ sys/sys/sem.h >@@ -31,7 +31,7 @@ > defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) > struct semid_ds_old { > struct ipc_perm_old sem_perm; /* operation permission struct */ >- struct sem *sem_base; /* pointer to first semaphore in set */ >+ struct sem *ksem_base; /* pointer to first semaphore in set */ > unsigned short sem_nsems; /* number of sems in set */ > time_t sem_otime; /* last operation time */ > long sem_pad1; /* SVABI/386 says I need this here */ >@@ -45,7 +45,7 @@ > > struct semid_ds { > struct ipc_perm sem_perm; /* operation permission struct */ >- struct sem *sem_base; /* pointer to first semaphore in set */ >+ struct sem *ksem_base; /* pointer to first semaphore in set */ > unsigned short sem_nsems; /* number of sems in set */ > time_t sem_otime; /* last operation time */ > time_t sem_ctime; /* last change time */ >@@ -73,14 +73,16 @@ > }; > #endif > >+#if defined(_KERNEL) || defined(_WANT_SEMUN) > /* > * semctl's arg parameter structure > */ > union semun { > int val; /* value for SETVAL */ > struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ > unsigned short *array; /* array for GETALL & SETALL */ > }; >+#endif > > /* > * commands for semctl >Index: usr.bin/svn/lib/libapr/apr.h >=================================================================== >--- usr.bin/svn/lib/libapr/apr.h >+++ usr.bin/svn/lib/libapr/apr.h >@@ -261,7 +261,7 @@ > #define APR_HAVE_STRSTR 1 > #define APR_HAVE_MEMCHR 1 > #define APR_HAVE_STRUCT_RLIMIT 1 >-#define APR_HAVE_UNION_SEMUN 1 >+#define APR_HAVE_UNION_SEMUN 0 > #define APR_HAVE_SCTP 1 > #define APR_HAVE_IOVEC 1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 224443
: 188945