/* SEF entry points for system processes. */
void sef_startup(void);
int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr);
+void sef_cancel(void);
void sef_exit(int status);
#define sef_receive(src, m_ptr) sef_receive_status(src, m_ptr, NULL)
endpoint_t sef_self_endpoint;
int sef_self_priv_flags;
int sef_self_first_receive_done;
+int sef_self_receiving;
/* Debug. */
#if SEF_INIT_DEBUG || SEF_LU_DEBUG || SEF_PING_DEBUG || SEF_SIGNAL_DEBUG
/* SEF receive() interface for system services. */
int r, status;
+ sef_self_receiving = TRUE;
+
while(TRUE) {
+ /* If the caller indicated that it no longer wants to receive a message,
+ * return now.
+ */
+ if (!sef_self_receiving)
+ return EINTR;
#if INTERCEPT_SEF_LU_REQUESTS
/* Handle SEF Live update before receive events. */
return r;
}
+/*===========================================================================*
+ * sef_cancel *
+ *===========================================================================*/
+void sef_cancel(void)
+{
+/* Cancel receiving a message. This function be called from a callback invoked
+ * from within sef_receive_status(), which will then return an EINTR error
+ * code. In particular, this function can be used to exit from the main receive
+ * loop when a signal handler causes the process to want to shut down.
+ */
+
+ sef_self_receiving = FALSE;
+}
+
/*===========================================================================*
* sef_exit *
*===========================================================================*/