bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoconf 2.52 vs Solaris 2.6 AC_SYS_LARGEFILE problems


From: Paul Eggert
Subject: Re: autoconf 2.52 vs Solaris 2.6 AC_SYS_LARGEFILE problems
Date: Fri, 30 Nov 2001 15:29:01 -0800 (PST)

> From: "Mark D. Baushke" <address@hidden>
> Date: Fri, 30 Nov 2001 11:25:42 -0800

> >  $ ulimit -f 4294967296
> >  $ ./a.out 
> >  file size limit is 4398046511104

Sorry, I should have made it clear that I was running 'bash'.  Bash
interprets the 'ulimit' argument as a multiple of 1024 bytes, whereas
/bin/sh multiplies by only 512 bytes.  If you use /bin/sh then your
result will be half the above.


> % /usr/local/packages/gcc/gcc-2.95.3/bin/gcc -g eggert.c 
> % ./a.out
> file size limit is -3

That suggests that large-file support is working correctly for you
now.  -3 is RLIM_INFINITY (after conversion to long long), and this is
the default setting.

Here's the same scenario with /bin/sh.  Notice that /bin/sh uses
512-byte blocks, so I doubled the operand of "ulimit -f":

   $ uname -a
   SunOS dew.twinsun.com 5.6 Generic_105181-29 sun4u sparc SUNW,Ultra-1
   $ gcc -v
   Reading specs from /opt/reb/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
   gcc version 2.95.2 19991024 (release)
   $ cat t.c
   #define _FILE_OFFSET_BITS 64
   #include <sys/resource.h>
   #include <stdio.h>
   int main()
   {
     struct rlimit r;
     if (getrlimit (RLIMIT_FSIZE, &r) != 0)
       perror ("getrlimit");
     printf ("file size limit is %lld\n", r.rlim_cur);
     return 0;
   }
   $ gcc t.c
   $ ulimit -f 8589934592
   $ ./a.out
   file size limit is 4398046511104
   $ ulimit -a
   time(seconds) unlimited
   file(blocks) 8589934592
   data(kbytes) 2097148
   stack(kbytes) 8192
   coredump(blocks) unlimited
   nofiles(descriptors) 64
   memory(kbytes) unlimited


> % /usr/bin/ulimit -f 4294967296

You don't want to invoke /usr/bin/ulimit; it has no effect if it
succeeds.  It is present only for POSIX compatiblity, which
prescribes this bizarre behavior!  For example:

   $ cd /tmp
   $ /usr/bin/cd /
   $ pwd
   /tmp

/usr/bin/ulimit is just like /usr/bin/cd; it has no effect when it
succeeds.

Instead, please start /bin/sh or /bin/ksh and try the above scenario.
(Sorry, I don't know how to do it with csh.)


> (gdb) p r
> $1 = {rlim_cur = 0xfffffffffffffffd, rlim_max = 0xfffffffffffffffd}

This also suggests that large-file mode is working for you in that
test program.  rlim_cur and rlim_max are 64-bit quantities (as they
should be).


> it remains unclear to me that big file support is really working on
> Solaris 2.6 when autoconf adds the '#define _FILE_OFFSET_BITS 64'

It's seems to me me that it's working for you, now that you have
upgraded to GCC 2.95.3.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]