1 ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
3 ;;; --- FD mixin definitions
6 (in-package :iolib
/streams
)
8 (defmethod shared-initialize :around
((stream dual-channel-fd-mixin
) slot-names
&key
)
9 (declare (ignore slot-names
))
11 (setf (isys:fd-nonblock-p
(fd-of stream
)) t
))
15 (defmethod close :before
((fd-mixin dual-channel-fd-mixin
) &key abort
)
16 (declare (ignore abort
))
17 (when (fd-of fd-mixin
)
18 (isys:close
(fd-of fd-mixin
))
19 (setf (fd-of fd-mixin
) nil
)))
21 ;;;; Get and Set O_NONBLOCK
23 (defmethod fd-non-blocking ((fd-mixin dual-channel-fd-mixin
))
24 (isys:fd-nonblock-p
(fd-of fd-mixin
)))
25 (defobsolete fd-non-blocking
"stream FDs are now always non-blocking.")
27 (defmethod (setf fd-non-blocking
) (mode (fd-mixin dual-channel-fd-mixin
))
28 (check-type mode boolean
"a boolean value")
29 (setf (isys:fd-nonblock-p
(fd-of fd-mixin
)) mode
))
30 (defobsolete (setf fd-non-blocking
) "stream FDs are now always non-blocking.")