Blame rt/mqueue.h

Packit 6c4009
/* Copyright (C) 2004-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _MQUEUE_H
Packit 6c4009
#define _MQUEUE_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
#include <fcntl.h>
Packit 6c4009
#include <bits/types/sigevent_t.h>
Packit 6c4009
#include <bits/types/struct_timespec.h>
Packit 6c4009
/* Get the definition of mqd_t and struct mq_attr.  */
Packit 6c4009
#include <bits/mqueue.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Establish connection between a process and a message queue NAME and
Packit 6c4009
   return message queue descriptor or (mqd_t) -1 on error.  OFLAG determines
Packit 6c4009
   the type of access used.  If O_CREAT is on OFLAG, the third argument is
Packit 6c4009
   taken as a `mode_t', the mode of the created message queue, and the fourth
Packit 6c4009
   argument is taken as `struct mq_attr *', pointer to message queue
Packit 6c4009
   attributes.  If the fourth argument is NULL, default attributes are
Packit 6c4009
   used.  */
Packit 6c4009
extern mqd_t mq_open (const char *__name, int __oflag, ...)
Packit 6c4009
  __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Removes the association between message queue descriptor MQDES and its
Packit 6c4009
   message queue.  */
Packit 6c4009
extern int mq_close (mqd_t __mqdes) __THROW;
Packit 6c4009
Packit 6c4009
/* Query status and attributes of message queue MQDES.  */
Packit 6c4009
extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat)
Packit 6c4009
  __THROW __nonnull ((2));
Packit 6c4009
Packit 6c4009
/* Set attributes associated with message queue MQDES and if OMQSTAT is
Packit 6c4009
   not NULL also query its old attributes.  */
Packit 6c4009
extern int mq_setattr (mqd_t __mqdes,
Packit 6c4009
		       const struct mq_attr *__restrict __mqstat,
Packit 6c4009
		       struct mq_attr *__restrict __omqstat)
Packit 6c4009
  __THROW __nonnull ((2));
Packit 6c4009
Packit 6c4009
/* Remove message queue named NAME.  */
Packit 6c4009
extern int mq_unlink (const char *__name) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Register notification issued upon message arrival to an empty
Packit 6c4009
   message queue MQDES.  */
Packit 6c4009
extern int mq_notify (mqd_t __mqdes, const struct sigevent *__notification)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
/* Receive the oldest from highest priority messages in message queue
Packit 6c4009
   MQDES.  */
Packit 6c4009
extern ssize_t mq_receive (mqd_t __mqdes, char *__msg_ptr, size_t __msg_len,
Packit 6c4009
			   unsigned int *__msg_prio) __nonnull ((2));
Packit 6c4009
Packit 6c4009
/* Add message pointed by MSG_PTR to message queue MQDES.  */
Packit 6c4009
extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len,
Packit 6c4009
		    unsigned int __msg_prio) __nonnull ((2));
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Receive the oldest from highest priority messages in message queue
Packit 6c4009
   MQDES, stop waiting if ABS_TIMEOUT expires.  */
Packit 6c4009
extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr,
Packit 6c4009
				size_t __msg_len,
Packit 6c4009
				unsigned int *__restrict __msg_prio,
Packit 6c4009
				const struct timespec *__restrict __abs_timeout)
Packit 6c4009
  __nonnull ((2, 5));
Packit 6c4009
Packit 6c4009
/* Add message pointed by MSG_PTR to message queue MQDES, stop blocking
Packit 6c4009
   on full message queue if ABS_TIMEOUT expires.  */
Packit 6c4009
extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr,
Packit 6c4009
			 size_t __msg_len, unsigned int __msg_prio,
Packit 6c4009
			 const struct timespec *__abs_timeout)
Packit 6c4009
  __nonnull ((2, 5));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Define some inlines helping to catch common problems.  */
Packit 6c4009
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \
Packit 6c4009
    && defined __va_arg_pack_len
Packit 6c4009
# include <bits/mqueue2.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* mqueue.h */