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.1.timer_create() #
NAME
timer_create – create a timer
SYNOPSIS
#include <sys.h>
#include <signal.h>
#include <time.h>
- int timer_create(clockid_t clock_id , struct sigevent *evp,
- timer_t *timerid );
- struct sigevent {
- int sigev_notify /* notification type */
- int sigev_signo; /* signal number */
- union sigval sigev_value; /* signal value */
- };
- union sigval {
- int sival_int; /* integer value */
- void *sival_ptr; /* pointer value */
- };
DESCRIPTION
timer_create() creates a timer using the Realtime Clock ID, CLOCK_REALTIME, as the timing base. The timer ID is unique and meaningful only within the calling thread until the timer is deleted. The timer is initially disarmed upon return from timer_create().
The timer is created on a per-thread basis. Expiration signals for the timer will be sent to the creating thread. A timer will NOT be automatically deleted when the creating thread exits. Also, pthread_exit() does NOT delete the timer. The user must do this by calling timer_delete().
If evp is non-NULL: then evp points to a sigevent structure, allocated by the application, which defines the asynchronous notification that will occur when the timer expires.
If the sigev_notify member of evp is
- SIGEV_SIGPOST,
- then the structure also contains the signal number to be sent to the thread. The application specific data value, sigev_value, is not used. Upon timer expiration, the thread is sent the signal defined in sigev_signo and conditionally added to the ready-to-run queue.
If the sigev_notify member of evp is - SIGEV_NONE
- then the sigev_signo and sigev_value are ignored. Upon timer expiration, the thread is added to the ready-to-run queue.
If evp is NULL, a default structure is used with values { SIGEV_SIGPOST, 0, {0} }.
RETURN VALUES
timer_create() returns 0 upon success and creates a timer_t, timerid , which can be passed to the timer calls; otherwise it returns -1 and sets errno.
ERRORS
- EAGAIN
- The system lacks sufficient signal queuing resources to honor the request. The calling thread has already created all of the timers it is allowed by this implementation.
- EINVAL
- The specified clock ID, clock_id, is not defined, only CLOCK_REALTIME may be used.
The specified signal notification type, evp->sigev_notify, is invalid.
The specified signal number, evp->sigev_signo, is invalid.