bool Connection::receiveActions() { Logger::logDebug("Connection: enter: %s", __FUNCTION__); while (1) { uint32_t action = 0; // Get the action. recvMsg(&action); switch (action) { case INVOKER_MSG_EXEC: receiveExec(); break; case INVOKER_MSG_ARGS: receiveArgs(); break; case INVOKER_MSG_ENV: // Clean-up all the env variables clearenv(); receiveEnv(); break; case INVOKER_MSG_PRIO: receivePriority(); break; case INVOKER_MSG_DELAY: receiveDelay(); break; case INVOKER_MSG_IO: receiveIO(); break; case INVOKER_MSG_IDS: receiveIDs(); break; case INVOKER_MSG_END: sendMsg(INVOKER_MSG_ACK); if (m_sendPid) sendPid(getpid()); return true; default: Logger::logError("Connection: received invalid action (%08x)\n", action); return false; } } }
void ProcessThread::stop() { const pid_t stopPid = 1; // assume that no user process has a pid of 1 sendPid(stopPid); }
void ProcessThread::processSignalHandler(int sig) { assert(sig == SIGCHLD); (void)sig; sendPid(0); }
void ProcessThread::processSignalHandler(int sig, siginfo_t* info, void*) { assert(sig == SIGCHLD); (void)sig; sendPid(info->si_pid); }