View | Details | Raw Unified | Return to bug 224443
Collapse All | Expand All

(-)contrib/sendmail/include/sm/os/sm_os_freebsd.h (-1 / +1 lines)
Lines 34-40 Link Here
34
# define SM_CONF_SHM	1
34
# define SM_CONF_SHM	1
35
#endif /* SM_CONF_SHM */
35
#endif /* SM_CONF_SHM */
36
#ifndef SM_CONF_SEM
36
#ifndef SM_CONF_SEM
37
# define SM_CONF_SEM	1
37
# define SM_CONF_SEM	2
38
#endif /* SM_CONF_SEM */
38
#endif /* SM_CONF_SEM */
39
#ifndef SM_CONF_MSG
39
#ifndef SM_CONF_MSG
40
# define SM_CONF_MSG	1
40
# define SM_CONF_MSG	1
(-)lib/libc/gen/semctl.c (+1 lines)
Lines 34-39 Link Here
34
#ifndef NO_COMPAT7
34
#ifndef NO_COMPAT7
35
#define _WANT_SEMUN_OLD
35
#define _WANT_SEMUN_OLD
36
#endif
36
#endif
37
#define _WANT_SEMUN
37
38
38
#include <sys/types.h>
39
#include <sys/types.h>
39
#include <sys/ipc.h>
40
#include <sys/ipc.h>
(-)lib/libc/sys/msgctl.2 (-2 / +2 lines)
Lines 63-70 Link Here
63
.Bd -literal
63
.Bd -literal
64
struct msqid_ds {
64
struct msqid_ds {
65
	struct	ipc_perm msg_perm;	/* msg queue permission bits */
65
	struct	ipc_perm msg_perm;	/* msg queue permission bits */
66
	struct	msg *msg_first;	/* first message in the queue */
66
	struct	msg *kmsg_first;	/* kernel data, don't use */
67
	struct	msg *msg_last;	/* last message in the queue */
67
	struct	msg *kmsg_last;	/* kernel data, don't use */
68
	msglen_t msg_cbytes;	/* number of bytes in use on the queue */
68
	msglen_t msg_cbytes;	/* number of bytes in use on the queue */
69
	msgqnum_t msg_qnum;	/* number of msgs in the queue */
69
	msgqnum_t msg_qnum;	/* number of msgs in the queue */
70
	msglen_t msg_qbytes;	/* max # of bytes on the queue */
70
	msglen_t msg_qbytes;	/* max # of bytes on the queue */
(-)lib/libc/sys/semctl.2 (-1 / +1 lines)
Lines 145-151 Link Here
145
.Bd -literal
145
.Bd -literal
146
struct semid_ds {
146
struct semid_ds {
147
        struct  ipc_perm sem_perm;      /* operation permission struct */
147
        struct  ipc_perm sem_perm;      /* operation permission struct */
148
        struct  sem *sem_base;  /* pointer to first semaphore in set */
148
        struct  sem *ksem_base;  /* kernel data, don't use */
149
        u_short sem_nsems;      /* number of sems in set */
149
        u_short sem_nsems;      /* number of sems in set */
150
        time_t  sem_otime;      /* last operation time */
150
        time_t  sem_otime;      /* last operation time */
151
        time_t  sem_ctime;      /* last change time */
151
        time_t  sem_ctime;      /* last change time */
(-)sys/compat/freebsd32/freebsd32_ipc.h (-6 / +6 lines)
Lines 43-49 Link Here
43
43
44
struct semid_ds32 {
44
struct semid_ds32 {
45
	struct ipc_perm32 sem_perm;
45
	struct ipc_perm32 sem_perm;
46
	uint32_t	sem_base;
46
	uint32_t	ksem_base;
47
	unsigned short	sem_nsems;
47
	unsigned short	sem_nsems;
48
	int32_t		sem_otime;
48
	int32_t		sem_otime;
49
	int32_t		sem_ctime;
49
	int32_t		sem_ctime;
Lines 57-64 Link Here
57
57
58
struct msqid_ds32 {
58
struct msqid_ds32 {
59
	struct ipc_perm32 msg_perm;
59
	struct ipc_perm32 msg_perm;
60
	uint32_t	msg_first;
60
	uint32_t	kmsg_first;
61
	uint32_t	msg_last;
61
	uint32_t	kmsg_last;
62
	uint32_t	msg_cbytes;
62
	uint32_t	msg_cbytes;
63
	uint32_t	msg_qnum;
63
	uint32_t	msg_qnum;
64
	uint32_t	msg_qbytes;
64
	uint32_t	msg_qbytes;
Lines 111-117 Link Here
111
111
112
struct semid_ds32_old {
112
struct semid_ds32_old {
113
	struct ipc_perm32_old sem_perm;
113
	struct ipc_perm32_old sem_perm;
114
	uint32_t	sem_base;
114
	uint32_t	ksem_base;
115
	unsigned short	sem_nsems;
115
	unsigned short	sem_nsems;
116
	int32_t		sem_otime;
116
	int32_t		sem_otime;
117
	int32_t		sem_pad1;
117
	int32_t		sem_pad1;
Lines 122-129 Link Here
122
122
123
struct msqid_ds32_old {
123
struct msqid_ds32_old {
124
	struct ipc_perm32_old msg_perm;
124
	struct ipc_perm32_old msg_perm;
125
	uint32_t	msg_first;
125
	uint32_t	kmsg_first;
126
	uint32_t	msg_last;
126
	uint32_t	kmsg_last;
127
	uint32_t	msg_cbytes;
127
	uint32_t	msg_cbytes;
128
	uint32_t	msg_qnum;
128
	uint32_t	msg_qnum;
129
	uint32_t	msg_qbytes;
129
	uint32_t	msg_qbytes;
(-)sys/compat/linux/linux_ipc.c (-3 / +3 lines)
Lines 160-167 Link Here
160
160
161
struct l_msqid_ds {
161
struct l_msqid_ds {
162
	struct l_ipc_perm	msg_perm;
162
	struct l_ipc_perm	msg_perm;
163
	l_uintptr_t		msg_first;	/* first message on queue,unused */
163
	l_uintptr_t		kmsg_first;	/* first message on queue,unused */
164
	l_uintptr_t		msg_last;	/* last message in queue,unused */
164
	l_uintptr_t		kmsg_last;	/* last message in queue,unused */
165
	l_time_t		msg_stime;	/* last msgsnd time */
165
	l_time_t		msg_stime;	/* last msgsnd time */
166
	l_time_t		msg_rtime;	/* last msgrcv time */
166
	l_time_t		msg_rtime;	/* last msgrcv time */
167
	l_time_t		msg_ctime;	/* last change time */
167
	l_time_t		msg_ctime;	/* last change time */
Lines 178-184 Link Here
178
	struct l_ipc_perm	sem_perm;
178
	struct l_ipc_perm	sem_perm;
179
	l_time_t		sem_otime;
179
	l_time_t		sem_otime;
180
	l_time_t		sem_ctime;
180
	l_time_t		sem_ctime;
181
	l_uintptr_t		sem_base;
181
	l_uintptr_t		ksem_base;
182
	l_uintptr_t		sem_pending;
182
	l_uintptr_t		sem_pending;
183
	l_uintptr_t		sem_pending_last;
183
	l_uintptr_t		sem_pending_last;
184
	l_uintptr_t		undo;
184
	l_uintptr_t		undo;
(-)sys/i386/ibcs2/ibcs2_ipc.h (-3 / +3 lines)
Lines 45-52 Link Here
45
45
46
struct ibcs2_msqid_ds {
46
struct ibcs2_msqid_ds {
47
	struct ibcs2_ipc_perm msg_perm;
47
	struct ibcs2_ipc_perm msg_perm;
48
	struct msg *msg_first;
48
	struct msg *kmsg_first;
49
	struct msg *msg_last;
49
	struct msg *kmsg_last;
50
	u_short msg_cbytes;
50
	u_short msg_cbytes;
51
	u_short msg_qnum;
51
	u_short msg_qnum;
52
	u_short msg_qbytes;
52
	u_short msg_qbytes;
Lines 59-65 Link Here
59
59
60
struct ibcs2_semid_ds {
60
struct ibcs2_semid_ds {
61
        struct ibcs2_ipc_perm sem_perm;
61
        struct ibcs2_ipc_perm sem_perm;
62
	struct ibcs2_sem *sem_base;
62
	struct ibcs2_sem *ksem_base;
63
	u_short sem_nsems;
63
	u_short sem_nsems;
64
	ibcs2_time_t sem_otime;
64
	ibcs2_time_t sem_otime;
65
	ibcs2_time_t sem_ctime;
65
	ibcs2_time_t sem_ctime;
(-)sys/i386/ibcs2/ibcs2_ipc.c (-6 / +6 lines)
Lines 74-81 Link Here
74
struct ibcs2_msqid_ds *ibp;
74
struct ibcs2_msqid_ds *ibp;
75
{
75
{
76
	cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm);
76
	cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm);
77
	ibp->msg_first = bp->msg_first;
77
	ibp->kmsg_first = bp->kmsg_first;
78
	ibp->msg_last = bp->msg_last;
78
	ibp->kmsg_last = bp->kmsg_last;
79
	ibp->msg_cbytes = (u_short)bp->msg_cbytes;
79
	ibp->msg_cbytes = (u_short)bp->msg_cbytes;
80
	ibp->msg_qnum = (u_short)bp->msg_qnum;
80
	ibp->msg_qnum = (u_short)bp->msg_qnum;
81
	ibp->msg_qbytes = (u_short)bp->msg_qbytes;
81
	ibp->msg_qbytes = (u_short)bp->msg_qbytes;
Lines 93-100 Link Here
93
struct msqid_ds *bp;
93
struct msqid_ds *bp;
94
{
94
{
95
	cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm);
95
	cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm);
96
	bp->msg_first = ibp->msg_first;
96
	bp->kmsg_first = ibp->kmsg_first;
97
	bp->msg_last = ibp->msg_last;
97
	bp->kmsg_last = ibp->kmsg_last;
98
	bp->msg_cbytes = ibp->msg_cbytes;
98
	bp->msg_cbytes = ibp->msg_cbytes;
99
	bp->msg_qnum = ibp->msg_qnum;
99
	bp->msg_qnum = ibp->msg_qnum;
100
	bp->msg_qbytes = ibp->msg_qbytes;
100
	bp->msg_qbytes = ibp->msg_qbytes;
Lines 284-290 Link Here
284
struct ibcs2_semid_ds *ibp;
284
struct ibcs2_semid_ds *ibp;
285
{
285
{
286
	cvt_perm2iperm(&bp->sem_perm, &ibp->sem_perm);
286
	cvt_perm2iperm(&bp->sem_perm, &ibp->sem_perm);
287
	ibp->sem_base = (struct ibcs2_sem *)bp->sem_base;
287
	ibp->ksem_base = (struct ibcs2_sem *)bp->ksem_base;
288
	ibp->sem_nsems = bp->sem_nsems;
288
	ibp->sem_nsems = bp->sem_nsems;
289
	ibp->sem_otime = bp->sem_otime;
289
	ibp->sem_otime = bp->sem_otime;
290
	ibp->sem_ctime = bp->sem_ctime;
290
	ibp->sem_ctime = bp->sem_ctime;
Lines 297-303 Link Here
297
struct semid_ds *bp;
297
struct semid_ds *bp;
298
{
298
{
299
	cvt_iperm2perm(&ibp->sem_perm, &bp->sem_perm);
299
	cvt_iperm2perm(&ibp->sem_perm, &bp->sem_perm);
300
	bp->sem_base = (struct sem *)ibp->sem_base;
300
	bp->ksem_base = (struct sem *)ibp->ksem_base;
301
	bp->sem_nsems = ibp->sem_nsems;
301
	bp->sem_nsems = ibp->sem_nsems;
302
	bp->sem_otime = ibp->sem_otime;
302
	bp->sem_otime = ibp->sem_otime;
303
	bp->sem_ctime = ibp->sem_ctime;
303
	bp->sem_ctime = ibp->sem_ctime;
(-)sys/kern/sysv_msg.c (-37 / +37 lines)
Lines 425-431 Link Here
425
	msqkptr->cred = NULL;
425
	msqkptr->cred = NULL;
426
426
427
	/* Free the message headers */
427
	/* Free the message headers */
428
	msghdr = msqkptr->u.msg_first;
428
	msghdr = msqkptr->u.kmsg_first;
429
	while (msghdr != NULL) {
429
	while (msghdr != NULL) {
430
		struct msg *msghdr_tmp;
430
		struct msg *msghdr_tmp;
431
431
Lines 573-579 Link Here
573
		 * thread cannot free a certain msghdr.  The msq will get
573
		 * thread cannot free a certain msghdr.  The msq will get
574
		 * into an inconsistent state.
574
		 * into an inconsistent state.
575
		 */
575
		 */
576
		for (msghdr = msqkptr->u.msg_first; msghdr != NULL;
576
		for (msghdr = msqkptr->u.kmsg_first; msghdr != NULL;
577
		    msghdr = msghdr->msg_next) {
577
		    msghdr = msghdr->msg_next) {
578
			error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr);
578
			error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr);
579
			if (error != 0)
579
			if (error != 0)
Lines 731-738 Link Here
731
		msqkptr->cred = crhold(cred);
731
		msqkptr->cred = crhold(cred);
732
		/* Make sure that the returned msqid is unique */
732
		/* Make sure that the returned msqid is unique */
733
		msqkptr->u.msg_perm.seq = (msqkptr->u.msg_perm.seq + 1) & 0x7fff;
733
		msqkptr->u.msg_perm.seq = (msqkptr->u.msg_perm.seq + 1) & 0x7fff;
734
		msqkptr->u.msg_first = NULL;
734
		msqkptr->u.kmsg_first = NULL;
735
		msqkptr->u.msg_last = NULL;
735
		msqkptr->u.kmsg_last = NULL;
736
		msqkptr->u.msg_cbytes = 0;
736
		msqkptr->u.msg_cbytes = 0;
737
		msqkptr->u.msg_qnum = 0;
737
		msqkptr->u.msg_qnum = 0;
738
		msqkptr->u.msg_qbytes = msginfo.msgmnb;
738
		msqkptr->u.msg_qbytes = msginfo.msgmnb;
Lines 1079-1092 Link Here
1079
	/*
1079
	/*
1080
	 * Put the message into the queue
1080
	 * Put the message into the queue
1081
	 */
1081
	 */
1082
	if (msqkptr->u.msg_first == NULL) {
1082
	if (msqkptr->u.kmsg_first == NULL) {
1083
		msqkptr->u.msg_first = msghdr;
1083
		msqkptr->u.kmsg_first = msghdr;
1084
		msqkptr->u.msg_last = msghdr;
1084
		msqkptr->u.kmsg_last = msghdr;
1085
	} else {
1085
	} else {
1086
		msqkptr->u.msg_last->msg_next = msghdr;
1086
		msqkptr->u.kmsg_last->msg_next = msghdr;
1087
		msqkptr->u.msg_last = msghdr;
1087
		msqkptr->u.kmsg_last = msghdr;
1088
	}
1088
	}
1089
	msqkptr->u.msg_last->msg_next = NULL;
1089
	msqkptr->u.kmsg_last->msg_next = NULL;
1090
1090
1091
	msqkptr->u.msg_cbytes += msghdr->msg_ts;
1091
	msqkptr->u.msg_cbytes += msghdr->msg_ts;
1092
	msqkptr->u.msg_qnum++;
1092
	msqkptr->u.msg_qnum++;
Lines 1194-1200 Link Here
1194
	msghdr = NULL;
1194
	msghdr = NULL;
1195
	while (msghdr == NULL) {
1195
	while (msghdr == NULL) {
1196
		if (msgtyp == 0) {
1196
		if (msgtyp == 0) {
1197
			msghdr = msqkptr->u.msg_first;
1197
			msghdr = msqkptr->u.kmsg_first;
1198
			if (msghdr != NULL) {
1198
			if (msghdr != NULL) {
1199
				if (msgsz < msghdr->msg_ts &&
1199
				if (msgsz < msghdr->msg_ts &&
1200
				    (msgflg & MSG_NOERROR) == 0) {
1200
				    (msgflg & MSG_NOERROR) == 0) {
Lines 1210-1230 Link Here
1210
				if (error != 0)
1210
				if (error != 0)
1211
					goto done2;
1211
					goto done2;
1212
#endif
1212
#endif
1213
				if (msqkptr->u.msg_first == msqkptr->u.msg_last) {
1213
				if (msqkptr->u.kmsg_first == msqkptr->u.kmsg_last) {
1214
					msqkptr->u.msg_first = NULL;
1214
					msqkptr->u.kmsg_first = NULL;
1215
					msqkptr->u.msg_last = NULL;
1215
					msqkptr->u.kmsg_last = NULL;
1216
				} else {
1216
				} else {
1217
					msqkptr->u.msg_first = msghdr->msg_next;
1217
					msqkptr->u.kmsg_first = msghdr->msg_next;
1218
					if (msqkptr->u.msg_first == NULL)
1218
					if (msqkptr->u.kmsg_first == NULL)
1219
						panic("msg_first/last screwed up #1");
1219
						panic("msg_first/last screwed up #1");
1220
				}
1220
				}
1221
			}
1221
			}
1222
		} else {
1222
		} else {
1223
			struct msg *previous;
1223
			struct msg *previous;
1224
			struct msg **prev;
1224
			struct msg **prev;
1225
1225
1226
			previous = NULL;
1226
			previous = NULL;
1227
			prev = &(msqkptr->u.msg_first);
1227
			prev = &(msqkptr->u.kmsg_first);
1228
			while ((msghdr = *prev) != NULL) {
1228
			while ((msghdr = *prev) != NULL) {
1229
				/*
1229
				/*
1230
				 * Is this message's type an exact match or is
1230
				 * Is this message's type an exact match or is
Lines 1256-1275 Link Here
1256
						goto done2;
1256
						goto done2;
1257
#endif
1257
#endif
1258
					*prev = msghdr->msg_next;
1258
					*prev = msghdr->msg_next;
1259
					if (msghdr == msqkptr->u.msg_last) {
1259
					if (msghdr == msqkptr->u.kmsg_last) {
1260
						if (previous == NULL) {
1260
						if (previous == NULL) {
1261
							if (prev !=
1261
							if (prev !=
1262
							    &msqkptr->u.msg_first)
1262
							    &msqkptr->u.kmsg_first)
1263
								panic("msg_first/last screwed up #2");
1263
								panic("kmsg_first/last screwed up #2");
1264
							msqkptr->u.msg_first =
1264
							msqkptr->u.kmsg_first =
1265
							    NULL;
1265
							    NULL;
1266
							msqkptr->u.msg_last =
1266
							msqkptr->u.kmsg_last =
1267
							    NULL;
1267
							    NULL;
1268
						} else {
1268
						} else {
1269
							if (prev ==
1269
							if (prev ==
1270
							    &msqkptr->u.msg_first)
1270
							    &msqkptr->u.kmsg_first)
1271
								panic("msg_first/last screwed up #3");
1271
								panic("kmsg_first/last screwed up #3");
1272
							msqkptr->u.msg_last =
1272
							msqkptr->u.kmsg_last =
1273
							    previous;
1273
							    previous;
1274
						}
1274
						}
1275
					}
1275
					}
Lines 1674-1681 Link Here
1674
		if (error)
1674
		if (error)
1675
			return (error);
1675
			return (error);
1676
		freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
1676
		freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
1677
		PTRIN_CP(msqbuf32, msqbuf, msg_first);
1677
		PTRIN_CP(msqbuf32, msqbuf, kmsg_first);
1678
		PTRIN_CP(msqbuf32, msqbuf, msg_last);
1678
		PTRIN_CP(msqbuf32, msqbuf, kmsg_last);
1679
		CP(msqbuf32, msqbuf, msg_cbytes);
1679
		CP(msqbuf32, msqbuf, msg_cbytes);
1680
		CP(msqbuf32, msqbuf, msg_qnum);
1680
		CP(msqbuf32, msqbuf, msg_qnum);
1681
		CP(msqbuf32, msqbuf, msg_qbytes);
1681
		CP(msqbuf32, msqbuf, msg_qbytes);
Lines 1691-1698 Link Here
1691
	if (uap->cmd == IPC_STAT) {
1691
	if (uap->cmd == IPC_STAT) {
1692
		bzero(&msqbuf32, sizeof(msqbuf32));
1692
		bzero(&msqbuf32, sizeof(msqbuf32));
1693
		freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
1693
		freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
1694
		PTROUT_CP(msqbuf, msqbuf32, msg_first);
1694
		PTROUT_CP(msqbuf, msqbuf32, kmsg_first);
1695
		PTROUT_CP(msqbuf, msqbuf32, msg_last);
1695
		PTROUT_CP(msqbuf, msqbuf32, kmsg_last);
1696
		CP(msqbuf, msqbuf32, msg_cbytes);
1696
		CP(msqbuf, msqbuf32, msg_cbytes);
1697
		CP(msqbuf, msqbuf32, msg_qnum);
1697
		CP(msqbuf, msqbuf32, msg_qnum);
1698
		CP(msqbuf, msqbuf32, msg_qbytes);
1698
		CP(msqbuf, msqbuf32, msg_qbytes);
Lines 1719-1726 Link Here
1719
		if (error)
1719
		if (error)
1720
			return (error);
1720
			return (error);
1721
		freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
1721
		freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
1722
		PTRIN_CP(msqbuf32, msqbuf, msg_first);
1722
		PTRIN_CP(msqbuf32, msqbuf, kmsg_first);
1723
		PTRIN_CP(msqbuf32, msqbuf, msg_last);
1723
		PTRIN_CP(msqbuf32, msqbuf, kmsg_last);
1724
		CP(msqbuf32, msqbuf, msg_cbytes);
1724
		CP(msqbuf32, msqbuf, msg_cbytes);
1725
		CP(msqbuf32, msqbuf, msg_qnum);
1725
		CP(msqbuf32, msqbuf, msg_qnum);
1726
		CP(msqbuf32, msqbuf, msg_qbytes);
1726
		CP(msqbuf32, msqbuf, msg_qbytes);
Lines 1735-1742 Link Here
1735
		return (error);
1735
		return (error);
1736
	if (uap->cmd == IPC_STAT) {
1736
	if (uap->cmd == IPC_STAT) {
1737
		freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
1737
		freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
1738
		PTROUT_CP(msqbuf, msqbuf32, msg_first);
1738
		PTROUT_CP(msqbuf, msqbuf32, kmsg_first);
1739
		PTROUT_CP(msqbuf, msqbuf32, msg_last);
1739
		PTROUT_CP(msqbuf, msqbuf32, kmsg_last);
1740
		CP(msqbuf, msqbuf32, msg_cbytes);
1740
		CP(msqbuf, msqbuf32, msg_cbytes);
1741
		CP(msqbuf, msqbuf32, msg_qnum);
1741
		CP(msqbuf, msqbuf32, msg_qnum);
1742
		CP(msqbuf, msqbuf32, msg_qbytes);
1742
		CP(msqbuf, msqbuf32, msg_qbytes);
Lines 1844-1851 Link Here
1844
		if (error)
1844
		if (error)
1845
			return (error);
1845
			return (error);
1846
		ipcperm_old2new(&msqold.msg_perm, &msqbuf.msg_perm);
1846
		ipcperm_old2new(&msqold.msg_perm, &msqbuf.msg_perm);
1847
		CP(msqold, msqbuf, msg_first);
1847
		CP(msqold, msqbuf, kmsg_first);
1848
		CP(msqold, msqbuf, msg_last);
1848
		CP(msqold, msqbuf, kmsg_last);
1849
		CP(msqold, msqbuf, msg_cbytes);
1849
		CP(msqold, msqbuf, msg_cbytes);
1850
		CP(msqold, msqbuf, msg_qnum);
1850
		CP(msqold, msqbuf, msg_qnum);
1851
		CP(msqold, msqbuf, msg_qbytes);
1851
		CP(msqold, msqbuf, msg_qbytes);
Lines 1861-1868 Link Here
1861
	if (uap->cmd == IPC_STAT) {
1861
	if (uap->cmd == IPC_STAT) {
1862
		bzero(&msqold, sizeof(msqold));
1862
		bzero(&msqold, sizeof(msqold));
1863
		ipcperm_new2old(&msqbuf.msg_perm, &msqold.msg_perm);
1863
		ipcperm_new2old(&msqbuf.msg_perm, &msqold.msg_perm);
1864
		CP(msqbuf, msqold, msg_first);
1864
		CP(msqbuf, msqold, kmsg_first);
1865
		CP(msqbuf, msqold, msg_last);
1865
		CP(msqbuf, msqold, kmsg_last);
1866
		CP(msqbuf, msqold, msg_cbytes);
1866
		CP(msqbuf, msqold, msg_cbytes);
1867
		CP(msqbuf, msqold, msg_qnum);
1867
		CP(msqbuf, msqold, msg_qnum);
1868
		CP(msqbuf, msqold, msg_qbytes);
1868
		CP(msqbuf, msqold, msg_qbytes);
(-)sys/kern/sysv_sem.c (-34 / +34 lines)
Lines 286-292 Link Here
286
	semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK);
286
	semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK);
287
287
288
	for (i = 0; i < seminfo.semmni; i++) {
288
	for (i = 0; i < seminfo.semmni; i++) {
289
		sema[i].u.sem_base = 0;
289
		sema[i].u.ksem_base = 0;
290
		sema[i].u.sem_perm.mode = 0;
290
		sema[i].u.sem_perm.mode = 0;
291
		sema[i].u.sem_perm.seq = 0;
291
		sema[i].u.sem_perm.seq = 0;
292
#ifdef MAC
292
#ifdef MAC
Lines 575-589 Link Here
575
	wakeup(semakptr);
575
	wakeup(semakptr);
576
	for (i = 0; i < seminfo.semmni; i++) {
576
	for (i = 0; i < seminfo.semmni; i++) {
577
		if ((sema[i].u.sem_perm.mode & SEM_ALLOC) &&
577
		if ((sema[i].u.sem_perm.mode & SEM_ALLOC) &&
578
		    sema[i].u.sem_base > semakptr->u.sem_base)
578
		    sema[i].u.ksem_base > semakptr->u.ksem_base)
579
			mtx_lock_flags(&sema_mtx[i], LOP_DUPOK);
579
			mtx_lock_flags(&sema_mtx[i], LOP_DUPOK);
580
	}
580
	}
581
	for (i = semakptr->u.sem_base - sem; i < semtot; i++)
581
	for (i = semakptr->u.ksem_base - sem; i < semtot; i++)
582
		sem[i] = sem[i + semakptr->u.sem_nsems];
582
		sem[i] = sem[i + semakptr->u.sem_nsems];
583
	for (i = 0; i < seminfo.semmni; i++) {
583
	for (i = 0; i < seminfo.semmni; i++) {
584
		if ((sema[i].u.sem_perm.mode & SEM_ALLOC) &&
584
		if ((sema[i].u.sem_perm.mode & SEM_ALLOC) &&
585
		    sema[i].u.sem_base > semakptr->u.sem_base) {
585
		    sema[i].u.ksem_base > semakptr->u.ksem_base) {
586
			sema[i].u.sem_base -= semakptr->u.sem_nsems;
586
			sema[i].u.ksem_base -= semakptr->u.sem_nsems;
587
			mtx_unlock(&sema_mtx[i]);
587
			mtx_unlock(&sema_mtx[i]);
588
		}
588
		}
589
	}
589
	}
Lines 801-807 Link Here
801
			error = EINVAL;
801
			error = EINVAL;
802
			goto done2;
802
			goto done2;
803
		}
803
		}
804
		*rval = semakptr->u.sem_base[semnum].semncnt;
804
		*rval = semakptr->u.ksem_base[semnum].semncnt;
805
		break;
805
		break;
806
806
807
	case GETPID:
807
	case GETPID:
Lines 813-819 Link Here
813
			error = EINVAL;
813
			error = EINVAL;
814
			goto done2;
814
			goto done2;
815
		}
815
		}
816
		*rval = semakptr->u.sem_base[semnum].sempid;
816
		*rval = semakptr->u.ksem_base[semnum].sempid;
817
		break;
817
		break;
818
818
819
	case GETVAL:
819
	case GETVAL:
Lines 825-831 Link Here
825
			error = EINVAL;
825
			error = EINVAL;
826
			goto done2;
826
			goto done2;
827
		}
827
		}
828
		*rval = semakptr->u.sem_base[semnum].semval;
828
		*rval = semakptr->u.ksem_base[semnum].semval;
829
		break;
829
		break;
830
830
831
	case GETALL:
831
	case GETALL:
Lines 859-865 Link Here
859
		if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R)))
859
		if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R)))
860
			goto done2;
860
			goto done2;
861
		for (i = 0; i < semakptr->u.sem_nsems; i++)
861
		for (i = 0; i < semakptr->u.sem_nsems; i++)
862
			array[i] = semakptr->u.sem_base[i].semval;
862
			array[i] = semakptr->u.ksem_base[i].semval;
863
		mtx_unlock(sema_mtxp);
863
		mtx_unlock(sema_mtxp);
864
		error = copyout(array, arg->array, count * sizeof(*array));
864
		error = copyout(array, arg->array, count * sizeof(*array));
865
		mtx_lock(sema_mtxp);
865
		mtx_lock(sema_mtxp);
Lines 874-880 Link Here
874
			error = EINVAL;
874
			error = EINVAL;
875
			goto done2;
875
			goto done2;
876
		}
876
		}
877
		*rval = semakptr->u.sem_base[semnum].semzcnt;
877
		*rval = semakptr->u.ksem_base[semnum].semzcnt;
878
		break;
878
		break;
879
879
880
	case SETVAL:
880
	case SETVAL:
Lines 890-896 Link Here
890
			error = ERANGE;
890
			error = ERANGE;
891
			goto done2;
891
			goto done2;
892
		}
892
		}
893
		semakptr->u.sem_base[semnum].semval = arg->val;
893
		semakptr->u.ksem_base[semnum].semval = arg->val;
894
		SEMUNDO_LOCK();
894
		SEMUNDO_LOCK();
895
		semundo_clear(semidx, semnum);
895
		semundo_clear(semidx, semnum);
896
		SEMUNDO_UNLOCK();
896
		SEMUNDO_UNLOCK();
Lines 920-926 Link Here
920
				error = ERANGE;
920
				error = ERANGE;
921
				break;
921
				break;
922
			}
922
			}
923
			semakptr->u.sem_base[i].semval = usval;
923
			semakptr->u.ksem_base[i].semval = usval;
924
		}
924
		}
925
		SEMUNDO_LOCK();
925
		SEMUNDO_LOCK();
926
		semundo_clear(semidx, -1);
926
		semundo_clear(semidx, -1);
Lines 1051-1066 Link Here
1051
		sema[semid].u.sem_nsems = nsems;
1051
		sema[semid].u.sem_nsems = nsems;
1052
		sema[semid].u.sem_otime = 0;
1052
		sema[semid].u.sem_otime = 0;
1053
		sema[semid].u.sem_ctime = time_second;
1053
		sema[semid].u.sem_ctime = time_second;
1054
		sema[semid].u.sem_base = &sem[semtot];
1054
		sema[semid].u.ksem_base = &sem[semtot];
1055
		semtot += nsems;
1055
		semtot += nsems;
1056
		bzero(sema[semid].u.sem_base,
1056
		bzero(sema[semid].u.ksem_base,
1057
		    sizeof(sema[semid].u.sem_base[0])*nsems);
1057
		    sizeof(sema[semid].u.ksem_base[0])*nsems);
1058
#ifdef MAC
1058
#ifdef MAC
1059
		mac_sysvsem_create(cred, &sema[semid]);
1059
		mac_sysvsem_create(cred, &sema[semid]);
1060
#endif
1060
#endif
1061
		mtx_unlock(&sema_mtx[semid]);
1061
		mtx_unlock(&sema_mtx[semid]);
1062
		DPRINTF(("sembase = %p, next = %p\n",
1062
		DPRINTF(("sembase = %p, next = %p\n",
1063
		    sema[semid].u.sem_base, &sem[semtot]));
1063
		    sema[semid].u.ksem_base, &sem[semtot]));
1064
	} else {
1064
	} else {
1065
		DPRINTF(("didn't find it and wasn't asked to create it\n"));
1065
		DPRINTF(("didn't find it and wasn't asked to create it\n"));
1066
		error = ENOENT;
1066
		error = ENOENT;
Lines 1203-1214 Link Here
1203
1203
1204
		for (i = 0; i < nsops; i++) {
1204
		for (i = 0; i < nsops; i++) {
1205
			sopptr = &sops[i];
1205
			sopptr = &sops[i];
1206
			semptr = &semakptr->u.sem_base[sopptr->sem_num];
1206
			semptr = &semakptr->u.ksem_base[sopptr->sem_num];
1207
1207
1208
			DPRINTF((
1208
			DPRINTF((
1209
			    "semop:  semakptr=%p, sem_base=%p, "
1209
			    "semop:  semakptr=%p, ksem_base=%p, "
1210
			    "semptr=%p, sem[%d]=%d : op=%d, flag=%s\n",
1210
			    "semptr=%p, sem[%d]=%d : op=%d, flag=%s\n",
1211
			    semakptr, semakptr->u.sem_base, semptr,
1211
			    semakptr, semakptr->u.ksem_base, semptr,
1212
			    sopptr->sem_num, semptr->semval, sopptr->sem_op,
1212
			    sopptr->sem_num, semptr->semval, sopptr->sem_op,
1213
			    (sopptr->sem_flg & IPC_NOWAIT) ?
1213
			    (sopptr->sem_flg & IPC_NOWAIT) ?
1214
			    "nowait" : "wait"));
1214
			    "nowait" : "wait"));
Lines 1250-1256 Link Here
1250
		 */
1250
		 */
1251
		DPRINTF(("semop:  rollback 0 through %d\n", i-1));
1251
		DPRINTF(("semop:  rollback 0 through %d\n", i-1));
1252
		for (j = 0; j < i; j++)
1252
		for (j = 0; j < i; j++)
1253
			semakptr->u.sem_base[sops[j].sem_num].semval -=
1253
			semakptr->u.ksem_base[sops[j].sem_num].semval -=
1254
			    sops[j].sem_op;
1254
			    sops[j].sem_op;
1255
1255
1256
		/* If we detected an error, return it */
1256
		/* If we detected an error, return it */
Lines 1289-1298 Link Here
1289
1289
1290
		/*
1290
		/*
1291
		 * Renew the semaphore's pointer after wakeup since
1291
		 * Renew the semaphore's pointer after wakeup since
1292
		 * during msleep sem_base may have been modified and semptr
1292
		 * during msleep ksem_base may have been modified and semptr
1293
		 * is not valid any more
1293
		 * is not valid any more
1294
		 */
1294
		 */
1295
		semptr = &semakptr->u.sem_base[sopptr->sem_num];
1295
		semptr = &semakptr->u.ksem_base[sopptr->sem_num];
1296
1296
1297
		/*
1297
		/*
1298
		 * The semaphore is still alive.  Readjust the count of
1298
		 * The semaphore is still alive.  Readjust the count of
Lines 1361-1367 Link Here
1361
			}
1361
			}
1362
1362
1363
			for (j = 0; j < nsops; j++)
1363
			for (j = 0; j < nsops; j++)
1364
				semakptr->u.sem_base[sops[j].sem_num].semval -=
1364
				semakptr->u.ksem_base[sops[j].sem_num].semval -=
1365
				    sops[j].sem_op;
1365
				    sops[j].sem_op;
1366
1366
1367
			DPRINTF(("error = %d from semundo_adjust\n", error));
1367
			DPRINTF(("error = %d from semundo_adjust\n", error));
Lines 1374-1380 Link Here
1374
	/* We're definitely done - set the sempid's and time */
1374
	/* We're definitely done - set the sempid's and time */
1375
	for (i = 0; i < nsops; i++) {
1375
	for (i = 0; i < nsops; i++) {
1376
		sopptr = &sops[i];
1376
		sopptr = &sops[i];
1377
		semptr = &semakptr->u.sem_base[sopptr->sem_num];
1377
		semptr = &semakptr->u.ksem_base[sopptr->sem_num];
1378
		semptr->sempid = td->td_proc->p_pid;
1378
		semptr->sempid = td->td_proc->p_pid;
1379
	}
1379
	}
1380
	semakptr->u.sem_otime = time_second;
1380
	semakptr->u.sem_otime = time_second;
Lines 1457-1469 Link Here
1457
			    suptr->un_proc, suptr->un_ent[ix].un_id,
1457
			    suptr->un_proc, suptr->un_ent[ix].un_id,
1458
			    suptr->un_ent[ix].un_num,
1458
			    suptr->un_ent[ix].un_num,
1459
			    suptr->un_ent[ix].un_adjval,
1459
			    suptr->un_ent[ix].un_adjval,
1460
			    semakptr->u.sem_base[semnum].semval));
1460
			    semakptr->u.ksem_base[semnum].semval));
1461
1461
1462
			if (adjval < 0 && semakptr->u.sem_base[semnum].semval <
1462
			if (adjval < 0 && semakptr->u.ksem_base[semnum].semval <
1463
			    -adjval)
1463
			    -adjval)
1464
				semakptr->u.sem_base[semnum].semval = 0;
1464
				semakptr->u.ksem_base[semnum].semval = 0;
1465
			else
1465
			else
1466
				semakptr->u.sem_base[semnum].semval += adjval;
1466
				semakptr->u.ksem_base[semnum].semval += adjval;
1467
1467
1468
			wakeup(semakptr);
1468
			wakeup(semakptr);
1469
			DPRINTF(("semexit:  back from wakeup\n"));
1469
			DPRINTF(("semexit:  back from wakeup\n"));
Lines 1764-1770 Link Here
1764
		if (error)
1764
		if (error)
1765
			return (error);
1765
			return (error);
1766
		ipcperm_old2new(&dsold.sem_perm, &dsbuf.sem_perm);
1766
		ipcperm_old2new(&dsold.sem_perm, &dsbuf.sem_perm);
1767
		CP(dsold, dsbuf, sem_base);
1767
		CP(dsold, dsbuf, ksem_base);
1768
		CP(dsold, dsbuf, sem_nsems);
1768
		CP(dsold, dsbuf, sem_nsems);
1769
		CP(dsold, dsbuf, sem_otime);
1769
		CP(dsold, dsbuf, sem_otime);
1770
		CP(dsold, dsbuf, sem_ctime);
1770
		CP(dsold, dsbuf, sem_ctime);
Lines 1789-1795 Link Here
1789
	case IPC_STAT:
1789
	case IPC_STAT:
1790
		bzero(&dsold, sizeof(dsold));
1790
		bzero(&dsold, sizeof(dsold));
1791
		ipcperm_new2old(&dsbuf.sem_perm, &dsold.sem_perm);
1791
		ipcperm_new2old(&dsbuf.sem_perm, &dsold.sem_perm);
1792
		CP(dsbuf, dsold, sem_base);
1792
		CP(dsbuf, dsold, ksem_base);
1793
		CP(dsbuf, dsold, sem_nsems);
1793
		CP(dsbuf, dsold, sem_nsems);
1794
		CP(dsbuf, dsold, sem_otime);
1794
		CP(dsbuf, dsold, sem_otime);
1795
		CP(dsbuf, dsold, sem_ctime);
1795
		CP(dsbuf, dsold, sem_ctime);
Lines 1861-1867 Link Here
1861
		if (error)
1861
		if (error)
1862
			return (error);
1862
			return (error);
1863
		freebsd32_ipcperm_old_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
1863
		freebsd32_ipcperm_old_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
1864
		PTRIN_CP(dsbuf32, dsbuf, sem_base);
1864
		PTRIN_CP(dsbuf32, dsbuf, ksem_base);
1865
		CP(dsbuf32, dsbuf, sem_nsems);
1865
		CP(dsbuf32, dsbuf, sem_nsems);
1866
		CP(dsbuf32, dsbuf, sem_otime);
1866
		CP(dsbuf32, dsbuf, sem_otime);
1867
		CP(dsbuf32, dsbuf, sem_ctime);
1867
		CP(dsbuf32, dsbuf, sem_ctime);
Lines 1886-1892 Link Here
1886
	case IPC_STAT:
1886
	case IPC_STAT:
1887
		bzero(&dsbuf32, sizeof(dsbuf32));
1887
		bzero(&dsbuf32, sizeof(dsbuf32));
1888
		freebsd32_ipcperm_old_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
1888
		freebsd32_ipcperm_old_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
1889
		PTROUT_CP(dsbuf, dsbuf32, sem_base);
1889
		PTROUT_CP(dsbuf, dsbuf32, ksem_base);
1890
		CP(dsbuf, dsbuf32, sem_nsems);
1890
		CP(dsbuf, dsbuf32, sem_nsems);
1891
		CP(dsbuf, dsbuf32, sem_otime);
1891
		CP(dsbuf, dsbuf32, sem_otime);
1892
		CP(dsbuf, dsbuf32, sem_ctime);
1892
		CP(dsbuf, dsbuf32, sem_ctime);
Lines 1933-1939 Link Here
1933
		if (error)
1933
		if (error)
1934
			return (error);
1934
			return (error);
1935
		freebsd32_ipcperm_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
1935
		freebsd32_ipcperm_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
1936
		PTRIN_CP(dsbuf32, dsbuf, sem_base);
1936
		PTRIN_CP(dsbuf32, dsbuf, ksem_base);
1937
		CP(dsbuf32, dsbuf, sem_nsems);
1937
		CP(dsbuf32, dsbuf, sem_nsems);
1938
		CP(dsbuf32, dsbuf, sem_otime);
1938
		CP(dsbuf32, dsbuf, sem_otime);
1939
		CP(dsbuf32, dsbuf, sem_ctime);
1939
		CP(dsbuf32, dsbuf, sem_ctime);
Lines 1958-1964 Link Here
1958
	case IPC_STAT:
1958
	case IPC_STAT:
1959
		bzero(&dsbuf32, sizeof(dsbuf32));
1959
		bzero(&dsbuf32, sizeof(dsbuf32));
1960
		freebsd32_ipcperm_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
1960
		freebsd32_ipcperm_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
1961
		PTROUT_CP(dsbuf, dsbuf32, sem_base);
1961
		PTROUT_CP(dsbuf, dsbuf32, ksem_base);
1962
		CP(dsbuf, dsbuf32, sem_nsems);
1962
		CP(dsbuf, dsbuf32, sem_nsems);
1963
		CP(dsbuf, dsbuf32, sem_otime);
1963
		CP(dsbuf, dsbuf32, sem_otime);
1964
		CP(dsbuf, dsbuf32, sem_ctime);
1964
		CP(dsbuf, dsbuf32, sem_ctime);
(-)sys/sys/msg.h (-21 / +4 lines)
Lines 63-70 Link Here
63
    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
63
    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
64
struct msqid_ds_old {
64
struct msqid_ds_old {
65
	struct	ipc_perm_old msg_perm;	/* msg queue permission bits */
65
	struct	ipc_perm_old msg_perm;	/* msg queue permission bits */
66
	struct	msg *msg_first;	/* first message in the queue */
66
	struct	msg *kmsg_first;	/* first message in the queue */
67
	struct	msg *msg_last;	/* last message in the queue */
67
	struct	msg *kmsg_last;	/* last message in the queue */
68
	msglen_t msg_cbytes;	/* number of bytes in use on the queue */
68
	msglen_t msg_cbytes;	/* number of bytes in use on the queue */
69
	msgqnum_t msg_qnum;	/* number of msgs in the queue */
69
	msgqnum_t msg_qnum;	/* number of msgs in the queue */
70
	msglen_t msg_qbytes;	/* max # of bytes on the queue */
70
	msglen_t msg_qbytes;	/* max # of bytes on the queue */
Lines 88-95 Link Here
88
88
89
struct msqid_ds {
89
struct msqid_ds {
90
	struct	ipc_perm msg_perm;	/* msg queue permission bits */
90
	struct	ipc_perm msg_perm;	/* msg queue permission bits */
91
	struct	msg *msg_first;	/* first message in the queue */
91
	struct	msg *kmsg_first;	/* first message in the queue */
92
	struct	msg *msg_last;	/* last message in the queue */
92
	struct	msg *kmsg_last;	/* last message in the queue */
93
	msglen_t msg_cbytes;	/* number of bytes in use on the queue */
93
	msglen_t msg_cbytes;	/* number of bytes in use on the queue */
94
	msgqnum_t msg_qnum;	/* number of msgs in the queue */
94
	msgqnum_t msg_qnum;	/* number of msgs in the queue */
95
	msglen_t msg_qbytes;	/* max # of bytes on the queue */
95
	msglen_t msg_qbytes;	/* max # of bytes on the queue */
Lines 100-122 Link Here
100
	time_t	msg_ctime;	/* time of last msgctl() */
100
	time_t	msg_ctime;	/* time of last msgctl() */
101
};
101
};
102
102
103
#if __BSD_VISIBLE
104
/*
105
 * Structure describing a message.  The SVID doesn't suggest any
106
 * particular name for this structure.  There is a reference in the
107
 * msgop man page that reads "The structure mymsg is an example of what
108
 * this user defined buffer might look like, and includes the following
109
 * members:".  This sentence is followed by two lines equivalent
110
 * to the mtype and mtext field declarations below.  It isn't clear
111
 * if "mymsg" refers to the name of the structure type or the name of an
112
 * instance of the structure...
113
 */
114
struct mymsg {
115
	long	mtype;		/* message type (+ve integer) */
116
	char	mtext[1];	/* message body */
117
};
118
#endif
119
120
#ifdef _KERNEL
103
#ifdef _KERNEL
121
104
122
struct msg {
105
struct msg {
(-)sys/sys/sem.h (-2 / +4 lines)
Lines 31-37 Link Here
31
    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
31
    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
32
struct semid_ds_old {
32
struct semid_ds_old {
33
	struct ipc_perm_old sem_perm;	/* operation permission struct */
33
	struct ipc_perm_old sem_perm;	/* operation permission struct */
34
	struct sem	*sem_base;	/* pointer to first semaphore in set */
34
	struct sem	*ksem_base;	/* pointer to first semaphore in set */
35
	unsigned short	sem_nsems;	/* number of sems in set */
35
	unsigned short	sem_nsems;	/* number of sems in set */
36
	time_t		sem_otime;	/* last operation time */
36
	time_t		sem_otime;	/* last operation time */
37
	long		sem_pad1;	/* SVABI/386 says I need this here */
37
	long		sem_pad1;	/* SVABI/386 says I need this here */
Lines 45-51 Link Here
45
45
46
struct semid_ds {
46
struct semid_ds {
47
	struct ipc_perm	sem_perm;	/* operation permission struct */
47
	struct ipc_perm	sem_perm;	/* operation permission struct */
48
	struct sem	*sem_base;	/* pointer to first semaphore in set */
48
	struct sem	*ksem_base;	/* pointer to first semaphore in set */
49
	unsigned short	sem_nsems;	/* number of sems in set */
49
	unsigned short	sem_nsems;	/* number of sems in set */
50
	time_t		sem_otime;	/* last operation time */
50
	time_t		sem_otime;	/* last operation time */
51
	time_t		sem_ctime;	/* last change time */
51
	time_t		sem_ctime;	/* last change time */
Lines 73-86 Link Here
73
};
73
};
74
#endif
74
#endif
75
75
76
#if defined(_KERNEL) || defined(_WANT_SEMUN)
76
/*
77
/*
77
 * semctl's arg parameter structure
78
 * semctl's arg parameter structure
78
 */
79
 */
79
union semun {
80
union semun {
80
	int		val;		/* value for SETVAL */
81
	int		val;		/* value for SETVAL */
81
	struct		semid_ds *buf;	/* buffer for IPC_STAT & IPC_SET */
82
	struct		semid_ds *buf;	/* buffer for IPC_STAT & IPC_SET */
82
	unsigned short	*array;		/* array for GETALL & SETALL */
83
	unsigned short	*array;		/* array for GETALL & SETALL */
83
};
84
};
85
#endif
84
86
85
/*
87
/*
86
 * commands for semctl
88
 * commands for semctl
(-)usr.bin/svn/lib/libapr/apr.h (-1 / +1 lines)
Lines 261-267 Link Here
261
#define APR_HAVE_STRSTR         1
261
#define APR_HAVE_STRSTR         1
262
#define APR_HAVE_MEMCHR         1
262
#define APR_HAVE_MEMCHR         1
263
#define APR_HAVE_STRUCT_RLIMIT  1
263
#define APR_HAVE_STRUCT_RLIMIT  1
264
#define APR_HAVE_UNION_SEMUN    1
264
#define APR_HAVE_UNION_SEMUN    0
265
#define APR_HAVE_SCTP           1
265
#define APR_HAVE_SCTP           1
266
#define APR_HAVE_IOVEC          1
266
#define APR_HAVE_IOVEC          1
267
267

Return to bug 224443