php function page
Note: Avoid using this function in multithreaded webservers. It is better to change the file permissions with chmod() after creating the file. Using umask() can lead to unexpected behavior of concurrently running scripts and the webserver itself because they all use the same umask.
My questions are
1) due to the above statement, to make your codes portable for "multithreaded webservers", are you not going to use umask() at all?
2) Will it be possible to totally drop umask, by create and chmod, for example, in the mkdir cases, Could mkdir() and chmod() totally replace umask and mkdir()?
3) will there be any cases that create and chmod cannot replace umask? for example, if you want to get the value of umask, without calling umask(), what else you can do? create a dummy file and check its permission, then calculate the umask (it seems there should be better way to get the umask value without calling php umask() function?