source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/mqueue.h

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 2.9 KB
Line 
1/*
2 * mqueue.h - definitions and function prototypes for POSIX mqueue support.
3 */
4
5#ifndef _MQUEUE_H
6#define _MQUEUE_H
7
8#include <features.h>
9#include <sys/types.h>
10#include <fcntl.h>
11#define __need_sigevent_t
12#include <bits/siginfo.h>
13#define __need_timespec
14#include <time.h>
15
16typedef int mqd_t;
17
18struct mq_attr {
19    long int mq_flags;          /* Message queue flags */
20    long int mq_maxmsg;         /* Maximum number of messages */
21    long int mq_msgsize;        /* Maximum message size */
22    long int mq_curmsgs;        /* Number of messages currently queued */
23    long int __pad[4];
24};
25
26__BEGIN_DECLS
27
28/*
29 * Establish connection between a process and a message queue __name and
30 * return message queue descriptor or (mqd_t) -1 on error. __oflag determines
31 * the type of access used. If O_CREAT is on __oflag, the third argument is
32 * taken as a `mode_t', the mode of the created message queue, and the fourth
33 * argument is taken as `struct mq_attr *', pointer to message queue
34 * attributes. If the fourth argument is NULL, default attributes are used.
35 */
36extern mqd_t mq_open(const char *__name, int __oflag, ...) __THROW;
37
38/*
39 * Remove the association between message queue descriptor __mqdes and its
40 * message queue.
41 */
42extern int mq_close(mqd_t __mqdes) __THROW;
43
44/* Query status and attributes of message queue __mqdes */
45extern int mq_getattr(mqd_t __mqdes, struct mq_attr *__mqstat) __THROW;
46
47/*
48 * Set attributes associated with message queue __mqdes and if __omqstat is
49 * not NULL also query its old attributes.
50 */
51extern int mq_setattr(mqd_t __mqdes,
52                      const struct mq_attr *__restrict __mqstat,
53                      struct mq_attr *__restrict __omqstat) __THROW;
54
55/* Remove message queue named __name */
56extern int mq_unlink(const char *__name) __THROW;
57
58/*
59 * Register notification upon message arrival to an empty message queue
60 * __mqdes
61 */
62extern int mq_notify(mqd_t __mqdes, const struct sigevent *__notification)
63     __THROW;
64
65/*
66 * Receive the oldest from highest priority messages in message queue
67 * __mqdes
68 */
69extern ssize_t mq_receive(mqd_t __mqdes, char *__msg_ptr, size_t __msg_len,
70                          unsigned int *__msg_prio);
71
72/* Add message pointed by __msg_ptr to message queue __mqdes */
73extern int mq_send(mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len,
74                   unsigned int __msg_prio);
75
76#ifdef __USE_XOPEN2K
77/*
78 * Receive the oldest from highest priority messages in message queue
79 * __mqdes, stop waiting if __abs_timeout expires.
80 */
81extern ssize_t mq_timedreceive(mqd_t __mqdes, char *__restrict __msg_ptr,
82                               size_t __msg_len,
83                               unsigned int *__restrict __msg_prio,
84                               const struct timespec *__restrict __abs_timeout);
85
86/*
87 * Add message pointed by __msg_ptr to message queue __mqdes, stop blocking
88 * on full message queue if __abs_timeout expires.
89 */
90extern int mq_timedsend(mqd_t __mqdes, const char *__msg_ptr,
91                        size_t __msg_len, unsigned int __msg_prio,
92                        const struct timespec *__abs_timeout);
93#endif
94
95__END_DECLS
96
97#endif
Note: See TracBrowser for help on using the repository browser.