pkarashchenko commented on code in PR #8696:
URL: https://github.com/apache/nuttx/pull/8696#discussion_r1123776469


##########
libs/libc/stdio/lib_libgetstreams.c:
##########
@@ -57,4 +57,18 @@ FAR struct streamlist *lib_get_streams(void)
   return &info->ta_streamlist;
 }
 
+/****************************************************************************
+ * Name: lib_get_stream
+ *
+ * Description:
+ *   Return a pointer to the file stream for this thread and given fd。
+ *   Note: only reserved fd number 0/1/2 is valid.
+ *
+ ****************************************************************************/
+
+FAR struct file_struct *lib_get_stream(int fd)
+{
+  return &lib_get_streams()->sl_std[fd];

Review Comment:
   Do we need to check `fd < 3`?



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