Bring back darwin hosted port to live, might also work for android hosted but is...
[AROS.git] / test / exec / portsend.c
blob3d173155a3cd87036cdbc98584446a7e1601749e
1 #include <proto/exec.h>
2 #include <proto/alib.h>
4 #include <exec/ports.h>
5 #include <stdio.h>
7 int main(void)
9 struct Message msg, *msg2;
10 struct MsgPort *port;
12 port = FindPort("PORTTEST");
13 if (port==NULL)
15 puts("Port not found");
16 return 20;
18 msg.mn_ReplyPort = CreatePort(NULL, 0);
19 if (msg.mn_ReplyPort==NULL)
21 puts("Error creating port");
22 return 20;
25 PutMsg(port, &msg);
26 WaitPort(msg.mn_ReplyPort);
27 msg2 = GetMsg(msg.mn_ReplyPort);
28 DeletePort(msg.mn_ReplyPort);
29 if (msg2!=&msg)
30 puts("Wrong message returned");
31 else
32 puts("Message returned");
34 return 0;