1//! Umask support.
2
3#[cfg(feature = "fs")]
4use crate::backend;
5#[cfg(feature = "fs")]
6use crate::fs::Mode;
7
8/// `umask(mask)`—Set the process file creation mask.
9///
10/// # References
11/// - [POSIX]
12/// - [Linux]
13///
14/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/umask.html
15/// [Linux]: https://man7.org/linux/man-pages/man2/umask.2.html
16#[cfg(feature = "fs")]
17#[cfg_attr(doc_cfg, doc(cfg(feature = "fs")))]
18#[inline]
19pub fn umask(mask: Mode) -> Mode {
20 backend::process::syscalls::umask(mode:mask)
21}
22