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

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>

main()
{
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 );

pclose(f);
}
--------

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.

Uwe
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  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