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]
pargs [-aceFlx] [pid | core]...
The pargs utility examines a target process or process core file and prints arguments, environment variables and values, or the process auxiliary vector.
pargs outputs unprintable characters as escaped octal in the format \exxx, unless the character is one of the characters specified in the "Escape Sequences" section of formats(5), in which case the character is printed as specified in that section.
pargs attempts to be sensitive to the locale of the target process. If the target process and the pargs process do not share a common character encoding, pargs attempts to employ the iconv(3C) facility to generate a printable version of the extracted strings. In the event that such a conversion is impossible, strings are displayed as 7-bit ASCII.
The following options are supported:
-a
Prints process arguments as contained in argv[] (default).
-c
Treats strings in the target process as though they were encoded in 7-bit ASCII, regardless of the locale of the target. The use of iconv(3C) is suppressed.
-e
Prints process environment variables and values as pointed at by the _environ symbol or by pr_envp in /proc/pid/psinfo.
-F
Force. Grabs the target process even if another process has control.
-l
Displays the arguments as a single command line. The command line is printed in a manner suitable for interpretation by /bin/sh. If the arguments contain unprintable characters, or if the target process is in a different locale, a warning message is displayed. The resulting command line might not be interpreted correctly by /bin/sh.
-x
Prints process auxiliary vector.
The following operands are supported:
pid
Process ID list.
core
Process core file.
Caution should be exercised when using the -F flag. Imposing two controlling processes on one victim process can lead to chaos. Safety is assured only if the primary controlling process, typically a debugger, has stopped the victim process and the primary controlling process is doing nothing at the moment of application of the proc tool in question.
The following exit values are returned:
0
Successful operation.
non-zero
An error has occurred (such as no such process, permission denied, or invalid option).
Process information and control files.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Evolving |
proc(1), iconv(3C), proc(4), ascii(5), attributes(5), environ(5), formats(5)