mqtest2.c (e100f6a2fc03d6f8c268f237f595533ea8044810) mqtest2.c (e8395c4843c0668d8402bb991cbc1eac09c21315)
1/* $FreeBSD$ */
2
3#include <sys/types.h>
4#include <sys/wait.h>
5#include <err.h>
6#include <fcntl.h>
7#include <mqueue.h>
8#include <signal.h>
9#include <stdio.h>
10#include <stdlib.h>
11#include <unistd.h>
12
1/* $FreeBSD$ */
2
3#include <sys/types.h>
4#include <sys/wait.h>
5#include <err.h>
6#include <fcntl.h>
7#include <mqueue.h>
8#include <signal.h>
9#include <stdio.h>
10#include <stdlib.h>
11#include <unistd.h>
12
13#include "freebsd_test_suite/macros.h"
14
13#define MQNAME "/mytstqueue2"
14#define LOOPS 1000
15#define PRIO 10
16
17static void
18alarmhandler(int sig __unused)
19{
20 write(1, "timeout\n", 8);
21 _exit(1);
22}
23
24int
25main(void)
26{
27 struct mq_attr attr;
28 mqd_t mq;
29 int status;
30 pid_t pid;
31
15#define MQNAME "/mytstqueue2"
16#define LOOPS 1000
17#define PRIO 10
18
19static void
20alarmhandler(int sig __unused)
21{
22 write(1, "timeout\n", 8);
23 _exit(1);
24}
25
26int
27main(void)
28{
29 struct mq_attr attr;
30 mqd_t mq;
31 int status;
32 pid_t pid;
33
34 PLAIN_REQUIRE_KERNEL_MODULE("mqueuefs", 0);
35
32 mq_unlink(MQNAME);
33
34 attr.mq_maxmsg = 5;
35 attr.mq_msgsize = 128;
36 mq = mq_open(MQNAME, O_CREAT | O_RDWR | O_EXCL, 0666, &attr);
37 if (mq == (mqd_t)-1)
38 err(1, "mq_open");
39 status = mq_getattr(mq, &attr);

--- 58 unchanged lines hidden ---
36 mq_unlink(MQNAME);
37
38 attr.mq_maxmsg = 5;
39 attr.mq_msgsize = 128;
40 mq = mq_open(MQNAME, O_CREAT | O_RDWR | O_EXCL, 0666, &attr);
41 if (mq == (mqd_t)-1)
42 err(1, "mq_open");
43 status = mq_getattr(mq, &attr);

--- 58 unchanged lines hidden ---