summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThorsten Glaser <tg@debian.org>2025-04-07 00:23:45 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2025-04-07 00:24:40 +0200
commit8a6bb3fb10bef1a31088e845f6b4b2ae44959ef3 (patch)
tree20976e9dde9b449d8d0acca305f00b43659c3936 /include
parentf82757461a7fdec3233766494d7003bc89f71241 (diff)
add getentropy(), fix return value of getrandom()
Signed-off-by: Thorsten Glaser <tg@debian.org>
Diffstat (limited to 'include')
-rw-r--r--include/unistd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h
index d50e1e4d3..e45266f14 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1250,6 +1250,15 @@ extern void swab (const void *__restrict __from, void *__restrict __to,
extern char *ctermid (char *__s) __THROW;
#endif
+/* OpenBSD-compatible access to random bytes.
+ May be a cancellation point here, unlike in glibc/musl. */
+#ifdef _DEFAULT_SOURCE
+# ifndef __getentropy_defined
+extern int getentropy(void *__buf, size_t __len) __nonnull ((1)) __wur;
+# define __getentropy_defined
+# endif
+#endif
+
__END_DECLS