Summary Files Commits Branches @commit @diff @stats
path: root / Year 3 / System programming / Practice09 / ex1.c
blob: 36ed844c0d50687ee825c50dd33b8815f38b2883 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <fcntl.h>
#include <sys/stat.h>
#include <mqueue.h>
#include <stdio.h>

int main() {
	mqd_t mq = mq_open("/spqueue", O_RDWR | O_CREAT, 0700);

	struct mq_attr mqattrs;
	mq_getattr(mq, &mqattrs);

	mq_close(mq);
	mq_unlink("/spqueue");

	printf("%ld %ld %ld %ld\n", mqattrs.mq_flags, mqattrs.mq_maxmsg, mqattrs.mq_msgsize, mqattrs.mq_curmsgs);

	return 0;
}