Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jul 2019 21:42:57 +0000 (UTC)
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350429 - in head/sys: kern sys
Message-ID:  <201907292142.x6TLgvWo038102@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: oshogbo
Date: Mon Jul 29 21:42:57 2019
New Revision: 350429
URL: https://svnweb.freebsd.org/changeset/base/350429

Log:
  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:
  head/sys/kern/kern_exit.c
  head/sys/sys/proc.h

Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c	Mon Jul 29 21:26:26 2019	(r350428)
+++ head/sys/kern/kern_exit.c	Mon Jul 29 21:42:57 2019	(r350429)
@@ -167,8 +167,8 @@ reaper_clear(struct proc *p)
 		proc_id_clear(PROC_ID_REAP, p->p_reapsubtree);
 }
 
-static void
-clear_orphan(struct proc *p)
+void
+proc_clear_orphan(struct proc *p)
 {
 	struct proc *p1;
 
@@ -522,7 +522,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;
@@ -556,7 +556,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);
 	}
 
@@ -912,7 +912,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat
 	reaper_clear(p);
 	proc_id_clear(PROC_ID_PID, p->p_pid);
 	PROC_LOCK(p);
-	clear_orphan(p);
+	proc_clear_orphan(p);
 	PROC_UNLOCK(p);
 	leavepgrp(p);
 	if (p->p_procdesc != NULL)
@@ -1372,7 +1372,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) {
 		if (LIST_EMPTY(&child->p_pptr->p_orphans)) {
 			child->p_treeflag |= P_TREE_FIRST_ORPHAN;

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Mon Jul 29 21:26:26 2019	(r350428)
+++ head/sys/sys/proc.h	Mon Jul 29 21:42:57 2019	(r350429)
@@ -1074,6 +1074,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?201907292142.x6TLgvWo038102>