162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
462306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
562306a36Sopenharmony_ci * for more details.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci#ifndef _UAPI_ASM_FCNTL_H
1062306a36Sopenharmony_ci#define _UAPI_ASM_FCNTL_H
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <asm/sgidefs.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#define O_APPEND	0x0008
1562306a36Sopenharmony_ci#define O_DSYNC		0x0010	/* used to be O_SYNC, see below */
1662306a36Sopenharmony_ci#define O_NONBLOCK	0x0080
1762306a36Sopenharmony_ci#define O_CREAT		0x0100	/* not fcntl */
1862306a36Sopenharmony_ci#define O_TRUNC		0x0200	/* not fcntl */
1962306a36Sopenharmony_ci#define O_EXCL		0x0400	/* not fcntl */
2062306a36Sopenharmony_ci#define O_NOCTTY	0x0800	/* not fcntl */
2162306a36Sopenharmony_ci#define FASYNC		0x1000	/* fcntl, for BSD compatibility */
2262306a36Sopenharmony_ci#define O_LARGEFILE	0x2000	/* allow large file opens */
2362306a36Sopenharmony_ci/*
2462306a36Sopenharmony_ci * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
2562306a36Sopenharmony_ci * the O_SYNC flag.  We continue to use the existing numerical value
2662306a36Sopenharmony_ci * for O_DSYNC semantics now, but using the correct symbolic name for it.
2762306a36Sopenharmony_ci * This new value is used to request true Posix O_SYNC semantics.  It is
2862306a36Sopenharmony_ci * defined in this strange way to make sure applications compiled against
2962306a36Sopenharmony_ci * new headers get at least O_DSYNC semantics on older kernels.
3062306a36Sopenharmony_ci *
3162306a36Sopenharmony_ci * This has the nice side-effect that we can simply test for O_DSYNC
3262306a36Sopenharmony_ci * wherever we do not care if O_DSYNC or O_SYNC is used.
3362306a36Sopenharmony_ci *
3462306a36Sopenharmony_ci * Note: __O_SYNC must never be used directly.
3562306a36Sopenharmony_ci */
3662306a36Sopenharmony_ci#define __O_SYNC	0x4000
3762306a36Sopenharmony_ci#define O_SYNC		(__O_SYNC|O_DSYNC)
3862306a36Sopenharmony_ci#define O_DIRECT	0x8000	/* direct disk access hint */
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci#define F_GETLK		14
4162306a36Sopenharmony_ci#define F_SETLK		6
4262306a36Sopenharmony_ci#define F_SETLKW	7
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#define F_SETOWN	24	/*  for sockets. */
4562306a36Sopenharmony_ci#define F_GETOWN	23	/*  for sockets. */
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
4862306a36Sopenharmony_ci#define F_GETLK64	33	/*  using 'struct flock64' */
4962306a36Sopenharmony_ci#define F_SETLK64	34
5062306a36Sopenharmony_ci#define F_SETLKW64	35
5162306a36Sopenharmony_ci#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#if _MIPS_SIM != _MIPS_SIM_ABI64
5462306a36Sopenharmony_ci#define __ARCH_FLOCK_EXTRA_SYSID	long l_sysid;
5562306a36Sopenharmony_ci#define __ARCH_FLOCK_PAD		long pad[4];
5662306a36Sopenharmony_ci#endif
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#include <asm-generic/fcntl.h>
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci#endif /* _UAPI_ASM_FCNTL_H */
61