April 2024 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
001: /* Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. 002: This file is part of the GNU C Library. 003: 004: The GNU C Library is free software; you can redistribute it and/or 005: modify it under the terms of the GNU Lesser General Public 006: License as published by the Free Software Foundation; either 007: version 2.1 of the License, or (at your option) any later version. 008: 009: The GNU C Library is distributed in the hope that it will be useful, 010: but WITHOUT ANY WARRANTY; without even the implied warranty of 011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012: Lesser General Public License for more details. 013: 014: You should have received a copy of the GNU Lesser General Public 015: License along with the GNU C Library; if not, write to the Free 016: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 017: 02111-1307 USA. */ 018: 019: #ifndef _MQUEUE_H 020: #define _MQUEUE_H 1 021: 022: #include <features.h> 023: #include <sys/types.h> 024: #include <fcntl.h> 025: #define __need_sigevent_t 026: #include <bits/siginfo.h> 027: #define __need_timespec 028: #include <time.h> 029: /* Get the definition of mqd_t and struct mq_attr. */ 030: #include <bits/mqueue.h> 031: 032: __BEGIN_DECLS 033: 034: /* Establish connection between a process and a message queue NAME and 035: return message queue descriptor or (mqd_t) -1 on error. OFLAG determines 036: the type of access used. If O_CREAT is on OFLAG, the third argument is 037: taken as a `mode_t', the mode of the created message queue, and the fourth 038: argument is taken as `struct mq_attr *', pointer to message queue 039: attributes. If the fourth argument is NULL, default attributes are 040: used. */ 041: extern mqd_t mq_open (__const char *__name, int __oflag, ...) 042: __THROW __nonnull ((1)); 043: 044: /* Removes the association between message queue descriptor MQDES and its 045: message queue. */ 046: extern int mq_close (mqd_t __mqdes) __THROW; 047: 048: /* Query status and attributes of message queue MQDES. */ 049: extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat) 050: __THROW __nonnull ((2)); 051: 052: /* Set attributes associated with message queue MQDES and if OMQSTAT is 053: not NULL also query its old attributes. */ 054: extern int mq_setattr (mqd_t __mqdes, 055: __const struct mq_attr *__restrict __mqstat, 056: struct mq_attr *__restrict __omqstat) 057: __THROW __nonnull ((2)); 058: 059: /* Remove message queue named NAME. */ 060: extern int mq_unlink (__const char *__name) __THROW __nonnull ((1)); 061: 062: /* Register notification issued upon message arrival to an empty 063: message queue MQDES. */ 064: extern int mq_notify (mqd_t __mqdes, __const struct sigevent *__notification) 065: __THROW; 066: 067: /* Receive the oldest from highest priority messages in message queue 068: MQDES. */ 069: extern ssize_t mq_receive (mqd_t __mqdes, char *__msg_ptr, size_t __msg_len, 070: unsigned int *__msg_prio) __nonnull ((2)); 071: 072: /* Add message pointed by MSG_PTR to message queue MQDES. */ 073: extern int mq_send (mqd_t __mqdes, __const char *__msg_ptr, size_t __msg_len, 074: unsigned int __msg_prio) __nonnull ((2)); 075: 076: #ifdef __USE_XOPEN2K 077: /* Receive the oldest from highest priority messages in message queue 078: MQDES, stop waiting if ABS_TIMEOUT expires. */ 079: extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, 080: size_t __msg_len, 081: unsigned int *__restrict __msg_prio, 082: __const struct timespec *__restrict __abs_timeout) 083: __nonnull ((2, 5)); 084: 085: /* Add message pointed by MSG_PTR to message queue MQDES, stop blocking 086: on full message queue if ABS_TIMEOUT expires. */ 087: extern int mq_timedsend (mqd_t __mqdes, __const char *__msg_ptr, 088: size_t __msg_len, unsigned int __msg_prio, 089: __const struct timespec *__abs_timeout) 090: __nonnull ((2, 5)); 091: #endif 092: 093: /* Define some inlines helping to catch common problems. */ 094: #if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline \ 095: && defined __va_arg_pack_len 096: # include <bits/mqueue2.h> 097: #endif 098: 099: __END_DECLS 100: 101: #endif /* mqueue.h */ 102: