Henri Gomez wrote:
While rebuild trunk from mod_jk I got an error on iSeries about
missing mktemp in iSeries.
if (!jk_shmem.lockname) {
if (shm_lock_reopen) {
int i;
jk_shmem.fd_lock = -1;
mode_t mask = umask(0);
for (i = 0; i < 8; i++) {
strcpy(flkname, "/tmp/jkshmlock.XXXXXX");
if (mktemp(flkname)) {
jk_shmem.fd_lock = open(flkname,
O_RDWR|O_CREAT|O_TRUNC, 0666);
if (jk_shmem.fd_lock >= 0)
break;
}
}
umask(mask);
}
How could we avoid this call ?
Wrong question. mktemp has been in UNIX for a dog's age and in POSIX/SUS
for a decade or more. See
http://www.opengroup.org/onlinepubs/007908799/xsh/mktemp.html which is
the 1997 version of the SUS.
The general approach to making C programs portable to broken systems
that are missing libraries is to provide a default version, usually
wrapped in an #ifdef.
IANA(ASF)L but we should be able to incorporate the mktemp
implementation from anything BSD licensed, like OpenBSD, for this purpose.
Ian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]