home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / g / gtak212.zip / 1.10 / open3.h < prev    next >
C/C++ Source or Header  |  1992-09-02  |  3KB  |  90 lines

  1. /*****************************************************************************
  2.  * $Id: open3.h,v 1.2 1992/09/02 20:08:28 ak Exp $
  3.  *****************************************************************************
  4.  * $Log: open3.h,v $
  5.  * Revision 1.2  1992/09/02  20:08:28  ak
  6.  * Version AK200
  7.  * - Tape access
  8.  * - Quick file access
  9.  * - OS/2 extended attributes
  10.  * - Some OS/2 fixes
  11.  * - Some fixes of Kai Uwe Rommel
  12.  *
  13.  * Revision 1.1.1.1  1992/09/02  19:22:11  ak
  14.  * Original GNU Tar 1.10 with some filenames changed for FAT compatibility.
  15.  *
  16.  * Revision 1.1  1992/09/02  19:22:09  ak
  17.  * Initial revision
  18.  *
  19.  *****************************************************************************/
  20.  
  21. /* Defines for Sys V style 3-argument open call.
  22.    Copyright (C) 1988 Free Software Foundation
  23.  
  24. This file is part of GNU Tar.
  25.  
  26. GNU Tar is free software; you can redistribute it and/or modify
  27. it under the terms of the GNU General Public License as published by
  28. the Free Software Foundation; either version 1, or (at your option)
  29. any later version.
  30.  
  31. GNU Tar is distributed in the hope that it will be useful,
  32. but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  34. GNU General Public License for more details.
  35.  
  36. You should have received a copy of the GNU General Public License
  37. along with GNU Tar; see the file COPYING.  If not, write to
  38. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  39.  
  40. /*
  41.  * @(#)open3.h 1.4 87/11/11
  42.  *
  43.  * open3.h -- #defines for the various flags for the Sys V style 3-argument
  44.  * open() call.  On BSD or System 5, the system already has this in an
  45.  * include file.  This file is needed for V7 and MINIX systems for the
  46.  * benefit of open3() in port.c, a routine that emulates the 3-argument
  47.  * call using system calls available on V7/MINIX. 
  48.  *
  49.  * This file is needed by PD tar even if we aren't using the
  50.  * emulator, since the #defines for O_WRONLY, etc. are used in
  51.  * a couple of places besides the open() calls, (e.g. in the assignment
  52.  * to openflag in extract.c).  We just #include this rather than
  53.  * #ifdef them out.
  54.  *
  55.  * Written 6/10/87 by rmtodd@uokmax (Richard Todd).
  56.  *
  57.  * The names have been changed by John Gilmore, 31 July 1987, since
  58.  * Richard called it "bsdopen", and really this change was introduced in
  59.  * AT&T Unix systems before BSD picked it up.
  60.  */
  61.  
  62. /* Only one of the next three should be specified */
  63. #define O_RDONLY     0 /* only allow read */
  64. #define    O_WRONLY     1 /* only allow write */
  65. #define    O_RDWR         2 /* both are allowed */
  66.  
  67. /* The rest of these can be OR-ed in to the above. */
  68. /*
  69.  * O_NDELAY isn't implemented by the emulator.  It's only useful (to tar) on
  70.  * systems that have named pipes anyway; it prevents tar's hanging by
  71.  * opening a named pipe.  We #ifndef it because some systems already have
  72.  * it defined.
  73.  */
  74. #ifndef O_NDELAY
  75. #define O_NDELAY     4 /* don't block on opening devices that would
  76.                 * block on open -- ignored by emulator. */
  77. #endif
  78. #define O_CREAT         8 /* create file if needed */
  79. #define O_EXCL        16 /* file cannot already exist */
  80. #define O_TRUNC        32 /* truncate file on open */
  81. #define O_APPEND    64 /* always write at end of file -- ignored by emul */
  82.  
  83. #ifdef EMUL_OPEN3
  84. /*
  85.  * make emulation transparent to rest of file -- redirect all open() calls
  86.  * to our routine
  87.  */
  88. #define open    open3
  89. #endif
  90.