[BUG] stat.st_size is not set for pipes

Uwe Rathmann (Uwe.Rathmann@epost.de)
Wed, 13 Jun 2001 13:56:00 +0200


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/