Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. // add message to common memmory
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include "shared.h"
  6. #include "message.h"
  7. int main(){
  8.     common *msg;
  9.     msg = (common *)getmem(615621961);
  10.    
  11.     sem_t full  = sem_init(615621962);
  12.     sem_t empty = sem_init(615621963);
  13.    
  14.     int i=0;char text[] = "Message ";
  15.  
  16.  
  17.     for(i=1; i<30; i++){
  18.    
  19.         PS(empty);
  20.            
  21.             msg->number = i;
  22.             text[8] = msg->number + '0';   
  23.             strcpy(msg->name, text);
  24.            
  25.         VS(full);  
  26.     }  
  27.   return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement