diff options
| author | [email protected] <[email protected]> | 2010-11-21 23:56:16 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2010-11-21 23:56:16 +0000 |
| commit | 72630eae88601f6d609cfa09700649150ace7112 (patch) | |
| tree | b23d1399c5ac52e5056f1978553b99c3a46c24be /components/pthreads/mqueue.h | |
| parent | d57496b78cf3ffc5d56545149e0c749fe8f56b77 (diff) | |
add clock and mqueue interface.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1083 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/pthreads/mqueue.h')
| -rw-r--r-- | components/pthreads/mqueue.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/components/pthreads/mqueue.h b/components/pthreads/mqueue.h new file mode 100644 index 0000000000..901b1bed59 --- /dev/null +++ b/components/pthreads/mqueue.h @@ -0,0 +1,33 @@ +#ifndef __MQUEUE_H__
+#define __MQUEUE_H__
+
+#include <rtthread.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <signal.h>
+
+typedef rt_mq_t mqd_t;
+struct mq_attr
+{
+ long mq_flags; /* Message queue flags. */
+ long mq_maxmsg; /* Maximum number of messages. */
+ long mq_msgsize; /* Maximum message size. */
+ long mq_curmsgs; /* Number of messages currently queued. */
+};
+
+int mq_close(mqd_t mqdes);
+int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);
+int mq_notify(mqd_t mqdes, const struct sigevent *notification);
+mqd_t mq_open(const char *name, int oflag, ...);
+ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio);
+int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio);
+int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat,
+ struct mq_attr *omqstat);
+ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
+ unsigned *msg_prio, const struct timespec *abs_timeout);
+int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio,
+ const struct timespec *abs_timeout);
+
+int mq_unlink(const char *name);
+
+#endif
|
