18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
48c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
58c2ecf20Sopenharmony_ci * for more details.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_FCNTL_H
108c2ecf20Sopenharmony_ci#define _UAPI_ASM_FCNTL_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <asm/sgidefs.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define O_APPEND	0x0008
158c2ecf20Sopenharmony_ci#define O_DSYNC		0x0010	/* used to be O_SYNC, see below */
168c2ecf20Sopenharmony_ci#define O_NONBLOCK	0x0080
178c2ecf20Sopenharmony_ci#define O_CREAT		0x0100	/* not fcntl */
188c2ecf20Sopenharmony_ci#define O_TRUNC		0x0200	/* not fcntl */
198c2ecf20Sopenharmony_ci#define O_EXCL		0x0400	/* not fcntl */
208c2ecf20Sopenharmony_ci#define O_NOCTTY	0x0800	/* not fcntl */
218c2ecf20Sopenharmony_ci#define FASYNC		0x1000	/* fcntl, for BSD compatibility */
228c2ecf20Sopenharmony_ci#define O_LARGEFILE	0x2000	/* allow large file opens */
238c2ecf20Sopenharmony_ci/*
248c2ecf20Sopenharmony_ci * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
258c2ecf20Sopenharmony_ci * the O_SYNC flag.  We continue to use the existing numerical value
268c2ecf20Sopenharmony_ci * for O_DSYNC semantics now, but using the correct symbolic name for it.
278c2ecf20Sopenharmony_ci * This new value is used to request true Posix O_SYNC semantics.  It is
288c2ecf20Sopenharmony_ci * defined in this strange way to make sure applications compiled against
298c2ecf20Sopenharmony_ci * new headers get at least O_DSYNC semantics on older kernels.
308c2ecf20Sopenharmony_ci *
318c2ecf20Sopenharmony_ci * This has the nice side-effect that we can simply test for O_DSYNC
328c2ecf20Sopenharmony_ci * wherever we do not care if O_DSYNC or O_SYNC is used.
338c2ecf20Sopenharmony_ci *
348c2ecf20Sopenharmony_ci * Note: __O_SYNC must never be used directly.
358c2ecf20Sopenharmony_ci */
368c2ecf20Sopenharmony_ci#define __O_SYNC	0x4000
378c2ecf20Sopenharmony_ci#define O_SYNC		(__O_SYNC|O_DSYNC)
388c2ecf20Sopenharmony_ci#define O_DIRECT	0x8000	/* direct disk access hint */
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define F_GETLK		14
418c2ecf20Sopenharmony_ci#define F_SETLK		6
428c2ecf20Sopenharmony_ci#define F_SETLKW	7
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define F_SETOWN	24	/*  for sockets. */
458c2ecf20Sopenharmony_ci#define F_GETOWN	23	/*  for sockets. */
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#ifndef __mips64
488c2ecf20Sopenharmony_ci#define F_GETLK64	33	/*  using 'struct flock64' */
498c2ecf20Sopenharmony_ci#define F_SETLK64	34
508c2ecf20Sopenharmony_ci#define F_SETLKW64	35
518c2ecf20Sopenharmony_ci#endif
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci/*
548c2ecf20Sopenharmony_ci * The flavours of struct flock.  "struct flock" is the ABI compliant
558c2ecf20Sopenharmony_ci * variant.  Finally struct flock64 is the LFS variant of struct flock.	 As
568c2ecf20Sopenharmony_ci * a historic accident and inconsistence with the ABI definition it doesn't
578c2ecf20Sopenharmony_ci * contain all the same fields as struct flock.
588c2ecf20Sopenharmony_ci */
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#if _MIPS_SIM != _MIPS_SIM_ABI64
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#include <linux/types.h>
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_cistruct flock {
658c2ecf20Sopenharmony_ci	short	l_type;
668c2ecf20Sopenharmony_ci	short	l_whence;
678c2ecf20Sopenharmony_ci	__kernel_off_t	l_start;
688c2ecf20Sopenharmony_ci	__kernel_off_t	l_len;
698c2ecf20Sopenharmony_ci	long	l_sysid;
708c2ecf20Sopenharmony_ci	__kernel_pid_t l_pid;
718c2ecf20Sopenharmony_ci	long	pad[4];
728c2ecf20Sopenharmony_ci};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#define HAVE_ARCH_STRUCT_FLOCK
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#include <asm-generic/fcntl.h>
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_FCNTL_H */
81