[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to request notifications

From: Sergiu Ivanov
Subject: How to request notifications
Date: Mon, 13 Jul 2009 20:47:56 +0300
User-agent: Mutt/1.5.18 (2008-05-17)


My current goal is to make unionmount go away when the mountee (the
union-mounted translator) goes away.  From antrik's words (and from
personal remembering) I know that this could be achieved by listening
to the MACH_NOTIFY_NO_SENDERS notification on translator's control
port.  However, I could not find sufficient (for me) information how
to properly request such a notification.

I looked into hurd/boot/boot.c and libfshelp/start-translator-long.c
but, unfourtunately, both are handling rather specific cases,
considerably different from my situation.  By analogy with boot.c, I
built up the following series of steps:

  mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE,
  mach_port_insert_right (mach_task_self (), nosenders_listen_port,
                         nosenders_listen_port, MACH_MSG_TYPE_MAKE_SEND);
  mach_port_request_notification (mach_task_self (), nosenders_listen_port,
                                  MACH_NOTIFY_NO_SENDERS, 1, 
                                  MACH_MSG_TYPE_MAKE_SEND_ONCE, &prev);

However, this series of steps is pretty meaningless, since I never
specify the port to the mountee, to which I would like to listen for
notifications.  I tried putting mountee_port and mountee_control (I
hope the names of the variables make their destination clear) instead
of nosenders_listen_port in different places, but I am constantly
receiving and ``invalid port right'' error.

Could somebody point out an idea of a solution to this problem,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]