Hello Samuel,

As far as I can tell, runsv is creating a fifo and attaching to it/opening read
only, but is not actually reading anything coming from it. sv is then trying to
open write to the other side of the fifo, but is not actually writing nothing to
it. Both parties are happy there there is someone on the other side of the ok
fifo.

So I made a test program fifo_mkrd_test.c that creates a fifo and attaches to it
just like runsv does, and fifo_test.c which opens it and closes it twice with a
sleep in between.

On linux both open actions succeed, but on the hurd the first attempt works but
the second does not. fifo_mkrd_test.c keeps attached to the fifo with an
infinite loop, but something seems to happen upon closing the write to the fifo
that makes it impossible to reopen it.

Best regards,
João 
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int fd;
extern int errno;
int main()
{
   mkfifo("afifo",0600);
   fd=open("afifo",O_RDONLY | O_NDELAY);
   fcntl(fd,F_SETFD,1);
   for (;;) {};
   return 0;
}
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
int fd;
extern int errno;
int main()
{
   fd=open("afifo",O_WRONLY | O_NDELAY);
   printf("fd=%i,errno=%i\n",fd,errno);
   close(fd);
   sleep(1);
   fd=open("afifo",O_WRONLY | O_NDELAY);
   printf("fd=%i,errno=%i\n",fd,errno);
   close(fd);
   return 0;
}

Reply via email to