8158 Want named threads API
[unleashed.git] / usr / src / man / man3proc / Pplatform.3proc
blob82ff02bf3ffbf719a70ef78afd885a06d636532c
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
31 The
32 .Fn Pplatform
33 function determines the name of the platform for the process handle
34 .Fa P .
35 Up to
36 .Fa bufsize
37 characters, including the null terminator, will be copied into
38 .Fa buffer .
39 .Pp
40 The platform is the value reported by the
41 .Sy -s
42 option to
43 .Xr uname 1 .
44 For example, on x86 systems, the value will be
45 .Sy i86pc .
46 .Pp
47 Note, process handles that correspond to a file, created by
48 .Xr Pgrab_file 3PROC ,
49 will not report a platform and the
50 .Fn Pplatform
51 function will fail.
52 .Sh RETURN VALUES
53 Upon successful completion, the
54 .Fn Pplatform
55 function returns
56 .Fa buffer .
57 Otherwise,
58 .Dv NULL
59 is returned,
60 .Sy errno
61 is set, and
62 .Fa buffer
63 is not updated.
64 .Sh ERRORS
65 The
66 .Fn Pplatform
67 function will fail if:
68 .Bl -tag -width Er
69 .It Er ENODATA
70 .Fa P
71 refers to a core file and there is no
72 .Sy NT_PLATFORM
73 ELF note available.
74 .It Er EFAULT
75 .Fa P
76 refers to a live process and
77 .Fa buffer
78 is an invalid address.
79 .El
80 .Sh INTERFACE STABILITY
81 .Sy Uncommitted
82 .Sh MT-LEVEL
83 See
84 .Sy LOCKING
86 .Xr libproc 3LIB .
87 .Sh SEE ALSO
88 .Xr uname 1 ,
89 .Xr sysinfo 2 ,
90 .Xr libproc 3LIB ,
91 .Xr proc 4