summaryrefslogtreecommitdiffstats
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-08-21 10:46:19 +0000
committerkib <kib@FreeBSD.org>2014-08-21 10:46:19 +0000
commitafeea342d67385e6a635b412c4c4069f21b0eda1 (patch)
treead885a4657af011765ad1e852eb52fc61fab14b8 /sys/sys/proc.h
parent9ac8060e5711317f8497c0f9c9e623976d50560f (diff)
downloadFreeBSD-src-afeea342d67385e6a635b412c4c4069f21b0eda1.zip
FreeBSD-src-afeea342d67385e6a635b412c4c4069f21b0eda1.tar.gz
MFC r269656:
Implement and use proc_realparent(9). MFC r270024 (by markj): Correct the order of arguments passed to LIST_INSERT_AFTER(). For merge, the p_treeflag member of struct proc was moved to the end of the structure, to keep KBI intact.
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 2932114..3d2e9e5 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -591,6 +591,7 @@ struct proc {
*/
LIST_ENTRY(proc) p_orphan; /* (e) List of orphan processes. */
LIST_HEAD(, proc) p_orphans; /* (e) Pointer to list of orphans. */
+ u_int p_treeflag; /* (e) P_TREE flags */
};
#define p_session p_pgrp->pg_session
@@ -628,7 +629,7 @@ struct proc {
#define P_SINGLE_BOUNDARY 0x400000 /* Threads should suspend at user boundary. */
#define P_HWPMC 0x800000 /* Process is using HWPMCs */
#define P_JAILED 0x1000000 /* Process is in jail. */
-#define P_ORPHAN 0x2000000 /* Orphaned. */
+#define P_UNUSED1 0x2000000
#define P_INEXEC 0x4000000 /* Process is in execve(). */
#define P_STATCHILD 0x8000000 /* Child process stopped or exited. */
#define P_INMEM 0x10000000 /* Loaded into memory. */
@@ -643,6 +644,11 @@ struct proc {
/* These flags are kept in p_flag2. */
#define P2_INHERIT_PROTECTED 0x00000001 /* New children get P_PROTECTED. */
+/* Flags protected by proctree_lock, kept in p_treeflags. */
+#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */
+#define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan
+ list */
+
/*
* These were process status values (p_stat), now they are only used in
* legacy conversion code.
@@ -883,6 +889,7 @@ int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb);
void procinit(void);
void proc_linkup0(struct proc *p, struct thread *td);
void proc_linkup(struct proc *p, struct thread *td);
+struct proc *proc_realparent(struct proc *child);
void proc_reap(struct thread *td, struct proc *p, int *status, int options);
void proc_reparent(struct proc *child, struct proc *newparent);
struct pstats *pstats_alloc(void);
OpenPOWER on IntegriCloud