Skip to content

Commit

Permalink
[orbis-kernel] Fix sys_stat hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Jul 17, 2023
1 parent 439444d commit 2c3137b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions orbis-kernel/src/sys/sys_generic.cpp
Original file line number Diff line number Diff line change
@@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion orbis-kernel/src/sys/sys_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion orbis-kernel/src/sys/sys_vfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down

0 comments on commit 2c3137b

Please sign in to comment.