chiark / gitweb /
[PATCH] oops forgot to add the new klibc/include directory
[elogind.git] / klibc / include / fcntl.h
1 /*
2  * fcntl.h
3  */
4
5 #ifndef _FCNTL_H
6 #define _FCNTL_H
7
8 #include <klibc/extern.h>
9 #include <klibc/compiler.h>
10 #include <sys/types.h>
11 #if defined(__mips__) && !defined(__mips64__)
12 # include <klibc/archfcntl.h>
13 #endif
14 #include <linux/fcntl.h>
15
16 /* This is ugly, but "struct flock" has actually been defined with
17    a long off_t, so it's really "struct flock64".  It just happens
18    to work.  Gag.  Barf.
19
20    This happens to work on all 32-bit architectures except MIPS. */
21
22 #ifdef F_GETLK64
23 # undef F_GETLK
24 # define F_GETLK F_GETLK64
25 #endif
26
27 #ifdef F_SETLK64
28 # undef F_SETLK
29 # define F_SETLK F_SETLK64
30 #endif
31
32 #ifdef F_SETLKW64
33 # undef F_SETLKW
34 # define F_SETLKW F_SETLKW64
35 #endif
36
37 /* This is defined here as well as in <unistd.h> since old-style code
38    would still include <fcntl.h> when using open(), and open() being
39    a varadic function changes its calling convention on some architectures. */
40 #ifndef _KLIBC_IN_OPEN_C
41 __extern int open(const char *, int, ...);
42 #endif
43
44 __extern int fcntl(int, int, ...);
45
46 #endif /* _FCNTL_H */