Skip to content

Commit 89a8e04

Browse files
authored
Merge pull request #1639 from vickenty/memmem
Add memmem
2 parents b3bbf1a + 1c012ae commit 89a8e04

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,12 @@ extern "C" {
10861086
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
10871087
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
10881088
pub fn uname(buf: *mut ::utsname) -> ::c_int;
1089+
pub fn memmem(
1090+
haystack: *const ::c_void,
1091+
haystacklen: ::size_t,
1092+
needle: *const ::c_void,
1093+
needlelen: ::size_t,
1094+
) -> *mut ::c_void;
10891095
}
10901096

10911097
cfg_if! {

src/unix/bsd/freebsdlike/freebsd/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,12 @@ extern "C" {
14351435
flags: ::c_int,
14361436
timeout: *const ::timespec,
14371437
) -> ::ssize_t;
1438+
pub fn memmem(
1439+
haystack: *const ::c_void,
1440+
haystacklen: ::size_t,
1441+
needle: *const ::c_void,
1442+
needlelen: ::size_t,
1443+
) -> *mut ::c_void;
14381444
}
14391445

14401446
#[link(name = "util")]

src/unix/bsd/netbsdlike/netbsd/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,12 @@ extern "C" {
18941894
) -> ::c_int;
18951895

18961896
pub fn _lwp_self() -> lwpid_t;
1897+
pub fn memmem(
1898+
haystack: *const ::c_void,
1899+
haystacklen: ::size_t,
1900+
needle: *const ::c_void,
1901+
needlelen: ::size_t,
1902+
) -> *mut ::c_void;
18971903
}
18981904

18991905
#[link(name = "util")]

src/unix/bsd/netbsdlike/openbsd/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,12 @@ extern "C" {
14781478
addr: caddr_t,
14791479
data: ::c_int,
14801480
) -> ::c_int;
1481+
pub fn memmem(
1482+
haystack: *const ::c_void,
1483+
haystacklen: ::size_t,
1484+
needle: *const ::c_void,
1485+
needlelen: ::size_t,
1486+
) -> *mut ::c_void;
14811487
}
14821488

14831489
cfg_if! {

src/unix/linux_like/linux/gnu/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,12 @@ extern "C" {
972972
buflen: ::size_t,
973973
flags: ::c_uint,
974974
) -> ::ssize_t;
975+
pub fn memmem(
976+
haystack: *const ::c_void,
977+
haystacklen: ::size_t,
978+
needle: *const ::c_void,
979+
needlelen: ::size_t,
980+
) -> *mut ::c_void;
975981
}
976982

977983
#[link(name = "util")]

src/unix/linux_like/linux/musl/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ extern "C" {
416416
cpuset: *const ::cpu_set_t,
417417
) -> ::c_int;
418418
pub fn sched_getcpu() -> ::c_int;
419+
pub fn memmem(
420+
haystack: *const ::c_void,
421+
haystacklen: ::size_t,
422+
needle: *const ::c_void,
423+
needlelen: ::size_t,
424+
) -> *mut ::c_void;
419425
}
420426

421427
cfg_if! {

0 commit comments

Comments
 (0)