xref: /illumos-gate/usr/src/man/man3proc/Psetwapt.3proc (revision e2f4f3dab373b605b62ac175115f264a5c417eb6)
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 PSETWAPT 3PROC
16.Os
17.Sh NAME
18.Nm Psetwapt
19.Nd set a watchpoint in a process
20.Sh SYNOPSIS
21.Lb libproc
22.In libproc.h
23.Ft int
24.Fo Psetwapt
25.Fa "struct ps_prochandle *P"
26.Fa "const prwatch_t *wp"
27.Fc
28.Sh DESCRIPTION
29The
30.Fn Psetwapt
31function adds a watchpoint to the process handle
32.Fa P .
33Allowing the hardware to generate a trap when the specified area is
34accessed.
35The watchpoint's parameters are described in
36.Fa wp .
37For more information on watchpoints and the
38.Sy prwatch_t
39structure, see the
40.Sy PCWATCH
41section in
42.Xr proc 4 .
43The watched area will persist until a subsequent call to
44.Xr Pdelwapt 3PROC .
45.Pp
46Note, only active processes support watchpoints.
47It is an error to call this function on process handles that correspond to core
48files, zombie processes, or files.
49.Sh RETURN VALUES
50Upon successful completion, the
51.Fn Psetwapt
52function returns
53.Sy 0
54and installs the watchpoint in
55.Fa P .
56Otherwise,
57.Sy -1
58is returned and
59.Sy errno
60is set.
61.Sh ERRORS
62For a full list of possible errors see the
63.Sy DIAGNOSTICS
64section in
65.Xr proc 4 .
66.Pp
67The
68.Fn Psetwapt
69function will fail if:
70.Bl -tag -width Er
71.It Er ENOENT
72.Fa P
73does not refer to an active process.
74.El
75.Sh INTERFACE STABILITY
76.Sy Uncommitted
77.Sh MT-LEVEL
78See
79.Sy LOCKING
80in
81.Xr libproc 3LIB .
82.Sh SEE ALSO
83.Xr libproc 3LIB ,
84.Xr Pdelwapt 3PROC ,
85.Xr proc 4
86