about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-05-14 17:55:02 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-05-14 17:55:02 +0200
commit4a70577e6f30da25decabb11e5f22ca2c22c50bd (patch)
treeb6ed528f0766cacdb28a6673a6f7aa1b13784acc /src
parentb818a29499b91faa2a222606802526073969e3c2 (diff)
downloadbox64-4a70577e6f30da25decabb11e5f22ca2c22c50bd.tar.gz
box64-4a70577e6f30da25decabb11e5f22ca2c22c50bd.zip
[WRAPPER] added arm64 special case to of_unconvert helper function
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/wrappedlibc.c8
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c7
2 files changed, 12 insertions, 3 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 0ee05f00..a0e8361f 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -652,9 +652,13 @@ int of_unconvert(int a)
     SUPER();
     #undef GO
     int missing = 0;
-    if(!O_NOFOLLOW) missing |= X86_O_NOFOLLOW;
+    #ifdef ARM64
+    if(!O_LARGEFILE) {
+        if((a&(0400000))==(0400000)) {a&=~(0400000); b|=(X86_O_LARGEFILE);}
+    }
+    #else
     if(!O_LARGEFILE) missing |= X86_O_LARGEFILE;
-    // flags 0x20000 unknown?!
+    #endif
     if(a && (a&~missing)) {
         printf_log(LOG_NONE, "Warning, of_unconvert(...) left over 0x%x, converted 0x%x\n", a, b);
     }
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index fb67dcda..2215028a 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -696,8 +696,13 @@ int of_unconvert32(int a)
     SUPER();
     #undef GO
     int missing = 0;
-    if(!O_NOFOLLOW) missing |= X86_O_NOFOLLOW;
+    #ifdef ARM64
+    if(!O_LARGEFILE) {
+        if((a&(0400000))==(0400000)) {a&=~(0400000); b|=(X86_O_LARGEFILE);}
+    }
+    #else
     if(!O_LARGEFILE) missing |= X86_O_LARGEFILE;
+    #endif
     if(a && (a&~missing)) {
         printf_log(LOG_NONE, "Warning, of_unconvert32(...) left over 0x%x, converted 0x%x\n", a, b);
     }