为什么会静脉曲张| 避孕药有什么副作用| 婴儿为什么老吐奶| 七月十二是什么星座| 拉青色大便是什么原因| ipv是什么疫苗| 1963年属兔的是什么命| 蕊五行属什么| 电解质水有什么好处| 阿尔茨海默症是什么病| 肺部纤维化是什么意思| 紫菜和海带有什么区别| 老是想咳嗽是什么原因| 投资什么好| 择日什么意思| 细胞是什么| 红色玫瑰花代表什么意思| 宫颈糜烂吃什么药| 便宜的反义词是什么| 胃肠功能紊乱是什么意思| 爬行对身体有什么好处| 痱子粉什么牌子好| 晚上九点半是什么时辰| 各的偏旁是什么| 印度为什么叫三哥| 负罪感什么意思| 三星堆遗址在什么地方| 人力资源是什么意思| 粒细胞偏高是什么意思| damon英文名什么寓意| 走仕途是什么意思| 茶话会是什么意思| 木瓜是什么季节的| 断档是什么意思| 浅尝辄止什么意思| 糖尿病人可以吃什么水果| 缺钾吃什么水果| 狮子座与什么星座最配| 很low是什么意思| 根管预备是什么意思| 检查hpv挂什么科| 心外科是看什么病的| 三月有什么节日| 铁皮石斛有什么功效| 三月生日是什么星座| 扫把星是什么生肖| 斗破苍穹什么时候出的| 液基细胞学检查是什么| 胆在什么位置图片| 通便吃什么最快排便| 10月出生的是什么星座| 一模一样的意思是什么| 荨麻疹用什么药膏| 经常闪腰是什么原因引起的| 铂金是什么材质| 前列腺液是什么样子| 香干是什么| 盲点是什么意思| 肚脐眼痒是什么原因| 獭尾肝是什么意思| 病毒感染有什么症状| 人山人海是什么生肖| 买什么化妆品好| 三花聚顶是什么修为| 什么是奇数什么是偶数| 昆明飞机场叫什么名字| 干眼症是什么原因引起的| 岳云鹏什么学历| 直肠炎吃什么药好的快| 什么叫飞机杯| 化脓性扁桃体炎吃什么药| 南瓜与什么食物相克| 肝不好吃什么水果| 为什么睡觉会打呼噜| 林彪为什么叛变| 胰尾显示不清什么意思| 黑枸杞的功效是什么| 体癣用什么药| 7.2号是什么星座| 什么经验| 降血糖的草都有什么草| 藜芦是什么| 为什么进不去| 胆固醇偏高吃什么食物可以降胆固醇| 胎心快是什么原因| superstar是什么意思| 交通运输是干什么的| 蚕长什么样| 阴道口长什么样| warning什么意思| 劳伦拉夫属于什么档次| 女人梦见下雪是什么征兆| 什么是甲状腺结节| 丑是什么库| 老凤祥银楼和老凤祥有什么区别| 六亲不认什么意思| 学生早餐吃什么方便又营养| 头晕脑胀是什么原因| 怀疑心衰做什么检查| 荨麻疹是什么原因| 什么是员额制| kiki是什么意思| 1988年什么命| 连襟什么意思| 减肥适合吃什么水果| 爱吐口水是什么原因| 暗网里面有什么| 人中浅的女人代表什么| 脱发去医院挂什么科| 经常手麻是什么原因| 腺体鳞化是什么意思| 吃深海鱼油有什么好处和坏处| 感冒引起的喉咙痛吃什么药| 纹眉失败擦什么淡化| 6.1号是什么星座| 炙是什么意思| 兰花是什么季节开的| 拖鞋什么材质的好| 六六无穷是什么意思| 肾病综合症是什么病| 什么是湿热体质| 酸是什么意思| 什么的小草| 阿莫西林什么时候吃| 一九八七年属什么生肖| 啤酒不能和什么一起吃| 11月26是什么星座| 卡其色是什么颜色| 孕妇头疼可以吃什么药| 为什么一躺下就鼻塞| 榴莲什么时候吃最好| 钟馗是什么意思| 牙疼吃什么止疼药见效快| 小拇指和无名指发麻是什么原因| 初潮是什么意思| 阴囊湿疹用什么药| 十八层地狱分别叫什么| 鸽子喜欢吃什么| 喝红酒有什么好处| 眼带用什么方法消除| 甚嚣尘上什么意思| 痛风可以吃什么肉类和蔬菜| 什么叫幽门螺旋杆菌| 诞生是什么意思| 早上喝一杯温开水有什么好处| 上海玉佛寺求什么最灵验| hib疫苗是什么意思| 懒趴是什么意思| 美国人喜欢什么颜色| cmv病毒是什么病毒| 性早熟有什么症状| 经常自言自语是什么原因| 血压正常头晕是什么原因| SS是什么| 一什么枣子| 弢是什么意思| 梦见偷菜是什么意思| smt是什么意思| 生目念什么| 吃什么尿酸高| 角质是什么| 梦见鳄鱼是什么预兆| 怀孕补铁吃什么| 低筋面粉适合做什么| 霉菌性阴道炎是什么症状| 甜叶菊有什么功效| 五蕴皆空是什么意思| 学生证件号码是什么| 痛风频繁发作说明什么| 儒家是什么意思| 宁静是什么民族| 长命百岁的动物是什么| 缺钾是什么症状| 1ph是什么意思| 什么是痔疮| 什么是菱形| 眼角发白是什么原因| 什么食物含维生素d| 人间仙境是什么意思| 殆什么意思| 慢阻肺吃什么药最有效最好| pe医学上是什么意思| 牙膏洗脸有什么好处| 6月什么星座| johnny什么意思| 京东白条什么时候还款| 杀手锏是什么意思| 鸭肉不能和什么一起吃| 广州有什么特产必带| 什么头什么向| 乳头为什么会内陷| 95年属什么生肖婚配表| 带id是什么意思| 甲钴胺有什么副作用| 什么叫辅酶q10| 睡觉打呼噜什么原因| 10月11是什么星座| 蛋白粉什么时间喝最好| 东华帝君是什么神仙| 阿咖酚散是什么药| 社区医院属于什么级别| 什么的尾巴有什么作用| 心衰的症状是什么| hoka是什么牌子| 脱臼是指什么从什么中滑脱| 天庭的动物是什么生肖| 孕妇贫血吃什么补血最快| 福五行属什么| 睡觉盗汗是什么原因| timing什么意思| 土豆炒什么好吃| 打篮球对身体有什么好处| 高处不胜寒什么意思| 日可以加什么偏旁| la什么牌子| 槐子泡水喝有什么功效| 天天喝啤酒对身体有什么危害| 什么花是蓝色的| 可乐鸡翅需要什么材料| 冬菜是什么菜| nak是什么牌子| 燃脂是什么意思| 抑郁症有什么症状| 天津卫的卫是什么意思| 喝芝麻糊有什么好处| esr是什么| 黄瓜敷脸有什么功效与作用| 肠粘连吃什么药| 女生有喉结是什么原因| 甲醛什么味道| porridge什么意思| 高颜值是什么意思| 儿童荨麻疹吃什么药| 看胰腺挂什么科| 吃维c有什么好处| 珍母口服液有什么作用| hc是什么| ckd是什么病| 异的偏旁是什么| 断章取义什么意思| 胰腺饱满是什么意思| 枸杞什么季节成熟| 秘书是干什么的| 心急吃不了热豆腐什么意思| 西红柿有什么营养| 印度属于什么亚| 杏子不能和什么一起吃| 黑话是什么意思| 今年的属相是什么生肖| 尿蛋白高是什么原因引起的| 21金维他有什么作用| 女人左下巴有痣代表什么| 茶水洗脸有什么好处和坏处| 未融资是什么意思| 常喝柠檬水有什么好处和坏处| 什么是生物工程| 梦见朋友死了是什么意思| 幽门螺杆菌是什么病| 名号是什么意思| 眼疖子用什么药| 太平猴魁属于什么茶| 屁多还臭是什么原因| 为什么要长智齿| 芒种是什么意思| 百度

Scroll to navigation

umask(2) System Calls Manual umask(2)

《围观》第77期:一个90后未婚爸爸的困境

百度 钱胡美琦觉得奇怪,便询问原因,钱穆说都是因为有静坐之功。

umask - set file mode creation mask

LIBRARY?

Standard C library (libc, -lc)

SYNOPSIS?

#include <sys/stat.h>
mode_t umask(mode_t mask);

DESCRIPTION?

umask() sets the calling process's file mode creation mask (umask) to mask & 0777 (i.e., only the file permission bits of mask are used), and returns the previous value of the mask.

The umask is used by open(2), mkdir(2), and other system calls that create files to modify the permissions placed on newly created files or directories. Specifically, permissions in the umask are turned off from the mode argument to open(2) and mkdir(2).

Alternatively, if the parent directory has a default ACL (see acl(5)), the umask is ignored, the default ACL is inherited, the permission bits are set based on the inherited ACL, and permission bits absent in the mode argument are turned off. For example, the following default ACL is equivalent to a umask of 022:


u::rwx,g::r-x,o::r-x

Combining the effect of this default ACL with a mode argument of 0666 (rw-rw-rw-), the resulting file permissions would be 0644 (rw-r--r--).

The constants that should be used to specify mask are described in inode(7).

The typical default value for the process umask is S_IWGRP | S_IWOTH (octal 022). In the usual case where the mode argument to open(2) is specified as:


S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH

(octal 0666) when creating a new file, the permissions on the resulting file will be:


S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH

(because 0666 & ~022 = 0644; i.e. rw-r--r--).

RETURN VALUE?

This system call always succeeds and the previous value of the mask is returned.

STANDARDS?

POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.

NOTES?

A child process created via fork(2) inherits its parent's umask. The umask is left unchanged by execve(2).

It is impossible to use umask() to fetch a process's umask without at the same time changing it. A second call to umask() would then be needed to restore the umask. The nonatomicity of these two steps provides the potential for races in multithreaded programs.

Since Linux 4.7, the umask of any process can be viewed via the Umask field of /proc/pid/status. Inspecting this field in /proc/self/status allows a process to retrieve its umask without at the same time changing it.

The umask setting also affects the permissions assigned to POSIX IPC objects (mq_open(3), sem_open(3), shm_open(3)), FIFOs (mkfifo(3)), and UNIX domain sockets (unix(7)) created by the process. The umask does not affect the permissions assigned to System?V IPC objects created by the process (using msgget(2), semget(2), shmget(2)).

SEE ALSO?

chmod(2), mkdir(2), open(2), stat(2), acl(5)

2025-08-06 Linux man-pages 6.03
百度