I created the documentation, please double check:

https://github.com/apache/nuttx/pull/17238

Now I need to test your patch and submit it. Anyway I already suggested
using the SYSLOG BUFFER, so the doc doesn't need to be updated later.

BR,

Alan

On Thu, Oct 16, 2025 at 4:38 PM Lwazi Dube <[email protected]> wrote:

> On Thu, 16 Oct 2025 at 07:09, Jean Thomas <[email protected]> wrote:
>
> >
> > Lwazi, did you do anything else to get it to use 0-terminated string?
> >
> > Jean
> >
>
> In streams.h, I add 1 to the buffer size:
>
> struct lib_syslograwstream_s
> {
>   struct lib_outstream_s common;
> #ifdef CONFIG_SYSLOG_BUFFER
>   char buffer[CONFIG_SYSLOG_BUFSIZE + 1]; <----
>   off_t offset;
> #endif
>   int last_ch;
> };
>
> And then 0-terminate just before the smh_call(SEMI_SYSLOG_WRITE0..) in
> up_nputs.
>
> The 0-termination needs be moved to syslograwstream_flush but I have not
> tested this:
>
> static int syslograwstream_flush(FAR struct lib_outstream_s *self)
> {
> <--snip-->
>   stream->buffer[stream->offset] = 0;
>   ssize_t nbytes = syslog_write(stream->buffer, stream->offset);
>

Reply via email to