A colleague has run into a problem. We assume it's a kernel issue. Here
is the pertinent bug report data.
[1.] One line summary of the problem:
fstat(2) returns st_size == 0 for a FIFO that is known to have data in it.
[2.] Full description of the problem/report:
When using a FIFO, fstat(2) (and stat(2)) returns a 'struct stat' with the
st_size field equal to zero, at a time when the FIFO is known to have data
in it. Problem occurs with Linux 2.6.16 kernel (see more below), but does
not occur on 2.4.20.
[3.] Keywords (i.e., modules, networking, kernel):
stat, fstat, FIFO, struct stat, st_size, system call, write
[4.] Kernel version (from /proc/version):
Linux version 2.6.16.13-4-default (geeko@buildhost) (gcc version 4.1.0
(SUSE Linux)) #1 Wed May 3 04:53:23 UTC 2006
Note: Problem does _not_ occur on Linux version 2.4.20-8
(bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 2003022 (Red Hat
Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003
[5.] Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/oops-tracing.txt)
No oops. Problem doesn't cause system crash, only affects behavior of
user applications.
[6.] A small shell script or example program which triggers the
problem (if possible)
I don't know if this qualifies as "small", but there is a 'C' program
attached that will reproduce the problem (fifo.c).
[7.] Environment
[7.1.] Software (add the output of the ver_linux script here)
See attached file (ver-linux.out).
[7.2.] Processor information (from /proc/cpuinfo):
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 79
model name : AMD Athlon(tm) 64 Processor 3500+
stepping : 2
cpu MHz : 1000.000
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ...