1 /* vi: set sw=4 ts=4: */
3 * fdatasync() for uClibc
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
13 #if !defined __NR_fdatasync && defined __NR_osf_fdatasync
14 # define __NR_fdatasync __NR_osf_fdatasync
19 # ifdef __UCLIBC_HAS_THREADS_NATIVE__
20 # include <sysdep-cancel.h>
22 # define SINGLE_THREAD_P 1
25 #define __NR___syscall_fdatasync __NR_fdatasync
27 static __always_inline
28 _syscall1(int, __syscall_fdatasync, int, fd)
33 return __syscall_fdatasync(fd);
35 # ifdef __UCLIBC_HAS_THREADS_NATIVE__
36 int oldtype = LIBC_CANCEL_ASYNC ();
37 int result = __syscall_fdatasync(fd);
38 LIBC_CANCEL_RESET (oldtype);
43 #elif defined __UCLIBC_HAS_STUBS__
44 /* no syscall available, so provide a stub */