#include <mipc/chMipc.h>int msgSpaceCreate(KnMsgSpaceId spaceGid, unsigned int msgQueueNb, unsigned int msgPoolNb, const KnMsgPool *msgPool);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
msgSpaceCreate() creates a message space.
spaceGid is the global identifier of the new
message space. It is under the responsibility of applications to assign unique
global identifiers to their message spaces. If spaceGid
is equal to the special
K_PRIVATEID constant, the
message space is private to the invoking actor: its message queues and message
pools will only be accessible to threads executing within this actor.
msgQueueNb is the number of message queues of the message space. Each message queue is designated by its index within the set of message queues (by an unsigned integer within the range [0 .. msgQueueNb - 1]).
msgPoolNb is the number of message pools of the
communication space. Its value must be within the range [1 ..
is a constant defined at microkernel compile time.
msgPool is a pointer to an array of poolNb structures of type
KnMsgPool. The KnMsgPool structure includes the following information:
unsigned int msgSize ; unsigned int msgNumber ;
Upon successful completion, the memory allocated for the message pools is mapped within the addressing space of the actor, and msgSpaceCreate() returns a positive local identifier of the message space. Otherwise, a negative error code is returned.
spaceGid is not equal to
K_PRIVATEID, and is already assigned to another existing message space.
There is not sufficient room in the addressing space of the actor to map the message pools of the created message space.
The value of msgQueueNb is equal to zero, or the value of msgPoolNb is out of the range [1 ...
The msgPool args are not correct: msgPool.msgSize is equal to 0, or msgPool.msgNumber is equal to 0.
Some of the data provided are outside the current actor's address space.
The system was not able
to allocate the memory needed to create the message space. This value is returned,
for example, when the system attemps to exceed the limit defined by the tunable
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|