#ifdef CONFIG_SDL
#include <SDL.h>
#endif
-#ifdef CONFIG_LINUX
+#if defined(CONFIG_LINUX) || defined(CONFIG_DARWIN)
#include <sys/ipc.h>
#include <sys/shm.h>
extern int g_shmid;
shutdown_guest_server();
stop_ecs();
-#ifdef CONFIG_LINUX
- /* clean up the vm lock memory by munkyu */
+#if defined(CONFIG_LINUX) || defined(CONFIG_DARWIN)
if (shmctl(g_shmid, IPC_RMID, 0) == -1) {
ERR("shmctl failed\n");
perror("emulator.c: ");
MULTI_DEBUG_CHANNEL(qemu, osutil);
+int g_shmid;
extern char tizen_target_img_path[];
CFDictionaryRef proxySettings;
void make_vm_lock_os(void)
{
- int shmid;
char *shared_memory;
int base_port;
base_port = get_emul_vm_base_port();
- shmid = shmget((key_t)base_port, MAXLEN, 0666|IPC_CREAT);
- if (shmid == -1) {
+ g_shmid = shmget((key_t)base_port, MAXLEN, 0666|IPC_CREAT);
+ if (g_shmid == -1) {
ERR("shmget failed\n");
perror("osutil-darwin: ");
return;
}
- shared_memory = shmat(shmid, (char *)0x00, 0);
+ shared_memory = shmat(g_shmid, (char *)0x00, 0);
if (shared_memory == (void *)-1) {
ERR("shmat failed\n");
perror("osutil-darwin: ");
return;
}
- sprintf(shared_memory, "%s", tizen_target_img_path);
+ g_sprintf(shared_memory, "%s", tizen_target_img_path);
INFO("shared memory key: %d, value: %s\n", base_port, (char *)shared_memory);
if (shmdt(shared_memory) == -1) {