1ps_pread(3PROC) Process Control Library Functions ps_pread(3PROC)
2
3
4
6 ps_pread, ps_pwrite, ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite -
7 interfaces in libthread_db that target process memory access
8
10 #include <proc_service.h>
11
12 ps_err_e ps_pread(struct ps_prochandle *ph, psaddr_t addr,
13 void *buf, size_t size);
14
15
16 ps_err_e ps_pwrite(struct ps_prochandle *ph, psaddr_t addr,
17 const void *buf, size_t size);
18
19
20 ps_err_e ps_pdread(struct ps_prochandle *ph, psaddr_t addr,
21 void *buf, size_t size);
22
23
24 ps_err_e ps_pdwrite(struct ps_prochandle *ph, psaddr_t addr,
25 const void *buf, size_t size);
26
27
28 ps_err_e ps_ptread(struct ps_prochandle *ph, psaddr_t addr,
29 void *buf, size_t size);
30
31
32 ps_err_e ps_ptwrite(struct ps_prochandle *ph, psaddr_t addr,
33 const void *buf, size_t size);
34
35
37 These routines copy data between the target process's address space and
38 the controlling process. ps_pread() copies size bytes from address addr
39 in the target process into buf in the controlling process. pr_pwrite()
40 is like ps_pread() except that the direction of the copy is reversed;
41 data is copied from the controlling process to the target process.
42
43
44 ps_pdread() and ps_ptread() behave identically to ps_pread().
45 ps_pdwrite() and ps_ptwrite() behave identically to ps_pwrite(). These
46 functions can be implemented as simple aliases for the corresponding
47 primary functions. They are artifacts of history that must be main‐
48 tained.
49
51 PS_OK The call returned successfully. size bytes were copied.
52
53
54 PS_BADADDR Some part of the address range from addr through
55 addr+size−1 is not part of the target process's address
56 space.
57
58
59 PS_ERR The function did not return successfully.
60
61
63 See attributes(5) for description of the following attributes:
64
65
66
67
68 ┌─────────────────────────────┬─────────────────────────────┐
69 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
70 ├─────────────────────────────┼─────────────────────────────┤
71 │MT Level │Safe │
72 └─────────────────────────────┴─────────────────────────────┘
73
75 libc_db(3LIB), librtld_db(3LIB), proc_service(3PROC), rtld_db(3EXT),
76 attributes(5), threads(5)
77
78
79
80SunOS 5.11 12 Oct 2007 ps_pread(3PROC)