Skip to content

Commit

Permalink
adding POSIX memccpy and mempcpy GNU extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored and tgross35 committed Dec 9, 2024
1 parent 7457aa1 commit 1e2da75
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ malloc_stats
malloc_trim
malloc_usable_size
mallopt
mempcpy
mq_notify
nl_mmap_hdr
nl_mmap_req
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ localtime_r
lseek
lstat
malloc
memccpy
memchr
memcmp
memcpy
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,8 @@ extern "C" {
timeout: *const crate::timespec,
sigmask: *const crate::sigset_t,
) -> c_int;

pub fn mempcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
}

cfg_if! {
Expand Down
1 change: 1 addition & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ extern "C" {
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn memccpy(dest: *mut c_void, src: *const c_void, c: c_int, n: size_t) -> *mut c_void;
}

extern "C" {
Expand Down

0 comments on commit 1e2da75

Please sign in to comment.