MCPcopy Create free account
hub / github.com/git/git / setitimer

Function setitimer

compat/mingw.c:2778–2807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2776}
2777
2778int setitimer(int type UNUSED, struct itimerval *in, struct itimerval *out)
2779{
2780 static const struct timeval zero;
2781 static int atexit_done;
2782
2783 if (out) {
2784 errno = EINVAL;
2785 return error("setitimer param 3 != NULL not implemented");
2786 }
2787 if (!is_timeval_eq(&in->it_interval, &zero) &&
2788 !is_timeval_eq(&in->it_interval, &in->it_value)) {
2789 errno = EINVAL;
2790 return error("setitimer: it_interval must be zero or eq it_value");
2791 }
2792
2793 if (timer_thread)
2794 stop_timer_thread();
2795
2796 if (is_timeval_eq(&in->it_value, &zero) &&
2797 is_timeval_eq(&in->it_interval, &zero))
2798 return 0;
2799
2800 timer_interval = in->it_value.tv_sec * 1000 + in->it_value.tv_usec / 1000;
2801 one_shot = is_timeval_eq(&in->it_interval, &zero);
2802 if (!atexit_done) {
2803 atexit(stop_timer_thread);
2804 atexit_done = 1;
2805 }
2806 return start_timer_thread();
2807}
2808
2809int sigaction(int sig, struct sigaction *in, struct sigaction *out)
2810{

Callers 2

set_progress_signalFunction · 0.85
clear_progress_signalFunction · 0.85

Calls 4

errorFunction · 0.85
is_timeval_eqFunction · 0.85
stop_timer_threadFunction · 0.85
start_timer_threadFunction · 0.85

Tested by

no test coverage detected