xref: /illumos-gate/usr/src/man/man3proc/Pplatform.3proc (revision 723f377c3492a26888b7d19197a1ec00eebebafe)
1.\"
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
5.\" 1.0 of the CDDL.
6.\"
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.
10.\"
11.\"
12.\" Copyright 2015 Joyent, Inc.
13.\"
14.Dd May 11, 2016
15.Dt PPLATFORM 3PROC
16.Os
17.Sh NAME
18.Nm Pplatform
19.Nd get platform string
20.Sh LIBRARY
21.Lb libproc
22.Sh SYNOPSIS
23.In libproc.h
24.Ft "char *"
25.Fo Pplatform
26.Fa "struct ps_prochandle *P"
27.Fa "char *buffer"
28.Fa "size_t bufsize"
29.Fc
30.Sh DESCRIPTION
31The
32.Fn Pplatform
33function determines the name of the platform for the process handle
34.Fa P .
35Up to
36.Fa bufsize
37characters, including the null terminator, will be copied into
38.Fa buffer .
39.Pp
40The platform is the value reported by the
41.Sy -s
42option to
43.Xr uname 1 .
44For example, on x86 systems, the value will be
45.Sy i86pc .
46.Pp
47Note, process handles that correspond to a file, created by
48.Xr Pgrab_file 3PROC ,
49will not report a platform and the
50.Fn Pplatform
51function will fail.
52.Sh RETURN VALUES
53Upon successful completion, the
54.Fn Pplatform
55function returns
56.Fa buffer .
57Otherwise,
58.Dv NULL
59is returned,
60.Sy errno
61is set, and
62.Fa buffer
63is not updated.
64.Sh ERRORS
65The
66.Fn Pplatform
67function will fail if:
68.Bl -tag -width Er
69.It Er ENODATA
70.Fa P
71refers to a core file and there is no
72.Sy NT_PLATFORM
73ELF note available.
74.It Er EFAULT
75.Fa P
76refers to a live process and
77.Fa buffer
78is an invalid address.
79.El
80.Sh INTERFACE STABILITY
81.Sy Uncommitted
82.Sh MT-LEVEL
83See
84.Sy LOCKING
85in
86.Xr libproc 3LIB .
87.Sh SEE ALSO
88.Xr uname 1 ,
89.Xr sysinfo 2 ,
90.Xr libproc 3LIB ,
91.Xr proc 4
92