xref: /netbsd-src/sys/compat/linux/arch/amd64/linux_fcntl.h (revision 21709ad01db1a91e3c201ed96d7d83992cdf0208)
1*21709ad0Sriastradh /*	$NetBSD: linux_fcntl.h,v 1.6 2024/10/01 16:35:42 riastradh Exp $ */
289647c7cSmanu 
389647c7cSmanu /*-
489647c7cSmanu  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
589647c7cSmanu  *
689647c7cSmanu  * Redistribution and use in source and binary forms, with or without
789647c7cSmanu  * modification, are permitted provided that the following conditions
889647c7cSmanu  * are met:
989647c7cSmanu  * 1. Redistributions of source code must retain the above copyright
1089647c7cSmanu  *    notice, this list of conditions and the following disclaimer.
1189647c7cSmanu  * 2. Redistributions in binary form must reproduce the above copyright
1289647c7cSmanu  *    notice, this list of conditions and the following disclaimer in the
1389647c7cSmanu  *    documentation and/or other materials provided with the distribution.
1489647c7cSmanu  * 3. All advertising materials mentioning features or use of this software
1589647c7cSmanu  *    must display the following acknowledgement:
1689647c7cSmanu  *	This product includes software developed by Emmanuel Dreyfus
1789647c7cSmanu  * 4. The name of the author may not be used to endorse or promote
1889647c7cSmanu  *    products derived from this software without specific prior written
1989647c7cSmanu  *    permission.
2089647c7cSmanu  *
2189647c7cSmanu  * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS''
2289647c7cSmanu  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
2389647c7cSmanu  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2489647c7cSmanu  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
2589647c7cSmanu  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2689647c7cSmanu  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2789647c7cSmanu  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2889647c7cSmanu  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2989647c7cSmanu  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3089647c7cSmanu  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3189647c7cSmanu  * POSSIBILITY OF SUCH DAMAGE.
3289647c7cSmanu  */
3389647c7cSmanu 
34069ef5a4Schs /*
35069ef5a4Schs  * Various flag values used in Linux for open(2) and fcntl(2).
36069ef5a4Schs  */
37069ef5a4Schs 
3889647c7cSmanu #ifndef _AMD64_LINUX_FCNTL_H
3989647c7cSmanu #define _AMD64_LINUX_FCNTL_H
4089647c7cSmanu 
41069ef5a4Schs /* read/write mode for open(2) defined in common/linux_fcntl.h */
42069ef5a4Schs 
43069ef5a4Schs /* flags used in open(2) */
44069ef5a4Schs #define LINUX_O_CREAT		0x00040
45069ef5a4Schs #define LINUX_O_EXCL		0x00080
46069ef5a4Schs #define LINUX_O_NOCTTY		0x00100
47069ef5a4Schs #define LINUX_O_TRUNC		0x00200
48069ef5a4Schs #define LINUX_O_APPEND		0x00400
49069ef5a4Schs #define LINUX_O_NONBLOCK	0x00800
50069ef5a4Schs #define LINUX_O_NDELAY		LINUX_O_NONBLOCK
51069ef5a4Schs #define LINUX_O_SYNC		0x01000
52069ef5a4Schs #define LINUX_FASYNC		0x02000
53bf8fee7bSnjoly #define LINUX_O_DIRECT		0x04000
54bf8fee7bSnjoly #define LINUX_O_LARGEFILE	0x08000
5538b9dc35Schs #define LINUX_O_DIRECTORY	0x10000
56bf8fee7bSnjoly #define LINUX_O_NOFOLLOW	0x20000
57bf8fee7bSnjoly #define LINUX_O_NOATIME		0x40000
58069ef5a4Schs #define LINUX_O_CLOEXEC		0x80000
5989647c7cSmanu 
60069ef5a4Schs /* fcntl(2) operations */
6189647c7cSmanu #define LINUX_F_DUPFD		0
6289647c7cSmanu #define LINUX_F_GETFD		1
6389647c7cSmanu #define LINUX_F_SETFD		2
6489647c7cSmanu #define LINUX_F_GETFL		3
6589647c7cSmanu #define LINUX_F_SETFL		4
6689647c7cSmanu #define LINUX_F_GETLK		5
6789647c7cSmanu #define LINUX_F_SETLK		6
6889647c7cSmanu #define LINUX_F_SETLKW		7
6989647c7cSmanu #define LINUX_F_SETOWN		8
7089647c7cSmanu #define LINUX_F_GETOWN		9
7189647c7cSmanu #define LINUX_F_GETLK64		12
7289647c7cSmanu #define LINUX_F_SETLK64		13
7389647c7cSmanu #define LINUX_F_SETLKW64	14
7489647c7cSmanu 
75069ef5a4Schs #define LINUX_F_RDLCK		0
76069ef5a4Schs #define LINUX_F_WRLCK		1
77069ef5a4Schs #define LINUX_F_UNLCK		2
78069ef5a4Schs 
7989647c7cSmanu #endif /* !_AMD64_LINUX_FCNTL_H */
80