| 1 |
.\" Copyright 2005, Robert Love <[email protected]> |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
.\" |
| 6 |
.TH inotify_rm_watch 2 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
inotify_rm_watch \- remove an existing watch from an inotify instance |
| 9 |
.SH LIBRARY |
| 10 |
Standard C library |
| 11 |
.RI ( libc ,\~ \-lc ) |
| 12 |
.SH SYNOPSIS |
| 13 |
.nf |
| 14 |
.B #include <sys/inotify.h> |
| 15 |
.P |
| 16 |
.BI "int inotify_rm_watch(int " fd ", int " wd ); |
| 17 |
.\" Before glibc 2.10, the second argument was types as uint32_t. |
| 18 |
.\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=7040 |
| 19 |
.fi |
| 20 |
.SH DESCRIPTION |
| 21 |
.BR inotify_rm_watch () |
| 22 |
removes the watch associated with the watch descriptor |
| 23 |
.I wd |
| 24 |
from the inotify instance associated with the file descriptor |
| 25 |
.IR fd . |
| 26 |
.P |
| 27 |
Removing a watch causes an |
| 28 |
.B IN_IGNORED |
| 29 |
event to be generated for this watch descriptor. |
| 30 |
(See |
| 31 |
.BR inotify (7).) |
| 32 |
.SH RETURN VALUE |
| 33 |
On success, |
| 34 |
.BR inotify_rm_watch () |
| 35 |
returns zero. |
| 36 |
On error, \-1 is returned and |
| 37 |
.I errno |
| 38 |
is set to indicate the error. |
| 39 |
.SH ERRORS |
| 40 |
.TP |
| 41 |
.B EBADF |
| 42 |
.I fd |
| 43 |
is not a valid file descriptor. |
| 44 |
.TP |
| 45 |
.B EINVAL |
| 46 |
The watch descriptor |
| 47 |
.I wd |
| 48 |
is not valid; |
| 49 |
or |
| 50 |
.I fd |
| 51 |
is not an inotify file descriptor. |
| 52 |
.SH STANDARDS |
| 53 |
Linux. |
| 54 |
.SH HISTORY |
| 55 |
Linux 2.6.13. |
| 56 |
.SH SEE ALSO |
| 57 |
.BR inotify_add_watch (2), |
| 58 |
.BR inotify_init (2), |
| 59 |
.BR inotify (7) |