xref: /openbmc/linux/arch/mips/include/uapi/asm/fcntl.h (revision b8121f0f2fd9668ac4290bd969b664a4c1ca9ad5)
161730c53SDavid Howells /*
261730c53SDavid Howells  * This file is subject to the terms and conditions of the GNU General Public
361730c53SDavid Howells  * License.  See the file "COPYING" in the main directory of this archive
461730c53SDavid Howells  * for more details.
561730c53SDavid Howells  *
661730c53SDavid Howells  * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
761730c53SDavid Howells  */
861730c53SDavid Howells #ifndef _ASM_FCNTL_H
961730c53SDavid Howells #define _ASM_FCNTL_H
1061730c53SDavid Howells 
11*b8121f0fSRalf Baechle #include <asm/sgidefs.h>
1261730c53SDavid Howells 
1361730c53SDavid Howells #define O_APPEND	0x0008
1461730c53SDavid Howells #define O_DSYNC		0x0010	/* used to be O_SYNC, see below */
1561730c53SDavid Howells #define O_NONBLOCK	0x0080
1661730c53SDavid Howells #define O_CREAT		0x0100	/* not fcntl */
1761730c53SDavid Howells #define O_TRUNC		0x0200	/* not fcntl */
1861730c53SDavid Howells #define O_EXCL		0x0400	/* not fcntl */
1961730c53SDavid Howells #define O_NOCTTY	0x0800	/* not fcntl */
2061730c53SDavid Howells #define FASYNC		0x1000	/* fcntl, for BSD compatibility */
2161730c53SDavid Howells #define O_LARGEFILE	0x2000	/* allow large file opens */
2261730c53SDavid Howells /*
2361730c53SDavid Howells  * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
2461730c53SDavid Howells  * the O_SYNC flag.  We continue to use the existing numerical value
2561730c53SDavid Howells  * for O_DSYNC semantics now, but using the correct symbolic name for it.
2661730c53SDavid Howells  * This new value is used to request true Posix O_SYNC semantics.  It is
2761730c53SDavid Howells  * defined in this strange way to make sure applications compiled against
2861730c53SDavid Howells  * new headers get at least O_DSYNC semantics on older kernels.
2961730c53SDavid Howells  *
3061730c53SDavid Howells  * This has the nice side-effect that we can simply test for O_DSYNC
3161730c53SDavid Howells  * wherever we do not care if O_DSYNC or O_SYNC is used.
3261730c53SDavid Howells  *
3361730c53SDavid Howells  * Note: __O_SYNC must never be used directly.
3461730c53SDavid Howells  */
3561730c53SDavid Howells #define __O_SYNC	0x4000
3661730c53SDavid Howells #define O_SYNC		(__O_SYNC|O_DSYNC)
3761730c53SDavid Howells #define O_DIRECT	0x8000	/* direct disk access hint */
3861730c53SDavid Howells 
3961730c53SDavid Howells #define F_GETLK		14
4061730c53SDavid Howells #define F_SETLK		6
4161730c53SDavid Howells #define F_SETLKW	7
4261730c53SDavid Howells 
4361730c53SDavid Howells #define F_SETOWN	24	/*  for sockets. */
4461730c53SDavid Howells #define F_GETOWN	23	/*  for sockets. */
4561730c53SDavid Howells 
4661730c53SDavid Howells #ifndef __mips64
4761730c53SDavid Howells #define F_GETLK64	33	/*  using 'struct flock64' */
4861730c53SDavid Howells #define F_SETLK64	34
4961730c53SDavid Howells #define F_SETLKW64	35
5061730c53SDavid Howells #endif
5161730c53SDavid Howells 
5261730c53SDavid Howells /*
5361730c53SDavid Howells  * The flavours of struct flock.  "struct flock" is the ABI compliant
5461730c53SDavid Howells  * variant.  Finally struct flock64 is the LFS variant of struct flock.	 As
5561730c53SDavid Howells  * a historic accident and inconsistence with the ABI definition it doesn't
5661730c53SDavid Howells  * contain all the same fields as struct flock.
5761730c53SDavid Howells  */
5861730c53SDavid Howells 
59*b8121f0fSRalf Baechle #if _MIPS_SIM != _MIPS_SIM_ABI64
60*b8121f0fSRalf Baechle 
6161730c53SDavid Howells #include <linux/types.h>
6261730c53SDavid Howells 
6361730c53SDavid Howells struct flock {
6461730c53SDavid Howells 	short	l_type;
6561730c53SDavid Howells 	short	l_whence;
6661730c53SDavid Howells 	off_t	l_start;
6761730c53SDavid Howells 	off_t	l_len;
6861730c53SDavid Howells 	long	l_sysid;
6961730c53SDavid Howells 	__kernel_pid_t l_pid;
7061730c53SDavid Howells 	long	pad[4];
7161730c53SDavid Howells };
7261730c53SDavid Howells 
7361730c53SDavid Howells #define HAVE_ARCH_STRUCT_FLOCK
7461730c53SDavid Howells 
75*b8121f0fSRalf Baechle #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
7661730c53SDavid Howells 
7761730c53SDavid Howells #include <asm-generic/fcntl.h>
7861730c53SDavid Howells 
7961730c53SDavid Howells #endif /* _ASM_FCNTL_H */
80