Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3732,6 +3732,7 @@ impl User {
/// let res = User::from_uid(Uid::from_raw(0)).unwrap().unwrap();
/// assert_eq!(res.name, "root");
/// ```
#[doc(alias("getpwuid", "getpwuid_r"))]
pub fn from_uid(uid: Uid) -> Result<Option<Self>> {
// SAFETY: `getpwuid_r` will write to `res` if it initializes the value
// at `pwd`.
Expand All @@ -3755,6 +3756,7 @@ impl User {
/// let res = User::from_name("root").unwrap().unwrap();
/// assert_eq!(res.name, "root");
/// ```
#[doc(alias("getpwnam", "getpwnam_r"))]
pub fn from_name(name: &str) -> Result<Option<Self>> {
let name = match CString::new(name) {
Ok(c_str) => c_str,
Expand Down
Loading