Module Name:    src
Committed By:   jruoho
Date:           Wed May 19 06:28:53 UTC 2010

Modified Files:
        src/distrib/sets/lists/comp: mi
        src/share/man/man3: Makefile
Added Files:
        src/share/man/man3: sigevent.3

Log Message:
Add sigevent(3), a manual page that describes the struct sigevent used by
the POSIX real time functions and timers.

XXX:    (a) Needs to be modified once real time signals are supported.
        (b) Could use an example.


To generate a diff of this commit:
cvs rdiff -u -r1.1450 -r1.1451 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.53 -r1.54 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/sigevent.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1450 src/distrib/sets/lists/comp/mi:1.1451
--- src/distrib/sets/lists/comp/mi:1.1450	Tue May 18 09:07:37 2010
+++ src/distrib/sets/lists/comp/mi	Wed May 19 06:28:53 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1450 2010/05/18 09:07:37 jruoho Exp $
+#	$NetBSD: mi,v 1.1451 2010/05/19 06:28:53 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -7951,6 +7951,7 @@
 ./usr/share/man/cat3/sigblock.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sigdelset.0		comp-c-catman		.cat
 ./usr/share/man/cat3/sigemptyset.0		comp-c-catman		.cat
+./usr/share/man/cat3/sigevent.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sigfillset.0		comp-c-catman		.cat
 ./usr/share/man/cat3/sighold.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sigignore.0		comp-c-catman		.cat
@@ -13747,6 +13748,7 @@
 ./usr/share/man/html3/sigblock.html		comp-c-htmlman		html
 ./usr/share/man/html3/sigdelset.html		comp-c-htmlman		html
 ./usr/share/man/html3/sigemptyset.html		comp-c-htmlman		html
+./usr/share/man/html3/sigevent.html		comp-c-htmlman		html
 ./usr/share/man/html3/sigfillset.html		comp-c-htmlman		html
 ./usr/share/man/html3/sighold.html		comp-c-htmlman		html
 ./usr/share/man/html3/sigignore.html		comp-c-htmlman		html
@@ -19559,6 +19561,7 @@
 ./usr/share/man/man3/sigblock.3			comp-c-man		.man
 ./usr/share/man/man3/sigdelset.3		comp-c-man		.man
 ./usr/share/man/man3/sigemptyset.3		comp-c-man		.man
+./usr/share/man/man3/sigevent.3			comp-c-man		.man
 ./usr/share/man/man3/sigfillset.3		comp-c-man		.man
 ./usr/share/man/man3/sighold.3			comp-c-man		.man
 ./usr/share/man/man3/sigignore.3		comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.53 src/share/man/man3/Makefile:1.54
--- src/share/man/man3/Makefile:1.53	Tue May 18 09:07:38 2010
+++ src/share/man/man3/Makefile	Wed May 19 06:28:53 2010
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile,v 1.53 2010/05/18 09:07:38 jruoho Exp $
+#	$NetBSD: Makefile,v 1.54 2010/05/19 06:28:53 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
 	__arraycount.3 assert.3 bits.3 bitstring.3 dirent.3 dlfcn.3 end.3 \
 	fast_divide32.3 ffs32.3 gcq.3 intro.3 inttypes.3 iso646.3 offsetof.3 \
-	queue.3 rb.3 stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
+	queue.3 rb.3 sigevent.3 \
+	stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
 	tgmath.3 timeradd.3 timeval.3 tree.3 types.3 varargs.3
 
 USETBL=	# used by queue.3

Added files:

Index: src/share/man/man3/sigevent.3
diff -u /dev/null src/share/man/man3/sigevent.3:1.1
--- /dev/null	Wed May 19 06:28:54 2010
+++ src/share/man/man3/sigevent.3	Wed May 19 06:28:53 2010
@@ -0,0 +1,164 @@
+.\" $NetBSD: sigevent.3,v 1.1 2010/05/19 06:28:53 jruoho Exp $
+.\"
+.\" Copyright (c) 2010 Jukka Ruohonen <jruoho...@iki.fi>
+.\"
+.\" 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, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``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 FOUNDATION OR CONTRIBUTORS
+.\" 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.
+.\"
+.Dd May 18, 2010
+.Dt SIGEVENT 3
+.Os
+.Sh NAME
+.Nm sigevent
+.Nd signal event structure
+.Sh SYNOPSIS
+.In sys/signal.h
+.Sh DESCRIPTION
+The
+.St -p1003.1-2004
+standard extends traditional
+.Tn UNIX
+signal semantics by providing facilities
+for realtime signal generation and delivery.
+.\"
+.\" XXX: Remove the paragraph once RT signals are supported.
+.\"
+Although
+.Nx
+does not yet support realtime signals,
+the described interface is fully functional.
+.Pp
+Realtime functions that can generate realtime signals include:
+.Bl -enum -offset 3n
+.It
+Completion of asynchronous
+.Tn I/O ;
+see
+.Xr aio 3 .
+.It
+Expiration of per-process timers; see
+.Xr timer_create 3 .
+.It
+Arrival of a message to an empty message queue; see
+.Xr mq_notify 3 .
+.El
+.Pp
+The
+.In sys/signal.h
+header, included by
+.In signal.h ,
+defines a
+.Va sigevent
+structure, which is the cornerstone in
+asynchronous delivery of realtime signals.
+This structure is defined as:
+.Bd -literal -offset indent
+struct sigevent {
+	int		  sigev_notify;
+	int		  sigev_signo;
+	union sigval	  sigev_value;
+	void		(*sigev_notify_function)(union sigval);
+	void		 *sigev_notify_attributes;
+};
+.Ed
+.Pp
+The included union is further defined in
+.In siginfo.h
+as:
+.Bd -literal -offset indent
+typedef union sigval {
+	int	 sival_int;
+	void	*sival_ptr;
+} sigval_t;
+.Ed
+.Pp
+The
+.Va sigev_notify
+integer defines the action taken when
+a notification such as timer expiration occurs.
+The possiblue values are:
+.Bl -tag -width "SIGEV_THREAD " -offset 2n
+.It Dv SIGEV_NONE
+This constant specifies a
+.Dq null
+handler; when a notification arrives, nothing happens.
+.It Dv SIGEV_SIGNAL
+The
+.Dv SIGEV_SIGNAL
+constant specifies that notifications are delivered by signals.
+When a notification arrives, the kernel sends the signal specified in
+.Va sigev_signo .
+.Pp
+In the signal handler the
+.Sq si_value
+of
+.Va siginfo_t
+is set to the value specified by the
+.Va sigev_value .
+In another words, the
+.Va sigev_value
+member is an application-defined value to be passed to
+a particular signal handler at the time of signal delivery.
+Depending whether the specified value is an integer or a pointer, the
+delivered value can be either
+.Va sigval_intr
+or
+.Va sigval_ptr .
+.It Dv SIGEV_THREAD
+This constant specifies a thread-driven notification mechanism.
+When a notification occurs, the kernel creates a new thread that starts
+executing the function specified in the function pointer
+.Va sigev_notify_function .
+The single argument passed to the function is specified in
+.Va sigev_value .
+.Pp
+If
+.Va sigev_notify_attributes
+is not
+.Dv NULL ,
+the provided attribute specifies the behavior of the thread; see
+.Xr pthread_attr 3 .
+(Note that although a pointer to void is specified for
+.Va sigev_notify_attributes ,
+the type is
+.Va pthread_attr_t
+in practice.)
+.El
+.\"
+.\" .Sh EXAMPLES
+.\"
+.\" XXX: Add one.
+.\"
+.Sh HISTORY
+The
+.Va sigevent
+structure first appeared in
+.Nx 1.6 .
+.Sh SEE ALSO
+.Xr siginfo 2 ,
+.Xr aio 3 ,
+.Xr mq_notify 3 ,
+.Xr timer_create 3
+.\"
+.\" XXX: Remove the paragraph once RT signals are supported.
+.\"
+.Sh BUGS
+Realtime signals are not yet supported.

Reply via email to