#include<stdio.h>
#include<sys/ipc.h>
#include<sys/msg.h>
struct msg_buffer {
long msg_type;
char msg[100];
} message;
main() {
key_t my_key;
int msg_id;
my_key = ftok("progfile", 65);
msg_id = msgget(my_key, 0666 | IPC_CREAT);
message.msg_type = 1;
fgets(message.
msg, 100, stdin
); msgsnd(msg_id, &message, sizeof(message), 0);
printf("Sent message is : %s \n", message.
msg); }
I2luY2x1ZGU8c3RkaW8uaD4gCiNpbmNsdWRlPHN5cy9pcGMuaD4KI2luY2x1ZGU8c3lzL21zZy5oPiAKc3RydWN0IG1zZ19idWZmZXIgeyAKbG9uZyBtc2dfdHlwZTsgCmNoYXIgbXNnWzEwMF07IAp9IG1lc3NhZ2U7IAptYWluKCkgeyAKa2V5X3QgbXlfa2V5OyAKaW50IG1zZ19pZDsgCm15X2tleSA9IGZ0b2soInByb2dmaWxlIiwgNjUpOyAKbXNnX2lkID0gbXNnZ2V0KG15X2tleSwgMDY2NiB8IElQQ19DUkVBVCk7IAptZXNzYWdlLm1zZ190eXBlID0gMTsgCnByaW50ZigiV3JpdGUgTWVzc2FnZSA6ICIpOyAKZmdldHMobWVzc2FnZS5tc2csIDEwMCwgc3RkaW4pOyAKbXNnc25kKG1zZ19pZCwgJm1lc3NhZ2UsIHNpemVvZihtZXNzYWdlKSwgMCk7IApwcmludGYoIlNlbnQgbWVzc2FnZSBpcyA6ICVzIFxuIiwgbWVzc2FnZS5tc2cpOyAKfQ==