Skip to content
Draft
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
5 changes: 5 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4410,6 +4410,11 @@ regmatch_t
regoff_t
remap_file_pages
removexattr
res_mkquery
res_query
res_querydomain
res_search
res_send
rlim64_t
rlimit64
rtentry
Expand Down
46 changes: 46 additions & 0 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,11 @@ pub const PIPE_BUF: usize = 4096;

pub const SI_LOAD_SHIFT: c_uint = 16;

// arpa/nameser.h
pub const T_A: c_int = 1;
pub const T_CNAME: c_int = 5;
pub const C_IN: c_int = 1;

// si_code values
pub const SI_USER: c_int = 0;
pub const SI_KERNEL: c_int = 0x80;
Expand Down Expand Up @@ -2101,6 +2106,47 @@ extern "C" {
buflen: size_t,
result: *mut *mut passwd,
) -> c_int;

// <resolv.h>
pub fn res_query(
dname: *const c_char,
class: c_int,
kind: c_int,
answer: *mut c_uchar,
anslen: c_int,
) -> c_int;
pub fn res_search(
dname: *const c_char,
class: c_int,
kind: c_int,
answer: *mut c_uchar,
anslen: c_int,
) -> c_int;
pub fn res_querydomain(
name: *const c_char,
domain: *const c_char,
class: c_int,
kind: c_int,
answer: *mut c_uchar,
anslen: c_int,
) -> c_int;
pub fn res_mkquery(
op: c_int,
dname: *const c_char,
class: c_int,
kind: c_int,
data: *const c_uchar,
datalen: c_int,
newrr: *const c_uchar,
buf: *mut c_uchar,
buflen: c_int,
) -> c_int;
Comment on lines +2133 to +2143

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to match the definitions linked at #4611: those have data as const and followed by an integer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also few arguments misplacements see above my comment and on linux it should be linked to libresolv.

pub fn res_send(
msg: *const c_uchar,
msglen: c_int,
answer: *mut c_uchar,
anslen: c_int,
) -> c_int;
}

// LFS64 extensions
Expand Down
Loading