2/6 POSIX message queues
Quoted 3 lines · Arnd
Nothing difficult here, but slow and avoidable if you have the structures laid out properly.
I thought about using s32 for the kernel mq_attr structure, and didn't like it: It would mean that 64-bit archs running native 64-bit apps must do a conversion - glibc must expose a structure with long values. Additionally, the posix message queue API uses 3 structures with long values, and only one of them is new - we'll need wrappers anyway.
The actual values in the mq_attr structure would fit into s32:
- mq_flags is 0 or O_NONBLOCK
- mq_maxmsg is less than 32k (kmalloc'ed array of pointers)
- mq_msgsize is theoretically unlimited, but the current implementation arbitrarily limits the value to 1 MB.
--
Manfred