how to use lseek() system call with over 2G files?

Erik Trulsson ertr1013 at student.uu.se
Tue Jan 6 09:50:13 PST 2004


On Tue, Jan 06, 2004 at 08:32:23PM +0300, Alex wrote:
> Hi everybody!
> 
> Some time ago there wasn't any possibility to create disk file larger 
> than 2G and there was no problem with lseek().
> But as for now we can do it but I looked into headers and found off_t is 
> equal to long -> no more than 2G on i386 machines.
> As far as lseek() is a system call I cannot believe it cannot be used 
> with larger files but how?
> 
> Maybe it's a silly question? :0)

Not a silly question, but one based on false assumptions.

FreeBSD has been able to create files larger than 2G for a long time.
off_t is a 64-bit type, and therefore is quite capable of representing
sizes larger than 2G.  lseek() has no problem handling files larger than
2G.


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se


More information about the freebsd-questions mailing list