tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.c
Extension
.c
Size
355 bytes
Lines
17
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0-only

#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>

#define BPF_RETVAL_HOOK(name, section, ctx, expected_err) \
	__attribute__((__section__("?" section))) \
	int name(struct ctx *_ctx) \
	{ \
		bpf_set_retval(bpf_get_retval()); \
		return 1; \
	}

#include "cgroup_getset_retval_hooks.h"

#undef BPF_RETVAL_HOOK

Annotation

Implementation Notes