tools/include/nolibc/sys/random.h

Source file repositories/reference/linux-study-clean/tools/include/nolibc/sys/random.h

File Facts

System
Linux kernel
Corpus path
tools/include/nolibc/sys/random.h
Extension
.h
Size
792 bytes
Lines
35
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.

Dependency Surface

Detected Declarations

Annotated Snippet

#include "../nolibc.h"

#ifndef _NOLIBC_SYS_RANDOM_H
#define _NOLIBC_SYS_RANDOM_H

#include "../arch.h"
#include "../sys.h"

#include <linux/random.h>

/*
 * ssize_t getrandom(void *buf, size_t buflen, unsigned int flags);
 */

static __attribute__((unused))
ssize_t _sys_getrandom(void *buf, size_t buflen, unsigned int flags)
{
	return __nolibc_syscall3(__NR_getrandom, buf, buflen, flags);
}

static __attribute__((unused))
ssize_t getrandom(void *buf, size_t buflen, unsigned int flags)
{
	return __sysret(_sys_getrandom(buf, buflen, flags));
}

#endif /* _NOLIBC_SYS_RANDOM_H */

Annotation

Implementation Notes