Docs » Autodocs » exec.library » FindPort
FindPort -- find a given system message port
port = FindPort(name) D0 A1 struct MsgPort *FindPort(STRPTR);
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 <exec/types.h> struct MsgPort *FindPort(); ULONG SafePutToPort(message, portname) struct Message *message; STRPTR portname; { struct MsgPort *port; Forbid(); port = FindPort(portname); if (port) PutMsg(port,message); Permit(); return((ULONG)port); /* If zero, the port has gone away */ }
name - name of the port to find
port - a pointer to the message port, or zero if not found.
|