summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_acct.c4
-rw-r--r--sys/kern/kern_exec.c4
-rw-r--r--sys/kern/kern_fork.c5
-rw-r--r--sys/kern/kern_prot.c4
-rw-r--r--sys/kern/kern_sig.c6
-rw-r--r--sys/sys/proc.h5
-rw-r--r--sys/sys/sysctl.h4
7 files changed, 17 insertions, 15 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index aa519740c5d..ce651a53b33 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_acct.c,v 1.24 2012/03/23 15:51:26 guenther Exp $ */
+/* $OpenBSD: kern_acct.c,v 1.25 2012/04/12 10:11:41 mikeb Exp $ */
/* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */
/*-
@@ -224,7 +224,7 @@ acct_process(struct proc *p)
acct.ac_tty = NODEV;
/* (8) The boolean flags that tell how the process terminated, etc. */
- acct.ac_flag = p->p_acflag;
+ acct.ac_flag = pr->ps_acflag;
/*
* Now, just write the accounting information to the file.
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 1940f070803..c8a202bd463 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.127 2012/03/26 04:19:55 deraadt Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.128 2012/04/12 10:11:41 mikeb Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -475,7 +475,7 @@ sys_execve(struct proc *p, void *v, register_t *retval)
bzero(p->p_comm, sizeof(p->p_comm));
len = min(nid.ni_cnd.cn_namelen, MAXCOMLEN);
bcopy(nid.ni_cnd.cn_nameptr, p->p_comm, len);
- p->p_acflag &= ~AFORK;
+ pr->ps_acflag &= ~AFORK;
/* record proc's vnode, for use by procfs and others */
if (p->p_textvp)
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 8bf4a377777..56eae96d07c 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.136 2012/04/10 15:50:52 guenther Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.137 2012/04/12 10:11:41 mikeb Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -501,7 +501,8 @@ fork1(struct proc *curp, int exitsig, int flags, void *stack, pid_t *tidptr,
*/
SCHED_LOCK(s);
getmicrotime(&pr->ps_start);
- p->p_acflag = AFORK;
+ if ((flags & FORK_THREAD) == 0)
+ pr->ps_acflag = AFORK;
p->p_stat = SRUN;
p->p_cpu = sched_choosecpu_fork(curp, flags);
setrunqueue(p);
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index c4a833de12e..982dfae4bb4 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.53 2012/04/10 15:50:52 guenther Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.54 2012/04/12 10:11:41 mikeb Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -763,7 +763,7 @@ suser(struct proc *p, u_int flags)
if (cred->cr_uid == 0) {
if (!(flags & SUSER_NOACCT))
- p->p_acflag |= ASU;
+ p->p_p->ps_acflag |= ASU;
return (0);
}
return (EPERM);
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 86dfae55cf7..991744db1d3 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.139 2012/04/11 15:28:50 kettenis Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.140 2012/04/12 10:11:41 mikeb Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -1345,7 +1345,7 @@ sigexit(struct proc *p, int signum)
/* Mark process as going away */
atomic_setbits_int(&p->p_flag, P_WEXIT);
- p->p_acflag |= AXSIG;
+ p->p_p->ps_acflag |= AXSIG;
if (sigprop[signum] & SA_CORE) {
p->p_sisig = signum;
@@ -1444,7 +1444,7 @@ coredump(struct proc *p)
VATTR_NULL(&vattr);
vattr.va_size = 0;
VOP_SETATTR(vp, &vattr, cred, p);
- p->p_acflag |= ACORE;
+ p->p_p->ps_acflag |= ACORE;
io.io_proc = p;
io.io_vp = vp;
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index f23a9577645..e01e2518775 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.155 2012/04/11 15:28:50 kettenis Exp $ */
+/* $OpenBSD: proc.h,v 1.156 2012/04/12 10:11:41 mikeb Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
@@ -202,6 +202,8 @@ struct process {
u_int pr_scale; /* pc scaling */
} ps_prof;
+ u_short ps_acflag; /* Accounting flags. */
+
/* End area that is copied on creation. */
#define ps_endcopy ps_refcnt
@@ -344,7 +346,6 @@ struct proc {
u_long p_prof_ticks; /* temp storage for profiling ticks util AST */
u_short p_xstat; /* Exit status for wait; also stop signal. */
- u_short p_acflag; /* Accounting flags. */
};
/* Status values. */
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index e1363560bba..598ef417e16 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.h,v 1.122 2012/04/10 15:50:52 guenther Exp $ */
+/* $OpenBSD: sysctl.h,v 1.123 2012/04/12 10:11:41 mikeb Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
@@ -519,7 +519,7 @@ do { \
(kp)->p_nice = (pr)->ps_nice; \
\
(kp)->p_xstat = (p)->p_xstat; \
- (kp)->p_acflag = (p)->p_acflag; \
+ (kp)->p_acflag = (pr)->ps_acflag; \
\
/* XXX depends on e_name being an array and not a pointer */ \
copy_str((kp)->p_emul, (char *)(p)->p_emul + \