Skip to content

Commit 1e2da75

Browse files
devnexentgross35
authored andcommitted
adding POSIX memccpy and mempcpy GNU extension.
[memccpy](https://pubs.opengroup.org/onlinepubs/9699919799/functions/memccpy.html) [mempcpy](https://man7.org/linux/man-pages/man3/mempcpy.3.html) (backport <#4186>) (cherry picked from commit ba5930d)
1 parent 7457aa1 commit 1e2da75

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

libc-test/semver/linux-gnu.txt

+1
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ malloc_stats
650650
malloc_trim
651651
malloc_usable_size
652652
mallopt
653+
mempcpy
653654
mq_notify
654655
nl_mmap_hdr
655656
nl_mmap_req

libc-test/semver/unix.txt

+1
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

+2
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,8 @@ extern "C" {
15391539
timeout: *const crate::timespec,
15401540
sigmask: *const crate::sigset_t,
15411541
) -> c_int;
1542+
1543+
pub fn mempcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
15421544
}
15431545

15441546
cfg_if! {

src/unix/mod.rs

+1
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)