143051d27SRobert Mustacchi.\"
243051d27SRobert Mustacchi.\" This file and its contents are supplied under the terms of the
343051d27SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0.
443051d27SRobert Mustacchi.\" You may only use this file in accordance with the terms of version
543051d27SRobert Mustacchi.\" 1.0 of the CDDL.
643051d27SRobert Mustacchi.\"
743051d27SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this
843051d27SRobert Mustacchi.\" source.  A copy of the CDDL is also available via the Internet at
943051d27SRobert Mustacchi.\" http://www.illumos.org/license/CDDL.
1043051d27SRobert Mustacchi.\"
1143051d27SRobert Mustacchi.\"
1243051d27SRobert Mustacchi.\" Copyright 2015 Joyent, Inc.
1343051d27SRobert Mustacchi.\"
1443051d27SRobert Mustacchi.Dd May 11, 2016
1543051d27SRobert Mustacchi.Dt PEXECNAME 3PROC
1643051d27SRobert Mustacchi.Os
1743051d27SRobert Mustacchi.Sh NAME
1843051d27SRobert Mustacchi.Nm Pexecname
1943051d27SRobert Mustacchi.Nd obtain full path to process executable
20*ab618543SJohn Levon.Sh LIBRARY
2143051d27SRobert Mustacchi.Lb libproc
22*ab618543SJohn Levon.Sh SYNOPSIS
2343051d27SRobert Mustacchi.In libproc.h
2443051d27SRobert Mustacchi.Ft "char *"
2543051d27SRobert Mustacchi.Fo Pexecname
2643051d27SRobert Mustacchi.Fa "struct ps_prochandle *P"
2743051d27SRobert Mustacchi.Fa "char *buf"
2843051d27SRobert Mustacchi.Fa "size_t buflen"
2943051d27SRobert Mustacchi.Fc
3043051d27SRobert Mustacchi.Sh DESCRIPTION
3143051d27SRobert MustacchiThe
3243051d27SRobert Mustacchi.Fn Pexecname
3343051d27SRobert Mustacchifunction attempts to determine the full path to the process executable
3443051d27SRobert Mustacchireferred to by the handle
3543051d27SRobert Mustacchi.Fa P .
3643051d27SRobert Mustacchi.Pp
3743051d27SRobert MustacchiIf found,
3843051d27SRobert Mustacchi.Fa buf
3943051d27SRobert Mustacchiwill be filled in with the full path for up to
4043051d27SRobert Mustacchi.Fa buflen
4143051d27SRobert Mustacchibytes, including the null terminator.
4243051d27SRobert Mustacchi.Pp
4343051d27SRobert MustacchiFor a handle grabbed with
4443051d27SRobert Mustacchi.Xr Pgrab_file 3PROC ,
4572d3dbb9SYuri Pankovthe executable refers to the path of the file itself.
4672d3dbb9SYuri PankovFor a core file, the system attempts to determine the original path of the
4772d3dbb9SYuri Pankovexecutable and return that.
4843051d27SRobert Mustacchi.Sh RETURN VALUES
4943051d27SRobert MustacchiUpon successful completion, the
5043051d27SRobert Mustacchi.Fn Pexecname
5143051d27SRobert Mustacchifunction returns the value of
5243051d27SRobert Mustacchi.Fa buf ,
5343051d27SRobert Mustacchiand up to
5443051d27SRobert Mustacchi.Fa buflen
5543051d27SRobert Mustacchibytes of
5643051d27SRobert Mustacchi.Fa buf
5743051d27SRobert Mustacchiare filled in with a null-terminated path.
5843051d27SRobert MustacchiOtherwise,
5943051d27SRobert Mustacchi.Dv NULL
6043051d27SRobert Mustacchiis returned.
6143051d27SRobert Mustacchi.Sh INTERFACE STABILITY
6243051d27SRobert Mustacchi.Sy Uncommitted
6343051d27SRobert Mustacchi.Sh MT-LEVEL
6443051d27SRobert MustacchiSee
6543051d27SRobert Mustacchi.Sy LOCKING
6643051d27SRobert Mustacchiin
6743051d27SRobert Mustacchi.Xr libproc 3LIB .
6843051d27SRobert Mustacchi.Sh SEE ALSO
6943051d27SRobert Mustacchi.Xr libproc 3LIB
70