1 #include "ace/Shared_Memory_SV.h"
2 #include "ace/Log_Msg.h"
3 #include "ace/OS_NS_unistd.h"
6 #define SHM_KEY (key_t) 5678
11 ACE_Shared_Memory_SV
shm_client (SHM_KEY
, SHMSZ
);
12 char *shm
= (char *) shm_client
.malloc ();
14 for (char *s
= shm
; *s
!= '\0'; s
++)
24 ACE_Shared_Memory_SV
shm_server (SHM_KEY
,
26 ACE_Shared_Memory_SV::ACE_CREATE
);
27 char *shm
= (char *) shm_server
.malloc ();
30 for (char c
= 'a'; c
<= 'z'; c
++)
38 if (shm_server
.remove () < 0)
39 ACE_ERROR ((LM_ERROR
, "%p\n", "remove"));
43 ACE_TMAIN (int, ACE_TCHAR
*[])
45 switch (ACE_OS::fork ())
48 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", "fork"), 1);
50 // Make sure the server starts up first.