Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'features/org.eclipse.equinox.executable.feature/library/eclipseShm.c')
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/eclipseShm.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipseShm.c b/features/org.eclipse.equinox.executable.feature/library/eclipseShm.c
index 0aaadbe2b..4fbb39be7 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipseShm.c
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipseShm.c
@@ -128,73 +128,6 @@ int setSharedData(const _TCHAR* id, const _TCHAR* data) {
return 0;
}
-#elif PHOTON
-
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-int createSharedData(char** id, int size) {
- int fd;
- char* location = "/tmp/eclipse_%x";
- char* name = malloc(strlen(location) + 9);
- sprintf(name, location, getpid());
- if ((fd = shm_open(name, O_RDWR | O_CREAT, 0666 )) == -1) return -1;
- if (ftruncate(fd, size) == -1 ) {
- shm_unlink(name);
- return -1;
- }
- close( fd );
- if (id != NULL) {
- *id = name;
- }
- return 0;
-}
-
-int destroySharedData(char* id) {
- return shm_unlink(id);
-}
-
-int getSharedData(char* id, char** data) {
- int fd, length, size;
- char *sharedData, *newData = NULL;
- if ((fd = shm_open(id, O_RDWR, 0666 )) == -1) return -1;
- size = lseek(fd, 0, SEEK_END);
- sharedData = mmap( 0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
- if (sharedData != MAP_FAILED) {
- if (data != NULL) {
- length = strlen(sharedData) + 1;
- newData = malloc(length);
- memcpy(newData, sharedData, length);
- }
- munmap(sharedData, size);
- }
- close(fd);
- *data = newData;
- return newData == NULL ? -1 : 0;
-}
-
-int setSharedData(char* id, char* data) {
- int fd, length, size;
- char *sharedData;
- if ((fd = shm_open(id, O_RDWR, 0666 )) == -1) return -1;
- size = lseek(fd, 0, SEEK_END);
- sharedData = mmap( 0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
- if (sharedData != MAP_FAILED) {
- if (data != NULL) {
- length = strlen(data) + 1;
- memcpy(sharedData, data, length);
- } else {
- memset(sharedData, 0, sizeof(char));
- }
- munmap(sharedData, size);
- }
- close(fd);
- return 0;
-}
-
#else /* Unix like platforms */
#include <sys/shm.h>

Back to the top