Hello fox experts!! I want to use POSIX message queues for interprocess communication. Why POSIX message queues and not System V message queues: it's possible to use file descriptors and select() for process synchronization.
In FOX kernelconfig I can select support for POSIX message queues and after running make I get the expected library librt, which should actually contain the POSIX message queues. My problem: for usage in my application the header file mqueue.h should actually contain the prototypes for mq_open(), mq_send()..., but it doesn't! It just contains the mq_attr (See the lines below). So, no conformity to the spec (http://www.opengroup.org/onlinepubs/009695399/basedefs/mqueue.h.html) . Did anybody ever use POSIX message in user space or is it not fully implemented? Is there another "nice" way for inter process communication and sync on FOX except named pipes? Best regards, Hendrik Lachmann <linux/mqueue.h> ======================================== #ifndef _LINUX_MQUEUE_H #define _LINUX_MQUEUE_H #include <linux/types.h> #define MQ_PRIO_MAX 32768 /* per-uid limit of kernel memory used by mqueue, in bytes */ #define MQ_BYTES_MAX 819200 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 */ long __reserved[4]; /* ignored for input, zeroed for output */ }; /* * SIGEV_THREAD implementation: * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed * to mq_notify, then * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not * necessary that the socket is bound. * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN * bytes long. * If the notification is triggered, then the cookie is sent to the netlink * socket. The last byte of the cookie is replaced with the NOTIFY_?? codes: * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was * removed, either due to a close() on the message queue fd or due to a * mq_notify() that removed the notification. */ #define NOTIFY_NONE 0 #define NOTIFY_WOKENUP 1 #define NOTIFY_REMOVED 2 #define NOTIFY_COOKIE_LEN 32 #endif
