iv_inotify(3)
β¨ iv_inotify β the ivykis inotify(7) wrapper, bestie edition β¨
okay so you want to watch files like a little hawk π¦ and you're using ivykis? say less. this is from the ivykis programmer's manual, and it's giving "inotify but make it event-loop-friendly." no cap. π
π NAME π
IV_INOTIFY_INIT, iv_inotify_register, iv_inotify_unregister, IV_INOTIFY_WATCH_INIT, iv_inotify_watch_register, iv_inotify_watch_unregister β literally the whole ivykis inotify(7) wrapper, one iconique family of functions. π
πΈ SYNOPSIS πΈ
like, here's the whole cast, verbatim, no edits, periodt:
#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 π
so here's the tea, bestie β β let's go function by function because the way that each one has a job is so satisfying.
π¦ the instance functions
iv_inotify_register β this one registers an iv_inotify instance with the iv_inotify(3) module. the inotify parameter is a pointer to the iv_inotify structure you want to register. that's it, that's the whole vibe.
iv_inotify_unregister β the reverse, the breakup arc π. it unregisters an iv_inotify instance from the iv_inotify(3) module. the inotify parameter is a pointer to the iv_inotify structure you're unregistering.
π the watch functions
iv_inotify_watch_register β adds a watch to the registered iv_inotify instance that's specified by the ->inotify member. like, it's matching them up. main character energy fr fr. π
iv_inotify_watch_unregister β removes a watch from the iv_inotify instance specified by the ->inotify member. goodbye watch π
π the struct deets (iykyk)
in the iv_inotify_watch structure used by these functions:
->pathnameand->maskcorrespond to the members ofstruct inotify_watchas described in inotify(7). yes, same names, same meaning, we are not inventing anything here.->handleris the event handler that gets called when this watch triggers. β¨- the arguments to that handler function are (1) the pointer stored in the
->cookiemember of theiv_inotify_watchstructure, and (2) a pointer to aninotify_eventstructure as described in inotify(7). so your cookie comes back to you, like a lil boomerang πͺπͺ.
β RETURN VALUE β
iv_inotify_registerandiv_inotify_watch_registerreturn zero on success. slay. β- on error,
-1is returned, anderrnois set appropriately. that's the "it's not giving" signal π.
π ERRORS π
ngl, the error handling is honestly just passing the buck in the cutest way: iv_inotify will return errors returned by inotify_init(3) and inotify_add_watch(3). so whatever those two say, that's what you get. π«Ά
π₯ SEE ALSO π₯
go read these, bestie, they're the extended universe:
and that's the whole page!! π this came to you from the ivykis girlies, dated 2009-02-07, filed under iv_inotify(3). obsessed with you for reading the whole thing, mwah πβ¨
π¦ where this page comes from
- alpine 3.22: ivykis-doc 0.43.2-r0 Β· LGPL-2.1-or-later
- alpine 3.23: ivykis-doc 0.43.2-r0 Β· LGPL-2.1-or-later
- alpine 3.24: ivykis-doc 0.43.2-r0 Β· LGPL-2.1-or-later
- debian bookworm: libivykis-dev 0.42.4-1
- debian trixie: libivykis-dev 0.43.2-1+b1
- epel 10: ivykis-devel 0.43.2-2.el10_0 Β· LicenseRef-Callaway-LGPLv2+
- epel 9: ivykis-devel 0.42.4-7.el9 Β· LGPLv2+
- fedora 43: ivykis-devel 0.43.2-4.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: ivykis-devel 0.43.2-4.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: ivykis-devel 0.43.2-5.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: ivykis-devel 0.43.2-5.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixpkgs unstable: libivykis 0.43.2
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- ubuntu jammy: libivykis-dev 0.42.4-1
- ubuntu noble: libivykis-dev 0.43-1build1
- ubuntu questing: libivykis-dev 0.43.2-1
- ubuntu resolute: libivykis-dev 0.43.2-1build1
- ubuntu stonking: libivykis-dev 0.43.2-1build1
- Copyright (C) 2009 Ronald Huizer
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms