#include <stdio.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> #define PERMS 0644 struct my_msgbuf { long mtype; char mtext[200]; }; int main(void) { struct my_msgbuf buf; int msqid; int len; key_t key; system("touch msgq.txt"); if ((key = ftok("msgq.txt", 'B')) == -1) { perror("ftok"); exit(1); } if ((msqid = msgget(key, PERMS | IPC_CREAT)) == -1) { perror("msgget"); exit(1); } printf("me...
Comments
Post a Comment