fs_shell: Use proper readv/writev functions on Haiku hosts.

Fixes #18269.
This commit is contained in:
Augustin Cavalier 2023-02-18 11:38:48 -05:00
parent 9a91a72662
commit dc509bfab4
2 changed files with 16 additions and 0 deletions

View File

@ -79,7 +79,11 @@ fssh_readv_pos(int fd, fssh_off_t pos, const struct fssh_iovec *vec, int count)
if (FSShell::restricted_file_restrict_io(fd, pos, length) < 0)
return -1;
#if defined(__HAIKU__)
return readv_pos(fd, pos, systemVecs, count);
#else
return _kern_readv(fd, pos, systemVecs, count);
#endif
}
@ -114,5 +118,9 @@ fssh_writev_pos(int fd, fssh_off_t pos, const struct fssh_iovec *vec, int count)
if (FSShell::restricted_file_restrict_io(fd, pos, length) < 0)
return -1;
#if defined(__HAIKU__)
return writev_pos(fd, pos, systemVecs, count);
#else
return _kern_writev(fd, pos, systemVecs, count);
#endif
}

View File

@ -390,7 +390,11 @@ fssh_read_pos(int fd, fssh_off_t pos, void *buffer, fssh_size_t count)
{
if (FSShell::restricted_file_restrict_io(fd, pos, count) < 0)
return -1;
#if defined(__HAIKU__)
return read_pos(fd, pos, buffer, count);
#else
return _kern_read(fd, pos, buffer, count);
#endif
}
@ -417,7 +421,11 @@ fssh_write_pos(int fd, fssh_off_t pos, const void *buffer, fssh_size_t count)
{
if (FSShell::restricted_file_restrict_io(fd, pos, count) < 0)
return -1;
#if defined(__HAIKU__)
return write_pos(fd, pos, buffer, count);
#else
return _kern_write(fd, pos, buffer, count);
#endif
}