OpenBSD manual page server

Manual Page Search Parameters

SIGIO_INIT(9) Kernel Developer's Manual SIGIO_INIT(9)

sigio_init, sigio_free, sigio_copy, sigio_setown, sigio_getownasynchronous IO signal API

#include <sys/sigio.h>

void
sigio_init(struct sigio_ref *sir);

void
sigio_free(struct sigio_ref *sir);

void
sigio_copy(struct sigio_ref *dst, struct sigio_ref *src);

int
sigio_setown(struct sigio_ref *sir, u_long cmd, caddr_t data);

pid_t
sigio_getown(struct sigio_ref *sir, u_long cmd, caddr_t data);

The asynchronous IO signal API provides a means to manage signal registrations. It associates a process or process group with a signal source. The association is revoked automatically when the process or process group is deleted.

() initializes the sigio reference sir.

() clears any process or process group associated with reference sir.

() copies registration from reference src to reference dst.

() associates the reference sir with a process or process group. cmd is one of ioctl commands FIOSETOWN, SIOCSPGRP and TIOCSPGRP. data is a pointer to a signed integer that represents the ID of the owner of the registration. For FIOSETOWN and SIOCSPGRP, a positive ID is taken as a process ID, and a negative ID is taken as a process group ID. If cmd is TIOCSPGRP, a positive ID is taken as a process group ID, and negative ID values are not allowed. For all values of cmd, the reference sir is cleared if the ID is zero.

When () is called, the invoking process' credentials are stored in the reference. These credentials are checked when the reference is used with pgsigio(9).

() stores the ID of the process or process group associated with the reference sir to the signed integer pointed by data. cmd is one of ioctl commands FIOGETOWN, SIOCGPGRP and TIOCGPGRP. For FIOGETOWN and SIOCGPGRP, a process ID is stored as a positive ID, and a process group ID is stored as a negative ID. For TIOCGPGRP, a process ID is stored as a negative ID, and a process group ID is stored as a positive ID. If there is no registered owner, a zero is stored in the integer.

sigio_init(), sigio_free(), sigio_copy(), sigio_setown() and sigio_getown() can be called during autoconf, or from process context.

sigio_setown() returns 0 on success. Otherwise, the following error values are returned:

[EINVAL]
The process group ID is invalid.
[EPERM]
The invoking process belongs to another session than the process or process group.
[ESRCH]
The process or process group does not exist.
[ESRCH]
The process is exiting.

pgsigio(9)

The sigio routines were adapted from FreeBSD and first appeared in OpenBSD 6.5.

January 8, 2020 OpenBSD-current