On Jul 17, 2008, at 11:02, Tom Yu via RT wrote: > mkstemp() does not take file mode flags, so to get the correct file > permissions on the file, we need to either use umask() (not > thread-friendly) or fchmod(). With fchmod, we would have a race condition where some other party could open the file after it was created but before the fchmod call. In the normal UNIX model, fchmod does not revoke access to an already opened file.