SNode.C
Loading...
Searching...
No Matches
utils::system Namespace Reference

Functions

sighandler_t signal (int sig, sighandler_t handler)
 
std::string sigabbrev_np (int sig)
 
time_t time (time_t *tloc)
 
int gettimeofday (struct timeval *tv, struct timezone *tz)
 
struct tm * gmtime (const time_t *timep)
 
time_t mktime (struct tm *tm)
 

Function Documentation

◆ gettimeofday()

int utils::system::gettimeofday ( struct timeval *  tv,
struct timezone *  tz 
)

Definition at line 57 of file time.cpp.

57 {
58 errno = 0;
59 return ::gettimeofday(tv, tz);
60 }

Referenced by utils::Timeval::currentTime().

Here is the caller graph for this function:

◆ gmtime()

struct tm * utils::system::gmtime ( const time_t *  timep)

Definition at line 62 of file time.cpp.

62 {
63 errno = 0;
64 return ::gmtime(timep);
65 }

Referenced by web::http::server::Response::clearCookie(), and httputils::to_http_date().

Here is the caller graph for this function:

◆ mktime()

time_t utils::system::mktime ( struct tm *  tm)

Definition at line 67 of file time.cpp.

67 {
68 errno = 0;
69 return ::mktime(tm);
70 }

◆ sigabbrev_np()

std::string utils::system::sigabbrev_np ( int  sig)

Definition at line 59 of file signal.cpp.

59 {
60 static std::map<int, std::string> sigMap = {
61 {SIGABRT, "ABRT"}, {SIGALRM, "ALRM"}, {SIGBUS, "BUS"}, {SIGCHLD, "CHLD"}, {SIGCONT, "CONT"}, {SIGFPE, "FPE"},
62 {SIGHUP, "HUP"}, {SIGILL, "ILL"}, {SIGINT, "INT"}, {SIGKILL, "KILL"}, {SIGPIPE, "PIPE"}, {SIGPOLL, "POLL"},
63 {SIGPROF, "PROF"}, {SIGQUIT, "QUIT"}, {SIGSEGV, "SEGV"}, {SIGSTOP, "STOP"}, {SIGSYS, "SYS"}, {SIGTERM, "TERM"},
64 {SIGTRAP, "TRAP"}, {SIGTSTP, "TSTP"}, {SIGTTIN, "TTIN"}, {SIGTTOU, "TTOU"}, {SIGUSR1, "USR1"}, {SIGUSR2, "USR2"},
65 {SIGURG, "URG"}, {SIGVTALRM, "VTALRM"}, {SIGXCPU, "XCPU"}, {SIGXFSZ, "XFSZ"}, {SIGWINCH, "WINCH"}};
66
67 return sigMap.contains(sig) ? sigMap[sig] : "UNKNOWN";
68 }

Referenced by core::EventLoop::free(), apps::websocket::subprotocol::echo::client::Echo::onSignal(), apps::websocket::subprotocol::echo::server::Echo::onSignal(), iot::mqtt::SubProtocol< WSSubProtocolRoleT >::onSignal(), core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::onSignal(), and core::EventLoop::stoponsig().

Here is the caller graph for this function:

◆ signal()

sighandler_t utils::system::signal ( int  sig,
sighandler_t  handler 
)

Definition at line 54 of file signal.cpp.

54 {
55 errno = 0;
56 return std::signal(sig, handler);
57 }

◆ time()

time_t utils::system::time ( time_t *  tloc)

Definition at line 52 of file time.cpp.

52 {
53 errno = 0;
54 return ::time(tloc);
55 }

Referenced by httputils::to_http_date().

Here is the caller graph for this function: