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


##########
include/nuttx/fs/fs.h:
##########
@@ -81,27 +81,51 @@
  */
 
 #if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
-#  define _NX_OPEN             nx_open
-#  define _NX_CLOSE(f)         nx_close(f)
 #  define _NX_READ(f,b,s)      nx_read(f,b,s)

Review Comment:
   `_NX_READ`, `_NX_WRITE` and `_NX_SEEK` work on a descriptor that the caller 
gives, and the kernel needs them: `printf()` of kernel code writes to the 
stdout of the calling task through `lib_libfwrite()` (or `lib_rawoutstream` 
without `CONFIG_FILE_STREAM`) and `_NX_WRITE`, which is `nx_write()` there. 
`write()` would set the errno of the caller and add a cancellation point to 
every `printf()` of the kernel.
   



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