shithub: mc

Download patch

ref: 6863b80514aa42c6983d412823970a8c80e0b0cc
parent: 0c36acb089dad1d5656d2af4508b5165f52dee3d
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Aug 20 10:45:43 EDT 2014

Add spork() and sporkfd() calls

        const spork : (cmd : byte[:][:]     -> (pid, fd, fd))
        const sporkfd   : (cmd : byte[:][:], infd : fd, outfd : fd -> pid)

    spork() will create a new process running 'cmd', initialize it's
    stdin and stdout file descriptors to new pipes, and return a
    tuple consisting, respectively, of the PID of the newly spawned
    process, the write end of the new process's stdin, and the read
    end of the stdout of the new process.

    sporkfd() is similar, although instead of creating new file
    descriptors for stdin and stdout in the spawned process, it
    will connect them to the passed file descriptors. infd
    must be readable, and outfd must be writable.