Unison Help
- Unison Kernel
- Pthreads
- pthread_create()
- pthread_exit()
- pthread_self()
- pthread_equal()
- pthread_join()
- pthread_detach()
- pthread_setschedparam()
- pthread_getschedparam()
- pthread_attr_init()
- pthread_attr_destroy()
- pthread_attr_setstackaddr()
- pthread_attr_getstackaddr()
- pthread_attr_setstacksize()
- pthread_attr_getstacksize()
- pthread_attr_setschedparam()
- pthread_attr_getschedparam()
- pthread_attr_setdetachstate()
- pthread_attr_getdetachstate()
- pthread_stackinfo()
- pthread_setprio()
- pthread_getprio()
- sched_get_priority_max()
- sched_get_priority_min()
- sched_yield()
- Pthread Cancellation
- Mutex
- Semaphores
- Message Queues
- Conditional Variables
- Barriers
- Timers
- Clocks
- Memory Allocation
- Rendezvous
- Interrupts
- Directory Services
- Miscellaneous
- Pthreads
- Unison I/O Library
- Unison STDIO Library
- STDIO Library Calls
- clearerr()
- dprintf()
- fclose()
- fdopen()
- feof()
- ferror()
- fileno()
- fflush()
- fgetc()
- fgetpos()
- fgets()
- fopen()
- fprintf()
- fputc()
- fputs()
- fread()
- freopen()
- fscanf()
- fseek()
- fseeko()
- fsetpos()
- ftell()
- ftello()
- fwrite()
- getc()
- getc_unlocked()
- getchar()
- getchar_unlocked()
- getdelim()
- getline()
- gets()
- get_stderr_ptr()
- get_stdin_ptr()
- get_stdout_ptr()
- noperprintf()
- perprintf()
- perror()
- posix_compat()
- printf()
- putc()
- putc_unlocked()
- putchar()
- putchar_unlocked()
- puts()
- remove()
- rewind()
- scanf()
- setbuf()
- setvbuf()
- snprintf()
- sprintf()
- sscanf()
- stderr_init()
- stderr_close()
- stdin_init()
- stdin_close()
- stdout_init()
- stdout_close()
- vdprintf()
- vscanf()
- vsscanf()
- vfscanf()
- vprintf()
- vsnprintf()
- vsprintf()
- vfprintf()
- ungetc()
- Do-nothing Stubs
- STDIO Library Calls
- Unison LIBC Library
- Unison I/O Servers
- Graphics, Camera, Video, Audio
- Network Protocols
- TCP and UDP Server - tcpd
- DHCP Client Service - dhcp client
- DHCP Server - dhcpd
- Telnet Server - telnetd
- Tiny FTP Server - tftpd
- Point to Point - pppd
- Network Translation - NAT with PAT
- Firewall
- Tiny HTTP Server - thttpd
- Tiny HTTP Server with TLS
- POP3 Server
- Simple Mail Transfer Protocol Services (SMTP)
- Bootp Protocol
- File Transfer Protocol Server (FTP)
- File Transfer Client Services
- RPC / XDR
- DNS Client
- HTTP/HTTPS Client
- REST Client
- AutoIP Service - autoip client
- mDNS server - mdnsd
- SNTP Client
- SNMP Agent - Snmpd server
- SSL/TLS library
- SSH server
- IP security
- Power Control
- Serial I/O
- System Services
- Universal Serial Bus (USB)
- Wireless
- Remedy Tools for Unison
1.8.5.timer_getoverrun() #
NAME
timer_settime, timer_gettime, timer_getoverrun – high-resolution timer operations
SYNOPSIS
#include <time.h>
- int timer_settime(timer_t timerid , int flags,
- const struct itimerspec *value,
- struct itimerspec *ovalue );
- int timer_gettime(timer_t timerid,
- struct itimerspec *value );
- int timer_getoverrun(timer_t timerid );
- struct itimerspec {
- struct timespec it_interval; /* timer period */
- struct timespec it_value; /* timer expiration */
- };
- struct timespec {
- time_t tv_sec; /* seconds */
- long tv_nsec; /* and nanoseconds */
- };
DESCRIPTION
If is non-zero, timer_settime() arms the timer, timerid, to next expire after the time designated by value. Upon expiration, an application-specified notification (see timer_create()) is queued for the calling thread. If timerid was already armed when timer_settime() is called, this call resets the time until the next expiration using the specified value. If value is zero, then the timer is disarmed.
Time may be expressed as either an absolute or relative time. If flags is set to TIMER_RELTIME, then the timer will initially expire relative to when the call is made. If flags is set to TIMER_ABSTIME, then the initial expiration will be relative to 00:00 Universal Coordinated Time, January 1, 1970. If the specified (absolute) time has already passed, timer_settime() succeeds and the expiration notification is made.
If value->it_interval is non-zero, then timerid, will be a periodic timer, to be reloaded to expire every value->it_value seconds and nanoseconds. Otherwise, if value->it_interval is zero and value->it_value is non-zero, then timerid is a one-shot timer, which will expire only at the time specified by value->it_value.
If ovalue is not NULL, and timer timerid had previously been used, then timer_settime() will store the remaining time until the previous timer expires in the timer and the previous reload interval in ovalue. (If the previous timer was disarmed, ovalue will be set to zero). The values stored in ovalue by timer_settime() are the same values that would have been returned by a call to timer_gettime().
timer_gettime() stores the amount of time until the specified timer, timerid, expires into value.
Only a single signal can be queued to the thread for a given timer at any point in time. When a timer, for which a signal is still pending expires, (from a previous interval), no signal will be queued, and a timer overrun count will be incremented.
RETURN VALUES
timer_settime(), timer_gettime(), and timer_getoverrun() return 0 upon success. If these functions fail, they return -1 and set errno to indicate the error condition.
ERRORS
- EINVAL
- timerid does not correspond to a timer returned by timer_create().
The timer, timerid, had already been deleted by timer_delete().
timer_settime has an invalid member of a structure. - ENOSYS
- The call is not supported.
SEE ALSO
clock_settime(), timer_create(), timer_delete()
NOTES
timer_getoverrun() is currently not supported and returns ENOSYS.