Subject: [bug#77943] [PATCH 1/2] services: shepherd: Provide the right #:kernel-log-file on the Hurd.

From: Ludovic Courtès <[email-masked]>
Date: Mon, 25 Aug 2025 21:52:59 +0200

Hello,

[email-masked] writes:

> No i have not sent this:
> Something like this fixes the D_WOULD_BLOCK errno.
> --8<---------------cut here---------------start------------->8---
> diff --git a/trans/streamio.c b/trans/streamio.c
> index e42ff908..93057146 100644
> --- a/trans/streamio.c
> +++ b/trans/streamio.c
> @@ -1049,6 +1049,8 @@ device_read_reply_inband (mach_port_t reply, kern_return_t errorcode,
>  
>    input_pending = 0;
>    err = errorcode;
> +  if (err == D_WOULD_BLOCK)
> +    err = EWOULDBLOCK;
>    if (!err)
>      {
>        if (datalen == 0)
> --8<---------------cut here---------------end--------------->8---

Neat!  You should send this and the C reproducer to bug-hurd.  :-)

> It is fine in the sense that fibers suspends the system-log successfully at the "end" of /dev/klog.
> However It is not fine because it will never wake up it up again. 
> According to the c example it now returns EWOULDBLOCK as expected.From testing around a bit I think it might be (@ (ice-9 rdelim) read-line) waiting for a terminating newline.
> And again when I retried this just now there was the noticable delay with anything shepherd when the shepherd-syslog is running (default (system-log-configuration) configuration)

Great.  So… mission accomplished?

Thank you!

Ludo’.