Skip to content

Commit

Permalink
Revert "using for readv/writev the same interface like UNIX"
Browse files Browse the repository at this point in the history
This reverts commit 6f195a2.
  • Loading branch information
stlankes committed May 22, 2024
1 parent 90d048a commit caf31d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct iovec {
pub iov_len: usize,
}

const IOV_MAX: i32 = 1024;
const IOV_MAX: usize = 1024;

pub(crate) fn init() {
Lazy::force(&SYS);
Expand Down Expand Up @@ -450,7 +450,7 @@ pub unsafe extern "C" fn sys_read(fd: FileDescriptor, buf: *mut u8, len: usize)
/// before proceeding to the next.
#[hermit_macro::system]
#[no_mangle]
pub unsafe extern "C" fn sys_readv(fd: i32, iov: *const iovec, iovcnt: i32) -> isize {
pub unsafe extern "C" fn sys_readv(fd: i32, iov: *const iovec, iovcnt: usize) -> isize {
if !(0..=IOV_MAX).contains(&iovcnt) {
return (-crate::errno::EINVAL).try_into().unwrap();
}
Expand Down Expand Up @@ -511,7 +511,7 @@ pub unsafe extern "C" fn sys_write(fd: FileDescriptor, buf: *const u8, len: usiz
/// complete area before proceeding to the next.
#[hermit_macro::system]
#[no_mangle]
pub unsafe extern "C" fn sys_writev(fd: FileDescriptor, iov: *const iovec, iovcnt: i32) -> isize {
pub unsafe extern "C" fn sys_writev(fd: FileDescriptor, iov: *const iovec, iovcnt: usize) -> isize {
if !(0..=IOV_MAX).contains(&iovcnt) {
return (-crate::errno::EINVAL).try_into().unwrap();
}
Expand Down

0 comments on commit caf31d9

Please sign in to comment.