cooling/cooling.cc
/// We share some memory with rsked: a status word. Attempt to set
/// this up, assuming rsked is running and has created the shared memory
/// with a key passed by cooling to rsked in its command line argument.
///
We share some memory with rsked: a status word. Attempt to set
this up, assuming rsked is running and has created the shared memory
with a key passed by cooling to rsked in its command line argument.
We share some memory with rsked : a status word . Attempt to set this up assuming rsked is running and has created the shared memory with a key passed by cooling to rsked in its command line argument .
bool Cooling::setup_shmem()
{
    m_shm_id = shmget( m_sh_token, sizeof(uint32_t), 0 );
    if (m_shm_id==(-1)) {
        LOG_ERROR(Lgr) << "Failed to get shared memory: " << strerror(errno);
        return false;
    } else {
        errno=0;
        m_shm_word = (uint32_t*) shmat(m_shm_id,NULL,0); 
        if ((void*)(-1)==m_shm_word) {
            LOG_ERROR(Lgr) << "Failed to attach shared memory: "
                          << strerror(errno);
            m_shm_word = nullptr;
        } else {
            LOG_INFO(Lgr) << "Shared memory attached, value=" << *m_shm_word;
        }
    }
    illuminate_grn(true);
    return true;
}
bool Cooling :: setup_shmem ( ) { m_shm_id = shmget ( m_sh_token , sizeof ( uint32_t ) , 0 ) ; if ( m_shm_id == ( -1 ) ) { LOG_ERROR ( Lgr ) << " " << strerror ( errno ) ; return false ; } else { errno = 0 ; m_shm_word = ( uint32_t * ) shmat ( m_shm_id , NULL , 0 ) ; if ( ( void * ) ( -1 ) == m_shm_word ) { LOG_ERROR ( Lgr ) << " " << strerror ( errno ) ; m_shm_word = nullptr ; } else { LOG_INFO ( Lgr ) << " " << * m_shm_word ; } } illuminate_grn ( true ) ; return true ; }
We share some memory with rsked: a status word.
We share some memory with rsked : a status word .
// RW