Q, SIGIO on pipe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux