Kernel modifications necessary to allow to follow fork()ed children.
PR: bin/25587 (in part) MFC after: 3 weeks
This commit is contained in:
parent
c03bfcc871
commit
9ccba881d9
sys
@ -51,6 +51,7 @@
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/pioctl.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/vnode.h>
|
||||
@ -757,6 +758,15 @@ again:
|
||||
msleep(p1, &p2->p_mtx, PWAIT, "ppwait", 0);
|
||||
PROC_UNLOCK(p2);
|
||||
|
||||
/*
|
||||
* If PF_FORK is set, the child process inherits the
|
||||
* procfs ioctl flags from its parent.
|
||||
*/
|
||||
if (p1->p_pfsflags & PF_FORK) {
|
||||
p2->p_stops = p1->p_stops;
|
||||
p2->p_pfsflags = p1->p_pfsflags;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return child proc pointer to parent.
|
||||
*/
|
||||
|
@ -75,4 +75,5 @@ struct procfs_status {
|
||||
|
||||
# define PF_LINGER 0x01 /* Keep stops around after last close */
|
||||
# define PF_ISUGID 0x02 /* Ignore UID/GID changes */
|
||||
# define PF_FORK 0x04 /* Retain settings on fork() */
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user