Unix file size - HP-UX

Hi All,

Currently we are using HP-UX machine.. We are facing problems with respect to file size. The file size does not seem to be exceeding 2 GB.

Could you please let me know the following

  1. Is there any difference between a 32 bit application and 64 bit application with respect to file size. If so what is the maximum file size allowed for a 32 bit application and what is the maximum size allowed for a 64 bit application?

  2. What other factors affect the file size limit on a HP-UX machine?

  3. Can the file size limit be changed to suit the needs? If so how?

  4. Currently we are using a 32 bit application compiled using a 32 bit compiler. Can the compile environment be changed from 32-bit to a 64-bit compile environment to compile a 32 bit application. If so what are the parameters that needs to be changed for this?

Thanks in advance,
Krishna

Are you mounting the filesystem with the largefiles option?

Actually, a command like "fsadm /dev/vg00/rlvol1" should be used to see if largefile support is enabled. Note that the mount option will only "attempt" to allow large files.

setrlimit() and ulimit() can be used to limit the size of file that a program can create.

HP-UX supports two ways for a 32 bit program to use large files. If you define _FILE_OFFSET_BITS to be 64 at compile time, the regular system calls now handle large files. If you define _LARGEFILE64_SOURCE a bunch of routines like open64() become available. I have never used either. I just compile in 64 bit mode which is done by using +DD64 on the cc comand line. But there is a "long long" datatype which is a 64 bit integer in either 32 bit or 64 bit mode.

Also see this.