Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ getentropy
getgrent_r
getloadavg
getmntent_r
getnetbyaddr_r
getnetbyname_r
getnetent_r
getpt
getpwent_r
getpwnam_r
Expand Down
4 changes: 4 additions & 0 deletions libc-test/semver/unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ dlopen
dlsym
dup
dup2
endnetent
execl
execle
execlp
Expand Down Expand Up @@ -567,6 +568,7 @@ getgid
getgroups
gethostname
getlogin
getnetent
getopt
getpeername
getpgid
Expand Down Expand Up @@ -660,6 +662,7 @@ munlock
munlockall
munmap
nanosleep
netent
nfds_t
nlink_t
ntohl
Expand Down Expand Up @@ -775,6 +778,7 @@ seteuid
setgid
setlocale
setlogmask
setnetent
setpgid
setregid
setreuid
Expand Down
24 changes: 24 additions & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,30 @@ extern "C" {
buflen: size_t,
result: *mut *mut crate::group,
) -> c_int;
pub fn getnetent_r(
result_buf: *mut crate::netent,
buf: *mut c_char,
buflen: size_t,
result: *mut *mut crate::netent,
h_errnop: *mut c_int,
) -> c_int;
pub fn getnetbyname_r(
name: *const c_char,
result_buf: *mut crate::netent,
buf: *mut c_char,
buflen: size_t,
result: *mut *mut crate::netent,
h_errnop: *mut c_int,
) -> c_int;
pub fn getnetbyaddr_r(
net: u32,
type_: c_int,
result_buf: *mut crate::netent,
buf: *mut c_char,
buflen: size_t,
result: *mut *mut crate::netent,
h_errnop: *mut c_int,
) -> c_int;

pub fn putpwent(p: *const crate::passwd, stream: *mut crate::FILE) -> c_int;
pub fn putgrent(grp: *const crate::group, stream: *mut crate::FILE) -> c_int;
Expand Down
12 changes: 12 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ s! {
pub s_proto: *mut c_char,
}

pub struct netent {
n_name: *mut c_char,
n_aliases: *mut *mut c_char,
n_addrtype: c_int,
n_net: u32,
}

pub struct protoent {
pub p_name: *mut c_char,
pub p_aliases: *mut *mut c_char,
Expand Down Expand Up @@ -1521,6 +1528,11 @@ extern "C" {
pub fn getservbyport(port: c_int, proto: *const c_char) -> *mut servent;
pub fn getservent() -> *mut servent;
pub fn setservent(stayopen: c_int);
pub fn getnetent() -> *mut netent;
pub fn getnetbyname(name: *const c_char) -> *mut netent;
pub fn getnetbyaddr(net: u32, type_: c_int) -> *mut netent;
pub fn setnetent(stayopen: c_int);
pub fn endnetent();
pub fn getprotobyname(name: *const c_char) -> *mut protoent;
pub fn getprotobynumber(proto: c_int) -> *mut protoent;
pub fn chroot(name: *const c_char) -> c_int;
Expand Down
Loading