class io.ChildProcess

class ChildProcess {
    // fields

    io.FileStream* readonly m_stderr;
    io.ChildProcessEvents readonly volatile m_activeEvents;
    std.Error const* readonly volatile m_ioError;
    bool readonly m_isOpen;

    // properties

    uint_t autoget property m_readParallelism;
    size_t autoget property m_readBlockSize;
    size_t autoget property m_readBufferSize;
    size_t autoget property m_writeBufferSize;
    io.ChildProcessOptions autoget property m_options;
    uint_t const property m_pid;
    uint_t const property m_exitCode;
    io.PtySize property m_ptySize;

    // construction

    construct();
    destruct();

    // methods

    bool errorcode start(
        string_t commandLine,
        std.HashTable const* environment = null,
        io.ChildProcessStartFlags flags = 0
    );

    bool errorcode terminate();
    void close();

    size_t errorcode read(
        void* p,
        size_t size
    );

    size_t errorcode write(
        void const* p,
        size_t size
    );

    long errorcode wait(
        io.ChildProcessEvents eventMask,
        void function* handler(io.ChildProcessEvents triggeredEvents)
    );

    bool errorcode cancelWait(long handle);

    io.ChildProcessEvents blockingWait(
        io.ChildProcessEvents eventMask,
        uint_t timeout = -1
    );

    import io.ChildProcess.ChildProcessEvents async asyncWait(io.ChildProcessEvents eventMask);

    // aliases

    alias dispose = close;
};