tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c- Extension
.c- Size
- 1179 bytes
- Lines
- 58
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: syscall or user/kernel boundary
- Status
- core 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 participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
Dependency Surface
errno.hstdio.hunistd.hsys/syscall.hutils.hipc.h
Detected Declarations
function ipc_unmuxedfunction main
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2015, Michael Ellerman, IBM Corp.
*
* This test simply tests that certain syscalls are implemented. It doesn't
* actually exercise their logic in any way.
*/
#define _GNU_SOURCE
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
#include "utils.h"
#define DO_TEST(_name, _num) \
static int test_##_name(void) \
{ \
int rc; \
printf("Testing " #_name); \
errno = 0; \
rc = syscall(_num, -1, 0, 0, 0, 0, 0); \
printf("\treturned %d, errno %d\n", rc, errno); \
return errno == ENOSYS; \
}
#include "ipc.h"
#undef DO_TEST
static int ipc_unmuxed(void)
{
int tests_done = 0;
#define DO_TEST(_name, _num) \
FAIL_IF(test_##_name()); \
tests_done++;
#include "ipc.h"
#undef DO_TEST
/*
* If we ran no tests then it means none of the syscall numbers were
* defined, possibly because we were built against old headers. But it
* means we didn't really test anything, so instead of passing mark it
* as a skip to give the user a clue.
*/
SKIP_IF(tests_done == 0);
return 0;
}
int main(void)
{
return test_harness(ipc_unmuxed, "ipc_unmuxed");
}
Annotation
- Immediate include surface: `errno.h`, `stdio.h`, `unistd.h`, `sys/syscall.h`, `utils.h`, `ipc.h`.
- Detected declarations: `function ipc_unmuxed`, `function main`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: core 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.