Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2019 20:55:47 +0000 (UTC)
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352190 - in stable/12/sys: kern sys
Message-ID:  <201909102055.x8AKtlZ6075827@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: oshogbo
Date: Tue Sep 10 20:55:47 2019
New Revision: 352190
URL: https://svnweb.freebsd.org/changeset/base/352190

Log:
  MFCr350429:
    proc: make clear_orphan an public API
  
    This will be useful for other patches with process descriptors.
    Change its name as well.
  
    Reviewed by:  markj, kib

Modified:
  stable/12/sys/kern/kern_exit.c
  stable/12/sys/sys/proc.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_exit.c
==============================================================================
--- stable/12/sys/kern/kern_exit.c	Tue Sep 10 20:49:47 2019	(r352189)
+++ stable/12/sys/kern/kern_exit.c	Tue Sep 10 20:55:47 2019	(r352190)
@@ -147,8 +147,8 @@ reaper_abandon_children(struct proc *p, bool exiting)
 	p->p_treeflag &= ~P_TREE_REAPER;
 }
 
-static void
-clear_orphan(struct proc *p)
+void
+proc_clear_orphan(struct proc *p)
 {
 	struct proc *p1;
 
@@ -505,7 +505,7 @@ exit1(struct thread *td, int rval, int signo)
 			 * list due to present P_TRACED flag. Clear
 			 * orphan link for q now while q is locked.
 			 */
-			clear_orphan(q);
+			proc_clear_orphan(q);
 			q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE);
 			q->p_flag2 &= ~P2_PTRACE_FSTP;
 			q->p_ptevents = 0;
@@ -539,7 +539,7 @@ exit1(struct thread *td, int rval, int signo)
 			kern_psignal(q, q->p_pdeathsig);
 		CTR2(KTR_PTRACE, "exit: pid %d, clearing orphan %d", p->p_pid,
 		    q->p_pid);
-		clear_orphan(q);
+		proc_clear_orphan(q);
 		PROC_UNLOCK(q);
 	}
 
@@ -889,7 +889,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat
 	reaper_abandon_children(p, true);
 	LIST_REMOVE(p, p_reapsibling);
 	PROC_LOCK(p);
-	clear_orphan(p);
+	proc_clear_orphan(p);
 	PROC_UNLOCK(p);
 	leavepgrp(p);
 	if (p->p_procdesc != NULL)
@@ -1367,7 +1367,7 @@ proc_reparent(struct proc *child, struct proc *parent,
 	LIST_REMOVE(child, p_sibling);
 	LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
 
-	clear_orphan(child);
+	proc_clear_orphan(child);
 	if ((child->p_flag & P_TRACED) != 0) {
 		proc_add_orphan(child, child->p_pptr);
 	}

Modified: stable/12/sys/sys/proc.h
==============================================================================
--- stable/12/sys/sys/proc.h	Tue Sep 10 20:49:47 2019	(r352189)
+++ stable/12/sys/sys/proc.h	Tue Sep 10 20:55:47 2019	(r352190)
@@ -1069,6 +1069,7 @@ void	proc_wkilled(struct proc *p);
 struct	pstats *pstats_alloc(void);
 void	pstats_fork(struct pstats *src, struct pstats *dst);
 void	pstats_free(struct pstats *ps);
+void	proc_clear_orphan(struct proc *p);
 void	reaper_abandon_children(struct proc *p, bool exiting);
 int	securelevel_ge(struct ucred *cr, int level);
 int	securelevel_gt(struct ucred *cr, int level);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909102055.x8AKtlZ6075827>