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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to