Pb w/ >2GB files on AIX (4.3.3/5.1)

Dean dean at dacunha.net
Tue Feb 18 03:07:12 EST 2003

On Tue, Feb 11, 2003 at 10:41:46 -0800, jw schultz wrote:
>mkstemp should have no need of a 64bit version.  Why is this
>an issue?

mkstemp() generates a temporary file name and open the corresponding
file with a 32bits system call (no 64bits version for this function in
AIX libc).
So I/O operations on the returned 32bits file descriptor will fail after
the 2GB limit.

By skipping mkstemp() function use, mktemp() + 64bits open() syscall (if
_LARGE_FILES defined) will be used, that will allow >2GB files.

Linux libc have a 64bits version of mkstemp() :
Linux(2.4.19)# nm /lib/libc.so.6 |grep mkstemp
000c65a0 T mkstemp
000c65e0 T mkstemp64

Solaris too:
SunOS(2.8)# nm /lib/libc.so |grep mkstemp|grep FUNC
[3538]  |    274264|     224|FUNC |GLOB |0    |9      |_mkstemp
[3294]  |    213800|     224|FUNC |GLOB |0    |9      |_mkstemp64
[4662]  |    274264|     224|FUNC |WEAK |0    |9      |mkstemp
[3668]  |    213800|     224|FUNC |WEAK |0    |9      |mkstemp64

and AIX gives :
AIX(5.1 ML3)# nm /lib/libc.a|grep mkstemp
mkstemp              D      254912      12
.mkstemp             T     1110564
../../../../../../../src/bos/usr/ccs/lib/libc/mkstemp.c f           -

Poor AIX users/programmers !

More information about the rsync mailing list