#include <oskit/c/mqueue.h>mqd_t mq_open(const char *name, int oflag, ...);
int mq_send(mqd_t mqdes, const char *msg_ptr, oskit_size_t msg_len, unsigned int msg_prio);
int mq_receive(mqd_t mqdes, char *msg_ptr, oskit_size_t msg_len, unsigned int *msg_prio);
int mq_close(mqd_t mqdes);
int mq_unlink(const char *name);
int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat);
int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);
int mq_notify(mqd_t mqdes, const struct sigevent *notification);
The implementation of POSIX message queue depends on the pthread library and cannot be used in single threaded environment.The message queue name space is dependent of file system name space and semaphore name space. Message queue descriptors are not related with file descriptors.
The mq_send() and mq_receive() are cancellation point.
mq_open()'s 3rd argument (mode_t) is ignored.
#include <oskit/c/semaphore.h>int sem_init(sem_t *sem, int pshared, unsigned int value);
int sem_destroy(sem_t *sem);
sem_t *sem_open(const char *name, int oflag, ...);
int sem_close(sem_t *sem);
int sem_unlink(const char *name);
int sem_getvalue(sem_t *sem, int *sval);
int sem_wait(sem_t *sem);
int sem_trywait(sem_t *sem);
int sem_post(sem_t *sem);
The implementation of POSIX semaphore depends on the pthread library and cannot be used in single threaded environment.The semaphore name space is dependent of file system name space and message queue name space.