Exemplo n.º 1
0
//
//  Open_Signal: C
//
DEVICE_CMD Open_Signal(REBREQ *req)
{
    //RL_Print("Open_Signal\n");

    sigset_t mask;
    sigset_t overlap;

#ifdef CHECK_MASK_OVERLAP //doesn't work yet
    if (sigprocmask(SIG_BLOCK, NULL, &mask) < 0) {
        goto error;
    }
    if (sigandset(&overlap, &mask, &req->special.signal.mask) < 0) {
        goto error;
    }
    if (!sigisemptyset(&overlap)) {
        req->error = EBUSY;
        return DR_ERROR;
    }
#endif

    if (sigprocmask(SIG_BLOCK, &req->special.signal.mask, NULL) < 0) {
        goto error;
    }

    SET_OPEN(req);
    Signal_Device(req, EVT_OPEN);

    return DR_DONE;

error:
    req->error = errno;
    return DR_ERROR;
}
Exemplo n.º 2
0
sigset_t sigset_and(sigset_t a, sigset_t b) {
	int status;
	sigset_t result;
	status = sigemptyset(&result);
	ASSUME(status, 0);
	status = sigandset(&result, &a, &b);
	ASSUME(status, 0);
	return result;
}
Exemplo n.º 3
0
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
RtSigSet RtSigSet::operator& (const RtSigSet& sigset)
{
    RtSigSet result;
    sigandset (&result, this, &sigset);
    return result;
}