1 '\" te
2 .\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved.
3 .\" This file and its contents are supplied under the terms of the
4 .\" Common Development and Distribution License ("CDDL"), version 1.0.
5 .\" You may only use this file in accordance with the terms of version
6 .\" 1.0 of the CDDL.
7 .\"
8 .\" A full copy of the text of the CDDL should have accompanied this
9 .\" source. A copy of the CDDL is also available via the Internet at
10 .\" http://www.illumos.org/license/CDDL.
11 .TH INOTIFY_RM_WATCH 3C "Sep 17, 2014"
12 .SH NAME
13 inotify_rm_watch \- remove a watch from an inotify instance
14 .SH SYNOPSIS
15
16 .LP
17 .nf
18 #include <sys/inotify.h>
19
20 \fBint\fR \fBinotify_rm_watch\fR(\fBint\fR \fIfd\fR, \fBint\fR \fIwd\fR);
21 .fi
22
23 .SH DESCRIPTION
24 .sp
25 .LP
26 The \fBinotify_rm_watch()\fR function removes the watch specified
27 by \fIwd\fR from the inotify instance associated with \fIfd\fR.
28 Removing a watch will induce an \fBIN_IGNORED\fR event; see
29 \fBinotify\fR(5) for details.
30
31 .SH RETURN VALUES
32 .sp
33 .LP
34 Upon succesful completion, \fBinotify_add_watch()\fR returns the
35 watch descriptor associated with the new watch.
36 If an error occurs, -1 is returned and errno is set to indicate
37 the error.
38
39 .SH ERRORS
40 .sp
41 .LP
42 \fBinotify_rm_watch()\fR will fail if:
43 .sp
44 .ne 2
45 .na
46 \fB\fBEBADF\fR\fR
47 .ad
48 .RS 10n
49 The \fIfd\fR argument is not a valid open file descriptor.
50 .RE
51
52 .sp
53 .ne 2
54 .na
55 \fB\fBEINVAL\fR\fR
56 .ad
57 .RS 10n
58 The \fIfd\fR argument does not correspond to an
59 \fBinotify\fR(5) instance as initialized with
60 \fBinotify_init\fR(3C) or \fBinotify_init1\fR(3C), or
61 \fIwd\fR is not a valid watch for the specified inotify
62 instance.
63 .RE
64
65 .sp
66 .SH NOTES
67 .sp
68 .LP
69
70 While the \fBinotify\fR(5) facility is implemented for purposes of
71 offering compatibility for Linux-borne applications, native
72 applications may opt to use it instead of (or in addition to) the
73 \fBPORT_SOURCE_FILE\fR capability of event ports. See
74 \fBinotify\fR(5) for details and restrictions.
75
76 .SH SEE ALSO
77 .sp
78 .LP
79 \fBinotify_init\fR(3C), \fBinotify_init1\fR(3C),
80 \fBport_create\fR(3C), \fBport_associate\fR(3C), \fBport_get\fR(3C),
81 \fBinotify\fR(5)