BSD 4_3 release
[unix-history] / usr / src / include / fcntl.h
index 3813570..5fd458f 100644 (file)
@@ -1,14 +1,24 @@
-/*     fcntl.h 4.2     83/09/25        */
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)fcntl.h     5.2 (Berkeley) 1/8/86
+ */
 
 /*
 
 /*
- * Flag values accessible to open(2) and fcntl(2)
- *  (The first three can only be set by open)
+ * Flag values accessible to open(2) and fcntl(2)-- copied from
+ * <sys/file.h>.  (The first three can only be set by open.)
  */
  */
-#define        O_RDONLY        0
-#define        O_WRONLY        1
-#define        O_RDWR          2
-#define        O_NDELAY        FNDELAY /* Non-blocking I/O */
-#define        O_APPEND        FAPPEND /* append (writes guaranteed at the end) */
+#define        O_RDONLY        000             /* open for reading */
+#define        O_WRONLY        001             /* open for writing */
+#define        O_RDWR          002             /* open for read & write */
+#define        O_NDELAY        FNDELAY         /* non-blocking open */
+                                       /* really non-blocking I/O for fcntl */
+#define        O_APPEND        FAPPEND         /* append on each write */
+#define        O_CREAT         FCREAT          /* open with file create */
+#define        O_TRUNC         FTRUNC          /* open with truncation */
+#define        O_EXCL          FEXCL           /* error on create if file exists */
 
 #ifndef        F_DUPFD
 /* fcntl(2) requests */
 
 #ifndef        F_DUPFD
 /* fcntl(2) requests */
@@ -24,4 +34,7 @@
 #define        FNDELAY         00004           /* non-blocking reads */
 #define        FAPPEND         00010           /* append on each write */
 #define        FASYNC          00100           /* signal pgrp when data ready */
 #define        FNDELAY         00004           /* non-blocking reads */
 #define        FAPPEND         00010           /* append on each write */
 #define        FASYNC          00100           /* signal pgrp when data ready */
+#define        FCREAT          01000           /* create if nonexistant */
+#define        FTRUNC          02000           /* truncate to zero length */
+#define        FEXCL           04000           /* error if already created */
 #endif
 #endif