Re: lseek SEEK_END fails on a Toshiba 6007MB disk.

Andreas Dilger (adilger@turbolabs.com)
Wed, 20 Feb 2002 17:23:12 -0700


On Feb 20, 2002 15:40 -0800, Kallol Biswas wrote:
> offset = lseek(fd, 0, SEEK_END);
>
> lseek: Value too large for defined data type

You need to use a 64-bit lseek (e.g. llseek or lseek64). This can
be done with '#define _LARGEFILE_SOURCE' and/or '#define _LARGEFILE64_SOURCE'
and/or '#define _FILE_OFFSET_BITS=64'.

Cheers, Andreas

--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

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