xref: /illumos-gate/usr/src/man/man3proc/Psetwapt.3proc (revision dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2)
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. The watchpoint's parameters are described in
35.Fa wp .
36For more information on watchpoints and the
37.Sy prwatch_t
38structure, see the
39.Sy PCWATCH
40section in
41.Xr proc 4 .
42The watched area will persist until a subsequent call to
43.Xr Pdelwapt 3PROC .
44.Pp
45Note, only active processes support watchpoints. It is an error to call
46this function on process handles that correspond to core files, zombie
47processes, or files.
48.Sh RETURN VALUES
49Upon successful completion, the
50.Fn Psetwapt
51function returns
52.Sy 0
53and installs the watchpoint in
54.Fa P .
55Otherwise,
56.Sy -1
57is returned and
58.Sy errno
59is set.
60.Sh ERRORS
61For a full list of possible errors see the
62.Sy DIAGNOSTICS
63section in
64.Xr proc 4 .
65.Pp
66The
67.Fn Psetwapt
68function will fail if:
69.Bl -tag -width Er
70.It Er ENOENT
71.Fa P
72does not refer to an active process.
73.El
74.Sh INTERFACE STABILITY
75.Sy Uncommitted
76.Sh MT-LEVEL
77See
78.Sy LOCKING
79in
80.Xr libproc 3LIB .
81.Sh SEE ALSO
82.Xr libproc 3LIB ,
83.Xr Pdelwapt 3PROC ,
84.Xr proc 4
85