]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/landlock: Fix net_test build with old libc
authorHu Yadi <hu.yadi@h3c.com>
Tue, 23 Jan 2024 06:26:21 +0000 (14:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:51:23 +0000 (09:51 +0100)
commitbb984e0428223eae51c28eb2893eb9302f0333f9
tree19311d81e14c2bbdc360d2dafe6696f365eb8a93
parent182a5d951507c1a1a4577cd55d6a5c146514873c
selftests/landlock: Fix net_test build with old libc

[ Upstream commit 116099ed345c932a8ae4a0d884a8f6cc54fd5fed ]

One issue comes up while building selftest/landlock/net_test on my side
(gcc 7.3/glibc-2.28/kernel-4.19).

net_test.c: In function ‘set_service’:
net_test.c:91:45: warning: implicit declaration of function ‘gettid’; [-Wimplicit-function-declaration]
    "_selftests-landlock-net-tid%d-index%d", gettid(),
                                             ^~~~~~
                                             getgid
net_test.c:(.text+0x4e0): undefined reference to `gettid'

Signed-off-by: Hu Yadi <hu.yadi@h3c.com>
Suggested-by: Jiao <jiaoxupo@h3c.com>
Reviewed-by: Berlin <berlin@h3c.com>
Fixes: a549d055a22e ("selftests/landlock: Add network tests")
Link: https://lore.kernel.org/r/20240123062621.25082-1-hu.yadi@h3c.com
[mic: Cosmetic fixes]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/landlock/net_test.c