diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-06-07 01:52:27 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-06-07 01:52:27 -0400 |
commit | ab11386aaaffc93755ff86199bf753a6d5ef4b45 (patch) | |
tree | 1b10227c0f62b2974127b437537466b6c63f3593 /src/mq/mq_open.c | |
parent | cbf35978a9870fb1f5c73a852c986d4fcca6c2d4 (diff) | |
download | musl-ab11386aaaffc93755ff86199bf753a6d5ef4b45.tar.gz musl-ab11386aaaffc93755ff86199bf753a6d5ef4b45.tar.bz2 musl-ab11386aaaffc93755ff86199bf753a6d5ef4b45.tar.xz musl-ab11386aaaffc93755ff86199bf753a6d5ef4b45.zip |
add support for POSIX message queues, except mq_notify
Diffstat (limited to 'src/mq/mq_open.c')
-rw-r--r-- | src/mq/mq_open.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mq/mq_open.c b/src/mq/mq_open.c new file mode 100644 index 00000000..57220a2b --- /dev/null +++ b/src/mq/mq_open.c @@ -0,0 +1,23 @@ +#include <mqueue.h> +#include <fcntl.h> +#include <errno.h> +#include <stdarg.h> +#include "syscall.h" + +mqd_t mq_open(const char *name, int flags, ...) +{ + mode_t mode = 0; + struct mq_attr *attr = 0; + if (*name++ != '/') { + errno = EINVAL; + return -1; + } + if (flags & O_CREAT) { + va_list ap; + va_start(ap, flags); + mode = va_arg(ap, mode_t); + attr = va_arg(ap, struct mq_attr *); + va_end(ap); + } + return syscall(SYS_mq_open, name, flags, mode, attr); +} |