Gary-Hobson commented on code in PR #8685:
URL: https://github.com/apache/nuttx/pull/8685#discussion_r1123224821


##########
libs/libc/stream/lib_stdsostream.c:
##########
@@ -63,6 +63,42 @@ static void stdsostream_putc(FAR struct lib_sostream_s 
*this, int ch)
   while (get_errno() == EINTR);
 }
 
+/****************************************************************************
+ * Name: stdsostream_puts
+ ****************************************************************************/
+
+static int stdsostream_puts(FAR struct lib_sostream_s *this,
+                            FAR const void *buffer, int len)
+{
+  FAR struct lib_stdsostream_s *sthis = (FAR struct lib_stdsostream_s *)this;
+  int result;
+
+  DEBUGASSERT(this && sthis->stream);
+
+  /* Loop until the character is successfully transferred or an irrecoverable
+   * error occurs.
+   */
+
+  do
+    {
+      result = lib_fwrite(buffer, len, sthis->stream);
+      if (result >= 0)
+        {
+          this->nput += result;
+          return result;
+        }
+
+      result = _NX_GETERRNO(result);
+
+      /* EINTR (meaning that fputc was interrupted by a signal) is the only
+       * recoverable error.
+       */
+    }
+  while (result == EINTR);

Review Comment:
   done



##########
libs/libc/stream/lib_rawinstream.c:
##########
@@ -66,6 +66,33 @@ static int rawinstream_getc(FAR struct lib_instream_s *this)
   return EOF;
 }
 
+/****************************************************************************
+ * Name: rawinstream_getc
+ ****************************************************************************/
+
+static int rawinstream_gets(FAR struct lib_instream_s *this,
+                            FAR void *buffer, int len)
+{
+  FAR struct lib_rawinstream_s *rthis = (FAR struct lib_rawinstream_s *)this;
+  int nread;
+
+  DEBUGASSERT(this && rthis->fd >= 0);
+
+  /* Attempt to read one character */
+
+  nread = _NX_READ(rthis->fd, buffer, len);
+  if (nread >= 0)
+    {
+      this->nget += nread;
+    }
+  else
+    {
+      nread = _NX_GETERRNO(nread);

Review Comment:
   done



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