random-util: use ssize_t for getrandom return value

This matches the prototype provided by glibc.
This commit is contained in:
Mike Gilbert
2021-12-26 10:13:56 +09:00
committed by Yu Watanabe
parent 4b7b73c714
commit 289b41aae7
2 changed files with 10 additions and 9 deletions
+2 -1
View File
@@ -78,7 +78,8 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) {
/* ======================================================================= */
#if !HAVE_GETRANDOM
static inline int missing_getrandom(void *buffer, size_t count, unsigned flags) {
/* glibc says getrandom() returns ssize_t */
static inline ssize_t missing_getrandom(void *buffer, size_t count, unsigned flags) {
# ifdef __NR_getrandom
return syscall(__NR_getrandom, buffer, count, flags);
# else