Commit graph

8 commits

Author SHA1 Message Date
Sanchayan Maity 368b5fc155 Initialise the "name" variable properly and compare all 32 bytes
Without this patch, calling sys_mq_open() with same names specified
results in two separate queues being opened and their descriptors
returned instead of the same descriptor being returned for both.

Do the initialisation and comparison properly, so that when the
same name is specified to sys_mq_open multiple times in same
process or different process, the same opened queue descriptor is
returned.
2016-03-23 11:11:30 +05:30
Sanchayan Maity 8501cb7ed8 Allow users to request a asynchronous notification
This patch adds functionality to request an asynchronous notification
if some other process has send a message to it. We currently send a
SIGALRM to avoid any changes to core infrastructure of signal handling.
Ideally we should implement a separate signal for this. Currently there
is an obvious disadvantage of not being able to use SIGALRM with alarm,
if we are using this functionality.
2016-03-22 17:51:09 +05:30
Sanchayan Maity 55d341bc54 Allow users to get and set attributes
Currently we only allow users to get and set number of queues. The
operation is always non blocking. There is no provision for non
blocking operation at the moment.

The queue sizes are set to MAX 256 by default. If a user changes the
attributes and sets the queue size or number of messages in a queue
to less than 256, it is the responsibility of the user to close any
queues which were opened with a descriptor greater than the value
currently set.

For example, by default queue sizes are 256. If 150 queues are opened
and then the user sets the number of queues to 32, all open descriptors
and queues from 32 to 150 must be closed. Note that descriptor number
allocation starts with zero and not one.
2016-03-22 15:57:53 +05:30
Sanchayan Maity d84b3d9248 Miscellaneous cleanup 2016-03-19 17:42:29 +05:30
Sanchayan Maity 0cc443d3c2 Fix message priority implementation
Functional specification mandates returning a message with a higher
timestamp in case two messages have the same priority. Somehow we
missed this in the implementation. This also introduced a bug where
all messages with same priority could cause problems.
2016-03-19 16:54:26 +05:30
Sanchayan Maity fe71ea4bc1 First round of assorted bug fixes
Fixed the following bugs:
1. Message priority was not set at all at two places
2. Limits check was not correct while returning error values
3. We are suppose to allow multiple users operate on the same queue
using a named descriptor. However any one user calling close before
the other would result in closing the queue even when other users
might be using it. Track number of users and close only if number of
users is zero. Yet to do functional tests for this, so this is untested,
but introduce it anyway at this juncture.
2016-03-19 11:49:48 +05:30
Sanchayan Maity 58ce9ca12b Fix return values used in mq_open 2016-03-15 19:51:08 +05:30
Sanchayan Maity 63062e7e15 Add message queue support for Minix
Implement message queues support for Minix.

Pending tasks:
Blocking or non blocking for send receive?
Sort by priority and time?
Test codes?
Bug fixes?
2016-03-07 17:41:07 +05:30