geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::POSIXSignalImp Class Reference

#include <POSIXSignal.hpp>

Inheritance diagram for geopm::POSIXSignalImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::POSIXSignalImp:
Collaboration graph
[legend]

Public Member Functions

 POSIXSignalImp ()=default
 
virtual ~POSIXSignalImp ()=default
 
sigset_t make_sigset (const std::set< int > &signal_set) const override
 Create a sigset_t from a set of signal numbers. More...
 
m_info_s reduce_info (const siginfo_t &info) const override
 Extract the signal number, signal value integer and sending PID from a siginfo_t struct to simplify mock data. More...
 
int sig_wait_info (const sigset_t *sigset, siginfo_t *info) const override
 Wrapper for sigwaitinfo(2) that converts errors into Exceptions. More...
 
int sig_timed_wait (const sigset_t *sigset, siginfo_t *info, const struct timespec *timeout) const override
 Wrapper for sigtimedwait(2) that converts errors into Exceptions. More...
 
void sig_queue (pid_t pid, int sig, int value) const override
 Wrapper for sigqueue(3) that converts errors into Exceptions. More...
 
void sig_action (int signum, const struct sigaction *act, struct sigaction *oldact) const override
 Wrapper for sigaction(2) that converts errors into Exceptions. More...
 
void sig_proc_mask (int how, const sigset_t *sigset, sigset_t *oldset) const override
 Wrapper for sigprocmask(2) that converts errors into Exceptions. More...
 
void sig_suspend (const sigset_t *mask) const override
 Wrapper for sigsuspend(2) that converts errors into Exceptions. More...
 
- Public Member Functions inherited from geopm::POSIXSignal
 POSIXSignal ()=default
 
virtual ~POSIXSignal ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::POSIXSignal
static std::unique_ptr< POSIXSignalmake_unique (void)
 Factory method for POSIXSignal interface. More...
 

Constructor & Destructor Documentation

◆ POSIXSignalImp()

geopm::POSIXSignalImp::POSIXSignalImp ( )
default

◆ ~POSIXSignalImp()

virtual geopm::POSIXSignalImp::~POSIXSignalImp ( )
virtualdefault

Member Function Documentation

◆ make_sigset()

sigset_t geopm::POSIXSignalImp::make_sigset ( const std::set< int > &  signal_set) const
overridevirtual

Create a sigset_t from a set of signal numbers.

Exceptions
geopm::Exceptionupon EINVAL
Parameters
signal_set[in]: Set of all signal numbers to add to the sigset.
Returns
A sigset_t that is zeroed except for specified signals

Implements geopm::POSIXSignal.

◆ reduce_info()

POSIXSignal::m_info_s geopm::POSIXSignalImp::reduce_info ( const siginfo_t &  info) const
overridevirtual

Extract the signal number, signal value integer and sending PID from a siginfo_t struct to simplify mock data.

Parameters
info[in]: see sigaction(2) man page
Returns
m_info_s reduced information set from siginfo_t struct

Implements geopm::POSIXSignal.

◆ sig_action()

void geopm::POSIXSignalImp::sig_action ( int  signum,
const struct sigaction *  act,
struct sigaction *  oldact 
) const
overridevirtual

Wrapper for sigaction(2) that converts errors into Exceptions.

Exceptions
geopm::Exceptionupon EFAULT, EINVAL
Warning
The Linux API sigaction(2) does not properly implement error checking, so this function checks for EFAULT if act or oldact are nullptr
Remarks
See documentation for sigaction(2) about parameters.

Implements geopm::POSIXSignal.

◆ sig_proc_mask()

void geopm::POSIXSignalImp::sig_proc_mask ( int  how,
const sigset_t *  sigset,
sigset_t *  oldset 
) const
overridevirtual

Wrapper for sigprocmask(2) that converts errors into Exceptions.

Exceptions
geopm::Exceptionupon EFAULT, EINVAL
Remarks
See documentation for sigprocmask(2) about parameters and return value.

Implements geopm::POSIXSignal.

◆ sig_queue()

void geopm::POSIXSignalImp::sig_queue ( pid_t  pid,
int  sig,
int  value 
) const
overridevirtual

Wrapper for sigqueue(3) that converts errors into Exceptions.

Exceptions
geopm::Exceptionupon EINVAL, ESRCH
Remarks
See documentation for sigqueue(3) about parameters.

Implements geopm::POSIXSignal.

◆ sig_suspend()

void geopm::POSIXSignalImp::sig_suspend ( const sigset_t *  mask) const
overridevirtual

Wrapper for sigsuspend(2) that converts errors into Exceptions.

Exceptions
geopm::Exceptionupon EFAULT
Remarks
See documentation for sigsuspend(2) about parameters and return value. Except that it doesn't return an error by default.

Implements geopm::POSIXSignal.

◆ sig_timed_wait()

int geopm::POSIXSignalImp::sig_timed_wait ( const sigset_t *  sigset,
siginfo_t *  info,
const struct timespec *  timeout 
) const
overridevirtual

Wrapper for sigtimedwait(2) that converts errors into Exceptions.

Exceptions
geopm::Exceptionupon EAGAIN, EINTR, EINVAL
Remarks
See documentation for sigtimedwait(2) about parameters and return value.

Implements geopm::POSIXSignal.

◆ sig_wait_info()

int geopm::POSIXSignalImp::sig_wait_info ( const sigset_t *  sigset,
siginfo_t *  info 
) const
overridevirtual

Wrapper for sigwaitinfo(2) that converts errors into Exceptions.

Exceptions
geopm::Exceptionupon EAGAIN, EINTR, EINVAL
Remarks
See documentation for sigwaitinfo(2) about parameters and return value.

Implements geopm::POSIXSignal.


The documentation for this class was generated from the following files: