2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
5 Desc: Search for a port by name.
8 #include <exec/execbase.h>
9 #include <aros/libcall.h>
10 #include <proto/exec.h>
12 #include "exec_intern.h"
13 #include "exec_debug.h"
15 /*****************************************************************************
19 AROS_LH1(struct MsgPort
*, FindPort
,
22 AROS_LHA(CONST_STRPTR
, name
, A1
),
25 struct ExecBase
*, SysBase
, 65, Exec
)
28 Look for a public messageport by name. This function doesn't
29 arbitrate for the port list and must be protected with a Forbid()
33 port - Pointer to NUL terminated C string.
36 Pointer to struct MsgPort or NULL if there is no port of that name.
48 ******************************************************************************/
52 struct MsgPort
*retVal
;
54 /* Nothing spectacular - just look for that name. */
55 #if defined(__AROSEXEC_SMP__)
56 EXEC_SPINLOCK_LOCK(&PrivExecBase(SysBase
)->PortListSpinLock
, NULL
, SPINLOCK_MODE_READ
);
58 retVal
= (struct MsgPort
*)FindName(&SysBase
->PortList
,name
);
59 #if defined(__AROSEXEC_SMP__)
60 EXEC_SPINLOCK_UNLOCK(&PrivExecBase(SysBase
)->PortListSpinLock
);