|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Version 4.0 ! 3: * Copyright (c) 1982, 1993 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: #include <common/feature.h> ! 15: #include <common/ccompat.h> ! 16: #include <common/_uid.h> ! 17: ! 18: /* ! 19: * Flag values accessible to open () and fcntl () ! 20: * The first three can only be set by open (). ! 21: */ ! 22: ! 23: #define O_RDONLY 0x00 ! 24: #define O_WRONLY 0x01 ! 25: #define O_RDWR 0x02 ! 26: #define O_NDELAY 0x04 /* non-blocking i/o */ ! 27: #define O_APPEND 0x08 /* append (writes guaranteed at the end */ ! 28: ! 29: #if _I386 ! 30: ! 31: #define O_SYNC 0x10 /* sync on every write */ ! 32: #define O_NONBLOCK 0x80 /* non-blocking i/o */ ! 33: ! 34: /* Flag values accessible only to 3 argument open (). */ ! 35: ! 36: #define O_CREAT 0x100 /* open with file create (third open arg) */ ! 37: #define O_TRUNC 0x200 /* open with truncation */ ! 38: #define O_EXCL 0x400 /* exclusive open */ ! 39: #define O_NOCTTY 0x800 /* don't assign a controlling tty */ ! 40: ! 41: #endif /* _I386 */ ! 42: ! 43: ! 44: /* fcntl () requests. */ ! 45: ! 46: #define F_DUPFD 0 /* duplicate file desriptor */ ! 47: #define F_GETFD 1 /* get file descriptor flags */ ! 48: #define F_SETFD 2 /* set file descriptor flags */ ! 49: #define F_GETFL 3 /* get file flags */ ! 50: #define F_SETFL 4 /* set file flags */ ! 51: #define F_GETLK 5 /* return blocking lock */ ! 52: #define F_SETLK 6 /* set or remove lock, return if blocked */ ! 53: #define F_SETLKW 7 /* set or remove lock, sleep if blocked */ ! 54: ! 55: ! 56: /* Locking command/return structure. */ ! 57: ! 58: struct flock { ! 59: short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ ! 60: short l_whence; /* SEEK_SET, SEEK_CUR, SEEK_END */ ! 61: long l_start; /* location */ ! 62: long l_len; /* 0 is through EOF */ ! 63: short __NON_POSIX (l_sysid); ! 64: /* system id of lock (GETLK) ? */ ! 65: short l_pid; /* process id of owner (GETLK) */ ! 66: }; ! 67: ! 68: #if ! _POSIX_SOURCE ! 69: ! 70: typedef struct flock flock_t; ! 71: ! 72: #endif ! 73: ! 74: ! 75: /* lock () command types. */ ! 76: ! 77: #define F_RDLCK 1 /* read lock; more than 1 allowed */ ! 78: #define F_WRLCK 2 /* write lock; blocks any lock */ ! 79: #define F_UNLCK 3 /* unlock */ ! 80: ! 81: ! 82: /* Close on exec bit */ ! 83: ! 84: #define FD_CLOEXEC 1 /* close fd on exec */ ! 85: ! 86: ! 87: __EXTERN_C_BEGIN__ ! 88: ! 89: int creat __PROTO ((__CONST__ char * _path, ! 90: __mode_t _mode)); ! 91: int fcntl __PROTO ((int _fildes, int _cmd, ...)); ! 92: int open __PROTO ((__CONST__ char * _path, int _oflag, ! 93: ...)); ! 94: ! 95: __EXTERN_C_END__ ! 96: ! 97: #endif /* ! defined (__FCNTL_H__) */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.