OSDN Git Service

lseek: Correct order of offset arguments
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / common / __syscall_fcntl64.c
1 /* vi: set sw=4 ts=4: */
2 /*
3  * __syscall_fcntl64() for uClibc
4  *
5  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
6  *
7  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8  */
9
10 #include <_lfs_64.h>
11 #include <sys/syscall.h>
12 #include <bits/wordsize.h>
13
14 #if defined __NR_fcntl64 && __WORDSIZE == 32
15 # include <stdarg.h>
16 # include <cancel.h>
17 # include <fcntl.h>
18
19 # define __NR___fcntl64_nocancel __NR_fcntl64
20 _syscall3(int, __NC(fcntl64), int, fd, int, cmd, long, arg)
21
22 int fcntl64(int fd, int cmd, ...)
23 {
24         long arg;
25         va_list list;
26
27         va_start(list, cmd);
28         arg = va_arg(list, long);
29         va_end(list);
30
31         if (SINGLE_THREAD_P || (cmd != F_SETLKW64))
32                 return __NC(fcntl64)(fd, cmd, arg);
33 # ifdef __NEW_THREADS
34         int oldtype = LIBC_CANCEL_ASYNC();
35         int result = __NC(fcntl64)(fd, cmd, arg);
36         LIBC_CANCEL_RESET(oldtype);
37         return result;
38 # endif
39 }
40 lt_strong_alias(fcntl64)
41 lt_libc_hidden(fcntl64)
42 #endif