xiaoxiang781216 commented on code in PR #21902:
URL: https://github.com/apache/nuttx/pull/21902#discussion_r4625384048


##########
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:
   yes, but all places need apply the similar change, I think.



-- 
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]

Reply via email to