vumonitor/vumonitor.cc
/// Establish shared memory with a block to hold struct vu_status
/// Do not throw since this is called by ctor.
///
Establish shared memory with a block to hold struct vu_status
Do not throw since this is called by ctor.
Establish shared memory with a block to hold struct vu_status Do not throw since this is called by ctor .
void VU_monitor::setup_shm()
{
    m_shm_id = shmget( m_shmkey, sizeof(VU_status), (IPC_CREAT|0660) );
    if (m_shm_id==(-1)) {
        LOG_ERROR(Lgr) << "Failed to get shared memory: "
                      << strerror(errno);
    } else {
        errno=0;
        m_shm_status=static_cast<VU_status*>( shmat(m_shm_id,NULL,0) );  RW
        if ((void*)(-1)==m_shm_status) {
            LOG_ERROR(Lgr) << "Failed to attach shared memory: "
                          << strerror(errno);
            m_shm_status = nullptr;
        } else {
            LOG_INFO(Lgr) << "Shared memory created with key: " << m_shmkey;
            force_clear_status();
        }
    }
}
void VU_monitor :: setup_shm ( ) { m_shm_id = shmget ( m_shmkey , sizeof ( VU_status ) , ( IPC_CREAT | 0660 ) ) ; if ( m_shm_id == ( -1 ) ) { LOG_ERROR ( Lgr ) << " " << strerror ( errno ) ; } else { errno = 0 ; m_shm_status = static_cast < VU_status * > ( shmat ( m_shm_id , NULL , 0 ) ) ; if ( ( void * ) ( -1 ) == m_shm_status ) { LOG_ERROR ( Lgr ) << " " << strerror ( errno ) ; m_shm_status = nullptr ; } else { LOG_INFO ( Lgr ) << " " << m_shmkey ; force_clear_status ( ) ; } } }
Establish shared memory with a block to hold struct vu_status
Do not throw since this is called by ctor.
Establish shared memory with a block to hold struct vu_status Do not throw since this is called by ctor .
// // RW