summaryrefslogtreecommitdiff
path: root/test/send_recvmsg.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-02-01 09:36:39 -0700
committerJens Axboe <axboe@kernel.dk>2020-02-01 09:36:39 -0700
commitfe96fe296f1b448a078d42a6e8c4c16c4a44c36e (patch)
tree23b744a39cbe0744576f026eeb2f11992514a37b /test/send_recvmsg.c
parentdbebec80a042e93d117a1a61ef44cde815f3d7d9 (diff)
parent6c0bb68b57a40e974cd488f16dfc5e8e0f180e3c (diff)
downloadliburing-fe96fe296f1b448a078d42a6e8c4c16c4a44c36e.tar.gz
liburing-fe96fe296f1b448a078d42a6e8c4c16c4a44c36e.tar.bz2
Merge branch 'dev' of https://github.com/CarterLi/liburing
* 'dev' of https://github.com/CarterLi/liburing: test: add test for send_recv
Diffstat (limited to 'test/send_recvmsg.c')
-rw-r--r--test/send_recvmsg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/send_recvmsg.c b/test/send_recvmsg.c
index 9d220eb..484a4b7 100644
--- a/test/send_recvmsg.c
+++ b/test/send_recvmsg.c
@@ -97,15 +97,16 @@ static void *recv_fn(void *data)
.iov_len = sizeof(buf) - 1,
};
struct io_uring ring;
+ int ret;
io_uring_queue_init(1, &ring, 0);
recv_prep(&ring, &iov);
pthread_mutex_unlock(mutex);
- do_recvmsg(&ring, &iov);
+ ret = do_recvmsg(&ring, &iov);
io_uring_queue_exit(&ring);
- return NULL;
+ return (void *)(intptr_t)ret;
}
static int do_sendmsg(void)
@@ -172,6 +173,7 @@ int main(int argc, char *argv[])
pthread_t recv_thread;
pthread_mutex_t mutex;
int ret;
+ void *retval;
pthread_mutexattr_init(&attr);
pthread_mutexattr_setpshared(&attr, 1);
@@ -186,5 +188,8 @@ int main(int argc, char *argv[])
pthread_mutex_lock(&mutex);
do_sendmsg();
+ pthread_join(recv_thread, &retval);
+ ret = (int)(intptr_t)retval;
+
return ret;
}