Bug 12513

Summary: stat() seems to return always size zero for any fifo (named pipe)
Product: File System Reporter: Jaime Lopez (jaime.lopez)
Component: OtherAssignee: fs_other
Status: REJECTED WILL_NOT_FIX    
Severity: normal CC: sjgolecha
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.18-92.1.18.el5 Subsystem:
Regression: No Bisected commit-id:

Description Jaime Lopez 2009-01-20 04:16:51 UTC
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
Comment 1 Alan 2009-03-20 06:24:12 UTC
The size fields are not defined for a FIFO, Linux is perfectly correct here and POSIX/SUS agrees.
Comment 2 Jaime Lopez 2009-03-25 07:37:51 UTC
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?