Posix message queue and command line?

I am writing code to replace TCP sockets on a POSIX message queue. Sometimes a program crashes (still in development) and the created queues are not deleted (they are not executed: mq_close() + mq_unlink() ). This causes problems when you re-run the code.

Is there a way to remove / delete these queues using the command line? I tried using: ipcs -q . This did not list all the queues.

I tried: lsof | grep queue-name lsof | grep queue-name . They really appeared here.

Ideally, I would like to use: ipcrm .

+6
source share
1 answer

POSIX IPC objects are implemented as files in virtual file systems. These files can be listed and deleted using ls and rm. To do this using POSIX message queues, we must attach the message queue file system using the following commands:

 $ su Password: # mkdir /dev/mqueue # mount -t mqueue none /dev/mqueue # exit 
+10
source

Source: https://habr.com/ru/post/988933/


All Articles