linux mkdir function can't authorize full permission

烈酒焚心 提交于 2019-11-29 04:56:46

From man 2 mkdir:

The argument mode specifies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created directory are (mode & ~umask & 0777).

I suggest you look at your umask - it is probably set to 0022. Try a chmod post-mkdir.

Permissions set by system calls like mkdir and open are always masked against the current process's umask. You can change the current umask using the umask() function; make sure to set it back when you're done.

Check the umask function: man 2 umask

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!