Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add POSIX memccpy and mempcpy GNU extension. #4186

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,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 @@ -1439,6 +1439,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
Loading