Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3proc/Pread.3proc
+++ new/usr/src/man/man3proc/Pread.3proc
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
10 10 .\"
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
11 11 .\"
12 12 .\" Copyright 2015 Joyent, Inc.
13 13 .\"
14 14 .Dd May 11, 2016
15 15 .Dt PREAD 3PROC
16 16 .Os
17 17 .Sh NAME
18 18 .Nm Pread ,
19 19 .Nm Pread_string
20 20 .Nd read data from a process
21 -.Sh SYNOPSIS
21 +.Sh LIBRARY
22 22 .Lb libproc
23 +.Sh SYNOPSIS
23 24 .In libproc.h
24 25 .Ft ssize_t
25 26 .Fo Pread
26 27 .Fa "struct ps_prochandle *P"
27 28 .Fa "void *buf"
28 29 .Fa "size_t nbytes"
29 30 .Fa "uintptr_t address"
30 31 .Fc
31 32 .Ft ssize_t
32 33 .Fo Pread_string
33 34 .Fa "struct ps_prochandle *P"
34 35 .Fa "char *buf"
35 36 .Fa "size_t nbytes"
36 37 .Fa "uintptr_t address"
37 38 .Fc
38 39 .Sh DESCRIPTION
39 40 The
40 41 .Fn Pread
41 42 function reads data from the process handle
42 43 .Fa P
43 44 starting at
44 45 .Fa address
45 46 in the address space of the process and reads at most
46 47 .Fa nbytes
47 48 of data into
48 49 .Fa buf
49 50 and is logically analogous to the
50 51 .Xr pread 2
51 52 function.
52 53 .Pp
53 54 For live processes, this function is equivalent to reading from the /proc file
54 55 system
55 56 .Sy as
56 57 file for the process.
57 58 For core files and file handles, it reads and writes from the logical address
58 59 space and not the corresponding offset of the file itself.
59 60 For example, a core file contains a sparse representation of the address space
60 61 of a crashed process and unmapped regions are not present in the file.
61 62 However,
62 63 .Fa address
63 64 still refers to the virtual addresses that were present at run-time and
64 65 not those in the core file.
65 66 .Pp
66 67 The
67 68 .Fn Pread_string
68 69 function is similar to the
69 70 .Fn Pread
70 71 function, except that it attempts to interpret
71 72 .Fa address
72 73 as a null terminated character string and will stop reading characters
73 74 into
74 75 .Fa buf
75 76 if either
76 77 .Fa nbytes
77 78 has been read or a null terminator is encountered.
78 79 The resulting data in
79 80 .Fa buf
80 81 will always be null terminated, even if no null terminator was found in
81 82 the first
82 83 .Fa nbytes
83 84 of data.
84 85 .Sh RETURN VALUES
85 86 Upon successful completion, the
86 87 .Fn Pread
87 88 and
88 89 .Fn Pread_string
89 90 functions return a non-negative integer indicating the number of bytes
90 91 actually read.
91 92 Otherwise, the functions return
92 93 .Sy -1
93 94 and set
94 95 .Sy errno
95 96 to indicate the error.
96 97 .Sh ERRORS
97 98 For a full list of possible errors also see the
98 99 .Sy DIAGNOSTICS
99 100 section in
100 101 .Xr proc 4
101 102 and
102 103 the
103 104 .Sy ERRORS
104 105 section in
105 106 .Xr pread 2 .
106 107 .Sh INTERFACE STABILITY
107 108 .Sy Uncommitted
108 109 .Sh MT-LEVEL
109 110 See
110 111 .Sy LOCKING
111 112 in
112 113 .Xr libproc 3LIB .
113 114 .Sh SEE ALSO
114 115 .Xr pread 2 ,
115 116 .Xr libproc 3LIB ,
116 117 .Xr proc 4
↓ open down ↓ |
84 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX