2008-01-20 17:07:18 -05:00
|
|
|
! Copyright (C) 2008 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
IN: io.unix.bsd
|
2008-04-11 10:54:50 -04:00
|
|
|
USING: namespaces system kernel accessors assocs continuations
|
|
|
|
unix
|
|
|
|
io.backend io.unix.backend io.unix.select io.unix.kqueue io.monitors ;
|
2008-01-20 17:07:18 -05:00
|
|
|
|
2008-04-02 21:09:56 -04:00
|
|
|
M: bsd init-io ( -- )
|
2008-04-11 10:54:50 -04:00
|
|
|
<select-mx> mx set-global
|
|
|
|
<kqueue-mx> kqueue-mx set-global
|
|
|
|
kqueue-mx get-global <mx-port> <mx-task>
|
|
|
|
dup io-task-fd
|
|
|
|
[ mx get-global reads>> set-at ]
|
|
|
|
[ mx get-global writes>> set-at ] 2bi ;
|
|
|
|
|
|
|
|
M: bsd (monitor) ( path recursive? mailbox -- )
|
2008-04-11 11:09:45 -04:00
|
|
|
swap [ "Recursive kqueue monitors not supported" throw ] when
|
|
|
|
<vnode-monitor> ;
|