Fix issues raised by @gnzlbg

This commit is contained in:
Fredrick Brennan 2018-03-04 10:09:43 +00:00
parent f59c095c5c
commit 6228556cfa
5 changed files with 34 additions and 28 deletions

View file

@ -1,5 +1,4 @@
use dox::{mem, Option};
use unix::group;
pub type wchar_t = i32;
pub type off_t = i64;
@ -391,7 +390,7 @@ extern {
pub fn endpwent();
pub fn setgrent();
pub fn endgrent();
pub fn getgrent() -> *mut group;
pub fn getgrent() -> *mut ::group;
pub fn getprogname() -> *const ::c_char;
pub fn setprogname(name: *const ::c_char);
@ -518,18 +517,6 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
pub fn getpwent_r(pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
pub fn getgrent_r(grp: *mut group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut group) -> ::c_int;
#[cfg_attr(all(target_os = "macos", target_arch ="x86"),
link_name = "sigwait$UNIX2003")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]

View file

@ -637,6 +637,16 @@ extern {
groups: *mut ::gid_t,
ngroups: *mut ::c_int) -> ::c_int;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
pub fn getpwent_r(pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
pub fn getgrent_r(grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
envp: *const *const ::c_char)
-> ::c_int;

View file

@ -1,7 +1,6 @@
//! Linux-specific definitions for linux-like values
use dox::{mem, Option};
use unix::group;
pub type useconds_t = u32;
pub type dev_t = u64;
@ -1471,7 +1470,7 @@ extern {
pub fn getpwent() -> *mut passwd;
pub fn setgrent();
pub fn endgrent();
pub fn getgrent() -> *mut group;
pub fn getgrent() -> *mut ::group;
pub fn setspent();
pub fn endspent();
pub fn getspent() -> *mut spwd;
@ -1831,18 +1830,6 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
pub fn getpwent_r(pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
pub fn getgrent_r(grp: *mut group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut group) -> ::c_int;
#[cfg_attr(all(target_os = "macos", target_arch ="x86"),
link_name = "sigwait$UNIX2003")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]

View file

@ -867,6 +867,18 @@ extern {
pub fn mallinfo() -> ::mallinfo;
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
pub fn getpwent_r(pwd: *mut ::unix::notbsd::linux::passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::unix::notbsd::linux::passwd) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
pub fn getgrent_r(grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
}
cfg_if! {

View file

@ -1430,6 +1430,16 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
pub fn getpwent_r(pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
pub fn getgrent_r(grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
pub fn sigwait(set: *const sigset_t,
sig: *mut ::c_int) -> ::c_int;