14b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis/* 24b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis * This file is subject to the terms and conditions of the GNU General Public 34b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis * License. See the file "COPYING" in the main directory of this archive 44b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis * for more details. 54b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis * 64b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle 74b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis */ 84b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis#ifndef _UAPI_ASM_FCNTL_H 94b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis#define _UAPI_ASM_FCNTL_H 104b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis 114b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis#include <asm/sgidefs.h> 124b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis 134b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77Argyrios Kyrtzidis#define O_APPEND 0x0008 140853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis#define O_DSYNC 0x0010 /* used to be O_SYNC, see below */ 150853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis#define O_NONBLOCK 0x0080 160853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis#define O_CREAT 0x0100 /* not fcntl */ 17eb8837b88c18631c69ac75f64ab1853762063180Douglas Gregor#define O_TRUNC 0x0200 /* not fcntl */ 18eb8837b88c18631c69ac75f64ab1853762063180Douglas Gregor#define O_EXCL 0x0400 /* not fcntl */ 19914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor#define O_NOCTTY 0x0800 /* not fcntl */ 204ae8f298b1ea51b4c2234f9148e2e4349c9bdd23Douglas Gregor#define FASYNC 0x1000 /* fcntl, for BSD compatibility */ 2131b87d8006d4863dd9b17e515ac720941efc38e3Daniel Dunbar#define O_LARGEFILE 0x2000 /* allow large file opens */ 22eb8837b88c18631c69ac75f64ab1853762063180Douglas Gregor/* 2387c08a5d6b9e1e44ae6f554df40139d3a6f60b33Douglas Gregor * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using 2428019772db70d4547be05a042eb950bc910f134fDouglas Gregor * the O_SYNC flag. We continue to use the existing numerical value 250853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis * for O_DSYNC semantics now, but using the correct symbolic name for it. 26a88084b78fd4ca5d3d858c14b02414f8cc399f02Douglas Gregor * This new value is used to request true Posix O_SYNC semantics. It is 27cc5888d833caf90ebda37f24da40d2cd06b4d820Douglas Gregor * defined in this strange way to make sure applications compiled against 28313e26c4e81f0e467490a530548450f4c824a6c4Douglas Gregor * new headers get at least O_DSYNC semantics on older kernels. 29385103b79c5338a2be5da0ca70652400bc267371Douglas Gregor * 30788f5a1242c04762f91eaa7565c07b9865846d88Douglas Gregor * This has the nice side-effect that we can simply test for O_DSYNC 310853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis * wherever we do not care if O_DSYNC or O_SYNC is used. 32f772d1e2a5688572d07f42896a50ac57a4a41fe8Daniel Dunbar * 33f772d1e2a5688572d07f42896a50ac57a4a41fe8Daniel Dunbar * Note: __O_SYNC must never be used directly. 344db64a461cb3442934afe43c83ed3f17f7c11c1dDouglas Gregor */ 35cc5888d833caf90ebda37f24da40d2cd06b4d820Douglas Gregor#define __O_SYNC 0x4000 364db64a461cb3442934afe43c83ed3f17f7c11c1dDouglas Gregor#define O_SYNC (__O_SYNC|O_DSYNC) 374db64a461cb3442934afe43c83ed3f17f7c11c1dDouglas Gregor#define O_DIRECT 0x8000 /* direct disk access hint */ 384db64a461cb3442934afe43c83ed3f17f7c11c1dDouglas Gregor 394db64a461cb3442934afe43c83ed3f17f7c11c1dDouglas Gregor#define F_GETLK 14 400853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis#define F_SETLK 6 410853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis#define F_SETLKW 7 42521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar 431abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548Douglas Gregor#define F_SETOWN 24 /* for sockets. */ 44521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar#define F_GETOWN 23 /* for sockets. */ 45521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar 46521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar#ifndef __mips64 47521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar#define F_GETLK64 33 /* using 'struct flock64' */ 48521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar#define F_SETLK64 34 49521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar#define F_SETLKW64 35 50521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar#endif 51521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar 52521bf9c529e653ab28896d027352d3e16e2672d5Daniel Dunbar/* 530853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis * The flavours of struct flock. "struct flock" is the ABI compliant 54f96b524306ccfa623235d375deee79637bd38f29Steve Naroff * variant. Finally struct flock64 is the LFS variant of struct flock. As 5544c181aec37789f25f6c15543c164416f72e562aDouglas Gregor * a historic accident and inconsistence with the ABI definition it doesn't 560853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis * contain all the same fields as struct flock. 570853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis */ 580853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis 59788f5a1242c04762f91eaa7565c07b9865846d88Douglas Gregor#if _MIPS_SIM != _MIPS_SIM_ABI64 60788f5a1242c04762f91eaa7565c07b9865846d88Douglas Gregor 61788f5a1242c04762f91eaa7565c07b9865846d88Douglas Gregor#include <linux/types.h> 62788f5a1242c04762f91eaa7565c07b9865846d88Douglas Gregor 6328019772db70d4547be05a042eb950bc910f134fDouglas Gregorstruct flock { 64405634b215f19eec7183bd8005e34aa5a02f64a1Douglas Gregor short l_type; 65405634b215f19eec7183bd8005e34aa5a02f64a1Douglas Gregor short l_whence; 660853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis __kernel_off_t l_start; 670853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis __kernel_off_t l_len; 680853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis long l_sysid; 690853a02c3b04d96a3c432b883e403175c954cd81Argyrios Kyrtzidis __kernel_pid_t l_pid; 704ae8f298b1ea51b4c2234f9148e2e4349c9bdd23Douglas Gregor long pad[4]; 71914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor}; 72914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor 73914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor#define HAVE_ARCH_STRUCT_FLOCK 74914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor 75914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 76914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor 77914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor#include <asm-generic/fcntl.h> 78914ed9d30e9abf829a62aa996b083b1e47c19ff6Douglas Gregor 79807b06157a1a5c050520fc194d32f16d22d423a8Daniel Dunbar#endif /* _UAPI_ASM_FCNTL_H */ 80807b06157a1a5c050520fc194d32f16d22d423a8Daniel Dunbar