cVisor Clojure SDK — java.lang.foreign (FFM) bindings over the libcvisor C ABI. Linux-only at runtime; requires JDK 22+.
(require '[cvisor.core :as cvisor]) (with-open [sb (cvisor/sandbox)] (:stdout (cvisor/run sb "echo hello"))) ; => "hello\n"
cVisor Clojure SDK — java.lang.foreign (FFM) bindings over the libcvisor C ABI.
Linux-only at runtime; requires JDK 22+.
(require '[cvisor.core :as cvisor])
(with-open [sb (cvisor/sandbox)]
(:stdout (cvisor/run sb "echo hello"))) ; => "hello\n"(run sb command)Run a shell command in the sandbox, blocking until it exits. Returns {:stdout String, :stderr String, :stdout-bytes bytes, :stderr-bytes bytes}.
Run a shell command in the sandbox, blocking until it exits. Returns
{:stdout String, :stderr String, :stdout-bytes bytes, :stderr-bytes bytes}.(sandbox)Create a sandbox. Free it with close (Closeable, so with-open works).
Create a sandbox. Free it with `close` (Closeable, so with-open works).
(set-log-level! sb level)Set the sandbox log level: :debug (or "DEBUG") enables logging, anything else disables it.
Set the sandbox log level: :debug (or "DEBUG") enables logging, anything else disables it.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |