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


##########
include/nuttx/fs/cookie.h:
##########
@@ -44,8 +44,8 @@
  * These callbacks can either lead to custom functions if fopencookie is used
  * or to standard file system functions if not.
  *
- * They are in their own header because stdio.h needs them, and a program
- * of a kernel build must not see the rest of nuttx/fs/fs.h.
+ * They are in their own header because stdio.h and nuttx/tls.h need them,
+ * and stdio.h includes nuttx/tls.h before it could define them.

Review Comment:
   merge to the first patch



##########
include/stdio.h:
##########
@@ -33,8 +33,17 @@
 #include <stdarg.h>
 #include <time.h>
 
-#include <nuttx/fs/fs.h>
-#include <nuttx/lib/lib.h>
+#include <nuttx/fs/cookie.h>
+
+/* Kernel code, and every program of a flat or protected build, still sees
+ * the file system and C library internals through stdio.h.  The programs
+ * of a kernel build cannot use them, and do not see them.
+ */
+
+#if !defined(CONFIG_BUILD_KERNEL) || defined(__KERNEL__)
+#  include <nuttx/fs/fs.h>
+#  include <nuttx/lib/lib.h>

Review Comment:
   remove lib.h



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