Skip to main content

Module worker

Module worker 

Source
Expand description

The worker binary’s mode dispatch.

One binary hosts several modes selected by its first argument. The sandbox helper mode is the first stage of every jailed spawn. The pdf mode is the production converter behind the runner. The two probe modes prove the jail from the inside. The remaining fake engine and harness modes exist only under the test-adapters feature, so a production build ships the helper, the PDF path, and the probes, and nothing else.

Every non-helper mode speaks the framed protocol: it reads one request frame from stdin, does its work, and writes exactly one response frame to stdout. It never writes a second frame or logs to stdout, because the parent treats any trailing stdout byte as a protocol violation.

Functions§

worker_main
Runs the worker. mode is the first argument, rest the ones after it. Returns the process exit code.