This function will search the system message port list for a port with the given name. The first port matching this name will be returned. No arbitration of the port list is done. This function MUST be protected with A
Forbid()/
Permit() pair!
#include
proto/exec.h
ULONG SafePutToPort(
struct Message * message, STRPTR portname)
{
struct MsgPort *port;
Forbid();
port = FindPort(portname);
if (port != NULL)
Permit();
return (ULONG)port; /* If zero, the port has gone away */
}