1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 21da177e4SLinus Torvalds /* 31da177e4SLinus Torvalds * This file is subject to the terms and conditions of the GNU General Public 41da177e4SLinus Torvalds * License. See the file "COPYING" in the main directory of this archive 51da177e4SLinus Torvalds * for more details. 61da177e4SLinus Torvalds * 7b4f8c423SRalf Baechle * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle 81da177e4SLinus Torvalds */ 9a932fec8SRalf Baechle #ifndef _UAPI_ASM_FCNTL_H 10a932fec8SRalf Baechle #define _UAPI_ASM_FCNTL_H 111da177e4SLinus Torvalds 12b8121f0fSRalf Baechle #include <asm/sgidefs.h> 13b4f8c423SRalf Baechle 141da177e4SLinus Torvalds #define O_APPEND 0x0008 156b2f3d1fSChristoph Hellwig #define O_DSYNC 0x0010 /* used to be O_SYNC, see below */ 161da177e4SLinus Torvalds #define O_NONBLOCK 0x0080 171da177e4SLinus Torvalds #define O_CREAT 0x0100 /* not fcntl */ 18ca074a33SRalf Baechle #define O_TRUNC 0x0200 /* not fcntl */ 191da177e4SLinus Torvalds #define O_EXCL 0x0400 /* not fcntl */ 201da177e4SLinus Torvalds #define O_NOCTTY 0x0800 /* not fcntl */ 211da177e4SLinus Torvalds #define FASYNC 0x1000 /* fcntl, for BSD compatibility */ 221da177e4SLinus Torvalds #define O_LARGEFILE 0x2000 /* allow large file opens */ 236b2f3d1fSChristoph Hellwig /* 2476b7e005SChristoph Hellwig * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using 256b2f3d1fSChristoph Hellwig * the O_SYNC flag. We continue to use the existing numerical value 266b2f3d1fSChristoph Hellwig * for O_DSYNC semantics now, but using the correct symbolic name for it. 276b2f3d1fSChristoph Hellwig * This new value is used to request true Posix O_SYNC semantics. It is 286b2f3d1fSChristoph Hellwig * defined in this strange way to make sure applications compiled against 296b2f3d1fSChristoph Hellwig * new headers get at least O_DSYNC semantics on older kernels. 306b2f3d1fSChristoph Hellwig * 316b2f3d1fSChristoph Hellwig * This has the nice side-effect that we can simply test for O_DSYNC 326b2f3d1fSChristoph Hellwig * wherever we do not care if O_DSYNC or O_SYNC is used. 336b2f3d1fSChristoph Hellwig * 346b2f3d1fSChristoph Hellwig * Note: __O_SYNC must never be used directly. 356b2f3d1fSChristoph Hellwig */ 366b2f3d1fSChristoph Hellwig #define __O_SYNC 0x4000 376b2f3d1fSChristoph Hellwig #define O_SYNC (__O_SYNC|O_DSYNC) 381da177e4SLinus Torvalds #define O_DIRECT 0x8000 /* direct disk access hint */ 391da177e4SLinus Torvalds 401da177e4SLinus Torvalds #define F_GETLK 14 411da177e4SLinus Torvalds #define F_SETLK 6 421da177e4SLinus Torvalds #define F_SETLKW 7 431da177e4SLinus Torvalds 441da177e4SLinus Torvalds #define F_SETOWN 24 /* for sockets. */ 451da177e4SLinus Torvalds #define F_GETOWN 23 /* for sockets. */ 461da177e4SLinus Torvalds 47*306f7cc1SChristoph Hellwig #if __BITS_PER_LONG == 32 || defined(__KERNEL__) 481da177e4SLinus Torvalds #define F_GETLK64 33 /* using 'struct flock64' */ 491da177e4SLinus Torvalds #define F_SETLK64 34 501da177e4SLinus Torvalds #define F_SETLKW64 35 51*306f7cc1SChristoph Hellwig #endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */ 521da177e4SLinus Torvalds 53b8121f0fSRalf Baechle #if _MIPS_SIM != _MIPS_SIM_ABI64 549f79b8b7SChristoph Hellwig #define __ARCH_FLOCK_EXTRA_SYSID long l_sysid; 559f79b8b7SChristoph Hellwig #define __ARCH_FLOCK_PAD long pad[4]; 569f79b8b7SChristoph Hellwig #endif 571da177e4SLinus Torvalds 589317259eSStephen Rothwell #include <asm-generic/fcntl.h> 591da177e4SLinus Torvalds 60a932fec8SRalf Baechle #endif /* _UAPI_ASM_FCNTL_H */ 61