⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os-io.sml

📁 这是我们参加06年全国开源软件的竞赛作品
💻 SML
字号:
(* os-io.sml * * COPYRIGHT (c) 1998 Bell Labs, Lucent Technologies. * *)structure OS_IO : OS_IO =  struct    structure IOM = IOManager    type iodesc = OS.IO.iodesc    type iodesc_kind = OS.IO.iodesc_kind    val hash = OS.IO.hash    val compare = OS.IO.compare    val kind = OS.IO.kind    structure Kind = OS.IO.Kind    type poll_desc = OS.IO.poll_desc    type poll_info = OS.IO.poll_info    val pollDesc = OS.IO.pollDesc    val pollToIODesc = OS.IO.pollToIODesc    exception Poll = OS.IO.Poll  (* set polling events; if the polling operation is not appropriate   * for the underlying I/O device, then the Poll exception is raised.   *)    val pollIn  = OS.IO.pollIn    val pollOut = OS.IO.pollOut    val pollPri = OS.IO.pollPri  (* polling functions *)    local      fun timeOut t = CML.wrap(CML.timeOutEvt t, fn () => [])      fun ioEvt pd = CML.wrap(IOM.ioEvt pd, fn info => [info])    in    fun pollEvt [pd] = ioEvt pd      | pollEvt _ = raise Fail "IO.OS.pollEvt not fully implemented"    fun poll ([pd], NONE) = CML.sync(ioEvt pd)      | poll ([pd], SOME t) = CML.select[timeOut t, ioEvt pd]      | poll _ = raise Fail "IO.OS.poll not fully implemented"    end  (* check for conditions *)    val isIn 		= OS.IO.isIn    val isOut		= OS.IO.isOut    val isPri		= OS.IO.isPri    val infoToPollDesc  = OS.IO.infoToPollDesc  end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -