diff options
[SP/P09] Solved exercises
1 files changed, 18 insertions, 0 deletions
| -rw-r--r-- | Year 3/System programming/Practice09/ex1.c | 18 |
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; +} |
