summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/exec/binfmt_bpf_interp.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/exec/binfmt_bpf_interp.c')
-rw-r--r--tools/testing/selftests/exec/binfmt_bpf_interp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/testing/selftests/exec/binfmt_bpf_interp.c b/tools/testing/selftests/exec/binfmt_bpf_interp.c
new file mode 100644
index 000000000000..2db205f095b2
--- /dev/null
+++ b/tools/testing/selftests/exec/binfmt_bpf_interp.c
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Test interpreter for the binfmt_misc_bpf selftest. A bpf-backed 'B' handler
+ * routes a matched binary here; printing this marker proves the program's
+ * chosen interpreter actually ran.
+ */
+#include <unistd.h>
+
+int main(int argc, char **argv)
+{
+ (void)argc;
+ (void)argv;
+ write(1, "BPF_INTERP_RAN\n", 15);
+ return 0;
+}