Summary Files Commits Branches @commit @diff @stats
path: root / Year 3 / System programming / Practice09 / ex1.c
diff options
context:
space:
mode:
1 files changed, 18 insertions, 0 deletions
-rw-r--r--Year 3/System programming/Practice09/ex1.c18
diff --git a/Year 3/System programming/Practice09/ex1.c b/Year 3/System programming/Practice09/ex1.c
new file mode 100644
index 0000000..36ed844
--- /dev/null
+++ b/Year 3/System programming/Practice09/ex1.c
@@ -0,0 +1,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;
+}