From 642b5fb0007b64c77d186fcb018d571152ee1d47 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 14 Aug 2023 18:51:07 +0200 Subject: reorganization: first steps --- src/libc/compat.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/libc/compat.c (limited to 'src/libc/compat.c') diff --git a/src/libc/compat.c b/src/libc/compat.c new file mode 100644 index 0000000..3ec47f9 --- /dev/null +++ b/src/libc/compat.c @@ -0,0 +1,20 @@ +#include +#include +#include + +#define eprintf(fmt, ...) fprintf(stderr, "user/lib/compat: "fmt"\n" __VA_OPT__(,) __VA_ARGS__) + +static hid_t h = -1; +long c0_fs_wait(char *buf, long len, struct ufs_request *res) { + if (h != -1) { + eprintf("didn't respond to request!"); + c0_fs_respond(NULL, -1, 0); + } + h = _sys_fs_wait(buf, len, res); + return h >= 0 ? 0 : -1; +} +long c0_fs_respond(void *buf, long ret, int flags) { + ret = _sys_fs_respond(h, buf, ret, flags); + h = -1; + return ret; +} -- cgit v1.2.3