Re: accept(2) returning a O_NONBLOCK socket

2025-05-10 Thread Samuel Thibault
Hello, Ludovic Courtès, le ven. 09 mai 2025 00:34:08 +0200, a ecrit: > The patch below fixes that (and thus fixes the Shepherd socket > activation, as yelninei initially reported). Makes sense indeed, applied, thanks! Samuel

Re: accept(2) returning a O_NONBLOCK socket

2025-05-10 Thread yelninei--- via Bug reports for the GNU Hurd
Hello Ludo, May 8, 2025, 22:34 by l...@gnu.org: > Hello, > > So I think my last attempt was misguided; attached is a simpler > reproducer that exhibits the problem following these steps: > > 1. create a socket, bind it, and mark it as O_NONBLOCK; > 2. select on that socket to wait for an incomin

Re: accept(2) returning a O_NONBLOCK socket

2025-05-08 Thread Ludovic Courtès
Hello, So I think my last attempt was misguided; attached is a simpler reproducer that exhibits the problem following these steps: 1. create a socket, bind it, and mark it as O_NONBLOCK; 2. select on that socket to wait for an incoming connection; 3. clear its O_NONBLOCK flag; 4. call acc

Re: accept(2) returning a O_NONBLOCK socket

2025-05-07 Thread Ludovic Courtès
Hi, yelni...@tutamail.com writes: > After spending a bit of time investigating I am a bit lost. I haven't > found anything that is for me obviously wrong, but have not yet fully > understood how things fit together. > > The only thing I have so far is that the flags of the wrong socket are > the

Re: accept(2) returning a O_NONBLOCK socket

2025-04-30 Thread yelninei--- via Bug reports for the GNU Hurd
Hello again, Apr 24, 2025, 19:05 by yelni...@tutamail.com: > Hello Samuel, > > I haven't had much time to look into this in depth yet but I have adapted my > initial example s.t. it doesn't need an external program for the main socket > (please excuse my terrible C code and the formatting). > >

Re: accept(2) returning a O_NONBLOCK socket

2025-04-24 Thread yelninei--- via Bug reports for the GNU Hurd
Hello Samuel, I haven't had much time to look into this in depth yet but I have adapted my initial example s.t. it doesn't need an external program for the main socket (please excuse my terrible C code and the formatting). The socket is first created nonblocking and once the first connection com

Re: accept(2) returning a O_NONBLOCK socket

2025-04-18 Thread Samuel Thibault
Hello, yelninei--- via Bug reports for the GNU Hurd, le ven. 18 avril 2025 14:42:03 +0200, a ecrit: >   client = accept(fd, NULL, NULL); >   if (client < 0) return 1; >   fprintf(stderr, "Accepting connection\n"); >   if ((fcntl(client, F_GETFL) & O_NONBLOCK) != 0) > { >   fprintf

accept(2) returning a O_NONBLOCK socket

2025-04-18 Thread yelninei--- via Bug reports for the GNU Hurd
Hello, This was originally https://issues.guix.gnu.org/77610. Guix recently switched to systemd-style socket activation (https://www.freedesktop.org/software/systemd/man/latest/daemon.html#Socket-Based%20Activation) for their daemon. When I tried this on a Guix Hurd VM the first connection to