From 5ea34cb56684081537ee33b2b786d332c91764f4 Mon Sep 17 00:00:00 2001 From: midipix Date: May 01 2020 19:03:04 +0000 Subject: glue layer: added __fs_tmp{file|dir}(), for fast & atomic tmpfs obj creation. --- diff --git a/arch/nt32/bits/syscall.h.in b/arch/nt32/bits/syscall.h.in index b9f9820..0383742 100644 --- a/arch/nt32/bits/syscall.h.in +++ b/arch/nt32/bits/syscall.h.in @@ -347,6 +347,9 @@ #define __NR_fs_mkdir 358 #define __NR_fs_chmod 359 +#define __NR_fs_tmpfile 360 +#define __NR_fs_tmpdir 361 + #define __NR_dbg_attach 368 #define __NR_dbg_detach 369 diff --git a/arch/nt64/bits/syscall.h.in b/arch/nt64/bits/syscall.h.in index b9f9820..0383742 100644 --- a/arch/nt64/bits/syscall.h.in +++ b/arch/nt64/bits/syscall.h.in @@ -347,6 +347,9 @@ #define __NR_fs_mkdir 358 #define __NR_fs_chmod 359 +#define __NR_fs_tmpfile 360 +#define __NR_fs_tmpdir 361 + #define __NR_dbg_attach 368 #define __NR_dbg_detach 369 diff --git a/include/sys/fs.h b/include/sys/fs.h index bbb8d4d..53246df 100644 --- a/include/sys/fs.h +++ b/include/sys/fs.h @@ -51,6 +51,9 @@ int __fs_dpath(int, const char *, int, char *, size_t); int __fs_mkdir(int, const char *, mode_t, uint32_t); int __fs_chmod(int, const char *, mode_t, int, uint32_t); +int __fs_tmpfile(int); +int __fs_tmpdir(int); + #ifdef __cplusplus } #endif diff --git a/src/arch/nt32/fs.c b/src/arch/nt32/fs.c index 93ccd82..11c9b7d 100644 --- a/src/arch/nt32/fs.c +++ b/src/arch/nt32/fs.c @@ -34,3 +34,13 @@ int __fs_chmod(int fdat, const char * path, mode_t mode, int flags, uint32_t ace { return syscall(SYS_fs_chmod,fdat,path,mode,flags,ace_flags); } + +int __fs_tmpfile(int flags) +{ + return syscall(SYS_fs_tmpfile,flags); +} + +int __fs_tmpdir(int flags) +{ + return syscall(SYS_fs_tmpdir,flags); +} diff --git a/src/arch/nt64/fs.c b/src/arch/nt64/fs.c index 93ccd82..11c9b7d 100644 --- a/src/arch/nt64/fs.c +++ b/src/arch/nt64/fs.c @@ -34,3 +34,13 @@ int __fs_chmod(int fdat, const char * path, mode_t mode, int flags, uint32_t ace { return syscall(SYS_fs_chmod,fdat,path,mode,flags,ace_flags); } + +int __fs_tmpfile(int flags) +{ + return syscall(SYS_fs_tmpfile,flags); +} + +int __fs_tmpdir(int flags) +{ + return syscall(SYS_fs_tmpdir,flags); +}