Advertisement
v3rganz

Untitled

May 20th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #ifndef SHMOPERATIONS_H
  2. #define SHMOPERATIONS_H
  3. #include "header.h"
  4.  
  5. int delSharedMem(int sharedMem) {
  6.   if(shmctl(sharedMem, IPC_RMID, NULL) == ERRCODE) {
  7.     perror("shmctl");
  8.     return EXIT_FAILURE;
  9.   }
  10.   return EXIT_SUCCESS;
  11. }
  12.  
  13. int detachSharedMem(void *attachedMem) {
  14.   if(shmdt(attachedMem) == ERRCODE) {
  15.     perror("shmdt");
  16.     return EXIT_FAILURE;
  17.   }
  18.  
  19.   return EXIT_SUCCESS;
  20. }
  21.  
  22. #endif // !SHMOPERATIONS_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement