Q, SIGIO on pipe
Between v5.4 and v5.5-rc5, big changes are made around pipe and my test program behaves differently.
{
err = mknod(fname, S_IFIFO | 0644, /*dev*/0);
fd = open(fname, O_RDWR, /*mode*/0);
err = sigaction(SIGIO, &sa, NULL);
pid = getpid();
err = fcntl(fd, F_SETOWN, pid);
err = fcntl(fd, F_SETSIG, SIGIO);
flags = fcntl(fd, F_GETFL);
err = fcntl(fd, F_SETFL, O_NONBLOCK | O_ASYNC | flags);
ssz = write(fd, &i, 1);
ssz = read(fd, &i, 1);
}In v5.4, the final write(2) and read(2) generate/send SIGIO for each, POLLIN and POLLOUT respectively.
But in v5.5-rc5, read(2) doesn't generate/send SIGIO POLLOUT while it reads 1 byte successfully.
Reading new pipe.c, pipe_read() fires the signal only when the pipe buffer was full (16 as PIPE_DEF_BUFFERS defines), so my test program which writes only 1 byte doesn't receive the signal. Am I right? If so, is this an intentional behaviour and the previous behaviour was wrong and violated some standards?
J. R. Okajima
Quoted 2 lines · J. R. Okajima
Between v5.4 and v5.5-rc5, big changes are made around pipe and my test program behaves differently.
Do you have a full test program I can look at?
David
David Howells:
Quoted 1 line
Do you have a full test program I can look at?
Here you are.