You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aya/test/integration-test/bpf/struct_flavors_reloc.bpf.c

19 lines
522 B
C

#include "reloc.h"
#include "struct_with_scalars.h"
__noinline int struct_flavors_global() {
struct relocated_struct_with_scalars s = {1, 2, 3};
#ifndef TARGET
if (bpf_core_field_exists(s.a)) {
return set_output(__builtin_preserve_access_index(s.a));
#else
if (bpf_core_field_exists(s.d)) {
return set_output(__builtin_preserve_access_index(s.d));
#endif
} else {
return set_output(__builtin_preserve_access_index(s.c));
}
}
SEC("uprobe") int program(void *ctx) { return struct_flavors_global(); }