summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/fdatasync.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-21 22:04:49 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:40 +0200
commit2c917b0305102f3e01e825406f0e15cd95560312 (patch)
tree73da9149bbb1236b1f0c4cd9413a3e2d6395deae /libc/sysdeps/linux/common/fdatasync.c
parentf9af28c64eaf09cd9daba0445cb04f7d28e3d792 (diff)
adapt fdatasync, fsync, msync to use cancel.h
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common/fdatasync.c')
-rw-r--r--libc/sysdeps/linux/common/fdatasync.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/libc/sysdeps/linux/common/fdatasync.c b/libc/sysdeps/linux/common/fdatasync.c
index e51c72365..6c2f4f9f3 100644
--- a/libc/sysdeps/linux/common/fdatasync.c
+++ b/libc/sysdeps/linux/common/fdatasync.c
@@ -8,36 +8,17 @@
*/
#include <sys/syscall.h>
-#include <unistd.h>
#if !defined __NR_fdatasync && defined __NR_osf_fdatasync
# define __NR_fdatasync __NR_osf_fdatasync
#endif
#ifdef __NR_fdatasync
+# include <unistd.h>
+# include <cancel.h>
-# ifdef __UCLIBC_HAS_THREADS_NATIVE__
-# include <sysdep-cancel.h>
-# else
-# define SINGLE_THREAD_P 1
-# endif
-
-#define __NR___syscall_fdatasync __NR_fdatasync
-
-static __always_inline
-_syscall1(int, __syscall_fdatasync, int, fd)
-
-int fdatasync(int fd)
-{
- if (SINGLE_THREAD_P)
- return __syscall_fdatasync(fd);
-
-# ifdef __UCLIBC_HAS_THREADS_NATIVE__
- int oldtype = LIBC_CANCEL_ASYNC ();
- int result = __syscall_fdatasync(fd);
- LIBC_CANCEL_RESET (oldtype);
- return result;
-# endif
-}
+# define __NR___fdatasync_nocancel __NR_fdatasync
+static _syscall1(int, __NC(fdatasync), int, fd)
+CANCELLABLE_SYSCALL(int, fdatasync, (int fd), (fd))
#endif