Skip to contentSkip to conversation

Fix mq_notify with SIGEV_NONE notification

PATCH Manfred Spraul 2 participants 2 messages Apr 14, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Jakub,

Quoted 6 lines · Jakub

mq_notify (q, NULL)
and
struct sigevent ev = { .sigev_notify = SIGEV_NONE }; mq_notify (q, &ev)
are not the same thing in POSIX, yet the kernel treats them the same.

What should mq_notify(q, &{.sigev_notify = SIGEV_NONE}) do? Register a notification, but deliver nothing?

--
Manfred

#2 lore raw
Quoted 8 lines · Manfred Spraul
Quoted 6 lines

mq_notify (q, NULL)
and
struct sigevent ev = { .sigev_notify = SIGEV_NONE }; mq_notify (q, &ev)
are not the same thing in POSIX, yet the kernel treats them the same.

What should mq_notify(q, &{.sigev_notify = SIGEV_NONE}) do? Register a notification, but deliver nothing?

Yes. It makes it impossible to mq_notify for others until the owner mq_notify (q, NULL) or until a message arrives at the queue while nobody is blocked in mq_{,timed}receive or until the mqd_t through which it has been registered is mq_close()d.
It is not very useful, sure, but neither is having two different ways how to unregister notification, one is completely enough. At which point it is IMHO better to follow the standard (and what other OSes do), rather than invent something new.

Jakub