My blog post about using it as a shell (see example-shell
directory).
procex
is a library for launching unix processes, that DOES NOT wrap createProcess
.
It interfaces directly with vfork
and execve
, and closes fds efficiently using the
new close_range
Linux syscall (or close
if not available).
The syntax for launching processes is clean, concise, and flexible, mimicking sh
.
procex
can:
execve
withoutfork
, i.e. replace the current process- Set fds besides 0, 1, and 2
- Launch a process without taking >0.5s when max fds is high
- Launch processes with an invalid UTF-8 name
- Be extended easily due to the flexible and simple API
- Be used as a shell
- not wrap Haskell functions in a
Cmd
likeshh
, because that is generally not a good solution
import Procex.Prelude
main :: IO ()
main = captureLazy (mq "cat" <<< "some stdin") >>= \stdout -> putStrLn (show stdout)
- Setting the environment (workaround: use
env
from coreutils) - Better README
- Support for non-Linux kernels