On Wed, Mar 11, 2009 at 06:48:49PM +0300, Alexander Yurchenko wrote: > On Wed, Mar 11, 2009 at 05:37:14PM +0200, Alexey Suslikov wrote: > > The limitation is 2Gb on 32-bit platforms because of off_t (man lseek). > > huh? > > [gra...@nohead tmp]$ cat x.c > #include <sys/types.h> > #include <stdio.h> > > int main(void) > { > printf("size of off_t is %u bits\n", 8 * sizeof(off_t)); > } > [gra...@nohead tmp]$ cc x.c > [gra...@nohead tmp]$ ./a.out > > size of off_t is 64 bits > [gra...@nohead tmp]$ arch -s > i386
This code is not portable. sizeof returns a size_t, which is 64 bits on 64-bits platforms. Better use %zu. -Otto