tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / test / exec / portsend.c
blob9064e0a6cfc0ca442a8a6626b982f9cd0de12870
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/exec.h>
7 #include <proto/alib.h>
9 #include <exec/ports.h>
10 #include <stdio.h>
12 int main(void)
14 struct Message msg, *msg2;
15 struct MsgPort *port;
17 port = FindPort("PORTTEST");
18 if (port==NULL)
20 puts("Port not found");
21 return 20;
23 msg.mn_ReplyPort = CreatePort(NULL, 0);
24 if (msg.mn_ReplyPort==NULL)
26 puts("Error creating port");
27 return 20;
30 PutMsg(port, &msg);
31 WaitPort(msg.mn_ReplyPort);
32 msg2 = GetMsg(msg.mn_ReplyPort);
33 DeletePort(msg.mn_ReplyPort);
34 if (msg2!=&msg)
35 puts("Wrong message returned");
36 else
37 puts("Message returned");
39 return 0;