xref: /netbsd-src/sys/compat/linux/arch/aarch64/linux_fcntl.h (revision abbc8a65e23054d25cf7067e2df63d999881954c)
1 /*	$NetBSD: linux_fcntl.h,v 1.1 2021/09/23 06:56:27 ryo Exp $	*/
2 
3 /*-
4  * Copyright (c) 2021 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _AARCH64_LINUX_FCNTL_H
30 #define _AARCH64_LINUX_FCNTL_H
31 
32 #define LINUX_O_CREAT		0x00000040
33 #define LINUX_O_EXCL		0x00000080
34 #define LINUX_O_NOCTTY		0x00000100
35 #define LINUX_O_TRUNC		0x00000200
36 #define LINUX_O_APPEND		0x00000400
37 #define LINUX_O_NONBLOCK	0x00000800
38 #define LINUX_O_NDELAY		LINUX_O_NONBLOCK
39 #define LINUX_O_SYNC		0x00001000
40 #define LINUX_FASYNC		0x00002000
41 #define LINUX_O_DIRECTORY	0x00004000
42 #define LINUX_O_NOFOLLOW	0x00008000
43 #define LINUX_O_DIRECT		0x00010000
44 #define LINUX_O_NOATIME		0x00040000
45 #define LINUX_O_CLOEXEC 	0x00080000
46 
47 #define LINUX_F_DUPFD		0
48 #define LINUX_F_GETFD		1
49 #define LINUX_F_SETFD		2
50 #define LINUX_F_GETFL		3
51 #define LINUX_F_SETFL		4
52 #define LINUX_F_GETLK		5
53 #define LINUX_F_GETLK64 	LINUX_F_GETLK
54 #define LINUX_F_SETLK		6
55 #define LINUX_F_SETLK64 	LINUX_F_SETLK
56 #define LINUX_F_SETLKW		7
57 #define LINUX_F_SETLKW64	LINUX_F_SETLKW
58 #define LINUX_F_SETOWN		8
59 #define LINUX_F_GETOWN		9
60 
61 #define LINUX_F_RDLCK		0
62 #define LINUX_F_WRLCK		1
63 #define LINUX_F_UNLCK		2
64 #define LINUX_F_EXLCK		4
65 #define LINUX_F_SHLCK		8
66 
67 #define LINUX_LOCK_SH		0x00000001
68 #define LINUX_LOCK_EX		0x00000002
69 #define LINUX_LOCK_NB		0x00000004
70 #define LINUX_LOCK_UN		0x00000008
71 
72 #endif /* !_AARCH64_LINUX_FCNTL_H */
73