summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/sys
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/sys')
-rw-r--r--libc/sysdeps/linux/common/sys/epoll.h14
-rw-r--r--libc/sysdeps/linux/common/sys/random.h22
2 files changed, 33 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/common/sys/epoll.h b/libc/sysdeps/linux/common/sys/epoll.h
index 5551bed0d..5138d77a9 100644
--- a/libc/sysdeps/linux/common/sys/epoll.h
+++ b/libc/sysdeps/linux/common/sys/epoll.h
@@ -19,6 +19,7 @@
#define _SYS_EPOLL_H 1
#include <stdint.h>
+#include <sys/ioctl.h>
#include <sys/types.h>
/* Get __sigset_t. */
@@ -87,6 +88,19 @@ struct epoll_event
epoll_data_t data; /* User data variable */
} __EPOLL_PACKED;
+struct epoll_params
+{
+ uint32_t busy_poll_usecs;
+ uint16_t busy_poll_budget;
+ uint8_t prefer_busy_poll;
+
+ /* pad the struct to a multiple of 64bits */
+ uint8_t __pad;
+};
+
+#define EPOLL_IOC_TYPE 0x8A
+#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params)
+#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params)
__BEGIN_DECLS
diff --git a/libc/sysdeps/linux/common/sys/random.h b/libc/sysdeps/linux/common/sys/random.h
index 3d12744ad..c3d9cf575 100644
--- a/libc/sysdeps/linux/common/sys/random.h
+++ b/libc/sysdeps/linux/common/sys/random.h
@@ -4,12 +4,20 @@
#ifndef _SYS_RANDOM_H
#define _SYS_RANDOM_H 1
+
#include <features.h>
#include <stddef.h>
__BEGIN_DECLS
-#if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+#include <bits/types.h>
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+#if defined __UCLIBC_LINUX_SPECIFIC__
# if 0 /*def __ASSUME_GETRANDOM_SYSCALL */
# include <linux/random.h>
# else
@@ -20,13 +28,21 @@ __BEGIN_DECLS
*
* GRND_NONBLOCK Don't block and return EAGAIN instead
* GRND_RANDOM Use the /dev/random pool instead of /dev/urandom
+ * GRND_INSECURE Write random data that may not be cryptographically secure.
*/
# define GRND_NONBLOCK 0x0001
# define GRND_RANDOM 0x0002
+# define GRND_INSECURE 0x0004
# endif
-/* FIXME: aren't there a couple of __restrict and const missing ? */
-extern int getrandom(void *__buf, size_t count, unsigned int flags)
+extern ssize_t getrandom(void *__buf, size_t count, unsigned int flags)
__nonnull ((1)) __wur;
+
+/* OpenBSD-compatible access to random bytes.
+ May be a cancellation point here, unlike in glibc/musl. */
+# ifndef __getentropy_defined
+extern int getentropy(void *__buf, size_t __len) __nonnull ((1)) __wur;
+# define __getentropy_defined
+# endif
#endif
__END_DECLS