linux: getting umask of an already running process?

后端 未结 5 844
广开言路
广开言路 2021-02-01 17:04

How can I check the umask of a program which is currently running?

[update: another process, not the current process.]

5条回答
  •  独厮守ぢ
    2021-02-01 17:41

    If you're the current process, you can write a file to /tmp and check its setting. A better solution is to call umask(3) passing zero - the function returns the setting prior to the call - and then reset it back by passing that value back into umask.

    The umask for another process doesn't seem to be exposed.

提交回复
热议问题