shm.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __SHM_H__
  2. #define __SHM_H__
  3. #pragma once
  4. #ifndef _WIN32
  5. #include <sys/shm.h>
  6. #else
  7. #include "config.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /*-------------------------------------------------------------------------
  12. *
  13. * shmem.c
  14. * Microsoft Windows Win32 Shared Memory Emulation
  15. *
  16. *-------------------------------------------------------------------------
  17. */
  18. #define IPC_RMID 256
  19. #define IPC_CREAT 512
  20. #define IPC_EXCL 1024
  21. #define IPC_PRIVATE 234564
  22. #define IPC_NOWAIT 2048
  23. #define IPC_STAT 4096
  24. #define SHM_RDONLY 010000
  25. /*
  26. * Shared memory
  27. */
  28. struct shmid_ds
  29. {
  30. int dummy;
  31. int shm_nattch;
  32. };
  33. TOOLKIT_API int shmdt(const void* shmaddr);
  34. TOOLKIT_API void* shmat(int memId, void* shmaddr, int flag);
  35. TOOLKIT_API int shmctl(int shmid, int flag, struct shmid_ds* dummy);
  36. TOOLKIT_API int shmget(int memKey, int size, int flag);
  37. #ifdef __cplusplus
  38. } // extern "C" {
  39. #endif
  40. #endif //_WIN32
  41. #endif //__SHM_H__