Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add message to common memmory
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "shared.h"
- #include "message.h"
- int main(){
- common *msg;
- msg = (common *)getmem(615621961);
- sem_t full = sem_init(615621962);
- sem_t empty = sem_init(615621963);
- int i=0;char text[] = "Message ";
- for(i=1; i<30; i++){
- PS(empty);
- msg->number = i;
- text[8] = msg->number + '0';
- strcpy(msg->name, text);
- VS(full);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement