You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/10 13:27:04 UTC

[GitHub] [incubator-nuttx] v01d commented on a change in pull request #3469: syslog: syslog_device ops are handled internally by the driver.

v01d commented on a change in pull request #3469:
URL: https://github.com/apache/incubator-nuttx/pull/3469#discussion_r611045235



##########
File path: drivers/syslog/README.txt
##########
@@ -120,21 +120,31 @@ SYSLOG Channels
   SYSLOG channel is represented by an interface defined in
   include/nuttx/syslog/syslog.h:
 
-    /* This structure provides the interface to a SYSLOG device */
+    /* SYSLOG I/O redirection methods */
 
-    typedef CODE int (*syslog_putc_t)(int ch);
-    typedef CODE int (*syslog_flush_t)(void);
+    typedef CODE ssize_t (*syslog_write_t)(FAR struct syslog_channel_s *channel,
+                                       FAR const char *buf, size_t buflen);
+    typedef CODE int (*syslog_putc_t)(FAR struct syslog_channel_s *channel,
+                                  int ch);
+    typedef CODE int (*syslog_flush_t)(FAR struct syslog_channel_s *channel);
+
+    /* SYSLOG device operations */
+
+    struct syslog_channel_ops_s
+    {
+      syslog_putc_t  sc_putc;   /* Normal buffered output */

Review comment:
       I don't fully understand the purpose of `put` either, but my guess is that is done this way so that it is possible to print the message from interrupt handlers without having to hold any lock (there is some comment about this in syslog implementation). When I looked at how to make ramlog implement write() I got stuck with this. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org