xref: /OK3568_Linux_fs/kernel/arch/mips/include/uapi/asm/fcntl.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
4*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
5*4882a593Smuzhiyun  * for more details.
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun #ifndef _UAPI_ASM_FCNTL_H
10*4882a593Smuzhiyun #define _UAPI_ASM_FCNTL_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #include <asm/sgidefs.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #define O_APPEND	0x0008
15*4882a593Smuzhiyun #define O_DSYNC		0x0010	/* used to be O_SYNC, see below */
16*4882a593Smuzhiyun #define O_NONBLOCK	0x0080
17*4882a593Smuzhiyun #define O_CREAT		0x0100	/* not fcntl */
18*4882a593Smuzhiyun #define O_TRUNC		0x0200	/* not fcntl */
19*4882a593Smuzhiyun #define O_EXCL		0x0400	/* not fcntl */
20*4882a593Smuzhiyun #define O_NOCTTY	0x0800	/* not fcntl */
21*4882a593Smuzhiyun #define FASYNC		0x1000	/* fcntl, for BSD compatibility */
22*4882a593Smuzhiyun #define O_LARGEFILE	0x2000	/* allow large file opens */
23*4882a593Smuzhiyun /*
24*4882a593Smuzhiyun  * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
25*4882a593Smuzhiyun  * the O_SYNC flag.  We continue to use the existing numerical value
26*4882a593Smuzhiyun  * for O_DSYNC semantics now, but using the correct symbolic name for it.
27*4882a593Smuzhiyun  * This new value is used to request true Posix O_SYNC semantics.  It is
28*4882a593Smuzhiyun  * defined in this strange way to make sure applications compiled against
29*4882a593Smuzhiyun  * new headers get at least O_DSYNC semantics on older kernels.
30*4882a593Smuzhiyun  *
31*4882a593Smuzhiyun  * This has the nice side-effect that we can simply test for O_DSYNC
32*4882a593Smuzhiyun  * wherever we do not care if O_DSYNC or O_SYNC is used.
33*4882a593Smuzhiyun  *
34*4882a593Smuzhiyun  * Note: __O_SYNC must never be used directly.
35*4882a593Smuzhiyun  */
36*4882a593Smuzhiyun #define __O_SYNC	0x4000
37*4882a593Smuzhiyun #define O_SYNC		(__O_SYNC|O_DSYNC)
38*4882a593Smuzhiyun #define O_DIRECT	0x8000	/* direct disk access hint */
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun #define F_GETLK		14
41*4882a593Smuzhiyun #define F_SETLK		6
42*4882a593Smuzhiyun #define F_SETLKW	7
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun #define F_SETOWN	24	/*  for sockets. */
45*4882a593Smuzhiyun #define F_GETOWN	23	/*  for sockets. */
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun #ifndef __mips64
48*4882a593Smuzhiyun #define F_GETLK64	33	/*  using 'struct flock64' */
49*4882a593Smuzhiyun #define F_SETLK64	34
50*4882a593Smuzhiyun #define F_SETLKW64	35
51*4882a593Smuzhiyun #endif
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun /*
54*4882a593Smuzhiyun  * The flavours of struct flock.  "struct flock" is the ABI compliant
55*4882a593Smuzhiyun  * variant.  Finally struct flock64 is the LFS variant of struct flock.	 As
56*4882a593Smuzhiyun  * a historic accident and inconsistence with the ABI definition it doesn't
57*4882a593Smuzhiyun  * contain all the same fields as struct flock.
58*4882a593Smuzhiyun  */
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun #if _MIPS_SIM != _MIPS_SIM_ABI64
61*4882a593Smuzhiyun 
62*4882a593Smuzhiyun #include <linux/types.h>
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun struct flock {
65*4882a593Smuzhiyun 	short	l_type;
66*4882a593Smuzhiyun 	short	l_whence;
67*4882a593Smuzhiyun 	__kernel_off_t	l_start;
68*4882a593Smuzhiyun 	__kernel_off_t	l_len;
69*4882a593Smuzhiyun 	long	l_sysid;
70*4882a593Smuzhiyun 	__kernel_pid_t l_pid;
71*4882a593Smuzhiyun 	long	pad[4];
72*4882a593Smuzhiyun };
73*4882a593Smuzhiyun 
74*4882a593Smuzhiyun #define HAVE_ARCH_STRUCT_FLOCK
75*4882a593Smuzhiyun 
76*4882a593Smuzhiyun #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun #include <asm-generic/fcntl.h>
79*4882a593Smuzhiyun 
80*4882a593Smuzhiyun #endif /* _UAPI_ASM_FCNTL_H */
81