From 0f30d227497418c6d3bef7d52244407e30454504 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 22 Dec 2025 23:27:56 +0100 Subject: Added c11 threads, fixed some locks and add *_unlocked functions --- lib/libc/sys/mqueue/mq_open.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/libc/sys/mqueue/mq_open.c (limited to 'lib/libc/sys/mqueue/mq_open.c') diff --git a/lib/libc/sys/mqueue/mq_open.c b/lib/libc/sys/mqueue/mq_open.c new file mode 100644 index 00000000..15ae9e18 --- /dev/null +++ b/lib/libc/sys/mqueue/mq_open.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include + +mqd_t mq_open(const char *name, int oflag, ...) +{ + mode_t mode; + struct mq_attr *attr; + + if (*name == '/') + name++; + + if (oflag & O_CREAT) { + va_list ap; + va_start(ap, oflag); + mode = va_arg(ap, mode_t); + attr = va_arg(ap, struct mq_attr *); + va_end(ap); + } else { + mode = 0; + attr = 0; + } + + return syscall(mq_open, name, oflag, mode, attr); +} -- cgit v1.2.3