mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Revert "libs/libc: correct the getrandom(2) prototype"
This reverts commit 8411ef1873.
Signed-off-by: chao.an <anchao@xiaomi.com>
Change-Id: I29e90e01f3b8a0460ee53831d38d96edf7d12ef2
This commit is contained in:
+2
-18
@@ -555,21 +555,13 @@ 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:
|
||||
* On success, getrandom() returns the number of bytes that were copied
|
||||
* to the buffer buf. This may be less than the number of bytes
|
||||
* requested via buflen if either GRND_RANDOM was specified in flags and
|
||||
* insufficient entropy was present in the random source or the system
|
||||
* call was interrupted by a signal.
|
||||
|
||||
* On error, -1 is returned, and errno is set appropriately.
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t getrandom(FAR void *bytes, size_t nbytes, unsigned int flags)
|
||||
void getrandom(FAR void *bytes, size_t nbytes)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -578,13 +570,5 @@ ssize_t getrandom(FAR void *bytes, size_t nbytes, unsigned int flags)
|
||||
{
|
||||
rng_buf_internal(bytes, nbytes);
|
||||
nxsem_post(&g_rng.rd_sem);
|
||||
ret = nbytes;
|
||||
}
|
||||
else
|
||||
{
|
||||
set_errno(-ret);
|
||||
ret = ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user