1*53ee8cc1Swenshuai.xi /* Copyright (C) 2003 Krzysztof Benedyczak & Michal Wronski 2*53ee8cc1Swenshuai.xi 3*53ee8cc1Swenshuai.xi This program is free software; you can redistribute it and/or 4*53ee8cc1Swenshuai.xi modify it under the terms of the GNU Lesser General Public 5*53ee8cc1Swenshuai.xi License as published by the Free Software Foundation; either 6*53ee8cc1Swenshuai.xi version 2.1 of the License, or (at your option) any later version. 7*53ee8cc1Swenshuai.xi 8*53ee8cc1Swenshuai.xi It is distributed in the hope that it will be useful, 9*53ee8cc1Swenshuai.xi but WITHOUT ANY WARRANTY; without even the implied warranty of 10*53ee8cc1Swenshuai.xi MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11*53ee8cc1Swenshuai.xi Lesser General Public License for more details. 12*53ee8cc1Swenshuai.xi 13*53ee8cc1Swenshuai.xi You should have received a copy of the GNU Lesser General Public 14*53ee8cc1Swenshuai.xi License along with this software; if not, write to the Free 15*53ee8cc1Swenshuai.xi Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 16*53ee8cc1Swenshuai.xi 02111-1307 USA. */ 17*53ee8cc1Swenshuai.xi 18*53ee8cc1Swenshuai.xi #ifndef _LINUX_MQUEUE_H 19*53ee8cc1Swenshuai.xi #define _LINUX_MQUEUE_H 20*53ee8cc1Swenshuai.xi 21*53ee8cc1Swenshuai.xi #define MQ_PRIO_MAX 32768 22*53ee8cc1Swenshuai.xi /* per-uid limit of kernel memory used by mqueue, in bytes */ 23*53ee8cc1Swenshuai.xi #define MQ_BYTES_MAX 819200 24*53ee8cc1Swenshuai.xi 25*53ee8cc1Swenshuai.xi struct mq_attr { 26*53ee8cc1Swenshuai.xi long mq_flags; /* message queue flags */ 27*53ee8cc1Swenshuai.xi long mq_maxmsg; /* maximum number of messages */ 28*53ee8cc1Swenshuai.xi long mq_msgsize; /* maximum message size */ 29*53ee8cc1Swenshuai.xi long mq_curmsgs; /* number of messages currently queued */ 30*53ee8cc1Swenshuai.xi long __reserved[4]; /* ignored for input, zeroed for output */ 31*53ee8cc1Swenshuai.xi }; 32*53ee8cc1Swenshuai.xi 33*53ee8cc1Swenshuai.xi /* 34*53ee8cc1Swenshuai.xi * SIGEV_THREAD implementation: 35*53ee8cc1Swenshuai.xi * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed 36*53ee8cc1Swenshuai.xi * to mq_notify, then 37*53ee8cc1Swenshuai.xi * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not 38*53ee8cc1Swenshuai.xi * necessary that the socket is bound. 39*53ee8cc1Swenshuai.xi * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN 40*53ee8cc1Swenshuai.xi * bytes long. 41*53ee8cc1Swenshuai.xi * If the notification is triggered, then the cookie is sent to the netlink 42*53ee8cc1Swenshuai.xi * socket. The last byte of the cookie is replaced with the NOTIFY_?? codes: 43*53ee8cc1Swenshuai.xi * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was 44*53ee8cc1Swenshuai.xi * removed, either due to a close() on the message queue fd or due to a 45*53ee8cc1Swenshuai.xi * mq_notify() that removed the notification. 46*53ee8cc1Swenshuai.xi */ 47*53ee8cc1Swenshuai.xi #define NOTIFY_NONE 0 48*53ee8cc1Swenshuai.xi #define NOTIFY_WOKENUP 1 49*53ee8cc1Swenshuai.xi #define NOTIFY_REMOVED 2 50*53ee8cc1Swenshuai.xi 51*53ee8cc1Swenshuai.xi #define NOTIFY_COOKIE_LEN 32 52*53ee8cc1Swenshuai.xi 53*53ee8cc1Swenshuai.xi #endif 54