https://github.com/jsavyasachi/beckon-ffm
Experimental FFM signal backends for beckon (Linux signalfd, macOS kqueue)
https://github.com/jsavyasachi/beckon-ffm
clojure clojure-library foreign-function-memory kqueue signalfd signals
Last synced: 9 days ago
JSON representation
Experimental FFM signal backends for beckon (Linux signalfd, macOS kqueue)
- Host: GitHub
- URL: https://github.com/jsavyasachi/beckon-ffm
- Owner: jsavyasachi
- License: epl-1.0
- Created: 2026-06-06T07:13:17.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-07-06T16:07:26.000Z (13 days ago)
- Last Synced: 2026-07-06T16:19:55.444Z (13 days ago)
- Topics: clojure, clojure-library, foreign-function-memory, kqueue, signalfd, signals
- Language: Java
- Homepage: https://cljdoc.org/d/net.clojars.savya/beckon-ffm
- Size: 37.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# beckon-ffm
[](https://clojars.org/net.clojars.savya/beckon-ffm)
[](https://cljdoc.org/d/net.clojars.savya/beckon-ffm/CURRENT)
[](https://github.com/jsavyasachi/beckon-ffm/actions/workflows/ci.yml)
Experimental signal backends for [beckon](https://github.com/jsavyasachi/beckon)
built entirely on the Java Foreign Function & Memory API (JDK 22+), as an
alternative to beckon's default `sun.misc.Signal` backend:
- **Linux** - `signalfd(2)`
- **macOS / BSD** - `kqueue(2)` with `EVFILT_SIGNAL`
It exists because `sun.misc.Signal` is an internal JDK API that may eventually be
removed; this proves out the supported modern replacement. It is **experimental**
and shipped separately precisely because it needs JDK 22+, while beckon's core
jar targets JDK 8.
## Stack
## Installation
Use [`beckon`](https://github.com/jsavyasachi/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.
```clj
[net.clojars.savya/beckon "0.4.1"]
[net.clojars.savya/beckon-ffm "0.1.3"]
```
Run the JVM with:
```
-Dbeckon.signal.backend=ffm --enable-native-access=ALL-UNNAMED
```
The right native mechanism is selected automatically for the platform. The
beckon API is unchanged - see the
[beckon README](https://github.com/jsavyasachi/beckon).
## Capabilities and limits
The two implementations differ, which is instructive:
- **Linux (`signalfd`)** reliably handles beckon's own `raise!`, but not signals
from *outside* the process (e.g. `kill -HUP`): a JVM starts threads before
beckon loads, and `signalfd` only captures a signal blocked in every thread,
which cannot be arranged retroactively.
- **macOS/BSD (`kqueue`)** sets each managed signal to `SIG_IGN` - a process-wide
disposition - so it also observes external signals.
Because of the Linux limitation and JEP 472 native-access restrictions
(`--enable-native-access`, denied by default from JDK 26), this is not a drop-in
replacement; `sun.misc.Signal` remains beckon's default.
## Compatibility
Requires JDK 22 or later (Foreign Function & Memory API, JEP 454). Linux and
macOS/BSD only. Continuously tested on JDK 25 across Ubuntu and macOS.
## License
Copyright © 2026 Savyasachi.
A companion to [beckon](https://github.com/jsavyasachi/beckon) (originally by Jean Niklas L'orange).
Distributed under the [Eclipse Public License 1.0](https://www.eclipse.org/legal/epl-v10.html).