tools/testing/selftests/landlock/common.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/landlock/common.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/landlock/common.h- Extension
.h- Size
- 6503 bytes
- Lines
- 256
- 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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
arpa/inet.herrno.hlinux/securebits.hsys/capability.hsys/prctl.hsys/socket.hsys/un.hsys/wait.hunistd.hkselftest_harness.hwrappers.h
Detected Declarations
struct protocol_variantstruct service_fixturefunction _init_capsfunction disable_capsfunction drop_capsfunction _change_capfunction set_capfunction clear_capfunction set_ambient_capfunction EXPECT_NEfunction clear_ambient_capfunction recv_fdfunction send_fdfunction enforce_rulesetfunction drop_access_rightsfunction set_unix_address
Annotated Snippet
struct protocol_variant {
int domain;
int type;
int protocol;
};
struct service_fixture {
struct protocol_variant protocol;
/* port is also stored in ipv4_addr.sin_port or ipv6_addr.sin6_port */
unsigned short port;
union {
struct sockaddr_in ipv4_addr;
struct sockaddr_in6 ipv6_addr;
struct {
struct sockaddr_un unix_addr;
socklen_t unix_addr_len;
};
struct sockaddr_storage _largest;
};
};
static void __maybe_unused set_unix_address(struct service_fixture *const srv,
const unsigned short index)
{
srv->unix_addr.sun_family = AF_UNIX;
sprintf(srv->unix_addr.sun_path,
"_selftests-landlock-abstract-unix-tid%d-index%d", sys_gettid(),
index);
srv->unix_addr_len = SUN_LEN(&srv->unix_addr);
srv->unix_addr.sun_path[0] = '\0';
}
Annotation
- Immediate include surface: `arpa/inet.h`, `errno.h`, `linux/securebits.h`, `sys/capability.h`, `sys/prctl.h`, `sys/socket.h`, `sys/un.h`, `sys/wait.h`.
- Detected declarations: `struct protocol_variant`, `struct service_fixture`, `function _init_caps`, `function disable_caps`, `function drop_caps`, `function _change_cap`, `function set_cap`, `function clear_cap`, `function set_ambient_cap`, `function EXPECT_NE`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.