18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef _SPARC_FCNTL_H
38c2ecf20Sopenharmony_ci#define _SPARC_FCNTL_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define O_APPEND	0x0008
68c2ecf20Sopenharmony_ci#define FASYNC		0x0040	/* fcntl, for BSD compatibility */
78c2ecf20Sopenharmony_ci#define O_CREAT		0x0200	/* not fcntl */
88c2ecf20Sopenharmony_ci#define O_TRUNC		0x0400	/* not fcntl */
98c2ecf20Sopenharmony_ci#define O_EXCL		0x0800	/* not fcntl */
108c2ecf20Sopenharmony_ci#define O_DSYNC		0x2000	/* used to be O_SYNC, see below */
118c2ecf20Sopenharmony_ci#define O_NONBLOCK	0x4000
128c2ecf20Sopenharmony_ci#if defined(__sparc__) && defined(__arch64__)
138c2ecf20Sopenharmony_ci#define O_NDELAY	0x0004
148c2ecf20Sopenharmony_ci#else
158c2ecf20Sopenharmony_ci#define O_NDELAY	(0x0004 | O_NONBLOCK)
168c2ecf20Sopenharmony_ci#endif
178c2ecf20Sopenharmony_ci#define O_NOCTTY	0x8000	/* not fcntl */
188c2ecf20Sopenharmony_ci#define O_LARGEFILE	0x40000
198c2ecf20Sopenharmony_ci#define O_DIRECT        0x100000 /* direct disk access hint */
208c2ecf20Sopenharmony_ci#define O_NOATIME	0x200000
218c2ecf20Sopenharmony_ci#define O_CLOEXEC	0x400000
228c2ecf20Sopenharmony_ci/*
238c2ecf20Sopenharmony_ci * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
248c2ecf20Sopenharmony_ci * the O_SYNC flag.  We continue to use the existing numerical value
258c2ecf20Sopenharmony_ci * for O_DSYNC semantics now, but using the correct symbolic name for it.
268c2ecf20Sopenharmony_ci * This new value is used to request true Posix O_SYNC semantics.  It is
278c2ecf20Sopenharmony_ci * defined in this strange way to make sure applications compiled against
288c2ecf20Sopenharmony_ci * new headers get at least O_DSYNC semantics on older kernels.
298c2ecf20Sopenharmony_ci *
308c2ecf20Sopenharmony_ci * This has the nice side-effect that we can simply test for O_DSYNC
318c2ecf20Sopenharmony_ci * wherever we do not care if O_DSYNC or O_SYNC is used.
328c2ecf20Sopenharmony_ci *
338c2ecf20Sopenharmony_ci * Note: __O_SYNC must never be used directly.
348c2ecf20Sopenharmony_ci */
358c2ecf20Sopenharmony_ci#define __O_SYNC	0x800000
368c2ecf20Sopenharmony_ci#define O_SYNC		(__O_SYNC|O_DSYNC)
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define O_PATH		0x1000000
398c2ecf20Sopenharmony_ci#define __O_TMPFILE	0x2000000
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define F_GETOWN	5	/*  for sockets. */
428c2ecf20Sopenharmony_ci#define F_SETOWN	6	/*  for sockets. */
438c2ecf20Sopenharmony_ci#define F_GETLK		7
448c2ecf20Sopenharmony_ci#define F_SETLK		8
458c2ecf20Sopenharmony_ci#define F_SETLKW	9
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/* for posix fcntl() and lockf() */
488c2ecf20Sopenharmony_ci#define F_RDLCK		1
498c2ecf20Sopenharmony_ci#define F_WRLCK		2
508c2ecf20Sopenharmony_ci#define F_UNLCK		3
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define __ARCH_FLOCK_PAD	short __unused;
538c2ecf20Sopenharmony_ci#define __ARCH_FLOCK64_PAD	short __unused;
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci#include <asm-generic/fcntl.h>
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#endif
58