home *** CD-ROM | disk | FTP | other *** search
- /* mac06©1997 by HNS/DSITRI hns@computer.org
- ** fcntl.h
- */
-
- #pragma once
-
- #include "stdarg.h"
- #include "sys/types.h"
-
- struct flock
- {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- pid_t l_pid;
- };
-
- #define F_DUPFD 0
- #define FD_CLOEXEC 0x0001
- #define F_GETFD 1
- #define F_SETFD 2
- #define F_GETFL 3
- #define F_SETFL 4
- #define F_GETLK 5
- #define F_SETLK 6
- #define F_SETLKW 7
- #define F_RDLCK 0x0001
- #define F_WRLCK 0x0002
- #define F_UNLCK 0x0003
-
- #define O_APPEND 0x0020
- #define O_CREAT 0x0004
- #define O_EXCL 0x0010
- #define O_NOCTTY 0x0400
- #define O_NONBLOCK 0x0800
-
- #define O_WRONLY 0x0001
- #define O_RDONLY 0x0002
- #define O_RDWR (O_WRONLY|O_RDONLY)
- #define O_TRUNC 0x0008
-
- int fcntl(int fd, int cmd, ...);
- int open(const char *name, int mode, ...);
- #define creat(name, mode) open((name), O_CREAT|O_TRUNC|O_WRONLY, (mode))
-
- /* EOF */