|
9 | 9 |
|
10 | 10 | #include <arpa/inet.h>
|
11 | 11 | #include <errno.h>
|
12 |
| -#include <linux/landlock.h> |
13 | 12 | #include <linux/securebits.h>
|
14 | 13 | #include <sys/capability.h>
|
15 | 14 | #include <sys/socket.h>
|
16 |
| -#include <sys/syscall.h> |
17 |
| -#include <sys/types.h> |
18 | 15 | #include <sys/un.h>
|
19 | 16 | #include <sys/wait.h>
|
20 | 17 | #include <unistd.h>
|
21 | 18 |
|
22 | 19 | #include "../kselftest_harness.h"
|
| 20 | +#include "wrappers.h" |
23 | 21 |
|
24 | 22 | #define TMP_DIR "tmp"
|
25 | 23 |
|
|
30 | 28 | /* TEST_F_FORK() should not be used for new tests. */
|
31 | 29 | #define TEST_F_FORK(fixture_name, test_name) TEST_F(fixture_name, test_name)
|
32 | 30 |
|
33 |
| -#ifndef landlock_create_ruleset |
34 |
| -static inline int |
35 |
| -landlock_create_ruleset(const struct landlock_ruleset_attr *const attr, |
36 |
| - const size_t size, const __u32 flags) |
37 |
| -{ |
38 |
| - return syscall(__NR_landlock_create_ruleset, attr, size, flags); |
39 |
| -} |
40 |
| -#endif |
41 |
| - |
42 |
| -#ifndef landlock_add_rule |
43 |
| -static inline int landlock_add_rule(const int ruleset_fd, |
44 |
| - const enum landlock_rule_type rule_type, |
45 |
| - const void *const rule_attr, |
46 |
| - const __u32 flags) |
47 |
| -{ |
48 |
| - return syscall(__NR_landlock_add_rule, ruleset_fd, rule_type, rule_attr, |
49 |
| - flags); |
50 |
| -} |
51 |
| -#endif |
52 |
| - |
53 |
| -#ifndef landlock_restrict_self |
54 |
| -static inline int landlock_restrict_self(const int ruleset_fd, |
55 |
| - const __u32 flags) |
56 |
| -{ |
57 |
| - return syscall(__NR_landlock_restrict_self, ruleset_fd, flags); |
58 |
| -} |
59 |
| -#endif |
60 |
| - |
61 | 31 | static void _init_caps(struct __test_metadata *const _metadata, bool drop_all)
|
62 | 32 | {
|
63 | 33 | cap_t cap_p;
|
@@ -250,11 +220,6 @@ struct service_fixture {
|
250 | 220 | };
|
251 | 221 | };
|
252 | 222 |
|
253 |
| -static pid_t __maybe_unused sys_gettid(void) |
254 |
| -{ |
255 |
| - return syscall(__NR_gettid); |
256 |
| -} |
257 |
| - |
258 | 223 | static void __maybe_unused set_unix_address(struct service_fixture *const srv,
|
259 | 224 | const unsigned short index)
|
260 | 225 | {
|
|
0 commit comments