Skip to content

Commit 6504081

Browse files
authored
Merge pull request #4186 from devnexen/memccpy_mempcpy
Add POSIX memccpy and mempcpy GNU extension.
2 parents 962dcb3 + ba5930d commit 6504081

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

libc-test/semver/linux-gnu.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ malloc_stats
626626
malloc_trim
627627
malloc_usable_size
628628
mallopt
629+
mempcpy
629630
mq_notify
630631
nl_mmap_hdr
631632
nl_mmap_req

libc-test/semver/unix.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ localtime_r
638638
lseek
639639
lstat
640640
malloc
641+
memccpy
641642
memchr
642643
memcmp
643644
memcpy

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,8 @@ extern "C" {
14311431
timeout: *const crate::timespec,
14321432
sigmask: *const crate::sigset_t,
14331433
) -> c_int;
1434+
1435+
pub fn mempcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
14341436
}
14351437

14361438
cfg_if! {

src/unix/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ extern "C" {
681681
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
682682
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
683683
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
684+
pub fn memccpy(dest: *mut c_void, src: *const c_void, c: c_int, n: size_t) -> *mut c_void;
684685
}
685686

686687
extern "C" {

0 commit comments

Comments
 (0)