2007-03-20 17:51:12 +01:00
|
|
|
/********************************************************************************
|
2012-07-17 05:58:11 +02:00
|
|
|
* include/mqueue.h
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2021-02-03 11:33:49 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2021-02-03 11:33:49 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2021-02-03 11:33:49 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2007-02-18 00:21:28 +01:00
|
|
|
*
|
2007-03-20 17:51:12 +01:00
|
|
|
********************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2008-11-16 17:36:30 +01:00
|
|
|
#ifndef __INCLUDE_MQUEUE_H
|
|
|
|
#define __INCLUDE_MQUEUE_H
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2007-03-20 17:51:12 +01:00
|
|
|
/********************************************************************************
|
2007-02-18 00:21:28 +01:00
|
|
|
* Included Files
|
2007-03-20 17:51:12 +01:00
|
|
|
********************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
2007-03-20 17:51:12 +01:00
|
|
|
/********************************************************************************
|
2014-09-28 18:15:33 +02:00
|
|
|
* Pre-processor Definitions
|
2007-03-20 17:51:12 +01:00
|
|
|
********************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2007-03-20 17:51:12 +01:00
|
|
|
#define MQ_NONBLOCK O_NONBLOCK
|
|
|
|
|
|
|
|
/********************************************************************************
|
2015-08-03 19:01:41 +02:00
|
|
|
* Public Type Declarations
|
2007-03-20 17:51:12 +01:00
|
|
|
********************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
/* Message queue attributes */
|
|
|
|
|
|
|
|
struct mq_attr
|
|
|
|
{
|
2007-03-20 17:51:12 +01:00
|
|
|
size_t mq_maxmsg; /* Max number of messages in queue */
|
|
|
|
size_t mq_msgsize; /* Max message size */
|
|
|
|
unsigned mq_flags; /* Queue flags */
|
|
|
|
size_t mq_curmsgs; /* Number of messages currently in queue */
|
2007-02-18 00:21:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Message queue descriptor */
|
|
|
|
|
2020-12-22 15:02:48 +01:00
|
|
|
typedef int mqd_t;
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2007-03-20 17:51:12 +01:00
|
|
|
/********************************************************************************
|
2014-12-06 02:16:14 +01:00
|
|
|
* Public Data
|
2007-03-20 17:51:12 +01:00
|
|
|
********************************************************************************/
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
2014-12-06 02:16:14 +01:00
|
|
|
extern "C"
|
|
|
|
{
|
2007-02-18 00:21:28 +01:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2014-12-06 02:16:14 +01:00
|
|
|
/********************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
|
|
mqd_t mq_open(FAR const char *mq_name, int oflags, ...);
|
2020-05-06 11:24:42 +02:00
|
|
|
int mq_close(mqd_t mqdes);
|
2014-12-06 02:16:14 +01:00
|
|
|
int mq_unlink(FAR const char *mq_name);
|
2019-02-16 02:18:55 +01:00
|
|
|
int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen,
|
|
|
|
unsigned int prio);
|
|
|
|
int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen,
|
|
|
|
unsigned int prio, FAR const struct timespec *abstime);
|
|
|
|
ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
|
|
|
FAR unsigned int *prio);
|
|
|
|
ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
|
|
|
FAR unsigned int *prio,
|
2014-12-06 02:16:14 +01:00
|
|
|
FAR const struct timespec *abstime);
|
2020-05-06 11:24:42 +02:00
|
|
|
int mq_notify(mqd_t mqdes, FAR const struct sigevent *notification);
|
2014-12-06 02:16:14 +01:00
|
|
|
int mq_setattr(mqd_t mqdes, FAR const struct mq_attr *mq_stat,
|
|
|
|
FAR struct mq_attr *oldstat);
|
|
|
|
int mq_getattr(mqd_t mqdes, FAR struct mq_attr *mq_stat);
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-11-16 17:36:30 +01:00
|
|
|
#endif /* __INCLUDE_MQUEUE_H */
|