summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/common/__syscall_fcntl64.c2
-rw-r--r--libc/sysdeps/linux/common/ftruncate.c4
-rw-r--r--libc/sysdeps/linux/common/openat.c15
3 files changed, 19 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/__syscall_fcntl64.c b/libc/sysdeps/linux/common/__syscall_fcntl64.c
index 0c13d152f..696b1ff41 100644
--- a/libc/sysdeps/linux/common/__syscall_fcntl64.c
+++ b/libc/sysdeps/linux/common/__syscall_fcntl64.c
@@ -30,7 +30,7 @@ int fcntl64(int fd, int cmd, ...)
arg = va_arg(list, long);
va_end(list);
- if (SINGLE_THREAD_P || (cmd != F_SETLKW64))
+ if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
return __NC(fcntl64)(fd, cmd, arg);
# ifdef __NEW_THREADS
oldtype = LIBC_CANCEL_ASYNC();
diff --git a/libc/sysdeps/linux/common/ftruncate.c b/libc/sysdeps/linux/common/ftruncate.c
index b9a69714f..637050777 100644
--- a/libc/sysdeps/linux/common/ftruncate.c
+++ b/libc/sysdeps/linux/common/ftruncate.c
@@ -15,7 +15,11 @@
int ftruncate(int fd, __off_t length)
{
# if __WORDSIZE == 32
+# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
+ return INLINE_SYSCALL(ftruncate64, 4, fd, 0, OFF_HI_LO(length));
+# else
return INLINE_SYSCALL(ftruncate64, 3, fd, OFF_HI_LO(length));
+# endif
# else
return ftruncate64(fd, length);
# endif
diff --git a/libc/sysdeps/linux/common/openat.c b/libc/sysdeps/linux/common/openat.c
index f71567cdc..62451df4c 100644
--- a/libc/sysdeps/linux/common/openat.c
+++ b/libc/sysdeps/linux/common/openat.c
@@ -9,6 +9,7 @@
#include <sys/syscall.h>
#include <fcntl.h>
#include <stdarg.h>
+#include <cancel.h>
#ifdef __NR_openat
# define __NR___syscall_openat __NR_openat
@@ -16,13 +17,25 @@ static __inline__ _syscall4(int, __syscall_openat, int, fd, const char *, file,
int __openat(int fd, const char *file, int o_flag, ...)
{
+#ifdef __NEW_THREADS
+ int oldtype, result;
+#endif
va_list ap;
mode_t mode;
va_start(ap, o_flag);
mode = va_arg(ap, int);
va_end(ap);
- return __syscall_openat(fd, file, o_flag, mode);
+
+ if (SINGLE_THREAD_P)
+ return __syscall_openat(fd, file, o_flag, mode);
+
+#ifdef __NEW_THREADS
+ oldtype = LIBC_CANCEL_ASYNC ();
+ result = __syscall_openat(fd, file, o_flag, mode);
+ LIBC_CANCEL_RESET (oldtype);
+ return result;
+#endif
}
strong_alias_untyped(__openat,openat)