POSIX Compliance

Richard B. Johnson (root@analogic.com)
Thu, 3 Apr 1997 19:44:00 -0500 (EST)


The following:
dev_end = lseek(fd, 0, SEEK_END);
Returns the file size or the device size (if a disk or disk partition)
on my Sun running SunOs 5.5.1.

On Linux machines of various versions, including the latest, it returns
zero (0). I do not know what is correct. However, if POSIX requires the
observed behavior, I think we no longer have a generic means of finding
out the size of a disk device or disk partition. This is not good.

It does return the file size if the object is a file. However, if
it is a disk or disk partition, it does not.

Cheers,
Dick Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp : ftp@boneserver.analogic.com
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.31 on an i586 machine (66.15 BogoMips).
Warning : I read unsolicited mail for $350.00 per hour. Supply billing address.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-