1995-10-13 23:34:21 -04:00
|
|
|
;;; Flags for open(2) and fcntl(2).
|
2001-03-10 22:47:00 -05:00
|
|
|
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
1995-10-13 23:34:21 -04:00
|
|
|
;;; Modified for Solaris by tvb@math.ufl.edu
|
|
|
|
|
2001-03-10 22:47:00 -05:00
|
|
|
(define-enum-constants open
|
1995-10-13 23:34:21 -04:00
|
|
|
(read 0)
|
|
|
|
(write 1)
|
|
|
|
(read+write 2)
|
|
|
|
(append 8)
|
|
|
|
(create #x0100)
|
|
|
|
(exclusive #x0400)
|
|
|
|
(no-control-tty #x800) ;claims to be POSIX
|
2001-03-10 22:47:00 -05:00
|
|
|
(non-blocking #x80) ;claims to be POSIX
|
1995-10-13 23:34:21 -04:00
|
|
|
(truncate #x0200)
|
|
|
|
|
|
|
|
;;; Not POSIX.
|
|
|
|
(no-delay 4)
|
|
|
|
(sync #x10))
|
|
|
|
|
|
|
|
(define open/access-mask
|
|
|
|
(bitwise-ior open/read
|
|
|
|
(bitwise-ior open/write open/read+write)))
|
|
|
|
|
|
|
|
|
2001-03-10 22:47:00 -05:00
|
|
|
(define-enum-constants fcntl
|
|
|
|
(dup-fdes 0) ; F_DUPFD
|
|
|
|
(get-fdes-flags 1) ; F_GETFD
|
|
|
|
(set-fdes-flags 2) ; F_SETFD
|
|
|
|
(get-status-flags 3) ; F_GETFL
|
|
|
|
(set-status-flags 4) ; F_SETFL
|
|
|
|
(get-owner 23) ; F_GETOWN (Not Posix)
|
|
|
|
(set-owner 24) ; F_SETOWN (Not Posix)
|
|
|
|
(get-record-lock 5) ; F_GETLK
|
|
|
|
(set-record-lock-no-block 6) ; F_SETLK
|
|
|
|
(set-record-lock 7)) ; F_SETLKW
|
1995-10-13 23:34:21 -04:00
|
|
|
|
2001-03-10 22:47:00 -05:00
|
|
|
;;; fcntl fdes-flags (F_GETFD)
|
1995-10-13 23:34:21 -04:00
|
|
|
|
2001-03-10 22:47:00 -05:00
|
|
|
(define fdflags/close-on-exec 1)
|
1995-10-13 23:34:21 -04:00
|
|
|
|
2001-03-10 22:47:00 -05:00
|
|
|
;;; fcntl status-flags (F_GETFL)
|
|
|
|
;;; Mostly, these are OPEN/... flags, like OPEN/APPEND.
|
|
|
|
;;; (define fdstatus/... ...)
|
|
|
|
|
|
|
|
;;; fcntl lock values.
|
|
|
|
|
|
|
|
(define-enum-constants lock
|
|
|
|
(read 1) ; F_RDLCK
|
|
|
|
(write 2) ; F_WRLCK
|
|
|
|
(release 3)) ; F_UNLCK
|