blob: 67dae75e5274d469b162a4ec51bffc9205b1c932 [file] [log] [blame]
Greg Kroah-Hartman6f52b162017-11-01 15:08:43 +01001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _SPARC_FCNTL_H
3#define _SPARC_FCNTL_H
4
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#define O_APPEND 0x0008
6#define FASYNC 0x0040 /* fcntl, for BSD compatibility */
7#define O_CREAT 0x0200 /* not fcntl */
8#define O_TRUNC 0x0400 /* not fcntl */
9#define O_EXCL 0x0800 /* not fcntl */
Christoph Hellwig6b2f3d12009-10-27 11:05:28 +010010#define O_DSYNC 0x2000 /* used to be O_SYNC, see below */
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#define O_NONBLOCK 0x4000
Sam Ravnborg6d1f4b82008-06-05 22:37:04 +020012#if defined(__sparc__) && defined(__arch64__)
13#define O_NDELAY 0x0004
14#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#define O_NDELAY (0x0004 | O_NONBLOCK)
Sam Ravnborg6d1f4b82008-06-05 22:37:04 +020016#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#define O_NOCTTY 0x8000 /* not fcntl */
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#define O_LARGEFILE 0x40000
19#define O_DIRECT 0x100000 /* direct disk access hint */
20#define O_NOATIME 0x200000
David S. Miller6ba60d22007-08-03 14:24:17 -070021#define O_CLOEXEC 0x400000
Christoph Hellwig6b2f3d12009-10-27 11:05:28 +010022/*
Christoph Hellwig76b7e002009-12-17 14:24:20 +010023 * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
Christoph Hellwig6b2f3d12009-10-27 11:05:28 +010024 * the O_SYNC flag. We continue to use the existing numerical value
25 * for O_DSYNC semantics now, but using the correct symbolic name for it.
26 * This new value is used to request true Posix O_SYNC semantics. It is
27 * defined in this strange way to make sure applications compiled against
28 * new headers get at least O_DSYNC semantics on older kernels.
29 *
30 * This has the nice side-effect that we can simply test for O_DSYNC
31 * wherever we do not care if O_DSYNC or O_SYNC is used.
32 *
33 * Note: __O_SYNC must never be used directly.
34 */
35#define __O_SYNC 0x800000
36#define O_SYNC (__O_SYNC|O_DSYNC)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Stephen Rothwell52296452011-03-16 18:09:27 +110038#define O_PATH 0x1000000
Al Virobb458c62013-07-13 13:26:37 +040039#define __O_TMPFILE 0x2000000
Stephen Rothwell52296452011-03-16 18:09:27 +110040
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#define F_GETOWN 5 /* for sockets. */
42#define F_SETOWN 6 /* for sockets. */
43#define F_GETLK 7
44#define F_SETLK 8
45#define F_SETLKW 9
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Linus Torvalds1da177e2005-04-16 15:20:36 -070047/* for posix fcntl() and lockf() */
48#define F_RDLCK 1
49#define F_WRLCK 2
50#define F_UNLCK 3
51
Stephen Rothwell5ac353f2005-09-06 15:18:00 -070052#define __ARCH_FLOCK_PAD short __unused;
Stephen Rothwell8d286aa2005-09-06 15:18:01 -070053#define __ARCH_FLOCK64_PAD short __unused;
Stephen Rothwell5ac353f2005-09-06 15:18:00 -070054
Mark Fortescuec8154c82007-08-04 21:17:18 -070055#include <asm-generic/fcntl.h>
Stephen Rothwell93172592005-09-06 15:17:57 -070056
Linus Torvalds1da177e2005-04-16 15:20:36 -070057#endif