commit a0ca57c

shtrophic  ·  2024-12-30 10:31:11 +0000 UTC
parent bbce5e3
update landloc.h
1 files changed,  +9, -4
+9, -4
 1@@ -70,7 +70,9 @@ int main(void) {
 2 
 3 #include <linux/version.h>
 4 
 5-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
 6+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
 7+#   error "no landlock on kernels older than 5.13.0"
 8+#endif
 9 
10 #include <unistd.h>
11 #include <linux/landlock.h>
12@@ -224,10 +226,13 @@ int main(void) {
13 
14 #else
15 
16-#define LL_PORT(p, rules) do { (void)p; (void)rules; } while (0)
17+#define LL_PORT(p, rules) do {\
18+    unsigned short __port = (p);\
19+    __u64 __rules = (rules);\
20+    (void)__port;\
21+    (void)__rules;\
22+} while (0)
23 
24 #endif /* LL_HAVE_NET */
25 
26-#endif /* KERNEL_VERSION(5, 13, 0) */
27-
28 #endif /* __LANDLOC_H__ */