From 89125d83384d931f053fd1e0d9436dba27d59bbb Mon Sep 17 00:00:00 2001 From: Karchnu Date: Mon, 3 Aug 2020 00:39:13 +0200 Subject: [PATCH] libipc now allows buffered readings from switched fd. --- src/ipc/lowlevel.cr | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ipc/lowlevel.cr b/src/ipc/lowlevel.cr index 1b04252..82541d3 100644 --- a/src/ipc/lowlevel.cr +++ b/src/ipc/lowlevel.cr @@ -11,8 +11,9 @@ lib LibIPC end struct Connection - type : ConnectionType # - spath : LibC::Char* # [4096] # [PATH_MAX] + type : ConnectionType # + more_to_read : Int16* # + spath : LibC::Char* # [4096] # [PATH_MAX] end struct Pollfd @@ -24,9 +25,9 @@ lib LibIPC struct Switching origin : LibC::Int dest : LibC::Int - orig_cb_in : (Int32, Pointer(Message)) -> ConnectionType + orig_cb_in : (Int32, Pointer(Message), Int16*) -> ConnectionType orig_cb_out : (Int32, Pointer(Message)) -> ConnectionType - dest_cb_in : (Int32, Pointer(Message)) -> ConnectionType + dest_cb_in : (Int32, Pointer(Message), Int16*) -> ConnectionType dest_cb_out : (Int32, Pointer(Message)) -> ConnectionType end @@ -146,7 +147,7 @@ lib LibIPC # , enum ipccb cb_in (fd, *ipc_message) # , enum ipccb cb_out (fd, *ipc_message) fun ipc_switching_callbacks(Ctx*, LibC::Int, - (LibC::Int, LibIPC::Message* -> LibIPC::IPCCB), + (LibC::Int, LibIPC::Message*, Int16* -> LibIPC::IPCCB), (LibC::Int, LibIPC::Message* -> LibIPC::IPCCB)) fun ipc_ctx_switching_add (ctx : Ctx*, fd1 : LibC::Int, fd2 : LibC::Int) # Void