00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _XENO_POSIX_MQUEUE_H
00020 #define _XENO_POSIX_MQUEUE_H
00021
00022 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00023
00024 #include <nucleus/xenomai.h>
00025
00026 #ifdef __KERNEL__
00027 #include <linux/types.h>
00028 #include <linux/signal.h>
00029 #include <linux/fcntl.h>
00030 #endif
00031
00032 #ifdef __XENO_SIM__
00033 #include <posix_overrides.h>
00034 #endif
00035
00036 #else
00037
00038 #include <xeno_config.h>
00039 #include <fcntl.h>
00040
00041 #endif
00042
00043 #if defined(__KERNEL__) || defined(__XENO_SIM__) || !defined(HAVE_MQUEUE_H)
00044
00045 #ifndef MQ_PRIO_MAX
00046 #define MQ_PRIO_MAX 32768
00047 #endif
00048
00049 #ifndef __KERNEL__
00050 typedef unsigned long mqd_t;
00051 #endif
00052
00053 struct mq_attr {
00054 long mq_flags;
00055 long mq_maxmsg;
00056 long mq_msgsize;
00057 long mq_curmsgs;
00058 };
00059
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif
00063
00064 int mq_getattr(mqd_t qd,
00065 struct mq_attr *attr);
00066
00067 int mq_setattr(mqd_t qd,
00068 const struct mq_attr *__restrict__ attr,
00069 struct mq_attr *__restrict__ oattr);
00070
00071 int mq_send(mqd_t qd,
00072 const char *buffer,
00073 size_t len,
00074 unsigned prio);
00075
00076 int mq_close(mqd_t qd);
00077
00078 ssize_t mq_receive(mqd_t q,
00079 char *buffer,
00080 size_t len,
00081 unsigned *prio);
00082
00083 ssize_t mq_timedreceive(mqd_t q,
00084 char *__restrict__ buffer,
00085 size_t len,
00086 unsigned *__restrict__ prio,
00087 const struct timespec *__restrict__ timeout);
00088
00089 int mq_timedsend(mqd_t q,
00090 const char *buffer,
00091 size_t len,
00092 unsigned prio,
00093 const struct timespec *timeout);
00094
00095 int mq_notify(mqd_t mqdes, const struct sigevent *notification);
00096
00097 mqd_t mq_open(const char *name,
00098 int oflags,
00099 ...);
00100
00101 int mq_unlink(const char *name);
00102
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106
00107 #else
00108
00109 #include_next <mqueue.h>
00110
00111 #ifdef __cplusplus
00112 extern "C" {
00113 #endif
00114
00115 mqd_t __real_mq_open(const char *name,
00116 int oflags,
00117 ...);
00118
00119 int __real_mq_close(mqd_t qd);
00120
00121 int __real_mq_unlink(const char *name);
00122
00123 int __real_mq_getattr(mqd_t qd,
00124 struct mq_attr *attr);
00125
00126 int __real_mq_setattr(mqd_t qd,
00127 const struct mq_attr *__restrict__ attr,
00128 struct mq_attr *__restrict__ oattr);
00129
00130 int __real_mq_send(mqd_t qd,
00131 const char *buffer,
00132 size_t len,
00133 unsigned prio);
00134
00135 int __real_mq_timedsend(mqd_t q,
00136 const char * buffer,
00137 size_t len,
00138 unsigned prio,
00139 const struct timespec *timeout);
00140
00141 ssize_t __real_mq_receive(mqd_t q,
00142 char *buffer,
00143 size_t len,
00144 unsigned *prio);
00145
00146 ssize_t __real_mq_timedreceive(mqd_t q,
00147 char *__restrict__ buffer,
00148 size_t len,
00149 unsigned *__restrict__ prio,
00150 const struct timespec *__restrict__ timeout);
00151
00152 int __real_mq_notify(mqd_t mqdes, const struct sigevent *notification);
00153
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157
00158 #endif
00159
00160 #endif