diff options
author | David Xu <davidxu@FreeBSD.org> | 2005-11-11 07:48:38 +0000 |
---|---|---|
committer | David Xu <davidxu@FreeBSD.org> | 2005-11-11 07:48:38 +0000 |
commit | bb5eebe6f2b6958db9fbde8ab11d74a5fc26ffd8 (patch) | |
tree | 74560fc5cb6c13d40ea30866073d6225f4feb053 /lib/libc/sys/timer_create.2 | |
parent | d09ed26fd80ce9c7bfbce9a4b89f352e610d8abc (diff) | |
download | src-bb5eebe6f2b6958db9fbde8ab11d74a5fc26ffd8.tar.gz src-bb5eebe6f2b6958db9fbde8ab11d74a5fc26ffd8.zip |
Add POSIX timer manuals.
Notes
Notes:
svn path=/head/; revision=152297
Diffstat (limited to 'lib/libc/sys/timer_create.2')
-rw-r--r-- | lib/libc/sys/timer_create.2 | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/lib/libc/sys/timer_create.2 b/lib/libc/sys/timer_create.2 new file mode 100644 index 000000000000..406800c802c0 --- /dev/null +++ b/lib/libc/sys/timer_create.2 @@ -0,0 +1,110 @@ +.\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Sep 11, 2000 +.Dt TIMER_CREATE 2 +.Os +.Sh NAME +.Nm timer_create +.Nd create a per-process timer (REALTIME) +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft int +.Fn timer_create "clockid_t clockid" "struct sigevent *restrict evp" "timer_t *restrict timerid" +.Sh DESCRIPTION +The +.Fn timer_create +function creates a per-process timer using the specified clock, +.Fa clock_id , +as the timing base. The +.Fn timer_create +function returns, in the location referenced by +.Fa timerid , +a timer ID of type timer_t used to identify the timer in timer requests. +This timer ID is unique within the calling process until the timer is deleted. +The particular clock, +.Fa clock_id , +is defined in +.In time.h . +The timer whose ID is returned is in a disarmed state upon return from +.Fn timer_create . +.Pp +The +.Fa evp +argument, if non-NULL, points to a sigevent structure. This structure, +allocated by the application, defines the asynchronous notification to occur +when the timer expires. If the +.Fa evp +argument is NULL, the effect is as if the evp argument pointed to a sigevent +structure with the sigev_notify member having the value SIGEV_SIGNAL, the +sigev_signo having a default signal number, and the sigev_value member having +the value of the timer ID. +.Pp +The implementations supports a clock_id of CLOCK_REALTIME or CLOCK_MONOTONIC. +.Pp +If evp->sigev_sigev_notify is SIGEV_THREAD and sev->sigev_notify_attributes +is not NULL, if the attribute pointed to by sev->sigev_notify_attributes has +a thread stack address specified by a call to +.Fn pthread_attr_setstack +or +.Fn pthread_attr_setstackaddr , +the results are unspecified if the signal is generated more than once. +.Sh RETURN VALUES +If the call succeeds, +.Fn timer_create +returns zero and update the location referenced by +.Fa timerid +to a timer_t, which can be passed to the per-process timer calls. If an error +occurs, the function shall return a value of -1 and set errno to indicate the +error. The value of timerid is undefined if an error occurs. +.Sh ERRORS +The +.Fn timer_create +will fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +The calling process has already created all of the timers it is allowed by +this implementation +.It Bq Er EINVAL +The specified clock ID is not supported. +.It Bq Er EFAULT +Any arguments point outside the allocated address space or there is a +memory protection fault. +.El +.Sh SEE ALSO +.Xr clock_getres 2 , +.Xr timer_delete 2 , +.Xr timer_getoverun 2 +.Sh STANDARDS +The +.Fn timer_create +function conforms to +.St -p1003.1-96 . |