reloc.h 423 B

12345678910111213141516171819
  1. // clang-format off
  2. #include <vmlinux.h>
  3. #include <bpf/bpf_helpers.h>
  4. #include <bpf/bpf_core_read.h>
  5. // clang-format on
  6. char _license[] SEC("license") = "GPL";
  7. struct {
  8. __uint(type, BPF_MAP_TYPE_ARRAY);
  9. __type(key, __u32);
  10. __type(value, __u64);
  11. __uint(max_entries, 1);
  12. } output_map SEC(".maps");
  13. long set_output(__u64 value) {
  14. __u32 key = 0;
  15. return bpf_map_update_elem(&output_map, &key, &value, BPF_ANY);
  16. }