diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-06-27 00:52:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 00:52:16 +0000 |
commit | 0922fd99e7c8cbe7334754d712e8450c29d3d8e7 (patch) | |
tree | c8422479d09eb2fc2ac77be025b248b6210e8e5a /src/unistd.rs | |
parent | 84b02b98a9e9d5f368241fefaebee2319dc058a9 (diff) | |
parent | 1fa1bb19b0ba905a7d89ad3d0496d0970245a3f1 (diff) | |
download | nix-0922fd99e7c8cbe7334754d712e8450c29d3d8e7.zip |
Merge #1693
1693: Document aliases for functions like getuid() r=asomers a=rtzoeller
Add the autocfg crate as a build dependency, and introduce `has_doc_alias` as a conditional compilation symbol.
Closes #1673.
Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
Diffstat (limited to 'src/unistd.rs')
-rw-r--r-- | src/unistd.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/unistd.rs b/src/unistd.rs index fe8ec840..86eec627 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -67,11 +67,13 @@ impl Uid { } /// Returns Uid of calling process. This is practically a more Rusty alias for `getuid`. + #[cfg_attr(has_doc_alias, doc(alias("getuid")))] pub fn current() -> Self { getuid() } /// Returns effective Uid of calling process. This is practically a more Rusty alias for `geteuid`. + #[cfg_attr(has_doc_alias, doc(alias("geteuid")))] pub fn effective() -> Self { geteuid() } @@ -122,11 +124,13 @@ impl Gid { } /// Returns Gid of calling process. This is practically a more Rusty alias for `getgid`. + #[cfg_attr(has_doc_alias, doc(alias("getgid")))] pub fn current() -> Self { getgid() } /// Returns effective Gid of calling process. This is practically a more Rusty alias for `getegid`. + #[cfg_attr(has_doc_alias, doc(alias("getegid")))] pub fn effective() -> Self { getegid() } @@ -172,11 +176,13 @@ impl Pid { } /// Returns PID of calling process + #[cfg_attr(has_doc_alias, doc(alias("getpid")))] pub fn this() -> Self { getpid() } /// Returns PID of parent of calling process + #[cfg_attr(has_doc_alias, doc(alias("getppid")))] pub fn parent() -> Self { getppid() } |