There are several questions here :
- Where are the files from the elements listed in ipcs ?
It depends. Queues are visible in a virtual file system.
From mq_overview(7) :
Mounting the message queue file system
On Linux, message queues are created in a virtual file system. (Other implementations may also provide such a feature, but
the details are likely to differ.) This file system can be mounted (by the superuser) using the following commands:
# mkdir /dev/mqueue
# mount -t mqueue none /dev/mqueue
Shared memory (shm_overview(7))
Accessing shared memory objects via the file system
On Linux, shared memory objects are created in a (tmpfs) virtual file system, normally mounted under /dev/shm. Since kernel
2.6.19, Linux supports the use of access control lists (ACLs) to control the permissions of objects in the virtual file sys-
Accessing named semaphores via the file system
On Linux, named semaphores are created in a virtual file system, normally mounted under /dev/shm, with names of the form
sem.somename. (This is the reason that semaphore names are limited to NAME_MAX-4 rather than NAME_MAX characters.)
Since Linux 2.6.19, ACLs can be placed on files under this directory, to control object permissions on a per-user and per-
- Why are the named pipes created by
mkfifo not listed in
I'm not sure about that so I'll only give you my opinion, and not an answer. My hypothesis is that as they are present in the actual file system, like the sockets, there are not managed the same way the kernel manages shared memory segments and message queues.
- How are the named pipes created by mkfifo different from the message
queues created by ipcmk?
The main difference between a pipe and a message queue is that a pipe is only a channel of communication between two processes. It functions at the byte level. You can read and write the way you want, and you have to design the protocol of communication. They are strict FIFOs: a byte written before another will always be read before at the other end.
A message queue deals with messages, and not bytes. And usually, they are less strictly FIFO. It depends on the implementation but they can support a mechanism of priority between messages.
In a way, message queues provide more functionnalities but you could, if you want to, implement FIFOs with message queues and vice-versa.