update api tests with options
[libc-test] / src / api / mqueue.c
1 #include "options.h"
2 #ifdef POSIX_MESSAGE_PASSING
3 #include <mqueue.h>
4 #define T(t) (t*)0;
5 #define F(t,n) {t *y = &x.n;}
6 static void f()
7 {
8 T(mqd_t)
9 T(pthread_attr_t)
10 T(size_t)
11 T(ssize_t)
12 T(struct timespec)
13 T(struct sigevent)
14 {
15 struct mq_attr x;
16 F(long, mq_flags)
17 F(long, mq_maxmsg)
18 F(long, mq_msgsize)
19 F(long, mq_curmsgs)
20 }
21 {int(*p)(mqd_t) = mq_close;}
22 {int(*p)(mqd_t,struct mq_attr*) = mq_getattr;}
23 {int(*p)(mqd_t,const struct sigevent*) = mq_notify;}
24 {mqd_t(*p)(const char*,int,...) = mq_open;}
25 {ssize_t(*p)(mqd_t,char*,size_t,unsigned*) = mq_receive;}
26 {int(*p)(mqd_t,const char*,size_t,unsigned) = mq_send;}
27 {int(*p)(mqd_t,const struct mq_attr*restrict,struct mq_attr*restrict) = mq_setattr;}
28 {int(*p)(const char*) = mq_unlink;}
29 }
30 #include <time.h>
31 static void g()
32 {
33 {ssize_t(*p)(mqd_t,char*restrict,size_t,unsigned*restrict,const struct timespec*restrict) = mq_timedreceive;}
34 {int(*p)(mqd_t,const char*,size_t,unsigned,const struct timespec*) = mq_timedsend;}
35 }
36 #endif
37