xref: /netbsd-src/sys/compat/linux/arch/powerpc/linux_fcntl.h (revision bf8fee7bf6b1cbbe98210059f99696da10ab8500)
1*bf8fee7bSnjoly /* $NetBSD: linux_fcntl.h,v 1.10 2014/06/25 16:30:42 njoly Exp $ */
23ec12572Smanu 
33ec12572Smanu /*-
43ec12572Smanu  * Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
53ec12572Smanu  * All rights reserved.
63ec12572Smanu  *
73ec12572Smanu  * This code is derived from software contributed to The NetBSD Foundation
83ec12572Smanu  * by Frank van der Linden, Eric Haszlakiewicz, and Emmanuel Dreyfus.
93ec12572Smanu  *
103ec12572Smanu  * Redistribution and use in source and binary forms, with or without
113ec12572Smanu  * modification, are permitted provided that the following conditions
123ec12572Smanu  * are met:
133ec12572Smanu  * 1. Redistributions of source code must retain the above copyright
143ec12572Smanu  *    notice, this list of conditions and the following disclaimer.
153ec12572Smanu  * 2. Redistributions in binary form must reproduce the above copyright
163ec12572Smanu  *    notice, this list of conditions and the following disclaimer in the
173ec12572Smanu  *    documentation and/or other materials provided with the distribution.
183ec12572Smanu  *
193ec12572Smanu  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
203ec12572Smanu  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
213ec12572Smanu  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
223ec12572Smanu  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
233ec12572Smanu  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
243ec12572Smanu  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
253ec12572Smanu  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
263ec12572Smanu  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
273ec12572Smanu  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
283ec12572Smanu  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
293ec12572Smanu  * POSSIBILITY OF SUCH DAMAGE.
303ec12572Smanu  */
313ec12572Smanu 
323ec12572Smanu /*
333ec12572Smanu  * Various flag values used in Linux for open(2) and fcntl(2).
343ec12572Smanu  */
353ec12572Smanu 
363ec12572Smanu #ifndef _POWERPC_LINUX_FCNTL_H
373ec12572Smanu #define _POWERPC_LINUX_FCNTL_H
383ec12572Smanu 
393ec12572Smanu /*
403ec12572Smanu  * read/write mode for open(2) are defined in common/linux_fcntl.h
413ec12572Smanu  */
423ec12572Smanu 
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
503ec12572Smanu #define LINUX_O_NDELAY		LINUX_O_NONBLOCK
51069ef5a4Schs #define LINUX_O_SYNC		0x01000
52069ef5a4Schs #define LINUX_FASYNC		0x02000
53069ef5a4Schs #define LINUX_O_DIRECTORY	0x04000
54*bf8fee7bSnjoly #define LINUX_O_NOFOLLOW	0x08000
55*bf8fee7bSnjoly #define LINUX_O_LARGEFILE	0x10000
56*bf8fee7bSnjoly #define LINUX_O_DIRECT		0x20000
57*bf8fee7bSnjoly #define LINUX_O_NOATIME		0x40000
58069ef5a4Schs #define LINUX_O_CLOEXEC		0x80000
593ec12572Smanu 
60069ef5a4Schs /* fcntl(2) operations */
613ec12572Smanu #define LINUX_F_DUPFD		0
623ec12572Smanu #define LINUX_F_GETFD		1
633ec12572Smanu #define LINUX_F_SETFD		2
643ec12572Smanu #define LINUX_F_GETFL		3
653ec12572Smanu #define LINUX_F_SETFL		4
663ec12572Smanu #define LINUX_F_GETLK		5
673ec12572Smanu #define LINUX_F_SETLK		6
683ec12572Smanu #define LINUX_F_SETLKW		7
693ec12572Smanu #define LINUX_F_SETOWN		8
703ec12572Smanu #define LINUX_F_GETOWN		9
713ec12572Smanu 
723ec12572Smanu #define LINUX_F_RDLCK		0
733ec12572Smanu #define LINUX_F_WRLCK		1
743ec12572Smanu #define LINUX_F_UNLCK		2
753ec12572Smanu 
763ec12572Smanu #define LINUX_LOCK_EX		4  /* F_EXLCK in Linux, and comment "or 3 " */
773ec12572Smanu #define LINUX_LOCK_SH		8  /* F_SHLCK in Linux, and comment "or 4'  */
783ec12572Smanu 
79238328fbSmanu #define LINUX_F_GETLK64		12
80238328fbSmanu #define LINUX_F_SETLK64		13
81238328fbSmanu #define LINUX_F_SETLKW64	14
82238328fbSmanu 
833ec12572Smanu #endif /* !_POWERPC_LINUX_FCNTL_H */
84