This is indeed happening - the pipe data is still there, it is just that
xfs is hiding it from you, small fix on its way into cvs land now.
Steve
>
> Hi,
>
> I think I found something fishy in XFS. Or at least, something which is worki
> ng
> on ext2 isn't working on XFS. Calling stat() on a named pipe which is on an
> XFS filesystem seems to flush all queued data in that pipe.
>
> Testcase:
> # mkfifo XYZ
> # ./t & (t.c attached)
> # echo foo > XYZ
>
> correct output: "read returned 4"
> wrong output: "read returned 0"
>
>
> cheers,
> Lennert
>
>
> -- t.c
> #include <stdio.h>
> #include <stdlib.h>
> #include <fcntl.h>
> #include <sys/stat.h>
> #include <unistd.h>
>
> int main()
> {
> char buf[512];
> int fd;
> int i;
> struct stat sb;
>
> fd = open("XYZ", O_RDONLY);
> fstat(fd, &sb);
> printf("read returned %i\n", read(fd, buf, 512));
>
> return 0;
> }
|