|
|
1.1 root 1: /* (-lgl
2: * COHERENT Version 3.2.2
3: * Copyright (c) 1982, 1992 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: -lgl) */
6: /*
7: * /usr/include/fcntl.h
8: * Cf. Intel iBCS2, pp. 6-35, 6-36.
9: */
10:
11: #ifndef _FCNTL_H
12: #define _FCNTL_H
13:
14: /*
15: * Flag values accessible to open() and fcntl()
16: * The first three can only be set by open().
17: */
18: #define O_RDONLY 0x00
19: #define O_WRONLY 0x01
20: #define O_RDWR 0x02
21: #define O_NDELAY 0x04 /* non-blocking i/o */
22: #define O_APPEND 0x08 /* append (writes guaranteed at the end */
23:
24: #ifdef _I386
25: #define O_SYNC 0x10 /* sync on every write */
26: #define O_NONBLOCK 0x80 /* non-blocking i/o */
27:
28: /* Flag values accessible only to 3 argument open(). */
29: #define O_CREAT 0x100 /* open with file create (third open arg) */
30: #define O_TRUNC 0x200 /* open with truncation */
31: #define O_EXCL 0x400 /* exclusive open */
32: #define O_NOCTTY 0x800 /* don't assign a controlling tty */
33:
34: #endif /* _I386 */
35:
36: /* fcntl() requests. */
37: #define F_DUPFD 0 /* duplicate file desriptor */
38: #define F_GETFD 1 /* get file descriptor flags */
39: #define F_SETFD 2 /* set file descriptor flags */
40: #define F_GETFL 3 /* get file flags */
41: #define F_SETFL 4 /* set file flags */
42: #define F_GETLK 5 /* return blocking lock */
43: #define F_SETLK 6 /* set or remove lock, return if blocked */
44: #define F_SETLKW 7 /* set or remove lock, sleep if blocked */
45:
46: /* Locking command/return structure. */
47: typedef struct flock {
48: short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
49: short l_whence; /* SEEK_SET, SEEK_CUR, SEEK_END */
50: long l_start; /* location */
51: long l_len; /* 0 is through EOF */
52: short l_sysid; /* system id of lock (for GETLK) ? */
53: short l_pid; /* process id of owner (for GETLK) */
54: } FLOCK;
55:
56: /* lock() command types. */
57: #define F_RDLCK 1 /* read lock; more than 1 allowed */
58: #define F_WRLCK 2 /* write lock; blocks any lock */
59: #define F_UNLCK 3 /* unlock */
60:
61: /* Close on exec bit for struct fd member f_flags2. */
62: #define FD_CLOEXEC 1 /* close fd on exec */
63:
64: #endif /* _FCNTL_H */
65: /* end of fcntl.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.