Advertisement
_takumi

message.h

Apr 23rd, 2023
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. // message.h
  2. #include <sys/types.h>
  3. #include <sys/wait.h>
  4. #include <fcntl.h>
  5. #include <errno.h>
  6. #include <string.h>
  7. #include <signal.h>
  8. #include <sys/sem.h>
  9. #include <unistd.h>
  10. #include <sys/shm.h>
  11. #include <stdio.h>
  12. #include <time.h>
  13. #include <stdlib.h>
  14. #include <sys/mman.h>  
  15. #include <sys/ipc.h>
  16.  
  17. #define PERMS   0666      // права доступа
  18.  
  19. // коды сообщений
  20. #define MSG_TYPE_CONT   1
  21. #define MSG_TYPE_FINISH 2
  22. #define MSG_ASSIGN_AREA 3
  23. #define MSG_REPORT      4
  24. #define SHM_ID          0x777     // ключ разделяемой памяти
  25.  
  26. // структура сообщения, помещаемого в разделяемую память
  27. typedef struct {
  28.   int type;
  29.   int area;
  30.   int group;
  31.   int data;
  32. } message_t;
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement