home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / include / fctldefs.h < prev    next >
C/C++ Source or Header  |  2000-12-16  |  2KB  |  74 lines

  1. /* @(#)fctldefs.h    1.8 00/12/17 Copyright 1996 J. Schilling */
  2. /*
  3.  *    Generic header for users of open(), creat() and chmod()
  4.  *
  5.  *    Copyright (c) 1996 J. Schilling
  6.  */
  7. /*
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 2, or (at your option)
  11.  * any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; see the file COPYING.  If not, write to
  20.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23. #ifndef _FCTLDEFS_H
  24. #define    _FCTLDEFS_H
  25.  
  26. #ifndef    _MCONFIG_H
  27. #include <mconfig.h>
  28. #endif
  29.  
  30. #ifndef    _INCL_SYS_TYPES_H
  31. #include <sys/types.h>        /* Needed for sys/stat.h        */
  32. #define    _INCL_SYS_TYPES_H
  33. #endif
  34. #ifndef    _INCL_SYS_STAT_H
  35. #include <sys/stat.h>        /* For 3rd arg of open() and chmod()    */
  36. #define    _INCL_SYS_STAT_H
  37. #endif
  38.  
  39. #ifdef    HAVE_SYS_FILE_H
  40. /*
  41.  * Historical systems with flock() only need sys/file.h
  42.  */
  43. #    include <sys/file.h>
  44. #endif
  45. #ifdef    HAVE_FCNTL_H
  46. #    include <fcntl.h>
  47. #endif
  48.  
  49. /*
  50.  * Do not define more than O_RDONLY / O_WRONLY / O_RDWR / O_BINARY
  51.  * The values may differ.
  52.  *
  53.  * O_BINARY is defined here to allow all applications to compile on a non DOS
  54.  * environment without repeating this definition.
  55.  */
  56. #ifndef    O_RDONLY
  57. #    define    O_RDONLY    0
  58. #endif
  59. #ifndef    O_WRONLY
  60. #    define    O_WRONLY    1
  61. #endif
  62. #ifndef    O_RDWR
  63. #    define    O_RDWR        2
  64. #endif
  65. #ifndef    O_BINARY            /* Only present on DOS or similar */
  66. #    define    O_BINARY    0
  67. #endif
  68.  
  69. #ifndef    O_ACCMODE
  70. #define    O_ACCMODE        (R_RDONLY|O_WRONLY|O_RDWR)
  71. #endif
  72.  
  73. #endif    /* _FCTLDEFS_H */
  74.