[LTP] [PATCH 1/2] SAFE_MACROS: Add SAFE_SETPRIORITY() && Drop redundant space

Cyril Hrubis chrubis@suse.cz
Tue Nov 22 11:22:27 CET 2016


Hi!
> > And also this is 1/2, shouldn't there be a second patch that uses this?
> 
> Yes, I should have sent the second patch that uses this, but I faced a problem
> below and was still working on it.
> 
> I found that setpriority01 with PRIO_USER as root will change system environment,
> set the priorities of all specified processes to 19.

Well that is kind of expected, since it should operate on all processes
whose user real id matches the who parameter. I guess that the only safe
way how to test this flag is to:

* Pick unused user id and sets it as a real user id
* Start a few processes there
* One of them calls setpriority and checks that all of them got it

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list