]> Git Repo - J-linux.git/blob - tools/testing/selftests/bpf/progs/bpf_iter_bpf_link.c
Merge tag 'vfs-6.13-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[J-linux.git] / tools / testing / selftests / bpf / progs / bpf_iter_bpf_link.c
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2022 Red Hat, Inc. */
3 #include <vmlinux.h>
4 #include <bpf/bpf_helpers.h>
5
6 char _license[] SEC("license") = "GPL";
7
8 SEC("iter/bpf_link")
9 int dump_bpf_link(struct bpf_iter__bpf_link *ctx)
10 {
11         struct seq_file *seq = ctx->meta->seq;
12         struct bpf_link *link = ctx->link;
13         int link_id;
14
15         if (!link)
16                 return 0;
17
18         link_id = link->id;
19         bpf_seq_write(seq, &link_id, sizeof(link_id));
20         return 0;
21 }
This page took 0.028257 seconds and 4 git commands to generate.