• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

include/posix/mqueue.h

00001 /*
00002  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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 /* !__KERNEL__ */
00031 
00032 #ifdef __XENO_SIM__
00033 #include <posix_overrides.h>
00034 #endif /* __XENO_SIM__ */
00035 
00036 #else /* !(__KERNEL__ || __XENO_SIM__) */
00037 
00038 #include <xeno_config.h>
00039 #include <fcntl.h>
00040 
00041 #endif /* !(__KERNEL__ || __XENO_SIM__) */
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 /* !__KERNEL__ */
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 /* !(__KERNEL__ || __XENO_SIM__ || !HAVE_MQUEUE_H) */
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 /* !(__KERNEL__ || __XENO_SIM__ || !HAVE_MQUEUE_H) */
00159 
00160 #endif /* _XENO_POSIX_MQUEUE_H */

Generated on Tue Jul 10 2012 20:41:22 for Xenomai API by  doxygen 1.7.1