Latest working kernel version: 2.2.17-14 (RedHat 7.0) Earliest failing kernel version: 2.4.7-10 (RedHat 7.2) Distribution: All distributions Hardware Environment: x86 / x86_64 (always reproducible) Software Environment: All distributions (RedHat ES 5.0, Ubuntu, ...) Problem Description: I have a problem using stat() with kernel 2.4.x and 2.6.x The size of ANY fifo is always 0. There is no backward compatibility, as in 2.2.x stat always returned the actual number of unread bytes in the fifo (not a random value). Now stat always returns a size of zero. The problem shows up when using the ls, stat commands. Steps to reproduce: 1. mkfifo xx 2. cat > xx & 3. cat < xx 4. ^Z 5. echo "abcd" > xx
The size fields are not defined for a FIFO, Linux is perfectly correct here and POSIX/SUS agrees.
I agree that Linux may be POSIX compliant and perfectly correct. But I personally find the former behavior very useful. The FIFO size is shown in other OS such as AIX. Is there any chance to recover the old way of things?