shared: Clean up includes

Split out of #37344.
This commit is contained in:
Daan De Meyer
2025-05-24 14:00:44 +02:00
parent 9d75fb9647
commit 69a283c5f2
394 changed files with 1181 additions and 1903 deletions
+5 -20
View File
@@ -2,16 +2,11 @@
#pragma once
#if HAVE_SECCOMP
#include <seccomp.h>
#include <seccomp.h> /* IWYU pragma: export */
#endif
#include <stdbool.h>
#include <stdint.h>
#include "errno-list.h"
#include "errno-util.h"
#include "parse-util.h"
#include "set.h"
#include "string-util.h"
#include "forward.h"
#if HAVE_SECCOMP
@@ -164,18 +159,8 @@ enum {
SECCOMP_ERROR_NUMBER_KILL = INT_MAX - 1,
};
static inline bool seccomp_errno_or_action_is_valid(int n) {
return n == SECCOMP_ERROR_NUMBER_KILL || errno_is_valid(n);
}
bool seccomp_errno_or_action_is_valid(int n);
static inline int seccomp_parse_errno_or_action(const char *p) {
if (streq_ptr(p, "kill"))
return SECCOMP_ERROR_NUMBER_KILL;
return parse_errno(p);
}
int seccomp_parse_errno_or_action(const char *p);
static inline const char* seccomp_errno_or_action_to_string(int num) {
if (num == SECCOMP_ERROR_NUMBER_KILL)
return "kill";
return errno_to_name(num);
}
const char* seccomp_errno_or_action_to_string(int num);