No description
  • Shell 51%
  • Scheme 27.3%
  • Makefile 11.6%
  • C 9.5%
  • Common Lisp 0.6%
Find a file
2026-07-30 15:46:48 -06:00
.builds ci: set umask 022 in package/verify tasks too (jerbuild creates group-writable cache dirs during pkg operations) 2026-07-22 13:10:56 -06:00
.jerboa Security hardening and release readiness 2026-06-23 10:50:05 -06:00
docs Security hardening and release readiness 2026-06-23 10:50:05 -06:00
scripts Resolve security audit findings 2026-07-11 17:22:32 -06:00
src fix: drain inotify queue, poll error reporting, lazy-load synchronization 2026-07-21 11:09:45 -06:00
support Security hardening and release readiness 2026-06-23 10:50:05 -06:00
tests Resolve security audit findings 2026-07-11 17:22:32 -06:00
.gitignore Security hardening and release readiness 2026-06-23 10:50:05 -06:00
AGENTS.md docs: remove jerboa-emacs restriction 2026-07-30 15:46:48 -06:00
jerboa_inotify_shim.c fix: drain inotify queue, poll error reporting, lazy-load synchronization 2026-07-21 11:09:45 -06:00
jpkg.sexp Add jpkg packaging 2026-07-21 15:09:24 -06:00
LICENSE Switch to MIT license 2026-07-21 13:42:18 -06:00
Makefile build: add lint target 2026-07-21 11:56:17 -06:00
README.md Resolve security audit findings 2026-07-11 17:22:32 -06:00
SECURITY.md Security hardening and release readiness 2026-06-23 10:50:05 -06:00

jerboa-inotify

Linux inotify filesystem event monitoring for Jerboa.

Status: experimental and Linux-only. Treat this repository as a native FFI filesystem component until the release gates in SECURITY.md and docs/ffi-boundary.md are complete.

Requirements

  • Linux with inotify support
  • Jerboa jerbuild
  • C compiler

Build And Test

make test-linux
make audit
make security
make platform-evidence
make sbom
make reproducibility-report
make release-evidence

On non-Linux hosts, make test transpiles the Jerboa source and skips runtime tests. CI runs the real kernel tests on Ubuntu.

Dynamic builds must set JERBOA_INOTIFY_LIB to the absolute path of the trusted directory containing jerboa_inotify_shim.so. The loader rejects relative paths, current-working-directory searches, bare library names, and a final shim path that is a symbolic link. Statically linked hosts are detected from the registered native entry points and do not need this variable.

If jerbuild is not installed, the Makefile bootstraps the pinned Jerboa release into .jerboa/bin.

make release-evidence records test output, platform evidence, native linkage when Linux is available, SBOM manifests, and reproducibility output under dist/release-evidence/. On non-Linux hosts it is expected to report partial evidence because inotify runtime checks require the Linux kernel.

Production Linux support is blocked until make platform-evidence records Linux runtime/linkage proof and overflow/backpressure proof through JERBOA_INOTIFY_TARGET_LINUX_PROOF_FILE and JERBOA_INOTIFY_TARGET_OVERFLOW_PROOF_FILE, or a Linux release host runs the full evidence target directly. Production release hosts should set the matching JERBOA_INOTIFY_REQUIRE_TARGET_*_PROOF=1 variables when proof files are required. Proof files must not contain private paths, hostnames, secrets, raw production watch output, or raw command output.

Usage

(import (jerboa-inotify))

(define fd (inotify-init))
(define wd (inotify-add-watch fd "/path/to/watch"
             (bitwise-ior IN_CREATE IN_DELETE IN_MODIFY)))

(when (inotify-poll fd 5000)
  (for-each
    (lambda (ev)
      (printf "wd=~a mask=~a name=~a~%"
        (inotify-event-wd ev)
        (inotify-event-mask ev)
        (inotify-event-name ev)))
    (inotify-read-events fd)))

(inotify-rm-watch fd wd)
(inotify-close fd)

Consumers must handle IN_Q_OVERFLOW by rescanning watched state. Inotify does not recursively watch directory trees. Production callers should follow docs/overflow-handling.md for cache invalidation, backpressure, and path-log redaction.

API

Function Description
(inotify-init) Create inotify instance, returns fd
(inotify-close fd) Close inotify fd
(inotify-add-watch fd path mask) Add watch, returns wd
(inotify-rm-watch fd wd) Remove watch
(inotify-poll fd timeout-ms) Poll for events
(inotify-read-events fd) Read pending events

Event Record

Accessor Description
(inotify-event-wd ev) Watch descriptor
(inotify-event-mask ev) Event mask
(inotify-event-cookie ev) Cookie for rename tracking
(inotify-event-name ev) Filename or #f

Security

See SECURITY.md, docs/ffi-boundary.md, docs/overflow-handling.md, and docs/release-evidence.md.