about summary refs log tree commit diff stats
path: root/src/os/os_linux.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-06-19 11:07:21 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-06-19 11:07:30 +0200
commit725316a5386eb713438625220b561bcd3710c8bc (patch)
tree3535222fdd3ec0c8b601df98006fa1736e9fb047 /src/os/os_linux.c
parentcc9ed708379b9b03e7a9b86f040f06f178606aef (diff)
downloadbox64-725316a5386eb713438625220b561bcd3710c8bc.tar.gz
box64-725316a5386eb713438625220b561bcd3710c8bc.zip
[DYNACACHE] Introduced DynaCache for ARM64 (disabled by default)
Diffstat (limited to 'src/os/os_linux.c')
-rw-r--r--src/os/os_linux.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/os/os_linux.c b/src/os/os_linux.c
index 29d0a1d1..d1a940b5 100644
--- a/src/os/os_linux.c
+++ b/src/os/os_linux.c
@@ -9,6 +9,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <stdlib.h>
+#include <errno.h>
 
 #include "os.h"
 #include "signals.h"
@@ -229,4 +230,23 @@ int FileExist(const char* filename, int flags)
             return 0; // nope
     }
     return 1;
+}
+
+int MakeDir(const char* folder)
+{
+    int ret = mkdir(folder, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+    if(!ret || ret==EEXIST)
+        return 1;
+    return 0;
+}
+
+size_t FileSize(const char* filename)
+{
+    struct stat sb;
+    if (stat(filename, &sb) == -1)
+        return 0;
+    // check type of file? should be executable, or folder
+    if (!S_ISREG(sb.st_mode))
+        return 0;
+    return sb.st_size;
 }
\ No newline at end of file