Add memmem

memmem is a non-standard extension, first added in GNU libc and later
ported to other systems. Support for it is non-uniform, thus it was only
added to platforms that seem to support it.
This commit is contained in:
Vickenty Fesunov 2020-01-06 20:26:55 +01:00
parent 8a7b02cc9e
commit 1c012aec18
6 changed files with 36 additions and 0 deletions

View File

@ -1086,6 +1086,12 @@ extern "C" {
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
}
cfg_if! {

View File

@ -1435,6 +1435,12 @@ extern "C" {
flags: ::c_int,
timeout: *const ::timespec,
) -> ::ssize_t;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
}
#[link(name = "util")]

View File

@ -1894,6 +1894,12 @@ extern "C" {
) -> ::c_int;
pub fn _lwp_self() -> lwpid_t;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
}
#[link(name = "util")]

View File

@ -1478,6 +1478,12 @@ extern "C" {
addr: caddr_t,
data: ::c_int,
) -> ::c_int;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
}
cfg_if! {

View File

@ -959,6 +959,12 @@ extern "C" {
buflen: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
}
#[link(name = "util")]

View File

@ -416,6 +416,12 @@ extern "C" {
cpuset: *const ::cpu_set_t,
) -> ::c_int;
pub fn sched_getcpu() -> ::c_int;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
}
cfg_if! {