home *** CD-ROM | disk | FTP | other *** search
- /* @(#)lock-file.h 1.1 91/01/24 */
- /* copyright (c) Mike Howard & Miller/Howard Investments, Inc. 1990,
- all rights reseved */
-
- /* lock_errno values */
- #define LCK_OK 0
- #define LCK_BLOCK 1 /* the requested lock was blocked */
- #define LCK_BADFD 2 /* fd is not a valid file descriptor */
- #define LCK_DEADLOCK 3 /* a deadlock was detected */
- #define LCK_INTR 4 /* an interupt aborted system call */
- #define LCK_OTHER 9 /* some other error - errno may give more information
- if you know how to interpret it */
-
- /* lock_support values */
- #define LCK_RECORD 1
- #define LCK_SHARED 2
- #define LCK_EXCLUSIVE 4
- #define LCK_NO_BLOCK 8
-
- #ifndef lock_errno
- extern int lock_errno;
- extern int lock_support;
- #endif
-
- #ifndef off_t
- #define off_t long
- #define RM_OFF_T_DEF
- #endif
- #ifdef PROTOTYPES_OK
- int lock_record_shared_wait(int fd, off_t offset, off_t len);
- int lock_record_exclusive_wait(int fd, off_t offset, off_t len);
- int lock_record_shared_nowait(int fd, off_t offset, off_t len);
- int lock_record_exclusive_nowait(int fd, off_t offset, off_t len);
- int unlock_record(int fd, off_t offset, off_t len);
- int lock_file_shared_wait(int fd);
- int lock_file_exclusive_wait(int fd);
- int lock_file_shared_nowait(int fd);
- int lock_file_exclusive_nowait(int fd);
- int unlock_file(int fd);
- #else
- int lock_record_shared_wait();
- int lock_record_exclusive_wait();
- int lock_record_shared_nowait();
- int lock_record_exclusive_nowait();
- int unlock_record();
- int lock_file_shared_wait();
- int lock_file_exclusive_wait();
- int lock_file_shared_nowait();
- int lock_file_exclusive_nowait();
- int unlock_file();
- #endif
-
- #ifdef RM_OFF_T_DEF
- # undef off_t
- #endif
-