1 .\" $NetBSD: fsetown.9,v 1.8 2008/04/30 13:10:58 martin Exp $
3 .\" Copyright (c) 2003, 2005 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Jaromir Dolecek.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
37 .Nd file descriptor owner handling functions
41 .Fn fsetown "struct lwp *l" "pid_t *pgid" "int cmd" "const void *data"
43 .Fn fgetown "struct lwp *l" "pid_t pgid" "int cmd" "void *data"
45 .Fn fownsignal "pid_t pgid" "int signo" "int code" "int band" "void *fdescdata"
47 These functions handle file descriptor owner related ioctls and
48 related signal delivery.
49 Device drivers and other parts of the kernel call these functions from
50 ioctl entry functions or I/O notification functions.
53 sets the owner of file.
55 is an ioctl command, one of
61 is interpreted as a pointer to a signed integer, the integer being
65 determines how exactly
67 should be interpreted.
72 the ID needs to be positive and is interpreted as process group ID.
77 the passed ID is the process ID if positive, or the process group ID
81 returns the current owner of the file.
83 is an ioctl command, one of
89 is interpreted as a pointer to a signed integer,
90 and the value is set according to the passed
96 value is positive process group ID if the owner is the process group,
97 or negative process ID if the owner is a process.
99 the returned value is the positive process ID if the owner is a process,
100 or the negative process group ID if the owner is a process group.
105 signal to be sent to the current file descriptor owner.
106 The signals typically used with this function are
114 arguments are sent along with the signal as additional signal specific
118 If the information is not available from the context of the
120 call, these should be passed as zero.
122 is used to lookup the file descriptor for
125 If it is specified, the file descriptor number is sent along with
126 the signal as additional signal specific information.
127 If file descriptor data pointer is not available in the context of the
131 should be used instead.
136 is translated by the kernel to a
142 This is done transparently by generic code, before the device- or
143 subsystem-specific ioctl entry function is called.
151 These kernel functions appeared in