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

From: Ludovic Courtès <[email-masked]>
Date: Sun, 17 Aug 2025 17:11:23 +0200

Hello,

[email-masked] writes:

> I found where the error gets set (debugging global variables is not fun)
>
> As a reminder we get the D_WOULD_BLOCK error back from the initial 
>
> if(err)
>     return err;
> check in dev_read.
>
> In our case this comes from device_read_reply_inband from the errorcode parameter. I am not yet sure where/how this gets called.
>
> My little C example now returns EWOULDBLOCK when reaching the "end" of /dev/klog.

So you have a patch for /hurd/streamio and a C reproducer?  (Maybe you
sent it already and I haven’t seen.)

> However this does not really help the shepherd syslog because guile's
> read-line blocks forever waiting for a terminating newline. Also guile
> is unaware that further attempts to read would EWOULDBLOCK as "(select
> (vector port) #() #() 0)" indicates that reading is possible but then
> actually trying to a get a char blocks.

Ah but I think that’s fine: shepherd, suspendable ports are enabled (via
Fibers), which means that read attempts that return EAGAIN or
EWOULDBLOCK result in the calling fiber being suspended.

You would need to try this for real, but it should be fine.

Thanks!

Ludo’.