]> www.infradead.org Git - users/dwmw2/linux.git/commit
bpf: handle implicit declaration of function gettid in bpf_iter.c
authorJason Xing <kernelxing@tencent.com>
Tue, 29 Oct 2024 07:46:27 +0000 (15:46 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Tue, 29 Oct 2024 18:26:13 +0000 (11:26 -0700)
commit42602e3a06f8e5b9a059344e305c9bee2dcc87c8
tree57a89c757f659ea4030bc9f46df505e18e94a4ec
parent87cb58aebdf7005661a07e9fd5a900f924d48c75
bpf: handle implicit declaration of function gettid in bpf_iter.c

As we can see from the title, when I compiled the selftests/bpf, I
saw the error:
implicit declaration of function ‘gettid’ ; did you mean ‘getgid’? [-Werror=implicit-function-declaration]
  skel->bss->tid = gettid();
                   ^~~~~~
                   getgid

Directly call the syscall solves this issue.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Tested-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/r/20241029074627.80289-1-kerneljasonxing@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_iter.c