Message queues (System V)

Mike McNally m5 at lynx.uucp
Sat Mar 3 03:03:20 AEST 1990


I have recently discovered that message queues with a key of IPC_PRIVATE are
not implicitly removed when all using tasks exit.  In other words, if
my program does:

	my_private_q = msgget(IPC_PRIVATE, IPC_CREAT | 0666);

and then has fun sending messages to itself and its offspring until dying a 
timely death, the queue will remain in the system.  Of course, because the
IPC_PRIVATE key was used, by definition no other process will ever be able
to "open" the queue in the future.

I realize that it would be "nice" to do a msgctl() to get rid of the thing,
but it seems a little user-hostile for the kernel to not do this automatically.
Is any purpose served by keeping the queue around?

(I found this out, BTW, on our Interactive Systems 386 system.)


-- 
Mike McNally                                    Lynx Real-Time Systems
uucp: {voder,athsys}!lynx!m5                    phone: 408 370 2233

            Where equal mind and contest equal, go.



More information about the Comp.unix.wizards mailing list