linux_file.h revision 293542
1177997Skib/*- 2177997Skib * Copyright (c) 2007 Roman Divacky 3177997Skib * All rights reserved. 4177997Skib * 5177997Skib * Redistribution and use in source and binary forms, with or without 6177997Skib * modification, are permitted provided that the following conditions 7177997Skib * are met: 8177997Skib * 1. Redistributions of source code must retain the above copyright 9177997Skib * notice, this list of conditions and the following disclaimer. 10177997Skib * 2. Redistributions in binary form must reproduce the above copyright 11177997Skib * notice, this list of conditions and the following disclaimer in the 12177997Skib * documentation and/or other materials provided with the distribution. 13177997Skib * 14177997Skib * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15177997Skib * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16177997Skib * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17177997Skib * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18177997Skib * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19177997Skib * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20177997Skib * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21177997Skib * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22177997Skib * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23177997Skib * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24177997Skib * SUCH DAMAGE. 25177997Skib * 26177997Skib * $FreeBSD: stable/10/sys/compat/linux/linux_file.h 293542 2016-01-09 16:32:35Z dchagin $ 27177997Skib */ 28177997Skib 29177997Skib#ifndef _LINUX_FILE_H_ 30177997Skib#define _LINUX_FILE_H_ 31177997Skib 32177997Skib#define LINUX_AT_FDCWD -100 33177997Skib#define LINUX_AT_SYMLINK_NOFOLLOW 0x100 34227693Sed#define LINUX_AT_EACCESS 0x200 35177997Skib#define LINUX_AT_REMOVEDIR 0x200 36227693Sed#define LINUX_AT_SYMLINK_FOLLOW 0x400 37177997Skib 38246085Sjhb/* 39246085Sjhb * posix_fadvise advice 40246085Sjhb */ 41246085Sjhb#define LINUX_POSIX_FADV_NORMAL 0 42246085Sjhb#define LINUX_POSIX_FADV_RANDOM 1 43246085Sjhb#define LINUX_POSIX_FADV_SEQUENTIAL 2 44246085Sjhb#define LINUX_POSIX_FADV_WILLNEED 3 45246085Sjhb#define LINUX_POSIX_FADV_DONTNEED 4 46246085Sjhb#define LINUX_POSIX_FADV_NOREUSE 5 47246085Sjhb 48246085Sjhb/* 49246085Sjhb * mount flags 50246085Sjhb */ 51246085Sjhb#define LINUX_MS_RDONLY 0x0001 52246085Sjhb#define LINUX_MS_NOSUID 0x0002 53246085Sjhb#define LINUX_MS_NODEV 0x0004 54246085Sjhb#define LINUX_MS_NOEXEC 0x0008 55246085Sjhb#define LINUX_MS_REMOUNT 0x0020 56246085Sjhb 57293541Sdchagin/* 58293541Sdchagin * common open/fcntl flags 59293541Sdchagin */ 60293541Sdchagin#define LINUX_O_RDONLY 00000000 61293541Sdchagin#define LINUX_O_WRONLY 00000001 62293541Sdchagin#define LINUX_O_RDWR 00000002 63293541Sdchagin#define LINUX_O_ACCMODE 00000003 64293541Sdchagin#define LINUX_O_CREAT 00000100 65293541Sdchagin#define LINUX_O_EXCL 00000200 66293541Sdchagin#define LINUX_O_NOCTTY 00000400 67293541Sdchagin#define LINUX_O_TRUNC 00001000 68293541Sdchagin#define LINUX_O_APPEND 00002000 69293541Sdchagin#define LINUX_O_NONBLOCK 00004000 70293541Sdchagin#define LINUX_O_NDELAY LINUX_O_NONBLOCK 71293541Sdchagin#define LINUX_O_SYNC 00010000 72293541Sdchagin#define LINUX_FASYNC 00020000 73293541Sdchagin#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */ 74293541Sdchagin#define LINUX_O_LARGEFILE 00100000 75293541Sdchagin#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */ 76293541Sdchagin#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */ 77293541Sdchagin#define LINUX_O_NOATIME 01000000 78293541Sdchagin#define LINUX_O_CLOEXEC 02000000 79293541Sdchagin 80293541Sdchagin#define LINUX_F_DUPFD 0 81293541Sdchagin#define LINUX_F_GETFD 1 82293541Sdchagin#define LINUX_F_SETFD 2 83293541Sdchagin#define LINUX_F_GETFL 3 84293541Sdchagin#define LINUX_F_SETFL 4 85293541Sdchagin#ifndef LINUX_F_GETLK 86293541Sdchagin#define LINUX_F_GETLK 5 87293541Sdchagin#define LINUX_F_SETLK 6 88293541Sdchagin#define LINUX_F_SETLKW 7 89293541Sdchagin#endif 90293541Sdchagin#ifndef LINUX_F_SETOWN 91293541Sdchagin#define LINUX_F_SETOWN 8 92293541Sdchagin#define LINUX_F_GETOWN 9 93293541Sdchagin#endif 94293542Sdchagin#ifndef LINUX_F_SETSIG 95293542Sdchagin#define LINUX_F_SETSIG 10 96293542Sdchagin#define LINUX_F_GETSIG 11 97293542Sdchagin#endif 98293542Sdchagin#ifndef LINUX_F_SETOWN_EX 99293542Sdchagin#define LINUX_F_SETOWN_EX 15 100293542Sdchagin#define LINUX_F_GETOWN_EX 16 101293542Sdchagin#define LINUX_F_GETOWNER_UIDS 17 102293542Sdchagin#endif 103293541Sdchagin 104293542Sdchagin#define LINUX_F_SPECIFIC_BASE 1024 105293542Sdchagin 106293542Sdchagin#define LINUX_F_SETLEASE (LINUX_F_SPECIFIC_BASE + 0) 107293542Sdchagin#define LINUX_F_GETLEASE (LINUX_F_SPECIFIC_BASE + 1) 108293542Sdchagin#define LINUX_F_CANCELLK (LINUX_F_SPECIFIC_BASE + 5) 109293542Sdchagin#define LINUX_F_DUPFD_CLOEXEC (LINUX_F_SPECIFIC_BASE + 6) 110293542Sdchagin#define LINUX_F_NOTIFY (LINUX_F_SPECIFIC_BASE + 2) 111293542Sdchagin#define LINUX_F_SETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 7) 112293542Sdchagin#define LINUX_F_GETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 8) 113293542Sdchagin 114293542Sdchagin#define LINUX_F_GETLKP 36 115293542Sdchagin#define LINUX_F_SETLKP 37 116293542Sdchagin#define LINUX_F_SETLKPW 38 117293542Sdchagin 118293542Sdchagin#define LINUX_F_OWNER_TID 0 119293542Sdchagin#define LINUX_F_OWNER_PID 1 120293542Sdchagin#define LINUX_F_OWNER_PGRP 2 121293542Sdchagin 122293541Sdchagin#ifndef LINUX_F_RDLCK 123293541Sdchagin#define LINUX_F_RDLCK 0 124293541Sdchagin#define LINUX_F_WRLCK 1 125293541Sdchagin#define LINUX_F_UNLCK 2 126293541Sdchagin#endif 127293541Sdchagin 128177997Skib#endif /* !_LINUX_FILE_H_ */ 129