diff options
Diffstat (limited to 'examples/System_V_IPC/SV_Shared_Memory')
3 files changed, 0 insertions, 127 deletions
diff --git a/examples/System_V_IPC/SV_Shared_Memory/Makefile b/examples/System_V_IPC/SV_Shared_Memory/Makefile deleted file mode 100644 index f3de3322d39..00000000000 --- a/examples/System_V_IPC/SV_Shared_Memory/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for tests of the SV_Shared_Memory wrapper -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = SV_Shared_Memory_Test - -LSRC = $(addsuffix .cpp,$(BIN)) - -LDLIBS = - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -INSTALL = - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/SV_Shared_Memory_Test.o .shobj/SV_Shared_Memory_Test.so: SV_Shared_Memory_Test.cpp \ - $(WRAPPER_ROOT)/ace/SV_Shared_Memory.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - SV_Shared_Memory_Test.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.cpp b/examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.cpp deleted file mode 100644 index d980ae1b62c..00000000000 --- a/examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "ace/SV_Shared_Memory.h" -// $Id$ - -#include "SV_Shared_Memory_Test.h" - -static void -client (void) -{ - ACE_SV_Shared_Memory shm_client; - - if (shm_client.open_and_attach (SHM_KEY, SHMSZ) == -1) - ACE_OS::perror ("open"), ACE_OS::exit (1); - - for (char *s = (char *) shm_client.get_segment_ptr (); *s != '\0'; s++) - putchar (*s); - - putchar ('\n'); - *(char *) shm_client.get_segment_ptr () = '*'; - ACE_OS::exit (0); -} - -static void -server (void) -{ - ACE_SV_Shared_Memory shm_server; - - if (shm_server.open_and_attach (SHM_KEY, SHMSZ, ACE_SV_Shared_Memory::ACE_CREATE) == -1) - ACE_OS::perror ("open"), ACE_OS::exit (1); - - char *s = (char *) shm_server.get_segment_ptr (); - - for (char c = 'a'; c <= 'z'; c++) - *s++ = c; - - *s = '\0'; - - for (s = (char *) shm_server.get_segment_ptr (); *s != '*'; ) - ACE_OS::sleep (1); - - if (shm_server.remove () < 0) - ACE_OS::perror ("remove"), ACE_OS::exit (1); - ACE_OS::exit (0); -} - -int -main (int, char *argv[]) -{ - switch (ACE_OS::fork ()) - { - case -1: - ACE_OS::perror (argv[0]), ACE_OS::exit (1); - case 0: - ACE_OS::sleep (1); - client (); - default: - server (); - } - return 0; -} - diff --git a/examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.h b/examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.h deleted file mode 100644 index 7712e016a09..00000000000 --- a/examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.h +++ /dev/null @@ -1,7 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/OS.h" -#define SHMSZ 27 -#define SEM_KEY 1234 -#define SHM_KEY 5678 |