tools/include/nolibc/err.h
Source file repositories/reference/linux-study-clean/tools/include/nolibc/err.h
File Facts
- System
- Linux kernel
- Corpus path
tools/include/nolibc/err.h- Extension
.h- Size
- 1606 bytes
- Lines
- 88
- 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
nolibc.herrno.hstdarg.hsys.h
Detected Declarations
function Copyrightfunction __attribute__function __attribute__function __attribute__function __attribute__function __attribute__function __attribute__function __attribute__
Annotated Snippet
#include "nolibc.h"
#ifndef _NOLIBC_ERR_H
#define _NOLIBC_ERR_H
#include "errno.h"
#include "stdarg.h"
#include "sys.h"
static __attribute__((unused))
void vwarn(const char *fmt, va_list args)
{
fprintf(stderr, "%s: ", program_invocation_short_name);
vfprintf(stderr, fmt, args);
fprintf(stderr, ": %m\n");
}
static __attribute__((unused))
void vwarnx(const char *fmt, va_list args)
{
fprintf(stderr, "%s: ", program_invocation_short_name);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
}
static __attribute__((unused))
void warn(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vwarn(fmt, args);
va_end(args);
}
static __attribute__((unused))
void warnx(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vwarnx(fmt, args);
va_end(args);
}
static __attribute__((noreturn, unused))
void verr(int eval, const char *fmt, va_list args)
{
vwarn(fmt, args);
exit(eval);
}
static __attribute__((noreturn, unused))
void verrx(int eval, const char *fmt, va_list args)
{
warnx(fmt, args);
exit(eval);
}
static __attribute__((noreturn, unused))
void err(int eval, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
verr(eval, fmt, args);
va_end(args);
}
static __attribute__((noreturn, unused))
void errx(int eval, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
verrx(eval, fmt, args);
va_end(args);
}
#endif /* _NOLIBC_ERR_H */
Annotation
- Immediate include surface: `nolibc.h`, `errno.h`, `stdarg.h`, `sys.h`.
- Detected declarations: `function Copyright`, `function __attribute__`, `function __attribute__`, `function __attribute__`, `function __attribute__`, `function __attribute__`, `function __attribute__`, `function __attribute__`.
- 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.