Skip to content

Commit

Permalink
WIP and debug stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke committed Jan 30, 2025
1 parent 3a35860 commit 6256183
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions options/linux/generic/sched.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask) {
}

int unshare(int) {
errno = ENOSYS;
return -1;
__ensure(!"Not implemented");
__builtin_unreachable();
}
Expand Down
3 changes: 3 additions & 0 deletions options/linux/generic/sys-sendfile.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

#include <sys/sendfile.h>
#include <bits/ensure.h>
#include <errno.h>

ssize_t sendfile(int, int, off_t *, size_t) {
errno = ENOSYS;
return -1;
__ensure(!"Not implemented");
__builtin_unreachable();
}
Expand Down
1 change: 1 addition & 0 deletions options/posix/generic/sys-socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ int accept(int fd, struct sockaddr *__restrict addr_ptr, socklen_t *__restrict a
}

int accept4(int fd, struct sockaddr *__restrict addr_ptr, socklen_t *__restrict addr_length, int flags) {
mlibc::infoLogger() << "mlibc: accept4 called" << frg::endlog;
int newfd;
MLIBC_CHECK_OR_ENOSYS(mlibc::sys_accept, -1);
if(int e = mlibc::sys_accept(fd, &newfd, addr_ptr, addr_length, flags); e) {
Expand Down
2 changes: 2 additions & 0 deletions options/posix/generic/sys-time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ int gettimeofday(struct timeval *__restrict result, void *__restrict unused) {
}

int settimeofday(const struct timeval *, const struct timezone *) {
errno = ENOSYS;
return -1;
__ensure(!"Not implemented");
__builtin_unreachable();
}
Expand Down
3 changes: 3 additions & 0 deletions sysdeps/managarm/generic/mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ sys_mount(const char *source, const char *target, const char *fstype, unsigned l
req.set_target_path(frg::string<MemoryAllocator>(getSysdepsAllocator(), target ? target : ""));
req.set_fs_type(frg::string<MemoryAllocator>(getSysdepsAllocator(), fstype ? fstype : ""));

if(!fstype)
abort();

auto [offer, send_head, send_tail, recv_resp] = exchangeMsgsSync(
getPosixLane(),
helix_ng::offer(
Expand Down
2 changes: 2 additions & 0 deletions sysdeps/managarm/generic/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ int sys_bind(int fd, const struct sockaddr *addr_ptr, socklen_t addr_length) {

int sys_connect(int fd, const struct sockaddr *addr_ptr, socklen_t addr_length) {
SignalGuard sguard;
mlibc::infoLogger() << "mlibc: entering connect syscall" << frg::endlog;

auto handle = getHandleForFd(fd);
if (!handle)
Expand Down Expand Up @@ -157,6 +158,7 @@ int sys_connect(int fd, const struct sockaddr *addr_ptr, socklen_t addr_length)
HEL_CHECK(recv_resp.error());

managarm::fs::SvrResponse<MemoryAllocator> resp(getSysdepsAllocator());
mlibc::infoLogger() << "mlibc: handling errors and exit connect syscall" << frg::endlog;
resp.ParseFromArray(recv_resp.data(), recv_resp.length());
if (resp.error() == managarm::fs::Errors::FILE_NOT_FOUND) {
return ENOENT;
Expand Down

0 comments on commit 6256183

Please sign in to comment.