Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3proc/Pfdinfo_iter.3proc
+++ new/usr/src/man/man3proc/Pfdinfo_iter.3proc
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
10 10 .\"
11 11 .\"
12 12 .\" Copyright 2015 Joyent, Inc.
13 13 .\"
14 14 .Dd May 11, 2016
15 15 .Dt PFDINFO_ITER 3PROC
16 16 .Os
17 17 .Sh NAME
18 18 .Nm Pfdinfo_iter
19 19 .Nd iterate open files in a process
20 -.Sh SYNOPSIS
20 +.Sh LIBRARY
21 21 .Lb libproc
22 +.Sh SYNOPSIS
22 23 .In libproc.h
23 24 .Ft int
24 25 .Fo Pfdinfo_iter
25 26 .Fa "struct ps_prochandle *P"
26 27 .Fa "proc_fdinfo_f *func"
27 28 .Fa "void *data"
28 29 .Fc
29 30 .Sh DESCRIPTION
30 31 The
31 32 .Fn Pfdinfo_iter
32 33 function iterates over the open files in the process represented by
33 34 .Fa P .
34 35 .Pp
35 36 For each open file, the callback function
36 37 .Fa func
37 38 will be invoked and it will be passed the
38 39 .Fa data
39 40 argument as well as a pointer to a
40 41 .Sy prfdinfo_t
41 42 structure defined in
42 43 .Xr libproc 3LIB .
43 44 For the full signature of the
44 45 .Vt proc_fdinfo_f
45 46 see
46 47 .Xr libproc 3LIB .
47 48 .Pp
48 49 The return value of
49 50 .Fa func
50 51 controls whether or not iteration continues.
51 52 If
52 53 .Fa func
53 54 returns
54 55 .Sy 0 ,
55 56 then iteration will continue.
56 57 However, if
57 58 .Fa func
58 59 instead returns a non-zero value, then iteration will halt and that
59 60 value will be used as the return value of the
60 61 .Fn Pfdinfo_iter
61 62 function.
62 63 Because the
63 64 .Fn Pfdinfo_iter
64 65 function returns
65 66 .Sy -1
66 67 to an indicate its own errors, it is recommended that the callback
67 68 function does not return
68 69 .Sy -1
69 70 to indicate an error so that the caller may distinguish between the
70 71 failure of the callback function and the failure of the
71 72 .Fn Pfdinfo_iter
72 73 function.
73 74 .Sh RETURN VALUES
74 75 Upon successful completion, the
75 76 .Fn Pfdinfo_iter
76 77 returns
77 78 .Sy 0 .
78 79 Otherwise, if there was an internal error then
79 80 .Sy -1
80 81 is returned.
81 82 Otherwise, if the callback function
82 83 .Fa func
83 84 returns non-zero, then its return value will be returned instead.
84 85 .Sh INTERFACE STABILITY
85 86 .Sy Uncommitted
86 87 .Sh MT-LEVEL
87 88 See
88 89 .Sy LOCKING
89 90 in
90 91 .Xr libproc 3LIB .
91 92 .Sh SEE ALSO
92 93 .Xr libproc 3LIB
↓ open down ↓ |
61 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX