Skip to content

Make VxWorks shims unsafe #3727

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

Merged
merged 1 commit into from
Jun 15, 2024
Merged
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
16 changes: 13 additions & 3 deletions src/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1867,19 +1867,29 @@ safe_f! {
}
}

pub fn pread(_fd: ::c_int, _buf: *mut ::c_void, _count: ::size_t, _offset: off64_t) -> ::ssize_t {
pub unsafe fn pread(
_fd: ::c_int,
_buf: *mut ::c_void,
_count: ::size_t,
_offset: off64_t,
) -> ::ssize_t {
-1
}

pub fn pwrite(
pub unsafe fn pwrite(
_fd: ::c_int,
_buf: *const ::c_void,
_count: ::size_t,
_offset: off64_t,
) -> ::ssize_t {
-1
}
pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int {

pub unsafe fn posix_memalign(
memptr: *mut *mut ::c_void,
align: ::size_t,
size: ::size_t,
) -> ::c_int {
// check to see if align is a power of 2 and if align is a multiple
// of sizeof(void *)
if (align & align - 1 != 0) || (align as usize % size_of::<::size_t>() != 0) {
Expand Down