package openbsd

  1. Overview
  2. Docs
Bindings for some OpenBSD syscalls

Install

Dune Dependency

Authors

Maintainers

Sources

openbsd.1.0.tar.gz
md5=7964ca160a505cee20415d69ccfe17b2
sha512=7cfe1bdb6d026d42876d01725474a9832da34f00da4b3bdfe74858f2e7cd5f9473db89d96dbf259166c55eb1d084a188d227be4c93b3b33aef62a38a5fba6784

README.md.html

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.