]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix usleep() implementation
authorAndrii Nakryiko <andriin@fb.com>
Fri, 13 Mar 2020 06:18:37 +0000 (23:18 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 13 Mar 2020 19:49:52 +0000 (12:49 -0700)
commitdf916a1a78484c17f8b29ca4134ee5b64efb104d
tree707021a3a1bf50ca0896c5170aa937cda10933fe
parent1c6ac4a24757f43343cd7a5277ae5f32aba646b8
selftests/bpf: Fix usleep() implementation

nanosleep syscall expects pointer to struct timespec, not nanoseconds
directly. Current implementation fulfills its purpose of invoking nanosleep
syscall, but doesn't really provide sleeping capabilities, which can cause
flakiness for tests relying on usleep() to wait for something.

Fixes: ec12a57b822c ("selftests/bpf: Guarantee that useep() calls nanosleep() syscall")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200313061837.3685572-1-andriin@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_progs.c