xiaoxiang781216 commented on code in PR #21902: URL: https://github.com/apache/nuttx/pull/21902#discussion_r4609276566
########## libs/libc/stdlib/lib_arc4random.c: ########## @@ -25,14 +25,48 @@ ****************************************************************************/ #include <errno.h> +#include <fcntl.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <sys/param.h> #include <sys/random.h> #include <time.h> +#include <unistd.h> +#include <nuttx/fs/fs.h> #include <nuttx/hashtable.h> +#include <nuttx/random.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* The flat build and the kernel copy read the device through a file of + * their own: a descriptor or the errno of the caller does not change. + */ + +#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__) +# define RANDOM_OPEN(f, p) file_open(f, p, O_RDONLY) Review Comment: should we modify _NX_OPEN mapping? so we can reuse the same facility in the furture. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
