linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Q, SIGIO on pipe
@ 2020-01-09  5:45 J. R. Okajima
  2020-01-22 14:22 ` David Howells
  0 siblings, 1 reply; 3+ messages in thread
From: J. R. Okajima @ 2020-01-09  5:45 UTC (permalink / raw)
  To: dhowells; +Cc: linux-fsdevel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Q, SIGIO on pipe
  2020-01-09  5:45 Q, SIGIO on pipe J. R. Okajima
@ 2020-01-22 14:22 ` David Howells
  2020-01-22 17:45   ` J. R. Okajima
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2020-01-22 14:22 UTC (permalink / raw)
  To: J. R. Okajima; +Cc: dhowells, linux-fsdevel

J. R. Okajima <hooanon05g@gmail.com> wrote:

> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Q, SIGIO on pipe
  2020-01-22 14:22 ` David Howells
@ 2020-01-22 17:45   ` J. R. Okajima
  0 siblings, 0 replies; 3+ messages in thread
From: J. R. Okajima @ 2020-01-22 17:45 UTC (permalink / raw)
  To: David Howells; +Cc: linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 80 bytes --]

David Howells:
> Do you have a full test program I can look at?

Here you are.


[-- Attachment #2: a.c.gz --]
[-- Type: application/gzip, Size: 909 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-22 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09  5:45 Q, SIGIO on pipe J. R. Okajima
2020-01-22 14:22 ` David Howells
2020-01-22 17:45   ` J. R. Okajima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).