From 5dc880de6e7c8566fbc8bc5dfc3a922d2d1c5ee3 Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Wed, 14 Dec 2016 14:05:26 -0800 Subject: tools lib bpf: Add bpf_prog_{attach,detach} Commit d8c5b17f2bc0 ("samples: bpf: add userspace example for attaching eBPF programs to cgroups") added these functions to samples/libbpf, but during this merge all of the samples libbpf functionality is shifting to tools/lib/bpf. Shift these functions there. Committer notes: Use bzero + attr.FIELD = value instead of 'attr = { .FIELD = value, just like the other wrapper calls to sys_bpf with bpf_attr to make this build in older toolchais, such as the ones in CentOS 5 and 6. Signed-off-by: Joe Stringer Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-au2zvtsh55vqeo3v3uw7jr4c@git.kernel.org Link: https://github.com/joestringer/linux/commit/353e6f298c3d0a92fa8bfa61ff898c5050261a12.patch Signed-off-by: Arnaldo Carvalho de Melo --- samples/bpf/libbpf.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'samples/bpf/libbpf.h') diff --git a/samples/bpf/libbpf.h b/samples/bpf/libbpf.h index cf7d2386d1f9..cc815624aacf 100644 --- a/samples/bpf/libbpf.h +++ b/samples/bpf/libbpf.h @@ -6,9 +6,6 @@ struct bpf_insn; -int bpf_prog_attach(int prog_fd, int attachable_fd, enum bpf_attach_type type); -int bpf_prog_detach(int attachable_fd, enum bpf_attach_type type); - /* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */ #define BPF_ALU64_REG(OP, DST, SRC) \ -- cgit v1.2.3-59-g8ed1b