18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef _ALPHA_FCNTL_H
38c2ecf20Sopenharmony_ci#define _ALPHA_FCNTL_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define O_CREAT		 01000	/* not fcntl */
68c2ecf20Sopenharmony_ci#define O_TRUNC		 02000	/* not fcntl */
78c2ecf20Sopenharmony_ci#define O_EXCL		 04000	/* not fcntl */
88c2ecf20Sopenharmony_ci#define O_NOCTTY	010000	/* not fcntl */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#define O_NONBLOCK	 00004
118c2ecf20Sopenharmony_ci#define O_APPEND	 00010
128c2ecf20Sopenharmony_ci#define O_DSYNC		040000	/* used to be O_SYNC, see below */
138c2ecf20Sopenharmony_ci#define O_DIRECTORY	0100000	/* must be a directory */
148c2ecf20Sopenharmony_ci#define O_NOFOLLOW	0200000 /* don't follow links */
158c2ecf20Sopenharmony_ci#define O_LARGEFILE	0400000 /* will be set by the kernel on every open */
168c2ecf20Sopenharmony_ci#define O_DIRECT	02000000 /* direct disk access - should check with OSF/1 */
178c2ecf20Sopenharmony_ci#define O_NOATIME	04000000
188c2ecf20Sopenharmony_ci#define O_CLOEXEC	010000000 /* set close_on_exec */
198c2ecf20Sopenharmony_ci/*
208c2ecf20Sopenharmony_ci * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
218c2ecf20Sopenharmony_ci * the O_SYNC flag.  We continue to use the existing numerical value
228c2ecf20Sopenharmony_ci * for O_DSYNC semantics now, but using the correct symbolic name for it.
238c2ecf20Sopenharmony_ci * This new value is used to request true Posix O_SYNC semantics.  It is
248c2ecf20Sopenharmony_ci * defined in this strange way to make sure applications compiled against
258c2ecf20Sopenharmony_ci * new headers get at least O_DSYNC semantics on older kernels.
268c2ecf20Sopenharmony_ci *
278c2ecf20Sopenharmony_ci * This has the nice side-effect that we can simply test for O_DSYNC
288c2ecf20Sopenharmony_ci * wherever we do not care if O_DSYNC or O_SYNC is used.
298c2ecf20Sopenharmony_ci *
308c2ecf20Sopenharmony_ci * Note: __O_SYNC must never be used directly.
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci#define __O_SYNC	020000000
338c2ecf20Sopenharmony_ci#define O_SYNC		(__O_SYNC|O_DSYNC)
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define O_PATH		040000000
368c2ecf20Sopenharmony_ci#define __O_TMPFILE	0100000000
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define F_GETLK		7
398c2ecf20Sopenharmony_ci#define F_SETLK		8
408c2ecf20Sopenharmony_ci#define F_SETLKW	9
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define F_SETOWN	5	/*  for sockets. */
438c2ecf20Sopenharmony_ci#define F_GETOWN	6	/*  for sockets. */
448c2ecf20Sopenharmony_ci#define F_SETSIG	10	/*  for sockets. */
458c2ecf20Sopenharmony_ci#define F_GETSIG	11	/*  for sockets. */
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		8
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci/* for old implementation of bsd flock () */
538c2ecf20Sopenharmony_ci#define F_EXLCK		16	/* or 3 */
548c2ecf20Sopenharmony_ci#define F_SHLCK		32	/* or 4 */
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#include <asm-generic/fcntl.h>
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#endif
59