#include <ipc/chIpc.h>int portEnable(KnCap * actorcap, int portli, int priority);
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.
The portEnable utility is used to put ports into the ENABLED state. The port's local identifier is portli in the actor whose capability is specified by the KnCap structure given by actorcap (see actorCreate (2K)). If actorcap is K_MYACTOR, the current actor is used. The priority field defines the priority of the port in the set of ENABLED ports (see below).
The portDisable utility puts the port in the DISABLED state.
The state of a port determines whether or not the port is used if a thread performs a multiple receive call ( ipcReceive (2K) with K_ANYENABLED option set). Only a message delivered to an ENABLED port may be received during a multiple receive call. When several ports in the set have messages queued behind them, the priority parameter given when the port was ENABLED is used (a low value means a high priority). During a multiple receive, the oldest message queued behind the highest priority ENABLED port is delivered. If none of the ENABLED ports have a queued message, the first message received by any of the ENABLED ports is delivered.
Upon successful completion a value of 0 is returned. Otherwise, a negative error code is returned.
portli is not a valid port identifier within the current actor.
actorcap does not specify a reachable actor.
Some of the data provided are outside the current actor's address space.
The port and the current actor must be located on the same site.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|