tools/testing/selftests/bpf/progs/err.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/err.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/err.h- Extension
.h- Size
- 592 bytes
- Lines
- 29
- 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.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function IS_ERR_OR_NULLfunction PTR_ERR
Annotated Snippet
#ifndef __ERR_H__
#define __ERR_H__
#define MAX_ERRNO 4095
#define IS_ERR_VALUE(x) (unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO
#define __STR(x) #x
#define set_if_not_errno_or_zero(x, y) \
({ \
asm volatile ("if %0 s< -4095 goto +1\n" \
"if %0 s<= 0 goto +1\n" \
"%0 = " __STR(y) "\n" \
: "+r"(x)); \
})
static inline int IS_ERR_OR_NULL(const void *ptr)
{
return !ptr || IS_ERR_VALUE((unsigned long)ptr);
}
static inline long PTR_ERR(const void *ptr)
{
return (long) ptr;
}
#endif /* __ERR_H__ */
Annotation
- Detected declarations: `function IS_ERR_OR_NULL`, `function PTR_ERR`.
- 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.