getitimer(2) System Calls Manual getitimer(2) getitimer, setitimer - (libc -lc) #include int getitimer(int which, struct itimerval *curr_value); int setitimer(int which, const struct itimerval *restrict new_value, struct itimerval *_Nullable restrict old_value); () . ( ). -- which-- : ITIMER_REAL ( ). SIGALRM. ITIMER_VIRTUAL . ( .) SIGVTALRM. ITIMER_PROF ( ) . ( .) SIGPROF. ITIMER_VIRTUAL . . : struct itimerval { struct timeval it_interval; /* Interval for periodic timer */ struct timeval it_value; /* Time until next expiration */ }; struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec; /* microseconds */ }; getitimer() getitimer() which curr_value. it_value . it_interval . it_value ( ). it_interval . it_interval ( ). setitimer() setitimer() which new_value. old_value NULL ( getitimer()). new_value.it_value . new_value.it_value . new_value.it_interval . . -1 errno . EFAULT new_value old_value curr_value . EINVAL which ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ( Linux 2.6.22) tv_usec new_value [0, 999999]. : setitimer(which, NULL, &old_value); (Solaris BSDs ) : getitimer(which, &old_value); Linux new_value . Linux: . . 4.2BSD SVr4 SUSv1 POSIX.1-2001. POSIX.1-2008 getitimer() setitimer() POSIX (timer_gettime(2) timer_settime(2) ) . POSIX.1-2024 . () time(7). ( .) ( ITIMER_VIRTUAL) . fork(2) . execve(2). POSIX.1 setitimer() alarm(2) sleep(3) usleep(3) . . ITIMER_REAL . . 2.6.16 jiffies. jiffies MAX_SEC_IN_JIFFIES ( include/linux/jiffies.h) . /i386 ( 2.6.13 jiffy 0.004 ) 99.42 . 2.6.16 . ( i386) 2.6.12 jiffy . 2.6.12. POSIX.1-2001 setitimer() tv_usec [0, 999999]. 2.6.21 . 2.6.22 : tv_usec EINVAL. gettimeofday(2) sigaction(2) signal(2) timer_create(2) timerfd_create(2) time(7) 3 . . : . 6.18 8 2026 getitimer(2)