1/* Like <fcntl.h>, but with non-working flags defined to 0. 2 3 Copyright (C) 2006-2007 Free Software Foundation, Inc. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software Foundation, 17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 18 19/* written by Paul Eggert */ 20 21#ifndef _GL_FCNTL_H 22 23#include <sys/types.h> 24#include <sys/stat.h> 25#include <unistd.h> 26/* The include_next requires a split double-inclusion guard. */ 27#if @HAVE_INCLUDE_NEXT@ 28# include_next <fcntl.h> 29#else 30# include @ABSOLUTE_FCNTL_H@ 31#endif 32 33#ifndef _GL_FCNTL_H 34#define _GL_FCNTL_H 35 36 37/* Declare overridden functions. */ 38 39#ifdef __cplusplus 40extern "C" { 41#endif 42 43#ifdef FCHDIR_REPLACEMENT 44# define open rpl_open 45extern int open (const char *, int, ...); 46#endif 47 48#ifdef __cplusplus 49} 50#endif 51 52 53/* Fix up the O_* macros. */ 54 55#if !defined O_DIRECT && defined O_DIRECTIO 56/* Tru64 spells it `O_DIRECTIO'. */ 57# define O_DIRECT O_DIRECTIO 58#endif 59 60#ifndef O_DIRECT 61# define O_DIRECT 0 62#endif 63 64#ifndef O_DIRECTORY 65# define O_DIRECTORY 0 66#endif 67 68#ifndef O_DSYNC 69# define O_DSYNC 0 70#endif 71 72#ifndef O_NDELAY 73# define O_NDELAY 0 74#endif 75 76#ifndef O_NOATIME 77# define O_NOATIME 0 78#endif 79 80#ifndef O_NONBLOCK 81# define O_NONBLOCK O_NDELAY 82#endif 83 84#ifndef O_NOCTTY 85# define O_NOCTTY 0 86#endif 87 88#ifndef O_NOFOLLOW 89# define O_NOFOLLOW 0 90#endif 91 92#ifndef O_NOLINKS 93# define O_NOLINKS 0 94#endif 95 96#ifndef O_RSYNC 97# define O_RSYNC 0 98#endif 99 100#ifndef O_SYNC 101# define O_SYNC 0 102#endif 103 104/* For systems that distinguish between text and binary I/O. 105 O_BINARY is usually declared in fcntl.h */ 106#if !defined O_BINARY && defined _O_BINARY 107 /* For MSC-compatible compilers. */ 108# define O_BINARY _O_BINARY 109# define O_TEXT _O_TEXT 110#endif 111 112#ifdef __BEOS__ 113 /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ 114# undef O_BINARY 115# undef O_TEXT 116#endif 117 118#ifndef O_BINARY 119# define O_BINARY 0 120# define O_TEXT 0 121#endif 122 123 124#endif /* _GL_FCNTL_H */ 125#endif /* _GL_FCNTL_H */ 126