NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
#include <mipc/chMipc.h>int msgSpaceCreate(KnMsgSpaceId spaceGid, unsigned int msgQueueNb, unsigned int msgPoolNb, const KnMsgPool *msgPools);
MIPC
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 .. K_MSG_POOLMAX
] where K_MSG_POOLMAX
(16) is a constant defined at kernel 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 ... K_MSG_POOLMAX
].
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 kern.mipc.maxOpenSpaceNumber
.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO