summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/Makefile4
-rw-r--r--share/man/man9/sigio_init.998
2 files changed, 100 insertions, 2 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 36cbe9ff2a6..54f370eec2b 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.290 2018/04/23 10:30:39 dlg Exp $
+# $OpenBSD: Makefile,v 1.291 2018/11/12 15:13:12 visa Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -31,7 +31,7 @@ MAN= aml_evalnode.9 atomic_add_int.9 atomic_cas_uint.9 \
radio.9 arc4random.9 rasops.9 ratecheck.9 refcnt_init.9 resettodr.9 \
rssadapt.9 route.9 rt_ifa_add.9 rt_timer_add.9 rtalloc.9 rtable_add.9 \
rtlabel_id2name.9 rtrequest.9 rwlock.9 SRPL_EMPTY_LOCKED.9 SipHash24.9 \
- sensor_attach.9 \
+ sensor_attach.9 sigio_init.9 \
spl.9 srp_enter.9 srpl_rc_init.9 startuphook_establish.9 \
socreate.9 sosplice.9 strcmp.9 style.9 syscall.9 sysctl_int.9 \
task_add.9 tc_init.9 tfind.9 thread_fork.9 \
diff --git a/share/man/man9/sigio_init.9 b/share/man/man9/sigio_init.9
new file mode 100644
index 00000000000..6dc4db73e45
--- /dev/null
+++ b/share/man/man9/sigio_init.9
@@ -0,0 +1,98 @@
+.\" $OpenBSD: sigio_init.9,v 1.1 2018/11/12 15:13:12 visa Exp $
+.\"
+.\" Copyright (c) 2018 Visa Hankala
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: November 12 2018 $
+.Dt SIGIO_INIT 9
+.Os
+.Sh NAME
+.Nm sigio_init ,
+.Nm sigio_free ,
+.Nm sigio_copy ,
+.Nm sigio_setown ,
+.Nm sigio_getown
+.Nd asynchronous IO signal API
+.Sh SYNOPSIS
+.In sys/sigio.h
+.Ft void
+.Fn "sigio_init" "struct sigio_ref *sir"
+.Ft void
+.Fn "sigio_free" "struct sigio_ref *sir"
+.Ft void
+.Fn "sigio_copy" "struct sigio_ref *dst" "struct sigio_ref *src"
+.Ft int
+.Fn "sigio_setown" "struct sigio_ref *sir" "pid_t pgid"
+.Ft pid_t
+.Fn "sigio_getown" "struct sigio_ref *sir"
+.Sh DESCRIPTION
+The asynchronous IO signal API provides means to manage signal registrations.
+It allows associating a process or process group with a signal source.
+The association is revoked automatically when the process or process group
+is deleted.
+.Pp
+.Fn sigio_init
+initializes the sigio reference
+.Fa sir .
+.Pp
+.Fn sigio_free
+clears any process or process group associated with reference
+.Fa sir .
+.Pp
+.Fn sigio_copy
+copies registration from reference
+.Fa src
+to reference
+.Fa dst .
+.Pp
+.Fn sigio_setown
+associates the reference
+.Fa sir
+with a process or process group.
+If
+.Fa pgid
+is positive, the ID is taken as a process ID.
+If
+.Fa pgid
+is negative, the ID is taken as a process group ID.
+The reference
+.Fa sir
+is cleared if
+.Fa pgid
+is zero.
+.Pp
+When
+.Fn sigio_setown
+is called, the invoking process' credentials are stored in the reference.
+These credentials are checked when the reference is used with
+.Xr pgsigio 9 .
+.Pp
+.Fn sigio_getown
+returns the ID of the process or process group associated with the reference
+.Fa sir .
+.Sh CONTEXT
+.Fn sigio_init ,
+.Fn sigio_free ,
+.Fn sigio_copy ,
+.Fn sigio_setown
+and
+.Fn sigio_getown
+can be called during autoconf, or from process context.
+.Sh SEE ALSO
+.Xr pgsigio 9
+.Sh HISTORY
+The sigio routines were adapted from
+.Fx
+and first appeared in
+.Ox 6.5 .