[LTP] [PATCH 5/5] syscalls/setpriority01: Use new user id to avoid messing system environment

Cyril Hrubis chrubis@suse.cz
Tue Dec 6 11:34:36 CET 2016


Hi!
> > Hmm, why do we run the actuall testcase in the child here? That
> > complicates the whole test far more than it should have.
> > 
> > We can instead just run pause() in the child and run the setpriority()
> > call in the parent with right pid/group/uid. Or did I miss something?
> > 
> 
> Sorry, if we do the actual test in the parent, we have to do the process
> synchronization, because parent needs child to be ready (prctl, setuid...)
> and after every test, child's pause() needs to be waken up by parent, so
> I feel it's more complicated by comparison...

Since we have the checkpoint synchronization in the test library this is
just a matter of calling TST_CHECKPOINT_WAIT() in the parent and
TST_CHECKPOINT_WAKE_AND_WAIT() in the child then finally
TST_CHECKPOINT_WAKE() in the parent.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list