1 .\" $OpenBSD: getentropy.2,v 1.8 2015/01/31 00:20:12 schwarze Exp $
3 .\" Copyright (c) 2018 Conrad Meyer <cem@FreeBSD.org>
4 .\" Copyright (c) 2014 Theo de Raadt
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
31 .Fn getentropy "void *buf" "size_t buflen"
34 fills a buffer with high-quality random data.
38 permitted is 256 bytes.
40 If it does not produce an error,
42 always provides the requested number of bytes of random data.
44 Similar to reading from
48 may block until the system has collected enough entropy to seed the CSPRNG.
49 .Sh IMPLEMENTATION NOTES
52 function is implemented using
63 parameter points to an
66 Too many bytes requested, or some other fatal error occurred.
85 libc compatibility shim first appeared in