Experimental signal backends for beckon
use only the Java Foreign Function & Memory API (JDK 22+). Use them as an
alternative to beckon's default sun.misc.Signal backend:
- Linux -
signalfd(2) - macOS / BSD -
kqueue(2)withEVFILT_SIGNAL
sun.misc.Signal is an internal JDK API. The JDK can remove it. This library
tests a supported replacement. It is experimental and ships separately
because it requires JDK 22+. The beckon core jar targets JDK 8.
Use beckon by default. Add
beckon-ffm only when you want the experimental Foreign Function & Memory
backend and can run on JDK 22+.
Add both artifacts, then opt in with a system property.
net.clojars.savya/beckon {:mvn/version "0.4.1"}
net.clojars.savya/beckon-ffm {:mvn/version "0.1.7"}Leiningen:
[net.clojars.savya/beckon "0.4.1"]
[net.clojars.savya/beckon-ffm "0.1.7"]Run the JVM with:
-Dbeckon.signal.backend=ffm --enable-native-access=ALL-UNNAMED
The platform selects the native mechanism automatically. The beckon API does not change. See the beckon README.
The two implementations differ:
- Linux (
signalfd) reliably handles beckon's ownraise!. It does not reliably handle signals from outside the process (e.g.kill -HUP). A JVM starts threads before beckon loads.signalfdonly captures a signal blocked in every thread. beckon cannot arrange this after the JVM starts. - macOS/BSD (
kqueue) sets each managed signal toSIG_IGN. This is a process-wide disposition. It also observes external signals.
The Linux limitation and JEP 472 native-access restrictions mean this is not a
drop-in replacement. --enable-native-access is denied by default from JDK 26.
sun.misc.Signal remains beckon's default.
Requires JDK 22 or later (Foreign Function & Memory API, JEP 454). Linux and macOS/BSD only. CI compiles and tests on JDK 22.
Use JDK 22. Compile the two Java FFM backends before running the test suite:
clojure -T:build compile-java
clojure -M:test
clojure -T:build jarCopyright © 2026 Savyasachi.
A companion to beckon (originally by Jean Niklas L'orange). Distributed under the Eclipse Public License 1.0.