treat empty TZ environment variable as GMT rather than default
[musl] / arch / mips / syscall_arch.h
index 1aa2c81..1b1179c 100644 (file)
@@ -3,6 +3,9 @@
 ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
 #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
 
+#ifdef SHARED
+__attribute__((visibility("hidden")))
+#endif
 long (__syscall)(long, ...);
 
 #define SYSCALL_RLIM_INFINITY (-1UL/2)
@@ -60,8 +63,9 @@ static inline long __syscall2(long n, long a, long b)
                : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
                  "$14", "$15", "$24", "$25", "hi", "lo", "memory");
        if (r7) return -r2;
+       long ret = r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
-       return r2;
+       return ret;
 }
 
 static inline long __syscall3(long n, long a, long b, long c)
@@ -78,8 +82,9 @@ static inline long __syscall3(long n, long a, long b, long c)
                : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
                  "$14", "$15", "$24", "$25", "hi", "lo", "memory");
        if (r7) return -r2;
+       long ret = r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
-       return r2;
+       return ret;
 }
 
 static inline long __syscall4(long n, long a, long b, long c, long d)
@@ -96,9 +101,10 @@ static inline long __syscall4(long n, long a, long b, long c, long d)
                : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
                  "$14", "$15", "$24", "$25", "hi", "lo", "memory");
        if (r7) return -r2;
+       long ret = r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
        if (n == SYS_fstatat) __stat_fix(c);
-       return r2;
+       return ret;
 }
 
 #else
@@ -116,7 +122,7 @@ static inline long __syscall1(long n, long a)
 static inline long __syscall2(long n, long a, long b)
 {
        long r2 = (__syscall)(n, a, b);
-       if (r2 > -4096UL) return -r2;
+       if (r2 > -4096UL) return r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
        return r2;
 }
@@ -124,7 +130,7 @@ static inline long __syscall2(long n, long a, long b)
 static inline long __syscall3(long n, long a, long b, long c)
 {
        long r2 = (__syscall)(n, a, b, c);
-       if (r2 > -4096UL) return -r2;
+       if (r2 > -4096UL) return r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
        return r2;
 }
@@ -132,7 +138,7 @@ static inline long __syscall3(long n, long a, long b, long c)
 static inline long __syscall4(long n, long a, long b, long c, long d)
 {
        long r2 = (__syscall)(n, a, b, c, d);
-       if (r2 > -4096UL) return -r2;
+       if (r2 > -4096UL) return r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
        if (n == SYS_fstatat) __stat_fix(c);
        return r2;
@@ -143,7 +149,7 @@ static inline long __syscall4(long n, long a, long b, long c, long d)
 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
 {
        long r2 = (__syscall)(n, a, b, c, d, e);
-       if (r2 > -4096UL) return -r2;
+       if (r2 > -4096UL) return r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
        if (n == SYS_fstatat) __stat_fix(c);
        return r2;
@@ -152,7 +158,7 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e)
 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
 {
        long r2 = (__syscall)(n, a, b, c, d, e, f);
-       if (r2 > -4096UL) return -r2;
+       if (r2 > -4096UL) return r2;
        if (n == SYS_stat64 || n == SYS_fstat64 || n == SYS_lstat64) __stat_fix(b);
        if (n == SYS_fstatat) __stat_fix(c);
        return r2;