summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/struct_ops_arena_fail.c
blob: 1c0ec727d63743ee24867bbead229ec9b5a23785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */

#include <vmlinux.h>
#include <bpf/bpf_helpers.h>
#include "../test_kmods/bpf_testmod.h"

char _license[] SEC("license") = "GPL";

/* No arena in the program: attaching to test_arena must be rejected. */
SEC("struct_ops/test_arena")
int test_arena_no_arena(unsigned long long *ctx)
{
	return 0;
}

SEC(".struct_ops.link")
struct bpf_testmod_ops3 testmod_arena_fail = {
	.test_arena = (void *)test_arena_no_arena,
};