Export getentropy and getrandom calls

getentropy per OpenBSD

  http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2

getrandom per Linux

  http://man7.org/linux/man-pages/man2/getrandom.2.html

  Note that GRND_NONBLOCK is not handled
This commit is contained in:
Corinna Vinschen
2016-12-16 23:10:19 +01:00
parent f46f501471
commit 4e75d7f504
5 changed files with 96 additions and 6 deletions

View File

@ -0,0 +1,29 @@
/* sys/random.h header file for Cygwin.
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */
#ifndef _SYS_RANDOM_H
#define _SYS_RANDOM_H
#include <_ansi.h>
#include <sys/types.h>
/* getrandom flags */
#define GRND_NONBLOCK 1
#define GRND_RANDOM 2
#ifdef __cplusplus
extern "C" {
#endif
ssize_t getrandom (void *__ptr, size_t __len, unsigned int __flags);
int getentropy (void *__ptr, size_t __len);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_RANDOM_H */