[PATCH v2 2/2] ioctl console test v2
archsbran at gmail.com
Mon Mar 23 10:36:56 UTC 2020
> > I think I am missing something obvious here. PR_GET_CHILD_SUBREAPER
> > tells if current process is a subreaper.
> > ----
> > int ret;
> > unsigned long arg2;
> > ret = prctl(PR_GET_CHILD_SUBREAPER, &arg2);
> > printf("ret: %d\n", ret);
> > printf("arg2: %d\n", arg2);
> > ----
> > How can it be used to confirm that the ppid process is a subreaper is
> > unclear to me ? I will look through it all once again with fresh eyes.
> Oh, you're right, I've overlooked that bit, my apologies. In that case,
> it seems that the easiest way is to have an additional helper program
> that makes itself reparented and reports its PPID.
So the idea now is:
Two programs tracer_ppid_sgid_sid and tracer_helper.
Now both of these will be reparented and will report their respective PPID.
The strace-DDD.test shell script will then match the PPID of both. If
it matches then its successful.
Is this correct ?
More information about the Strace-devel