Implementation of tst_get_unused_pid()

There are many testcases which require an unused pid value.

tst_get_unused_pid() is the function to address this problem.

I also removed tst_get_max_pids() because it's used only in one place (tst_get_free_pids())
and can be subsituted with
  SAFE_FILE_SCANF(cleanup_fn, PID_MAX_PATH, "%d", &pid);

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
3 files changed