Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. int fd = shm_open("EscapeRoom", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
  2.     ftruncate(fd, sizeof(struct EscapeRoom));
  3.  
  4.     struct EscapeRoom *room;
  5.     int prot = prot = PROT_READ | PROT_WRITE;
  6.     int flags = MAP_SHARED | MAP_ANONYMOUS;
  7.     room = (struct EscapeRoom *)mmap(NULL, sizeof(struct EscapeRoom), prot, flags, fd, 0);
  8.  
  9.     int liczbaGraczy;
  10.     int liczbaPokoi;
  11.  
  12.     scanf("%d %d", &liczbaPokoi, &liczbaGraczy);
  13.    
  14.     room->ileDoWejscia = liczbaGraczy;
  15.     room->ileDoWyjscia = liczbaGraczy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement