1 #include "ace/SV_Message_Queue.h"
4 // FUZZ: disable check_for_streams_include
5 #include "ace/streams.h"
7 #include "ace/Malloc.h"
8 #include "ace/OS_NS_stdio.h"
9 #include "ace/OS_NS_unistd.h"
10 #include "ace/OS_NS_stdlib.h"
13 #if defined (ACE_HAS_SYSV_IPC) && !defined(ACE_LACKS_SYSV_SHMEM)
16 ACE_TMAIN (int, ACE_TCHAR
*[])
18 long pid
= long (ACE_OS::getpid ());
19 ACE_SV_Message_Queue
msgque (SRV_KEY
);
20 Message_Block
send_msg (SRV_ID
,
22 ACE_OS::cuserid (static_cast<char *> (0)),
24 Message_Block
recv_msg (pid
);
26 if (msgque
.send (send_msg
, send_msg
.length ()) < 0)
27 ACE_OS::perror ("msgque.send"), ACE_OS::exit (1);
29 if (msgque
.recv (recv_msg
, sizeof (Message_Data
), recv_msg
.type ()) < 0)
30 ACE_OS::perror ("msgrcv"), ACE_OS::exit (1);
32 cout
<< "a message of length "
34 << " received from server "
37 << recv_msg
.user () << "): "
38 << recv_msg
.text () << "\n";
45 int ACE_TMAIN (int, ACE_TCHAR
*[])
48 "SYSV IPC, or SYSV SHMEM is not supported on this platform\n"));
51 #endif /* ACE_HAS_SYSV_IPC && !ACE_LACKS_SYSV_SHMEM*/