Changeset 69 for branches/home/psmith/restructure/src
- Timestamp:
- 02/05/07 04:51:27 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/home/psmith/restructure/src/io/fd-helper.lisp ¶
r15 r69 33 33 (defconstant +cmd-get-flags+ 3) 34 34 (defconstant +cmd-set-flags+ 4) 35 (defconstant +arg-nonblock+ #x0004) 35 36 #+(or darwin macosx freebsd) 37 (defconstant +arg-nonblock+ #x4) 38 39 #+linux 40 (defconstant +arg-nonblock+ #x800) 36 41 37 42 (defcfun ("close" %close) :int … … 41 46 (fd :int) 42 47 (cmd :int) 48 #+(or darwin macosx freebsd) 43 49 (arg :int)) 50 #+linux 51 (arg :long)) 44 52 45 53 (defcfun ("read" %read) :long … … 61 69 (%memset ptr 0 size)) 62 70 71 (defun get-fd-flags(unix-fd) 72 (%fcntl unix-fd +cmd-get-flags+ 0)) 63 73 64 74 (defun set-fd-nonblocking (unix-fd) 65 75 "Set UNIX-FD to non-blocking mode (O_NONBLOCK)." 66 (%fcntl unix-fd +cmd-set-flags+ +arg-nonblock+)) 76 (let* ((flags (get-fd-flags unix-fd)) 77 (new-flags (logior flags +arg-nonblock+))) 78 (format t "set-fd-nonblocking :fd ~A :old-flags 0x~X 0x~X~%" unix-fd flags new-flags) 79 (%fcntl unix-fd +cmd-set-flags+ new-flags))) 67 80 68 81
Note: See TracChangeset
for help on using the changeset viewer.