From: Waldemar Kozaczuk <
jwkoz...@gmail.com>
Committer: WALDEMAR KOZACZUK <
jwkoz...@gmail.com>
Branch: master
vfs: add mknodat
Signed-off-by: Waldemar Kozaczuk <
jwkoz...@gmail.com>
Fix signature
---
diff --git a/exported_symbols/osv_ld-musl.so.1.symbols b/exported_symbols/osv_ld-musl.so.1.symbols
--- a/exported_symbols/osv_ld-musl.so.1.symbols
+++ b/exported_symbols/osv_ld-musl.so.1.symbols
@@ -646,6 +646,7 @@ mkdtemp
mkfifo
mkfifoat
mknod
+mknodat
mkostemp
mkostemp64
mkostemps
diff --git a/fs/vfs/main.cc b/fs/vfs/main.cc
--- a/fs/vfs/main.cc
+++ b/fs/vfs/main.cc
@@ -315,6 +315,13 @@ int mknod(const char *pathname, mode_t mode, dev_t dev)
return __xmknod(0, pathname, mode, &dev);
}
+OSV_LIBC_API
+int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev)
+{
+ return vfs_fun_at2(dirfd, pathname, [mode, dev](const char *path) {
+ return mknod(path, mode, dev);
+ });
+}
TRACEPOINT(trace_vfs_lseek, "%d 0x%x %d", int, off_t, int);
TRACEPOINT(trace_vfs_lseek_ret, "0x%x", off_t);
diff --git a/linux.cc b/linux.cc
--- a/linux.cc
+++ b/linux.cc
@@ -566,6 +566,7 @@ OSV_LIBC_API long syscall(long number, ...)
SYSCALL4(renameat, int, const char *, int, const char *);
SYSCALL1(sys_brk, void *);
SYSCALL4(clock_nanosleep, clockid_t, int, const struct timespec *, struct timespec *);
+ SYSCALL4(mknodat, int, const char *, mode_t, dev_t);
SYSCALL5(statx, int, const char *, int, unsigned int, struct statx *);
}