Advertisement
Luis_Pedro

Untitled

Nov 8th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. void inicializaMemoriaPartilhada(void){
  2.     struct armazem *memoriaPartilhada;
  3.     int shmid;
  4.     shmid=shmget(1234,(sizeof(struct armazem)*(config->numero_armazens_sistema)),0777|IPC_CREAT);
  5.     memoriaPartilhada=shmat(shmid, NULL, 0);
  6.     for (int i=0;i<config->numero_armazens_sistema;i++){
  7.         memoriaPartilhada[i]=config->armazensSistema[i];
  8.         printf("memoria partilhada %s",memoriaPartilhada[i].nome);
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement