summaryrefslogtreecommitdiff
path: root/src/unistd.rs
diff options
context:
space:
mode:
authorRyan Zoeller <rtzoeller@rtzoeller.com>2022-04-07 23:17:37 -0500
committerRyan Zoeller <rtzoeller@rtzoeller.com>2022-06-26 19:36:45 -0500
commit1fa1bb19b0ba905a7d89ad3d0496d0970245a3f1 (patch)
treec8422479d09eb2fc2ac77be025b248b6210e8e5a /src/unistd.rs
parent84b02b98a9e9d5f368241fefaebee2319dc058a9 (diff)
downloadnix-1fa1bb19b0ba905a7d89ad3d0496d0970245a3f1.zip
Document aliases for functions like getuid()
Add the autocfg crate as a build dependency, and introduce has_doc_alias as a conditional compilation symbol.
Diffstat (limited to 'src/unistd.rs')
-rw-r--r--src/unistd.rs6
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()
}