Regd "既存のメッセージ キューの ID を取得するにはどうすればよいですか?"
man msgget から
If msgflg specifies both IPC_CREAT and IPC_EXCL and a message queue already exists for key, then msgget() fails with errno set to EEX-
IST. (This is analogous to the effect of the combination O_CREAT | O_EXCL for open(2).)
IPC_EXCL フラグなしで試してください。
登録 メッセージキューはそのIDをどこに保存しますか
マンプロセスから
/proc/sysvipc
Subdirectory containing the pseudo-files msg, sem and shm. These files list the System V Interprocess Communication (IPC)
objects (respectively: message queues, semaphores, and shared memory) that currently exist on the system, providing similar
information to that available via ipcs(1). These files have headers and are formatted (one IPC object per line) for easy under-
standing. svipc(7) provides further background on the information shown by these files.