Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // message.h
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <string.h>
- #include <signal.h>
- #include <sys/sem.h>
- #include <unistd.h>
- #include <sys/shm.h>
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- #include <sys/mman.h>
- #include <sys/ipc.h>
- #define PERMS 0666 // права доступа
- // коды сообщений
- #define MSG_TYPE_CONT 1
- #define MSG_TYPE_FINISH 2
- #define MSG_ASSIGN_AREA 3
- #define MSG_REPORT 4
- #define SHM_ID 0x777 // ключ разделяемой памяти
- // структура сообщения, помещаемого в разделяемую память
- typedef struct {
- int type;
- int area;
- int group;
- int data;
- } message_t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement