📄 mqueue.h
字号:
/****************************************************************************** Copyright(C) 2005,2006 Frank ZHANG All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ****************************************************************************** If you want to distribute this software with modifications under any terms other than the GPL or distribute the software linked with proprietary applications that are not distributed in full compliance with the GNU Public License, a Commercial License is needed. Commercial licensing and support of this software are available at a fee. For more information, See http://www.openmgcp.org ******************************************************************************/#ifndef __MQUEUE_H__#define __MQUEUE_H__#ifdef __cplusplusextern "C" {#endif/* Also defined in pthread.h */#ifndef HAVE_STRUCT_TIMESPEC#define HAVE_STRUCT_TIMESPECtypedef unsigned long int timer_t;struct timespec{ timer_t tv_sec; /* Seconds */ long tv_nsec; /* Nanoseconds */};#endiftypedef unsigned int 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. */};#define O_RDONLY 0x00000000 /* Open read-only */#define O_WRONLY 0x00000001 /* Open write-only */#define O_RDWR 0x00000002 /* Reading and writing */#define O_CREAT 0x00000100 /* Create file if it doesn't exist already */#define O_EXCL 0x00000400 /* Error if create and file exists */#define O_NONBLOCK 0x00001000 /* Do not block on open */int mq_close(mqd_t mqdes);mqd_t mq_open(const char *name, int oflag, ...);int 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_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);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -