no1wudi commented on code in PR #8696:
URL: https://github.com/apache/nuttx/pull/8696#discussion_r1123954229
##########
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:
Maybe not? This is a specific and internal NuttX interface, it used to get
stdin/stdout/stderr stream, other usage is to get them in foreign language by
experienced developers, they should read the describe of this function and this
case is not common.
--
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]