[lkml]   [2001]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[BUG] stat.st_size is not set for pipes

I have upgraded from 2.4.2 to 2.4.5 and noticed a difference between the
output of fstat() for pipes using the following testprogram:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

FILE *f;
struct stat buf;
int retval;

f = popen("echo -n test", "r");
retval = fstat(fileno(f), &buf);
printf("Data: %d, %d\n", retval, buf.st_size );


Under 2.0.x, 2.2.x and 2.4.2 st_size reports the 4 bytes of the "test"
string, 2.4.5 reports 0.

Please CC to my email address also, as I'm not subscribed to the list. I
checked the archives and hope I didn't miss a previous discussion of this.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.072 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site