diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-11-25 14:15:08 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-11-25 14:15:08 +0000 |
commit | 7ae80340d621d6add95f6c7d9e5e7a0e921f0b42 (patch) | |
tree | fdf6c4edee23a85248dc448c347d7056a0bebfff /src/libskabus/skabus_rpc_reply_async.c | |
parent | 38c9492b4fb971fe08e4ac0167e06e5dccb3eb2e (diff) | |
download | skabus-7ae80340d621d6add95f6c7d9e5e7a0e921f0b42.tar.xz |
Finish skabus_rpc doc, add missing functions
Diffstat (limited to 'src/libskabus/skabus_rpc_reply_async.c')
-rw-r--r-- | src/libskabus/skabus_rpc_reply_async.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libskabus/skabus_rpc_reply_async.c b/src/libskabus/skabus_rpc_reply_async.c new file mode 100644 index 0000000..a6b106c --- /dev/null +++ b/src/libskabus/skabus_rpc_reply_async.c @@ -0,0 +1,17 @@ +/* ISC license. */ + +#include <sys/uio.h> +#include <skalibs/uint64.h> +#include <skalibs/unixmessage.h> +#include <skalibs/skaclient.h> +#include <skabus/rpc.h> + +int skabus_rpc_reply_withfds_async (skabus_rpc_t *a, uint64_t serial, char result, char const *s, size_t len, int const *fds, unsigned int nfds, unsigned char const *bits) +{ + char pack[10] = "R" ; + struct iovec v[2] = { { .iov_base = pack, .iov_len = 10 }, { .iov_base = (char *)s, .iov_len = len } } ; + unixmessage_v_t m = { .v = v, .vlen = 2, .fds = (int *)fds, .nfds = nfds } ; + uint64_pack_big(pack+1, serial) ; + pack[9] = result ; + return skaclient_aputv_and_close(&a->connection, &m, bits) ; +} |