summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2009-06-02 12:11:17 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2009-06-02 12:11:17 +0000
commit091923e0232ec2771385260914d34fc49c12a6a4 (patch)
treee91e7d1aa96c529bd58b45b6a801a0d77f0cd43f /sys/kern
parentf02b189f64fff76ecbc81e0d55b4fe65db8d6b2d (diff)
msgctl(), shmctl(), semctl() all have operations that are supposed
to return pids, not thread ids, so record the former when performing operations. ok blambert
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sysv_msg.c6
-rw-r--r--sys/kern/sysv_sem.c4
-rw-r--r--sys/kern/sysv_shm.c6
3 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c
index 706b839fa1b..379b9b31145 100644
--- a/sys/kern/sysv_msg.c
+++ b/sys/kern/sysv_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_msg.c,v 1.20 2007/10/14 23:08:04 fgsch Exp $ */
+/* $OpenBSD: sysv_msg.c,v 1.21 2009/06/02 12:11:16 guenther Exp $ */
/* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */
/*
@@ -598,7 +598,7 @@ sys_msgsnd(struct proc *p, void *v, register_t *retval)
msqptr->msg_cbytes += msghdr->msg_ts;
msqptr->msg_qnum++;
- msqptr->msg_lspid = p->p_pid;
+ msqptr->msg_lspid = p->p_p->ps_mainproc->p_pid;
msqptr->msg_stime = time_second;
wakeup(msqptr);
@@ -793,7 +793,7 @@ sys_msgrcv(struct proc *p, void *v, register_t *retval)
msqptr->msg_cbytes -= msghdr->msg_ts;
msqptr->msg_qnum--;
- msqptr->msg_lrpid = p->p_pid;
+ msqptr->msg_lrpid = p->p_p->ps_mainproc->p_pid;
msqptr->msg_rtime = time_second;
/*
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index c085f2bccc4..2ae92eefa0a 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_sem.c,v 1.39 2009/05/16 23:00:45 thib Exp $ */
+/* $OpenBSD: sysv_sem.c,v 1.40 2009/06/02 12:11:16 guenther Exp $ */
/* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */
/*
@@ -717,7 +717,7 @@ done:
for (i = 0; i < nsops; i++) {
sopptr = &sops[i];
semptr = &semaptr->sem_base[sopptr->sem_num];
- semptr->sempid = p->p_pid;
+ semptr->sempid = p->p_p->ps_mainproc->p_pid;
}
semaptr->sem_otime = time_second;
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index 9d1c0ccf2ef..5496b7908be 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_shm.c,v 1.49 2007/09/15 10:10:37 martin Exp $ */
+/* $OpenBSD: sysv_shm.c,v 1.50 2009/06/02 12:11:16 guenther Exp $ */
/* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */
/*
@@ -280,7 +280,7 @@ sys_shmat(struct proc *p, void *v, register_t *retval)
shmmap_s->va = attach_va;
shmmap_s->shmid = SCARG(uap, shmid);
- shmseg->shm_lpid = p->p_pid;
+ shmseg->shm_lpid = p->p_p->ps_mainproc->p_pid;
shmseg->shm_atime = time_second;
shmseg->shm_nattch++;
*retval = attach_va;
@@ -445,7 +445,7 @@ shmget_allocate_segment(struct proc *p,
shmseg->shm_perm.seq = shmseqs[segnum] = (shmseqs[segnum] + 1) & 0x7fff;
shmseg->shm_perm.key = key;
shmseg->shm_segsz = SCARG(uap, size);
- shmseg->shm_cpid = p->p_pid;
+ shmseg->shm_cpid = p->p_p->ps_mainproc->p_pid;
shmseg->shm_lpid = shmseg->shm_nattch = 0;
shmseg->shm_atime = shmseg->shm_dtime = 0;
shmseg->shm_ctime = time_second;