I've looked at the code for mkstemp() and it looks thread-safe, but the man 
pages (at least for Solaris 8 and Solaris 10) don't mention if it is or isn't 
thread-safe.  (The man pages should be updated.)

The way the code is written if more than 1 thread calls mkstemp() at the same 
time, and the pid is used when generating the replacement chars for the 
template "X" characters, then initially two threads could end up with the same 
filename.  During the open() one of them should succeed and 1 should fail and 
generate a new filename.  So it appears that it should be safe to use.

Correct?

Thanks for your input....

david.
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to