xref: /illumos-gate/usr/src/man/man3proc/proc_content2str.3proc (revision 8459c777fc1aaabb2f7dad05de1313aa169417cd)
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 PROC_CONTENT2STR 3PROC
16.Os
17.Sh NAME
18.Nm proc_content2str ,
19.Nm proc_str2content
20.Nd convert a string to and from a core_content_t
21.Sh SYNOPSIS
22.Lb libproc
23.In libproc.h
24.Ft int
25.Fo proc_content2str
26.Fa "core_content_t content"
27.Fa "char *buf"
28.Fa "size_t size"
29.Fc
30.Ft int
31.Fo proc_str2content
32.Fa "const char *str"
33.Fa "core_content_t *cp"
34.Fc
35.Sh DESCRIPTION
36The
37.Fn proc_content2str
38function converts the contents of a process (whether active or a core
39file) from
40.Fa content
41into a string and writes up to
42.Fa size
43characters, including the null-terminator, into
44.Fa buf .
45.Pp
46A content string will be a series of one or more tokens concatenated
47together with the
48.Sy +
49or
50.Sy -
51characters, indicating that the subsequent token should be added or
52subtracted from the previous ones.
53The full list of tokens and constants is available in the
54.Sy core_content_t
55portion of the
56.Sy TYPES
57section in
58.Xr libproc 3LIB .
59.Pp
60The
61.Fn proc_str2content
62function takes the character string
63.Fa str
64and based on the format described in the previous paragraph, converts it
65back into a
66.Vt core_content_t
67which is placed into
68.Fa cp .
69.Sh RETURN VALUES
70Upon successful completion, the
71.Fn proc_content2str
72function will return the number of characters written into
73.Fa buf ,
74excluding the terminating null character.
75.Pp
76Upon successful completion, the
77.Fn proc_str2content
78function will return
79.Sy 0 .
80Otherwise,
81.Sy -1
82will be returned to indicate an unknown string.
83.Sh INTERFACE STABILITY
84.Sy Uncommitted
85.Sh MT-LEVEL
86.Sy MT-Safe
87.Sh SEE ALSO
88.Xr coreadm 1M ,
89.Xr libproc 3LIB ,
90.Xr proc 4
91