linux_fcntl.h revision 1.7
11.7Schs/* $NetBSD: linux_fcntl.h,v 1.7 2010/11/02 18:01:26 chs Exp $ */ 21.1Smanu 31.1Smanu/*- 41.1Smanu * Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc. 51.1Smanu * All rights reserved. 61.1Smanu * 71.1Smanu * This code is derived from software contributed to The NetBSD Foundation 81.1Smanu * by Frank van der Linden, Eric Haszlakiewicz, and Emmanuel Dreyfus. 91.1Smanu * 101.1Smanu * Redistribution and use in source and binary forms, with or without 111.1Smanu * modification, are permitted provided that the following conditions 121.1Smanu * are met: 131.1Smanu * 1. Redistributions of source code must retain the above copyright 141.1Smanu * notice, this list of conditions and the following disclaimer. 151.1Smanu * 2. Redistributions in binary form must reproduce the above copyright 161.1Smanu * notice, this list of conditions and the following disclaimer in the 171.1Smanu * documentation and/or other materials provided with the distribution. 181.1Smanu * 191.1Smanu * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 201.1Smanu * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 211.1Smanu * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 221.1Smanu * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 231.1Smanu * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 241.1Smanu * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 251.1Smanu * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 261.1Smanu * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 271.1Smanu * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 281.1Smanu * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 291.1Smanu * POSSIBILITY OF SUCH DAMAGE. 301.1Smanu */ 311.1Smanu 321.1Smanu/* 331.1Smanu * Various flag values used in Linux for open(2) and fcntl(2). 341.1Smanu */ 351.1Smanu 361.1Smanu#ifndef _MIPS_LINUX_FCNTL_H 371.1Smanu#define _MIPS_LINUX_FCNTL_H 381.1Smanu 391.3Sperry/* 401.1Smanu * read/write mode for open(2) are defined in common/linux_fcntl.h 411.1Smanu */ 421.1Smanu 431.7Schs/* flags used in open(2) */ 441.7Schs#define LINUX_O_APPEND 0x00008 451.7Schs#define LINUX_O_SYNC 0x00010 461.7Schs#define LINUX_O_NONBLOCK 0x00080 471.1Smanu#define LINUX_O_NDELAY LINUX_O_NONBLOCK 481.7Schs#define LINUX_O_CREAT 0x00100 491.7Schs#define LINUX_O_TRUNC 0x00200 501.7Schs#define LINUX_O_EXCL 0x00400 511.7Schs#define LINUX_O_NOCTTY 0x00800 521.7Schs#define LINUX_FASYNC 0x01000 531.6Schs#define LINUX_O_DIRECTORY 0x10000 541.7Schs#define LINUX_O_CLOEXEC 0x80000 551.1Smanu 561.7Schs/* fcntl(2) operations */ 571.1Smanu#define LINUX_F_DUPFD 0 581.1Smanu#define LINUX_F_GETFD 1 591.1Smanu#define LINUX_F_SETFD 2 601.1Smanu#define LINUX_F_GETFL 3 611.1Smanu#define LINUX_F_SETFL 4 621.1Smanu#define LINUX_F_GETLK 14 631.1Smanu#define LINUX_F_SETLK 6 641.1Smanu#define LINUX_F_SETLKW 7 651.1Smanu#define LINUX_F_SETOWN 24 661.1Smanu#define LINUX_F_GETOWN 23 671.1Smanu 681.1Smanu#define LINUX_F_RDLCK 0 691.1Smanu#define LINUX_F_WRLCK 1 701.1Smanu#define LINUX_F_UNLCK 2 711.1Smanu 721.1Smanu#define LINUX_LOCK_EX 4 /* F_EXLCK in Linux, and comment "or 3 " */ 731.1Smanu#define LINUX_LOCK_SH 8 /* F_SHLCK in Linux, and comment "or 4' */ 741.2Smanu 751.2Smanu#define LINUX_F_GETLK64 33 761.2Smanu#define LINUX_F_SETLK64 34 771.2Smanu#define LINUX_F_SETLKW64 35 781.1Smanu 791.1Smanu#endif /* !_MIPS_LINUX_FCNTL_H */ 80