xref: /openbmc/linux/arch/sparc/include/uapi/asm/fcntl.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
254579826SDavid Howells #ifndef _SPARC_FCNTL_H
354579826SDavid Howells #define _SPARC_FCNTL_H
454579826SDavid Howells 
554579826SDavid Howells #define O_APPEND	0x0008
654579826SDavid Howells #define FASYNC		0x0040	/* fcntl, for BSD compatibility */
754579826SDavid Howells #define O_CREAT		0x0200	/* not fcntl */
854579826SDavid Howells #define O_TRUNC		0x0400	/* not fcntl */
954579826SDavid Howells #define O_EXCL		0x0800	/* not fcntl */
1054579826SDavid Howells #define O_DSYNC		0x2000	/* used to be O_SYNC, see below */
1154579826SDavid Howells #define O_NONBLOCK	0x4000
1254579826SDavid Howells #if defined(__sparc__) && defined(__arch64__)
1354579826SDavid Howells #define O_NDELAY	0x0004
1454579826SDavid Howells #else
1554579826SDavid Howells #define O_NDELAY	(0x0004 | O_NONBLOCK)
1654579826SDavid Howells #endif
1754579826SDavid Howells #define O_NOCTTY	0x8000	/* not fcntl */
1854579826SDavid Howells #define O_LARGEFILE	0x40000
1954579826SDavid Howells #define O_DIRECT        0x100000 /* direct disk access hint */
2054579826SDavid Howells #define O_NOATIME	0x200000
2154579826SDavid Howells #define O_CLOEXEC	0x400000
2254579826SDavid Howells /*
2354579826SDavid Howells  * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
2454579826SDavid Howells  * the O_SYNC flag.  We continue to use the existing numerical value
2554579826SDavid Howells  * for O_DSYNC semantics now, but using the correct symbolic name for it.
2654579826SDavid Howells  * This new value is used to request true Posix O_SYNC semantics.  It is
2754579826SDavid Howells  * defined in this strange way to make sure applications compiled against
2854579826SDavid Howells  * new headers get at least O_DSYNC semantics on older kernels.
2954579826SDavid Howells  *
3054579826SDavid Howells  * This has the nice side-effect that we can simply test for O_DSYNC
3154579826SDavid Howells  * wherever we do not care if O_DSYNC or O_SYNC is used.
3254579826SDavid Howells  *
3354579826SDavid Howells  * Note: __O_SYNC must never be used directly.
3454579826SDavid Howells  */
3554579826SDavid Howells #define __O_SYNC	0x800000
3654579826SDavid Howells #define O_SYNC		(__O_SYNC|O_DSYNC)
3754579826SDavid Howells 
3854579826SDavid Howells #define O_PATH		0x1000000
39bb458c64SAl Viro #define __O_TMPFILE	0x2000000
4054579826SDavid Howells 
4154579826SDavid Howells #define F_GETOWN	5	/*  for sockets. */
4254579826SDavid Howells #define F_SETOWN	6	/*  for sockets. */
4354579826SDavid Howells #define F_GETLK		7
4454579826SDavid Howells #define F_SETLK		8
4554579826SDavid Howells #define F_SETLKW	9
4654579826SDavid Howells 
4754579826SDavid Howells /* for posix fcntl() and lockf() */
4854579826SDavid Howells #define F_RDLCK		1
4954579826SDavid Howells #define F_WRLCK		2
5054579826SDavid Howells #define F_UNLCK		3
5154579826SDavid Howells 
5254579826SDavid Howells #define __ARCH_FLOCK_PAD	short __unused;
5354579826SDavid Howells #define __ARCH_FLOCK64_PAD	short __unused;
5454579826SDavid Howells 
5554579826SDavid Howells #include <asm-generic/fcntl.h>
5654579826SDavid Howells 
5754579826SDavid Howells #endif
58