xref: /original-bsd/sys/sys/fcntl.h (revision 6aad6cb2)
1 /*	fcntl.h	4.3	85/05/22	*/
2 
3 /*
4  * Flag values accessible to open(2) and fcntl(2)
5  *  (The first three can only be set by open)
6  */
7 #define	O_RDONLY	0
8 #define	O_WRONLY	1
9 #define	O_RDWR		2
10 #define	O_NDELAY	FNDELAY	/* Non-blocking I/O */
11 #define	O_APPEND	FAPPEND	/* append (writes guaranteed at the end) */
12 #define	O_CREAT		FCREAT	/* open with file create */
13 #define	O_TRUNC		FTRUNC	/* open with truncation */
14 #define	O_EXCL		FEXCL	/* error on create if file exists */
15 
16 #ifndef	F_DUPFD
17 /* fcntl(2) requests */
18 #define	F_DUPFD	0	/* Duplicate fildes */
19 #define	F_GETFD	1	/* Get fildes flags */
20 #define	F_SETFD	2	/* Set fildes flags */
21 #define	F_GETFL	3	/* Get file flags */
22 #define	F_SETFL	4	/* Set file flags */
23 #define	F_GETOWN 5	/* Get owner */
24 #define F_SETOWN 6	/* Set owner */
25 
26 /* flags for F_GETFL, F_SETFL-- copied from <sys/file.h> */
27 #define	FNDELAY		00004		/* non-blocking reads */
28 #define	FAPPEND		00010		/* append on each write */
29 #define	FASYNC		00100		/* signal pgrp when data ready */
30 #define	FCREAT		01000		/* create if nonexistant */
31 #define	FTRUNC		02000		/* truncate to zero length */
32 #define	FEXCL		04000		/* error if already created */
33 #endif
34