Subject: lib/23158: mkstemp manpage suggests non-portable usage
To: None <email@example.com>
From: Johan Danielsson <firstname.lastname@example.org>
Date: 10/14/2003 14:52:23
>Synopsis: mkstemp manpage suggests non-portable usage
>Arrival-Date: Tue Oct 14 12:53:00 UTC 2003
>Originator: Johan Danielsson
>Release: NetBSD 1.6T
System: NetBSD blubb.pdc.kth.se 1.6T NetBSD 1.6T (BLUBB) #531: Thu May 29 13:09:25 CEST 2003 email@example.com:/usr/misc/src/netbsd/netbsd-cvs/src/sys/arch/i386/compile/BLUBB i386
The template may be any file name with some number of `Xs'
appended to it, for example /tmp/temp.XXXX. The trailing `Xs'
are replaced with the current process number and/or a unique
letter combination. The number of unique file names mktemp() can
return depends on the number of `Xs' provided; six `Xs' will
result in mktemp() testing roughly 26 ** 6 combinations. At
least 6 `X's should be used, though 10 is much better.
This is true for our (and many other) implementation, but SUSv2
mandates that there be exactly 6 trailing X, and I've certainly seen
implementations that did not work properly with less that 6 X.