package openbsd

  1. Overview
  2. Docs

Openbsd package for OCaml

The Openbsd package provides Pledge and Unveil modules which wraps pledge(2) and unveil(2) syscalls to ocaml.

The interface is fully documented in the interface file lib/openbsd.mli.

Usage

On portable project, it is recommanded to use Pledge.supported and Unveil.supported constants to conditionally calls the wrappers.

Calling them on unsupported system will raise an Failure exception.

Examples

let open Openbsd in
if Pledge.supported then
  Pledge.promises "stdio rpath"
let open Openbsd in
if Unveil.supported then (
  Unveil.add "./lib" "r";
  Unveil.add "./logs" "rwc";
  Unveil.lock ())
OCaml

Innovation. Community. Security.