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 35 of file time.cpp.

35 {
36 errno = 0;
37 return ::gettimeofday(tv, tz);
38 }

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 40 of file time.cpp.

40 {
41 errno = 0;
42 return ::gmtime(timep);
43 }

Referenced by httputils::to_http_date().

Here is the caller graph for this function:

◆ mktime()

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

Definition at line 45 of file time.cpp.

45 {
46 errno = 0;
47 return ::mktime(tm);
48 }

◆ sigabbrev_np()

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

Definition at line 37 of file signal.cpp.

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

◆ signal()

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

Definition at line 32 of file signal.cpp.

32 {
33 errno = 0;
34 return std::signal(sig, handler);
35 }

◆ time()

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

Definition at line 30 of file time.cpp.

30 {
31 errno = 0;
32 return ::time(tloc);
33 }

Referenced by httputils::to_http_date().

Here is the caller graph for this function: