tools/include/nolibc/sys/resource.h
Source file repositories/reference/linux-study-clean/tools/include/nolibc/sys/resource.h
File Facts
- System
- Linux kernel
- Corpus path
tools/include/nolibc/sys/resource.h- Extension
.h- Size
- 1220 bytes
- Lines
- 54
- 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
../nolibc.h../sys.hlinux/resource.h
Detected Declarations
function __attribute__function __attribute__function __attribute__
Annotated Snippet
#include "../nolibc.h"
#ifndef _NOLIBC_SYS_RESOURCE_H
#define _NOLIBC_SYS_RESOURCE_H
#include "../sys.h"
#include <linux/resource.h>
/*
* int getrlimit(int resource, struct rlimit *rlim);
* int setrlimit(int resource, const struct rlimit *rlim);
*/
static __attribute__((unused))
int _sys_prlimit64(pid_t pid, int resource,
const struct rlimit64 *new_limit, struct rlimit64 *old_limit)
{
return __nolibc_syscall4(__NR_prlimit64, pid, resource, new_limit, old_limit);
}
static __attribute__((unused))
int getrlimit(int resource, struct rlimit *rlim)
{
struct rlimit64 rlim64;
int ret;
ret = __sysret(_sys_prlimit64(0, resource, NULL, &rlim64));
rlim->rlim_cur = rlim64.rlim_cur;
rlim->rlim_max = rlim64.rlim_max;
return ret;
}
static __attribute__((unused))
int setrlimit(int resource, const struct rlimit *rlim)
{
struct rlimit64 rlim64 = {
.rlim_cur = rlim->rlim_cur,
.rlim_max = rlim->rlim_max,
};
return __sysret(_sys_prlimit64(0, resource, &rlim64, NULL));
}
#endif /* _NOLIBC_SYS_RESOURCE_H */
Annotation
- Immediate include surface: `../nolibc.h`, `../sys.h`, `linux/resource.h`.
- Detected declarations: `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.