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/Pgetareg.3proc.man.txt
+++ new/usr/src/man/man3proc/Pgetareg.3proc.man.txt
1 1 PGETAREG(3PROC) Process Control Library Functions PGETAREG(3PROC)
2 2
3 3 NAME
4 4 Pgetareg, Pputareg, Lgetareg, Lputareg - set and get a register from a
5 5 stopped process or thread
6 6
7 -SYNOPSIS
7 +LIBRARY
8 8 Process Control Library (libproc, -lproc)
9 +
10 +SYNOPSIS
9 11 #include <libproc.h>
10 12
11 13 int
12 14 Pgetareg(struct ps_prochandle *P, int regno, prgreg_t *preg);
13 15
14 16 int
15 17 Pputareg(struct ps_prochandle *P, int regno, prgreg_t preg);
16 18
17 19 int
18 20 Lgetareg(struct ps_lwphandle *L, int regno, prgreg_t *preg);
19 21
20 22 int
21 23 Lputareg(struct ps_lwphandle *L, int regno, prgreg_t preg);
22 24
23 25 DESCRIPTION
24 26 The Pgetareg() and Pputareg() functions read and update the registers of
25 27 the process handle referred to by P. The getting and setting of
26 28 registers of the process operates on the representative thread (LWP).
27 29 For more information on how the representative is chosen, see proc(4).
28 30
29 31 To change the registers of a specific thread, use the Lgetareg() and
30 32 Lputareg() functions.
31 33
32 34 The getting and setting of registers only applies to stopped processes.
33 35 In addition, one may obtain registers from core files, but not set them.
34 36 To stop a process, see the Pstop(3PROC) function.
35 37
36 38 The register to get or set is indicated by the regno argument. For a
37 39 list of registers, see <sys/regset.h>. The set of registers is specific
38 40 to each architecture of the system. The Pgetareg() function will fill in
39 41 the value of preg with the value of the register regno, while the
40 42 Pputareg() function will update the value of the register regno with the
41 43 value in preg. Updated registers will be set when the process resumes
42 44 execution.
43 45
44 46 The Lgetareg() and Lputareg() functions are equivalent to the Pgetareg()
45 47 and Psetareg() functions, except rather than operating on the process and
46 48 its representative thread, they instead operate on the thread handle L.
47 49
48 50 RETURN VALUES
49 51 Upon successful completion, the Pgetareg() and Pputareg() function return
50 52 0. Otherwise, -1 is returned, errno is set, and no registers will have
51 53 been gotten or updated.
52 54
53 55 ERRORS
54 56 The Pgetareg() and Lgetareg() functions will fail if:
55 57
56 58 EINVAL The value of regno is invalid. This means it is less
57 59 than 0 and greater than NPRGREG. Note, NPRGREG's
58 60 value varies based on process architecture.
59 61
60 62 EBUSY The handle P is neither stopped nor a core file.
61 63
62 64 ENODATA The handle P refers to a file obtained through
63 65 Pgrab_file(3PROC).
64 66
65 67 The Pputareg() and Lputareg() functions will fail if:
66 68
67 69 EINVAL The value of regno is invalid. This means it is less
68 70 than 0 and greater than NPRGREG. Note, NPRGREG's
69 71 value varies based on process architecture.
70 72
71 73 EBUSY The handle P is not stopped or refers to a non-active
72 74 process.
73 75
74 76 INTERFACE STABILITY
75 77 Uncommitted
76 78
77 79 MT-LEVEL
78 80 See LOCKING in libproc(3LIB).
79 81
80 82 SEE ALSO
81 83 errno(3C), libproc(3LIB), Lgrab(3PROC), Pgrab_file(3PROC), Pstop(3PROC),
82 84 proc(4)
83 85
84 86 illumos May 11, 2016 illumos
↓ open down ↓ |
66 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX