]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:46 +0000 (14:01 +0100)
commit449dd20852d8563d5e9c32a9228a106d8399570a
tree00737f5978e0496ac43387067e19dc7ff018c8c9
parent728dd20c8df74e09a9f34872b26d962a0f31d529
bpf: handle implicit declaration of function gettid in bpf_iter.c

commit 42602e3a06f8e5b9a059344e305c9bee2dcc87c8 upstream.

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>
Cc: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/prog_tests/bpf_iter.c