libs/libc: correct the getrandom(2) prototype

Reference here:
https://man7.org/linux/man-pages/man2/getrandom.2.html

Change-Id: I25b913c4b6533b3888cb2b9c62bb71505a0815c9
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2020-12-07 11:10:04 +08:00
committed by chao an
parent 11385f64d3
commit 511d65392a
6 changed files with 10 additions and 6 deletions
+3 -1
View File
@@ -555,13 +555,15 @@ void up_randompool_initialize(void)
* Input Parameters:
* bytes - Buffer for returned random bytes
* nbytes - Number of bytes requested.
* flags - Bit mask that can contain zero or more of the ORed values
* together.
*
* Returned Value:
* None
*
****************************************************************************/
void getrandom(FAR void *bytes, size_t nbytes)
void getrandom(FAR void *bytes, size_t nbytes, unsigned int flags)
{
int ret;
+1 -1
View File
@@ -165,7 +165,7 @@ static ssize_t devurand_read(FAR struct file *filep, FAR char *buffer,
#ifdef CONFIG_DEV_URANDOM_RANDOM_POOL
if (len > 0)
{
getrandom(buffer, len);
getrandom(buffer, len, 0);
}
#else
+3 -1
View File
@@ -64,13 +64,15 @@
* Input Parameters:
* bytes - Buffer for returned random bytes
* nbytes - Number of bytes requested.
* flags - Bit mask that can contain zero or more of the ORed values
* together.
*
* Returned Value:
* None
*
****************************************************************************/
void getrandom(FAR void *bytes, size_t nbytes);
void getrandom(FAR void *bytes, size_t nbytes, unsigned int flags);
#endif /* CONFIG_CRYPTO_RANDOM_POOL */
+1 -1
View File
@@ -382,5 +382,5 @@ SYSCALL_LOOKUP(telldir, 1)
*/
#ifdef CONFIG_CRYPTO_RANDOM_POOL
SYSCALL_LOOKUP(getrandom, 2)
SYSCALL_LOOKUP(getrandom, 3)
#endif
+1 -1
View File
@@ -44,7 +44,7 @@
void uuid_create(uuid_t *u, uint32_t *status)
{
#ifdef CONFIG_CRYPTO_RANDOM_POOL
getrandom(u, sizeof(uuid_t));
getrandom(u, sizeof(uuid_t), 0);
#else
unsigned long *beg = (unsigned long *)u;
unsigned long *end = (unsigned long *)(u + 1);
+1 -1
View File
@@ -35,7 +35,7 @@
"getitimer","sys/time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","int","FAR struct itimerval *"
"getpeername","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getpid","unistd.h","","pid_t"
"getrandom","sys/random.h","defined(CONFIG_CRYPTO_RANDOM_POOL)","void","FAR void *","size_t"
"getrandom","sys/random.h","defined(CONFIG_CRYPTO_RANDOM_POOL)","void","FAR void *","size_t","unsigned int"
"getsockname","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getsockopt","sys/socket.h","defined(CONFIG_NET)","int","int","int","int","FAR void *","FAR socklen_t *"
"getuid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","uid_t"
1 _exit unistd.h void int
35 getitimer sys/time.h !defined(CONFIG_DISABLE_POSIX_TIMERS) int int
36 getpeername sys/socket.h defined(CONFIG_NET) int int
37 getpid unistd.h pid_t
38 getrandom sys/random.h defined(CONFIG_CRYPTO_RANDOM_POOL) void FAR void *
39 getsockname sys/socket.h defined(CONFIG_NET) int int
40 getsockopt sys/socket.h defined(CONFIG_NET) int int
41 getuid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) uid_t