bpf: use return macros

parent 789bf479
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "compiler.h" #include "compiler.h"
#include "conf.h" #include "conf.h"
#include "config.h" #include "config.h"
#include "macro.h"
#include "memory_utils.h" #include "memory_utils.h"
#include "syscall_numbers.h" #include "syscall_numbers.h"
...@@ -72,41 +73,36 @@ __hidden extern int bpf_list_add_device(struct lxc_conf *conf, struct device_ite ...@@ -72,41 +73,36 @@ __hidden extern int bpf_list_add_device(struct lxc_conf *conf, struct device_ite
static inline struct bpf_program *bpf_program_new(uint32_t prog_type) static inline struct bpf_program *bpf_program_new(uint32_t prog_type)
{ {
errno = ENOSYS; return ret_set_errno(NULL, ENOSYS);
return NULL;
} }
static inline int bpf_program_init(struct bpf_program *prog) static inline int bpf_program_init(struct bpf_program *prog)
{ {
errno = ENOSYS; return ret_errno(ENOSYS);
return -1;
} }
static inline int bpf_program_append_device(struct bpf_program *prog, char type, static inline int bpf_program_append_device(struct bpf_program *prog, char type,
int major, int minor, int major, int minor,
const char *access, int allow) const char *access, int allow)
{ {
errno = ENOSYS; return ret_errno(ENOSYS);
return -1;
} }
static inline int bpf_program_finalize(struct bpf_program *prog) static inline int bpf_program_finalize(struct bpf_program *prog)
{ {
errno = ENOSYS; return ret_errno(ENOSYS);
return -1;
} }
static inline int bpf_program_cgroup_attach(struct bpf_program *prog, int type, static inline int bpf_program_cgroup_attach(struct bpf_program *prog, int type,
const char *path, uint32_t flags) int fd_cgroup, int replace_bpf_fd,
uint32_t flags)
{ {
errno = ENOSYS; return ret_errno(ENOSYS);
return -1;
} }
static inline int bpf_program_cgroup_detach(struct bpf_program *prog) static inline int bpf_program_cgroup_detach(struct bpf_program *prog)
{ {
errno = ENOSYS; return ret_errno(ENOSYS);
return -1;
} }
static inline void bpf_program_free(struct bpf_program *prog) static inline void bpf_program_free(struct bpf_program *prog)
...@@ -119,14 +115,13 @@ static inline void bpf_device_program_free(struct cgroup_ops *ops) ...@@ -119,14 +115,13 @@ static inline void bpf_device_program_free(struct cgroup_ops *ops)
static inline bool bpf_devices_cgroup_supported(void) static inline bool bpf_devices_cgroup_supported(void)
{ {
return false; return ret_set_errno(false, ENOSYS);
} }
static inline int bpf_list_add_device(struct lxc_conf *conf, static inline int bpf_list_add_device(struct lxc_conf *conf,
struct device_item *device) struct device_item *device)
{ {
errno = ENOSYS; return ret_errno(ENOSYS);
return -1;
} }
#endif /* !HAVE_STRUCT_BPF_CGROUP_DEV_CTX */ #endif /* !HAVE_STRUCT_BPF_CGROUP_DEV_CTX */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment