57 lines · c
1/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */2/* Copyright (C) 2003 Krzysztof Benedyczak & Michal Wronski3 4 This program is free software; you can redistribute it and/or5 modify it under the terms of the GNU Lesser General Public6 License as published by the Free Software Foundation; either7 version 2.1 of the License, or (at your option) any later version.8 9 It is distributed in the hope that it will be useful,10 but WITHOUT ANY WARRANTY; without even the implied warranty of11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12 Lesser General Public License for more details.13 14 You should have received a copy of the GNU Lesser General Public15 License along with this software; if not, write to the Free16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA17 02111-1307 USA. */18 19#ifndef _LINUX_MQUEUE_H20#define _LINUX_MQUEUE_H21 22#include <linux/types.h>23 24#define MQ_PRIO_MAX 3276825/* per-uid limit of kernel memory used by mqueue, in bytes */26#define MQ_BYTES_MAX 81920027 28struct mq_attr {29 __kernel_long_t mq_flags; /* message queue flags */30 __kernel_long_t mq_maxmsg; /* maximum number of messages */31 __kernel_long_t mq_msgsize; /* maximum message size */32 __kernel_long_t mq_curmsgs; /* number of messages currently queued */33 __kernel_long_t __reserved[4]; /* ignored for input, zeroed for output */34};35 36/*37 * SIGEV_THREAD implementation:38 * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed39 * to mq_notify, then40 * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not41 * necessary that the socket is bound.42 * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN43 * bytes long.44 * If the notification is triggered, then the cookie is sent to the netlink45 * socket. The last byte of the cookie is replaced with the NOTIFY_?? codes:46 * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was47 * removed, either due to a close() on the message queue fd or due to a48 * mq_notify() that removed the notification.49 */50#define NOTIFY_NONE 051#define NOTIFY_WOKENUP 152#define NOTIFY_REMOVED 253 54#define NOTIFY_COOKIE_LEN 3255 56#endif57