Skip to content

Commit

Permalink
Merge pull request rust-lang#1639 from vickenty/memmem
Browse files Browse the repository at this point in the history
Add memmem
  • Loading branch information
JohnTitor committed Feb 20, 2020
2 parents b3bbf1a + 1c012ae commit 89a8e04
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Expand Up @@ -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! {
Expand Down
6 changes: 6 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -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")]
Expand Down
6 changes: 6 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -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")]
Expand Down
6 changes: 6 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -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! {
Expand Down
6 changes: 6 additions & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -972,6 +972,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")]
Expand Down
6 changes: 6 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Expand Up @@ -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! {
Expand Down

0 comments on commit 89a8e04

Please sign in to comment.