19.11.3. Discussion
The second argument to mkdir( ) is the permission
mode for the new directory, which must be an octal number. The
current umask is taken away from this permission value to create the
permissions for the new directory. So, if the current umask is
0002, calling
mkdir('/tmp/apples',0777) sets the permissions on
the resulting directory to 0775 (user and group
can read, write, and execute; others can only read and execute).