Bug 12513 - stat() seems to return always size zero for any fifo (named pipe)
Summary: stat() seems to return always size zero for any fifo (named pipe)
Status: REJECTED WILL_NOT_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-20 04:16 UTC by Jaime Lopez
Modified: 2009-03-25 07:37 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.18-92.1.18.el5
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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?

Note You need to log in before you can comment on or make changes to this bug.