selftests/bpf: Use nanosleep() syscall instead of sleep() in get_cgroup_id
Glibc's sleep() switched to clock_nanosleep() from nanosleep(), and thus
syscalls:sys_enter_nanosleep tracepoint is not hitting which is causing
testcase failure. Instead of depending on glibc sleep(), call nanosleep()
systemcall directly.
Before:
# ./get_cgroup_id_user
...
main:FAIL:compare_cgroup_id kern cgid 0 user cgid 483
After:
# ./get_cgroup_id_user
...
main:PASS:compare_cgroup_id
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210316153048.136447-1-ravi.bangoria@linux.ibm.com