2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright 2015 Joyent, Inc.
15 .Dt PROC_ARG_GRAB 3PROC
20 .Nd process grabbing utility function
24 .Ft "struct ps_prochandle"
31 .Ft "struct ps_prochandle"
34 .Fa "const char *path"
38 .Fa "const char **lwps"
45 functions are utility functions which process arguments pointing to a
46 currently active process or a core file and returns a process handle to
51 contains the name of something to try and open.
52 How it is interpreted depends on the value of
54 The following values may be passed in as a bitwise-exclusive-OR for
56 .Bl -tag -width Dv -offset indent
60 to specify process IDs and /proc arguments.
64 to specify core files.
66 Encompasses all of the previous opens.
71 controls the behavior when the corresponding process grabbing function
72 is called by the underlying system.
73 For a list of flags that may be passed in here, see
76 .Xr Pgrab_core 3PROC .
82 pointer and in the event that the
88 will be updated with a more detailed error number.
92 argument allows a search path for its binaries to be specified in case a
93 core file is found and opened.
99 then if there is a thread specification present in
101 it will be validated to see if it is a valid range and then a pointer to
102 the start of the thread specification will be stored in
104 For more information on determining process range validity, see
105 .Xr proc_lwp_range_valid 3PROC
106 for more information on valid and invalid tread specifications.
108 Upon successful completion, the
112 functions return a pointer to the process handle is returned.
117 is set to include a more specific error.
119 For a full list of additional errors, see the
124 .Xr Pgrab_core 3PROC .
130 function will fail if:
134 contains an invalid thread specification.
137 was set and no core file could be found corresponding to
141 was set and no process could be found corresponding to
143 .It Er G_NOPROCORCORE
148 were set and no process or core file could be found corresponding to
151 .Sh INTERFACE STABILITY
158 .Xr Pgrab_core 3PROC ,
160 .Xr proc_lwp_range_valid 3PROC ,