diff options
author | Robert Mustacchi <rm@joyent.com> | 2014-12-26 02:46:52 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2015-02-15 00:36:58 +0000 |
commit | f31c6fa33bcc9a608ce6f9ffd671ffc2b65a30ef (patch) | |
tree | 804c1aad78118d760e083f79a0f411894272488f /usr/src/lib/libc/port/sys/getrandom.c | |
parent | d34c3434a6ead24ec3e41daebf60ff85376c9e47 (diff) | |
download | illumos-joyent-f31c6fa33bcc9a608ce6f9ffd671ffc2b65a30ef.tar.gz |
OS-3845 want arc4random(3C) suite
OS-3846 want getentropy(3C)
OS-3847 want getrandom(2)
OS-3848 want explicit_bzero(3C)
OS-3843 want MC_INHERIT_ZERO
OS-3844 uuid_generate can leak its cache in edge conditions
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Diffstat (limited to 'usr/src/lib/libc/port/sys/getrandom.c')
-rw-r--r-- | usr/src/lib/libc/port/sys/getrandom.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/usr/src/lib/libc/port/sys/getrandom.c b/usr/src/lib/libc/port/sys/getrandom.c new file mode 100644 index 0000000000..8e59f526a1 --- /dev/null +++ b/usr/src/lib/libc/port/sys/getrandom.c @@ -0,0 +1,24 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2015 Joyent, Inc. + */ + +#include <sys/types.h> +#include <sys/syscall.h> +#include <sys/random.h> + +int +getrandom(void *buf, size_t len, int flags) +{ + return (syscall(SYS_getrandom, buf, len, flags)); +} |