Skip to content

Commit d709451

Browse files
committed
HACK: Debugging stuff
1 parent 71607f2 commit d709451

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed

options/linux/generic/sys-mount.cpp

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,36 @@ int umount2(const char *target, int flags) {
2929
}
3030

3131
int fsopen(const char *, unsigned int) {
32-
__ensure(!"Not implemented");
33-
__builtin_unreachable();
32+
errno = ENOSYS;
33+
return -1;
34+
// __ensure(!"Not implemented");
35+
// __builtin_unreachable();
3436
}
3537

3638
int fsmount(int, unsigned int, unsigned int) {
37-
__ensure(!"Not implemented");
38-
__builtin_unreachable();
39+
errno = ENOSYS;
40+
return -1;
41+
// __ensure(!"Not implemented");
42+
// __builtin_unreachable();
3943
}
4044

4145
int fsconfig(int, unsigned int, const char *, const void *, int) {
42-
__ensure(!"Not implemented");
43-
__builtin_unreachable();
46+
errno = ENOSYS;
47+
return -1;
48+
// __ensure(!"Not implemented");
49+
// __builtin_unreachable();
4450
}
4551

4652
int move_mount(int, const char *, int, const char *, unsigned int) {
47-
__ensure(!"Not implemented");
48-
__builtin_unreachable();
53+
errno = ENOSYS;
54+
return -1;
55+
// __ensure(!"Not implemented");
56+
// __builtin_unreachable();
4957
}
5058

5159
int open_tree(int, const char *, unsigned int) {
52-
__ensure(!"Not implemented");
53-
__builtin_unreachable();
60+
errno = ENOSYS;
61+
return -1;
62+
// __ensure(!"Not implemented");
63+
// __builtin_unreachable();
5464
}

sysdeps/managarm/generic/file.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2266,8 +2266,10 @@ sys_statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct
22662266
SignalGuard sguard;
22672267

22682268
managarm::posix::FstatAtRequest<MemoryAllocator> req(getSysdepsAllocator());
2269-
if (pathname)
2269+
if (pathname) {
22702270
req.set_path(frg::string<MemoryAllocator>(getSysdepsAllocator(), pathname));
2271+
mlibc::infoLogger() << "mlibc: path is " << pathname << frg::endlog;
2272+
}
22712273
req.set_fd(dirfd);
22722274

22732275
if (flags
@@ -2954,6 +2956,7 @@ static int do_statfs(int fd, const char *path, struct statfs *buf) {
29542956
if (path) {
29552957
req.set_fd(-1);
29562958
req.set_path(frg::string<MemoryAllocator>(getSysdepsAllocator(), path));
2959+
mlibc::infoLogger() << "mlibc: path is " << path << frg::endlog;
29572960
} else {
29582961
req.set_fd(fd);
29592962
}

sysdeps/managarm/generic/ioctl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ int sys_ioctl(int fd, unsigned long request, void *arg, int *result) {
12541254
mlibc::infoLogger() << "mlibc: Unexpected ioctl with"
12551255
<< " type: 0x" << frg::hex_fmt(_IOC_TYPE(request)) << ", number: 0x"
12561256
<< frg::hex_fmt(_IOC_NR(request))
1257-
<< " (raw request: " << frg::hex_fmt(request) << ")" << frg::endlog;
1257+
<< " (raw request: " << frg::hex_fmt(request) << ")" << " (we're pid: " << getpid() << ")" << frg::endlog;
12581258

12591259
return ENOSYS;
12601260
}

sysdeps/managarm/generic/mount.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ sys_mount(const char *source, const char *target, const char *fstype, unsigned l
2121
req.set_target_path(frg::string<MemoryAllocator>(getSysdepsAllocator(), target ? target : ""));
2222
req.set_fs_type(frg::string<MemoryAllocator>(getSysdepsAllocator(), fstype ? fstype : ""));
2323

24+
if(!fstype)
25+
__builtin_trap();
26+
27+
mlibc::infoLogger() << "mlibc mounting....";
28+
if(source)
29+
mlibc::infoLogger() << " source is: " << source;
30+
else
31+
mlibc::infoLogger() << " no source?";
32+
if(target)
33+
mlibc::infoLogger() << " target is: " << target;
34+
else
35+
mlibc::infoLogger() << " no target?";
36+
if(fstype)
37+
mlibc::infoLogger() << " fstype is: " << fstype;
38+
else
39+
mlibc::infoLogger() << " no fstype?";
40+
mlibc::infoLogger() << frg::endlog;
41+
2442
auto [offer, send_head, send_tail, recv_resp] = exchangeMsgsSync(
2543
getPosixLane(),
2644
helix_ng::offer(

0 commit comments

Comments
 (0)