Hi Li,
quoted
quoted
+ if (access("/proc/self/oom_score_adj", F_OK) == -1) {
We need to check here also /proc/PID/oom_score_adj, i.e. score_path.
Good catch, I would add a 'W_OK' checking and skip the setting with
a reminder message if run without root.
how about this?
if (access(score_path, W_OK) == -1) {
tst_res(TINFO, "Warning: %s cannot be accessed for writing,
please check if test run with root user.",
score_path);
return
}
No, value < 0 obviously requires root, thus access() check is not enough.
Try echo -1 > /proc/$$/oom_score_adj
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp