[orbis-kernel] Fix sys_stat hack

This commit is contained in:
Ivan Chikish 2023-07-17 23:01:24 +03:00
parent 439444d72b
commit 2c3137b566
3 changed files with 6 additions and 2 deletions

View file

@ -1,7 +1,9 @@
#include "orbis/utils/Logs.hpp"
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_read(Thread *thread, sint fd, ptr<void> buf,
size_t nbyte) {
ORBIS_LOG_NOTICE(__FUNCTION__, fd, buf, nbyte);
if (auto read = thread->tproc->ops->read) {
return read(thread, fd, buf, nbyte);
}
@ -10,6 +12,7 @@ orbis::SysResult orbis::sys_read(Thread *thread, sint fd, ptr<void> buf,
}
orbis::SysResult orbis::sys_pread(Thread *thread, sint fd, ptr<void> buf,
size_t nbyte, off_t offset) {
ORBIS_LOG_NOTICE(__FUNCTION__, fd, buf, nbyte, offset);
if (auto pread = thread->tproc->ops->pread) {
return pread(thread, fd, buf, nbyte, offset);
}
@ -32,6 +35,7 @@ orbis::SysResult orbis::sys_preadv(Thread *thread, sint fd,
}
orbis::SysResult orbis::sys_write(Thread *thread, sint fd, ptr<const void> buf,
size_t nbyte) {
ORBIS_LOG_NOTICE(__FUNCTION__, fd, buf, nbyte);
if (auto write = thread->tproc->ops->write) {
return write(thread, fd, buf, nbyte);
}

View file

@ -111,7 +111,7 @@ orbis::SysResult orbis::sys_clock_getres(Thread *thread, clockid_t clock_id,
orbis::SysResult orbis::sys_nanosleep(Thread *thread,
cptr<orbis::timespec> rqtp,
ptr<orbis::timespec> rmtp) {
ORBIS_LOG_TRACE(__FUNCTION__, rqtp, rmtp);
ORBIS_LOG_NOTICE(__FUNCTION__, rqtp, rmtp);
struct ::timespec rq;
struct ::timespec rm;
orbis::timespec value;

View file

@ -123,7 +123,7 @@ orbis::SysResult orbis::sys_stat(Thread *thread, ptr<char> path, ptr<Stat> ub) {
ub->size = len;
ub->blksize = 1;
ub->blocks = len;
ub->mode = 0777;
ub->mode = 0777 | 0x8000;
sys_close(thread, fd);
thread->retval[0] = 0;
return {};