xiaoxiang781216 commented on code in PR #10602: URL: https://github.com/apache/nuttx/pull/10602#discussion_r1361877829
########## sched/tls/task_initinfo.c: ########## @@ -28,6 +28,8 @@ #include <nuttx/kmalloc.h> #include <nuttx/mutex.h> +#include <nuttx/lib/lib.h> Review Comment: > `<nuttx/lib/lib.h>` was used to reference `lib_stream_initialize` and `lib_stream_release` before your patch so I am not sure if it is such a problem in this case. both functions are moved into sched, so the inclusion doesn't need anymore > Deciding what function is to be called would require some if statements in running code which I would like to avoid. but you have to do the check since: 1. stdin/stdout/sderr is initialized inside kernel space 2. The assignment of stdin/stdout/stderr's callback inside kernel space point to the lib_fxxx_cb copy which is part of kernel space 3. fopen/fdopen point lib_fxxx_cb in user space when user call fwrite/fread on stdin/stdout/stderr, prefetch abort will happen since user space doesn't have right to execute the code inside the kernel space. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org