diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-11-16 21:37:20 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-11-21 16:13:17 +0100 |
commit | 7736a71fd2c4f0704db2e0d110959f817829cb85 (patch) | |
tree | cf46ad874a24607341e783fac5de3109ed6e629b /src/shared/bpf-dlopen.h | |
parent | 28795f2c138203fb700fc394f0937708af886116 (diff) | |
download | systemd-7736a71fd2c4f0704db2e0d110959f817829cb85.tar.gz |
dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the types from the official headers
Make sure that the sym_xyz function pointers have the types that the
functions we'll assign them have.
And of course, this found a number of incompatibilities right-away, in
particular in the bpf hookup.
(Doing this will trigger deprecation warnings from libbpf. I simply
turned them off locally now, since we are well aware of what we are
doing in that regard.)
There's one return type fix (bool → int), that actually matters I think,
as it might have created an incompatibility on some archs.
Diffstat (limited to 'src/shared/bpf-dlopen.h')
-rw-r--r-- | src/shared/bpf-dlopen.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/bpf-dlopen.h b/src/shared/bpf-dlopen.h index 95951e63e0..0750abc56b 100644 --- a/src/shared/bpf-dlopen.h +++ b/src/shared/bpf-dlopen.h @@ -8,8 +8,8 @@ #include "bpf-compat.h" -extern struct bpf_link* (*sym_bpf_program__attach_cgroup)(struct bpf_program *, int); -extern struct bpf_link* (*sym_bpf_program__attach_lsm)(struct bpf_program *); +extern struct bpf_link* (*sym_bpf_program__attach_cgroup)(const struct bpf_program *, int); +extern struct bpf_link* (*sym_bpf_program__attach_lsm)(const struct bpf_program *); extern int (*sym_bpf_link__fd)(const struct bpf_link *); extern int (*sym_bpf_link__destroy)(struct bpf_link *); extern int (*sym_bpf_map__fd)(const struct bpf_map *); |