Skip to content

Commit

Permalink
make getpw/grent_r have the same def with the GNU one
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC committed Oct 3, 2022
1 parent 7e55ae2 commit af54865
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
12 changes: 2 additions & 10 deletions src/unix/solarish/compat.rs
@@ -1,6 +1,7 @@
// Common functions that are unfortunately missing on illumos and
// Solaris, but often needed by other crates.

use core::convert::TryInto;
use unix::solarish::*;

const PTEM: &[u8] = b"ptem\0";
Expand Down Expand Up @@ -169,11 +170,7 @@ pub unsafe fn forkpty(

0
}
/// Standard conforming wrapper around `native_getpwent_r()`
///
/// TODO: remove this entry and rename `native_getpwent_r` to `getpwent_r` in
/// `mod.rs` when the standard conforming definitoin is added to the upstream
/// kernel

pub unsafe fn getpwent_r(
pwd: *mut passwd,
buf: *mut ::c_char,
Expand All @@ -189,11 +186,6 @@ pub unsafe fn getpwent_r(
}
}

/// Standord conforming wrapper around `native_getgrent_r()`
///
/// TODO: remove this entry and rename `native_getgrent_r` to `getgrent_r` in
/// `mod.rs` when the standard conforming definition is added to the upstream
/// kernel
pub unsafe fn getgrent_r(
grp: *mut ::group,
buf: *mut ::c_char,
Expand Down
8 changes: 2 additions & 6 deletions src/unix/solarish/mod.rs
Expand Up @@ -3018,16 +3018,12 @@ extern "C" {
any(target_os = "solaris", target_os = "illumos"),
link_name = "getpwent_r"
)]
pub fn native_getpwent_r(pwd: *mut passwd, buf: *mut ::c_char, buflen: ::c_int) -> *mut passwd;
fn native_getpwent_r(pwd: *mut passwd, buf: *mut ::c_char, buflen: ::c_int) -> *mut passwd;
#[cfg_attr(
any(target_os = "solaris", target_os = "illumos"),
link_name = "getgrent_r"
)]
pub fn native_getgrent_r(
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::c_int,
) -> *mut ::group;
fn native_getgrent_r(grp: *mut ::group, buf: *mut ::c_char, buflen: ::c_int) -> *mut ::group;
#[cfg_attr(
any(target_os = "solaris", target_os = "illumos"),
link_name = "__posix_sigwait"
Expand Down

0 comments on commit af54865

Please sign in to comment.