'\" te .\" Copyright (c) 2006, Sun Microsystems, Inc., .\" All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH PROC_SIGNAL 9F "Jan 16, 2006" .SH NAME proc_signal, proc_ref, proc_unref \- send a signal to a process .SH SYNOPSIS .nf #include #include #include \fBvoid *\fR\fBproc_ref\fR(void) .fi .LP .nf \fBvoid\fR\fBproc_unref\fR(\fBvoid\fR \fI*pref\fR); .fi .LP .nf \fBint\fR \fBproc_signal\fR(\fBvoid\fR \fI*pref\fR, \fBint\fR \fIsig\fR); .fi .SH INTERFACE LEVEL illumos DDI specific (illumos DDI). .SH PARAMETERS .ne 2 .na \fB\fIpref\fR\fR .ad .RS 8n A handle for the process to be signalled. .RE .sp .ne 2 .na \fB\fIsig\fR\fR .ad .RS 8n Signal number to be sent to the process. .RE .SH DESCRIPTION This set of routines allows a driver to send a signal to a process. The routine \fBproc_ref()\fR is used to retrieve an unambiguous reference to the process for signalling purposes. The return value can be used as a unique handle on the process, even if the process dies. Because system resources are committed to a process reference, \fBproc_unref()\fR should be used to remove it as soon as it is no longer needed.\fBproc_signal()\fR is used to send signal \fIsig\fR to the referenced process. The following set of signals may be sent to a process from a driver: .sp .ne 2 .na \fB\fBSIGHUP\fR\fR .ad .RS 12n The device has been disconnected. .RE .sp .ne 2 .na \fB\fBSIGINT\fR\fR .ad .RS 12n The interrupt character has been received. .RE .sp .ne 2 .na \fB\fBSIGQUIT\fR\fR .ad .RS 12n The quit character has been received. .RE .sp .ne 2 .na \fB\fBSIGPOLL\fR\fR .ad .RS 12n A pollable event has occurred. .RE .sp .ne 2 .na \fB\fBSIGKILL\fR\fR .ad .RS 12n Kill the process (cannot be caught or ignored). .RE .sp .ne 2 .na \fB\fBSIGWINCH\fR\fR .ad .RS 12n Window size change. .RE .sp .ne 2 .na \fB\fBSIGURG\fR\fR .ad .RS 12n Urgent data are available. .RE .sp .LP See \fBsignal.h\fR(3HEAD) for more details on the meaning of these signals. .sp .LP If the process has exited at the time the signal was sent, \fBproc_signal()\fR returns an error code; the caller should remove the reference on the process by calling \fBproc_unref()\fR. .sp .LP The driver writer must ensure that for each call made to \fBproc_ref()\fR, there is exactly one corresponding call to \fBproc_unref()\fR. .SH RETURN VALUES The \fBproc_ref()\fR returns the following: .sp .ne 2 .na \fB\fIpref\fR\fR .ad .RS 8n An opaque handle used to refer to the current process. .RE .sp .LP The \fBproc_signal()\fR returns the following: .sp .ne 2 .na \fB\fB0\fR\fR .ad .RS 6n The process existed before the signal was sent. .RE .sp .ne 2 .na \fB\fB-1\fR\fR .ad .RS 6n The process no longer exists; no signal was sent. .RE .SH CONTEXT The \fBproc_unref()\fR and \fBproc_signal()\fR functions can be called from user, interrupt, or kernel context. The \fBproc_ref()\fR function should be called only from user context. .SH SEE ALSO .BR signal.h (3HEAD), .BR putnextctl1 (9F) .sp .LP \fIWriting Device Drivers\fR