iv\_inotify(3) ivykis programmer's manual iv\_inotify(3)

# [NAME](#NAME)

IV\_INOTIFY\_INIT, iv\_inotify\_register, iv\_inotify\_unregister, IV\_INOTIFY\_WATCH\_INIT, iv\_inotify\_watch\_register, iv\_inotify\_watch\_unregister - ivykis [**inotify**(7)](/man/os/ivykis/inotify.7) wrapper

# [SYNOPSIS](#SYNOPSIS)

```
#include <iv_inotify.h>



struct iv_inotify {
};
```

**void IV\_INOTIFY\_INIT(struct iv\_inotify \*inotify);**  
**int iv\_inotify\_register(struct iv\_inotify \*inotify);**  
**void iv\_inotify\_unregister(struct iv\_inotify \*inotify);**

```
struct iv_inotify_watch {


        struct iv_inotify       *inotify;


        const char              *pathname;


        uint32_t                mask;


        void                    *cookie;


        void                    (*handler)(void *, struct inotify_event *);
};
```

**void IV\_INOTIFY\_WATCH\_INIT(struct iv\_inotify\_watch \*watch);**  
**int iv\_inotify\_watch\_register(struct iv\_inotify\_watch \*watch);**  
**int iv\_inotify\_watch\_unregister(struct iv\_inotify\_watch \*watch);**

# [DESCRIPTION](#DESCRIPTION)

The **iv\_inotify\_register** function registers an **iv\_inotify** instance with the [**iv\_inotify**(3)](/man/os/ivykis/iv_inotify.3) module. The **inotify** parameter is a pointer to the **iv\_inotify** structure to be registered.

The **iv\_inotify\_unregister** function unregisters an **iv\_inotify** instance from the [**iv\_inotify**(3)](/man/os/ivykis/iv_inotify.3) module. The **inotify** parameter is a pointer to the **iv\_inotify** structure to be unregistered.

The **iv\_inotify\_watch\_register** function adds a watch to the registered **iv\_inotify** instance specified by the **-&gt;inotify** member.

The **iv\_inotify\_watch\_unregister** function removes a watch from the **iv\_inotify** instance specified by the **-&gt;inotify** member.

In the **iv\_inotify\_watch** structure used in these functions, the **-&gt;pathname** and **-&gt;mask** members correspond to the members of struct inotify\_watch as described in [**inotify**(7)](/man/os/ivykis/inotify.7). **-&gt;handler** is the event handler called when this watch triggers. The arguments to this handler function are the pointer stored in the **-&gt;cookie** member of the **iv\_inotify\_watch** structure and a pointer to an inotify\_event structure as described in [**inotify**(7)](/man/os/ivykis/inotify.7).

# [RETURN VALUE](#RETURN_VALUE)

**iv\_inotify\_register** and **iv\_inotify\_watch\_register** return zero on success. On error, -1 is returned, and errno is set appropriately.

# [ERRORS](#ERRORS)

iv\_inotify will return errors returned by [**inotify\_init**(3)](/man/os/ivykis/inotify_init.3) and [**inotify\_add\_watch**(3)](/man/os/ivykis/inotify_add_watch.3).

# [SEE ALSO](#SEE_ALSO)

[**ivykis**(3)](/man/os/ivykis/ivykis.3), [**inotify**(7)](/man/os/ivykis/inotify.7), [**inotify\_init**(3)](/man/os/ivykis/inotify_init.3), [**inotify\_add\_watch**(3)](/man/os/ivykis/inotify_add_watch.3), [**inotify\_rm\_watch**(3)](/man/os/ivykis/inotify_rm_watch.3)

2009-02-07 ivykis

---

Document: IV_INOTIFY_INIT(3) from ivykis 0.43.2-r8 (Chainguard OS)
Source: https://github.com/buytenh/ivykis
