@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user