2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Create a new message port.
9 #include <exec/memory.h>
10 #include <exec/ports.h>
11 #include <exec/execbase.h>
12 #include <proto/exec.h>
14 #include "exec_util.h"
16 /*****************************************************************************
20 AROS_LH0(struct MsgPort
*, CreateMsgPort
,
25 struct ExecBase
*, SysBase
, 111, Exec
)
28 Create a new message port. A signal will be allocated and the message
29 port set to signal you task
34 Pointer to messageport structure
46 ******************************************************************************/
52 /* Allocate memory for struct MsgPort */
53 ret
=(struct MsgPort
*)AllocMem(sizeof(struct MsgPort
),MEMF_PUBLIC
|MEMF_CLEAR
);
58 /* Allocate a signal bit */
62 /* Initialize messageport structure */
66 /* Set task to send the signal to. */
67 ret
->mp_SigTask
=GET_THIS_TASK
;
69 /* Now the port is ready for use. */
72 /* Couldn't get the signal bit. Free the memory. */
73 FreeMem(ret
,sizeof(struct MsgPort
));