summaryrefslogtreecommitdiff
path: root/src/libunixonacid/textclient_commandv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid/textclient_commandv.c')
-rw-r--r--src/libunixonacid/textclient_commandv.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libunixonacid/textclient_commandv.c b/src/libunixonacid/textclient_commandv.c
new file mode 100644
index 0000000..5bcd411
--- /dev/null
+++ b/src/libunixonacid/textclient_commandv.c
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#include <sys/uio.h>
+#include <errno.h>
+#include <skalibs/error.h>
+#include <skalibs/textclient.h>
+
+int textclient_commandv (textclient_t *a, struct iovec const *v, unsigned int n, tain_t const *deadline, tain_t *stamp)
+{
+ struct iovec ans ;
+ if (!textclient_exchangev(a, v, n, &ans, deadline, stamp)) return 0 ;
+ if (ans.iov_len != 1) return (errno = EPROTO, 0) ;
+ if (*(char *)ans.iov_base) return (errno = *(char *)ans.iov_base, 0) ;
+ return 1 ;
+}