Exemple #1
0
void svrExitCommandHandler() {
    struct itimerval interval;

    interval.it_value.tv_sec = 0;
    interval.it_value.tv_usec = 0;
    interval.it_interval.tv_sec = 0;
    interval.it_interval.tv_usec = 0;
    setitimer(ITIMER_REAL, &interval, NULL);
    if (static_chp.m_pKpi) {
        CloseShm(static_chp.m_pKpi);
        static_chp.m_pKpi = NULL;
    }
    if (static_chp.m_nIdentifier) {
        DestoryShm(static_chp.m_nIdentifier);
        static_chp.m_nIdentifier = 0;
    }
    if (static_chp.m_nQid) {
        CloseMessageQueue(static_chp.m_nQid);
        static_chp.m_nQid = 0;
    }
    pthread_mutex_destroy(&mutex_lock_timer);
    PipeShellExit(static_chp.m_shell);
    ScClose(static_chp.m_comm);
    ScExit(static_chp.m_comm);
    BufExit(&local_gws_buff);
    svrClearSysMon();
    ShutdownInstance();
}
Exemple #2
0
int main(void)
{
    OpenShm();

    if(shm_fd != -1 || shm_addr != MAP_FAILED)
    {
        printf ("data (@ %#x): '%s'\n", (unsigned int) shm_addr, shm_addr);

        while(*shm_addr != 'a')
        {}

        printf ("data (@ %#x): '%s'\n", (unsigned int) shm_addr, shm_addr);

        *shm_addr = 'A';

        printf ("data (@ %#x): '%s'\n", (unsigned int) shm_addr, shm_addr);

        CloseShm();
    }

    return (0);
}