diff options
| author | 2024-12-30 11:31:11 +0100 | |
|---|---|---|
| committer | 2024-12-30 11:31:11 +0100 | |
| commit | a0ca57cc670c9c6dad633ba55a73d810ed61e5ce (patch) | |
| tree | 72ba9b5cb48a58aa296f1cb72c59695d934f5e01 /landloc.h | |
| parent | use correct macros for compatibility (diff) | |
| download | snac2-a0ca57cc670c9c6dad633ba55a73d810ed61e5ce.tar.gz snac2-a0ca57cc670c9c6dad633ba55a73d810ed61e5ce.tar.xz snac2-a0ca57cc670c9c6dad633ba55a73d810ed61e5ce.zip | |
update landloc.h
Diffstat (limited to 'landloc.h')
| -rw-r--r-- | landloc.h | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -70,7 +70,9 @@ int main(void) { | |||
| 70 | 70 | ||
| 71 | #include <linux/version.h> | 71 | #include <linux/version.h> |
| 72 | 72 | ||
| 73 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) | 73 | #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) |
| 74 | # error "no landlock on kernels older than 5.13.0" | ||
| 75 | #endif | ||
| 74 | 76 | ||
| 75 | #include <unistd.h> | 77 | #include <unistd.h> |
| 76 | #include <linux/landlock.h> | 78 | #include <linux/landlock.h> |
| @@ -224,10 +226,13 @@ int main(void) { | |||
| 224 | 226 | ||
| 225 | #else | 227 | #else |
| 226 | 228 | ||
| 227 | #define LL_PORT(p, rules) do { (void)p; (void)rules; } while (0) | 229 | #define LL_PORT(p, rules) do {\ |
| 230 | unsigned short __port = (p);\ | ||
| 231 | __u64 __rules = (rules);\ | ||
| 232 | (void)__port;\ | ||
| 233 | (void)__rules;\ | ||
| 234 | } while (0) | ||
| 228 | 235 | ||
| 229 | #endif /* LL_HAVE_NET */ | 236 | #endif /* LL_HAVE_NET */ |
| 230 | 237 | ||
| 231 | #endif /* KERNEL_VERSION(5, 13, 0) */ | ||
| 232 | |||
| 233 | #endif /* __LANDLOC_H__ */ | 238 | #endif /* __LANDLOC_H__ */ |