Нужно создать 5 очередей сообщений, делаю следующим образом
void creatqIPC(){
int key;
key=ftok(logpath,1);
printf("key=%d\n",key);
if(qid1 = msgget(key, IPC_CREAT | 0660)==-1){
printf("Can't create the queue\n");
exit(1);
}
printf("QID = %d\n", qid1);
key=ftok(logpath,2);
printf("key=%d\n",key);
if(qid2 = msgget(key, IPC_CREAT | 0660)==-1){
printf("Can't create the queue\n");
exit(1);
}
printf("QID = %d\n", qid2);
key=ftok(logpath,3);
printf("key=%d\n",key);
if(qid3 = msgget(key, IPC_CREAT | 0660)==-1){
printf("Can't create the queue\n");
exit(1);
}
printf("QID = %d\n", qid3);
key=ftok(logpath,4);
printf("key=%d\n",key);
if(qid4 = msgget(key, IPC_CREAT | 0660)==-1){
printf("Can't create the queue\n");
exit(1);
}
printf("QID = %d\n", qid4);
key=ftok(logpath,1234);
printf("key=%d\n",key);
if(qid5 = msgget(key, IPC_CREAT | 0660)==-1){
printf("Can't create the queue\n");
exit(1);
}
printf("QID = %d\n", qid5);
}
key=16867675
QID = 0
key=33644891
QID = 0
key=50422107
QID = 0
key=67199323
QID = 0
key=-771661477
QID = 0