---
name: "inotify_rm_watch"
section: "2"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/inotify_rm_watch"
---

# inotify\_rm\_watch(2)

remove an existing watch from an inotify instance

## NAME

inotify\_rm\_watch - remove an existing watch from an inotify instance

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <sys/inotify.h>
```

**int inotify\_rm\_watch(int** *fd***, int** *wd***);**

## DESCRIPTION

**inotify\_rm\_watch**() removes the watch associated with the watch descriptor *wd* from the inotify instance associated with the file descriptor *fd*.

Removing a watch causes an **IN\_IGNORED** event to be generated for this watch descriptor. (See [**inotify**(7)](/inotify/7.md).)

## RETURN VALUE

On success, **inotify\_rm\_watch**() returns zero. On error, -1 is returned and *errno* is set to indicate the error.

## ERRORS

- **EBADF**

  *fd* is not a valid file descriptor.

- **EINVAL**

  The watch descriptor *wd* is not valid; or *fd* is not an inotify file descriptor.

## STANDARDS

Linux.

## HISTORY

Linux 2.6.13.

## SEE ALSO

[**inotify\_add\_watch**(2)](/inotify_add_watch/2.md), [**inotify\_init**(2)](/inotify_init/2.md), [**inotify**(7)](/inotify/7.md)
