diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-05-21 14:10:26 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-06-12 15:21:15 +0200 |
commit | 5c672e90a659033815b104b2da128037b26a31ef (patch) | |
tree | b3fdf5013bd5753077deada35eb76f762077081c /src/shared/bpf-dlopen.c | |
parent | repart: Use CRYPT_ACTIVATE_PRIVATE (diff) | |
download | systemd-5c672e90a659033815b104b2da128037b26a31ef.tar.xz systemd-5c672e90a659033815b104b2da128037b26a31ef.zip |
basic/dlfcn-util: deobfuscate macro definitions
When looking at how dlopen for various libs is implemented, I found that the
macros hide too much. I find it much easier to see what is going on if 'extern'
and '= NULL' are written explicitly. After all, we don't hide those for other
definitions, e.g. our style guide says that static variables should be
initialized with '= NULL'. With that change, it's much more obvious what is
a variable declaration and what is a variable initialization.
Diffstat (limited to 'src/shared/bpf-dlopen.c')
-rw-r--r-- | src/shared/bpf-dlopen.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/shared/bpf-dlopen.c b/src/shared/bpf-dlopen.c index 50491fc6aa..ca5060a102 100644 --- a/src/shared/bpf-dlopen.c +++ b/src/shared/bpf-dlopen.c @@ -18,36 +18,36 @@ #define MODERN_LIBBPF 0 #endif -DLSYM_FUNCTION(bpf_link__destroy); -DLSYM_FUNCTION(bpf_link__fd); -DLSYM_FUNCTION(bpf_link__open); -DLSYM_FUNCTION(bpf_link__pin); -DLSYM_FUNCTION(bpf_map__fd); -DLSYM_FUNCTION(bpf_map__name); -DLSYM_FUNCTION(bpf_map__set_inner_map_fd); -DLSYM_FUNCTION(bpf_map__set_max_entries); -DLSYM_FUNCTION(bpf_map__set_pin_path); -DLSYM_FUNCTION(bpf_map_delete_elem); -DLSYM_FUNCTION(bpf_map_get_fd_by_id); -DLSYM_FUNCTION(bpf_map_lookup_elem); -DLSYM_FUNCTION(bpf_map_update_elem); -DLSYM_FUNCTION(bpf_object__attach_skeleton); -DLSYM_FUNCTION(bpf_object__destroy_skeleton); -DLSYM_FUNCTION(bpf_object__detach_skeleton); -DLSYM_FUNCTION(bpf_object__load_skeleton); -DLSYM_FUNCTION(bpf_object__name); -DLSYM_FUNCTION(bpf_object__open_skeleton); -DLSYM_FUNCTION(bpf_object__pin_maps); -DLSYM_FUNCTION(bpf_program__attach); -DLSYM_FUNCTION(bpf_program__attach_cgroup); -DLSYM_FUNCTION(bpf_program__attach_lsm); -DLSYM_FUNCTION(bpf_program__name); -DLSYM_FUNCTION(libbpf_get_error); -DLSYM_FUNCTION(libbpf_set_print); -DLSYM_FUNCTION(ring_buffer__epoll_fd); -DLSYM_FUNCTION(ring_buffer__free); -DLSYM_FUNCTION(ring_buffer__new); -DLSYM_FUNCTION(ring_buffer__poll); +DLSYM_PROTOTYPE(bpf_link__destroy) = NULL; +DLSYM_PROTOTYPE(bpf_link__fd) = NULL; +DLSYM_PROTOTYPE(bpf_link__open) = NULL; +DLSYM_PROTOTYPE(bpf_link__pin) = NULL; +DLSYM_PROTOTYPE(bpf_map__fd) = NULL; +DLSYM_PROTOTYPE(bpf_map__name) = NULL; +DLSYM_PROTOTYPE(bpf_map__set_inner_map_fd) = NULL; +DLSYM_PROTOTYPE(bpf_map__set_max_entries) = NULL; +DLSYM_PROTOTYPE(bpf_map__set_pin_path) = NULL; +DLSYM_PROTOTYPE(bpf_map_delete_elem) = NULL; +DLSYM_PROTOTYPE(bpf_map_get_fd_by_id) = NULL; +DLSYM_PROTOTYPE(bpf_map_lookup_elem) = NULL; +DLSYM_PROTOTYPE(bpf_map_update_elem) = NULL; +DLSYM_PROTOTYPE(bpf_object__attach_skeleton) = NULL; +DLSYM_PROTOTYPE(bpf_object__destroy_skeleton) = NULL; +DLSYM_PROTOTYPE(bpf_object__detach_skeleton) = NULL; +DLSYM_PROTOTYPE(bpf_object__load_skeleton) = NULL; +DLSYM_PROTOTYPE(bpf_object__name) = NULL; +DLSYM_PROTOTYPE(bpf_object__open_skeleton) = NULL; +DLSYM_PROTOTYPE(bpf_object__pin_maps) = NULL; +DLSYM_PROTOTYPE(bpf_program__attach) = NULL; +DLSYM_PROTOTYPE(bpf_program__attach_cgroup) = NULL; +DLSYM_PROTOTYPE(bpf_program__attach_lsm) = NULL; +DLSYM_PROTOTYPE(bpf_program__name) = NULL; +DLSYM_PROTOTYPE(libbpf_get_error) = NULL; +DLSYM_PROTOTYPE(libbpf_set_print) = NULL; +DLSYM_PROTOTYPE(ring_buffer__epoll_fd) = NULL; +DLSYM_PROTOTYPE(ring_buffer__free) = NULL; +DLSYM_PROTOTYPE(ring_buffer__new) = NULL; +DLSYM_PROTOTYPE(ring_buffer__poll) = NULL; /* new symbols available from libbpf 0.7.0 */ int (*sym_bpf_map_create)(enum bpf_map_type, const char *, __u32, __u32, __u32, const struct bpf_map_create_opts *); |