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

Description

Provides bindings around pledge(2) and unveil(2) syscalls.

Tags

openbsd

Published: 11 Oct 2024

README

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 ())

Dependencies (2)

  1. dune >= "3.16"
  2. ocaml

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.