summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/upgrade.html2
-rw-r--r--package/deps.mak1
-rw-r--r--src/include/skalibs/unix-timed.h2
-rw-r--r--src/libunixonacid/buffer_timed_get.c1
-rw-r--r--src/libunixonacid/ipc_timed_recv.c30
5 files changed, 35 insertions, 1 deletions
diff --git a/doc/upgrade.html b/doc/upgrade.html
index fd1a05f..f2a16cc 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -22,7 +22,7 @@
<ul>
<li> More support for advanced fd callbacks in <tt>unixmessage_sender</tt> and <tt>unixconnection</tt>. </li>
- <li> <tt>ipc_timed_send()</tt>. </li>
+ <li> <tt>ipc_timed_send()</tt>, <tt>ipc_timed_recv()</tt> </li>
</ul>
<h2> in 2.3.10.0 </h2>
diff --git a/package/deps.mak b/package/deps.mak
index 56a9383..e4752f1 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -727,6 +727,7 @@ src/libunixonacid/dd_commit.o src/libunixonacid/dd_commit.lo: src/libunixonacid/
src/libunixonacid/dd_commit_devino.o src/libunixonacid/dd_commit_devino.lo: src/libunixonacid/dd_commit_devino.c src/include/skalibs/uint64.h src/include/skalibs/unix-transactional.h
src/libunixonacid/dd_open_read.o src/libunixonacid/dd_open_read.lo: src/libunixonacid/dd_open_read.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
src/libunixonacid/dd_open_write.o src/libunixonacid/dd_open_write.lo: src/libunixonacid/dd_open_write.c src/include/skalibs/djbunix.h src/include/skalibs/random.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/ipc_timed_recv.o src/libunixonacid/ipc_timed_recv.lo: src/libunixonacid/ipc_timed_recv.c src/include/skalibs/functypes.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h src/include/skalibs/webipc.h
src/libunixonacid/ipc_timed_send.o src/libunixonacid/ipc_timed_send.lo: src/libunixonacid/ipc_timed_send.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
src/libunixonacid/kolbak_call.o src/libunixonacid/kolbak_call.lo: src/libunixonacid/kolbak_call.c src/include/skalibs/kolbak.h src/include/skalibs/unixmessage.h
src/libunixonacid/kolbak_enqueue.o src/libunixonacid/kolbak_enqueue.lo: src/libunixonacid/kolbak_enqueue.c src/include/skalibs/kolbak.h src/include/skalibs/unixmessage.h
diff --git a/src/include/skalibs/unix-timed.h b/src/include/skalibs/unix-timed.h
index c3ae4cd..68c6361 100644
--- a/src/include/skalibs/unix-timed.h
+++ b/src/include/skalibs/unix-timed.h
@@ -35,5 +35,7 @@ extern int netstring_timed_get (buffer *, stralloc *, tain_t const *, tain_t *)
extern int ipc_timed_send (int, char const *, unsigned int, tain_t const *, tain_t *) ;
#define ipc_timed_send_g(fd, s, len, deadline) ipc_timed_send(fd, s, len, (deadline), &STAMP)
+extern int ipc_timed_get (int, char *, unsigned int, char *, tain_t const *, tain_t *) ;
+#define ipc_timed_get_g(fd, s, len, path, deadline) ipc_timed_get(fd, s, len, path, (deadline), &STAMP)
#endif
diff --git a/src/libunixonacid/buffer_timed_get.c b/src/libunixonacid/buffer_timed_get.c
index 2f3b751..af846ff 100644
--- a/src/libunixonacid/buffer_timed_get.c
+++ b/src/libunixonacid/buffer_timed_get.c
@@ -1,6 +1,7 @@
/* ISC license. */
#include <skalibs/buffer.h>
+#include <skalibs/buffer.h>
#include <skalibs/tai.h>
#include <skalibs/unix-timed.h>
diff --git a/src/libunixonacid/ipc_timed_recv.c b/src/libunixonacid/ipc_timed_recv.c
new file mode 100644
index 0000000..bcb991d
--- /dev/null
+++ b/src/libunixonacid/ipc_timed_recv.c
@@ -0,0 +1,30 @@
+/* ISC license. */
+
+#include <skalibs/functypes.h>
+#include <skalibs/tai.h>
+#include <skalibs/webipc.h>
+#include <skalibs/unix-timed.h>
+
+struct blah_s
+{
+ int fd ;
+ char *s ;
+ unsigned int len ;
+ char *path ;
+} ;
+
+static int getfd (struct blah_s *blah)
+{
+ return blah->fd ;
+}
+
+static int get (struct blah_s *blah)
+{
+ return sanitize_read(ipc_recv(blah->fd, blah->s, blah->len, blah->path)) ;
+}
+
+int ipc_timed_get (int fd, char *s, unsigned int len, char *path, tain_t const *deadline, tain_t *stamp)
+{
+ struct blah_s blah = { .fd = fd, .s = s, .len = len, .path = path } ;
+ return timed_get(&blah, (initfunc_t_ref)&getfd, (initfunc_t_ref)&get, deadline, stamp) ;
+}