#include <ipc/chIpc.h>int portCreate(KnCap * actorcap, KnUniqueId * portui);
portCreate creates a port which is attached to the actor the capability of which (see actorCreate (2K)) is given by actorcap. If actorcap is K_MYACTOR, the port is attached to the current actor.
A unique identifier is allocated to the port. This identifier is returned in the KnUniqueId structure given by portui.
The port is created in the DISABLED state (see portEnable (2K)).
The port message queue capacity is limited to K_CPORTQUEUE.
The maximum number of ports that may be created on a site is limited to a value set at microkernel generation.
portDeclare is equivalent to portCreate, except that the unique identifier of the port is given by the user (in portui ) instead of being generated by the microkernel. The unique identifier provided by the user must have been previously built using uiBuild (2K). As the user is responsible for insuring the unicity of the port identifier, portDeclare is restricted to SUPERVISOR threads (see threadCreate (2K)), or threads belonging to SYSTEM actors (see actorCreate (2K)).
Upon successful completion, a positive local identifier of the port is returned. Otherwise, a negative error code is returned.
actorcap is an inconsistent actor capability.
actorcap does not specify a reachable actor.
Some of the provided data are outside the current actor's address space.
The current thread is neither a supervisor thread nor a thread of a system actor ( portDeclare only).
The system is out of resources.
The target actor and the current actor must be located on the same site.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|