if (fclose (file)) { fprintf (stderr, "fatal: unable to close temp file: %s\n", strerror (errno)); exit (1); I don''t understand why the above piece of code is failing... fatal: unable to close file: File too large and of course my code fails at 2G... The output should be 7.7G. zfs list -o name,used,available,reservation,quota NAME USED AVAIL RESERV QUOTA tank/survey/zones 4.41G 405G none none I don''t understand since I have no problem with 3 gig ISOs on the same pool. # ulimit unlimited # uname -a SunOS sunrise 5.11 snv_75 i86pc i386 i86pc any help is appreciated, Thanks
On Dec 25, 2007 1:33 PM, K <kugutsumen at kugutsumen.com> wrote:> > if (fclose (file)) { > fprintf (stderr, "fatal: unable to close temp file: %s\n", > strerror (errno)); > exit (1); > > I don''t understand why the above piece of code is failing...What command line is used to compile the code? I would guess that you don''t have large file support. A variant of the following would probably be good: cc -c $CFLAGS `getconf LFS_CFLAGS` myprog.c cc -o myprog $LDFLAGS `getconf LFS_LDFLAGS` -- Mike Gerdts http://mgerdts.blogspot.com/
On 26/12/2007, at 2:43 AM, Mike Gerdts wrote:> On Dec 25, 2007 1:33 PM, K <kugutsumen at kugutsumen.com> wrote: >> >> if (fclose (file)) { >> fprintf (stderr, "fatal: unable to close temp file: %s\n", >> strerror (errno)); >> exit (1); >> >> I don''t understand why the above piece of code is failing... > > What command line is used to compile the code? I would guess that you > don''t have large file support. A variant of the following would > probably be good: > > cc -c $CFLAGS `getconf LFS_CFLAGS` myprog.c > cc -o myprog $LDFLAGS `getconf LFS_LDFLAGS` > > -- > Mike Gerdts > http://mgerdts.blogspot.com/getconf -a | grep ^LFS LFS64_CFLAGS: -D_LARGEFILE64_SOURCE LFS64_LDFLAGS: LFS64_LIBS: LFS64_LINTFLAGS: -D_LARGEFILE64_SOURCE LFS_CFLAGS: -D_LARGEFILE_SOURCE - D_FILE_OFFSET_BITS=64 LFS_LDFLAGS: LFS_LIBS: LFS_LINTFLAGS: -D_LARGEFILE_SOURCE - D_FILE_OFFSET_BITS=64 I guess that will do. Thanks for the tip.