pike.git / lib / modules / Process.pmod

version» Context lines:

pike.git/lib/modules/Process.pmod:55: Inside #if constant(Stdio.__HAVE_SEND_FD__)
   "fds":({    forkd_pipe->pipe(Stdio.PROP_BIDIRECTIONAL|    Stdio.PROP_SEND_FD),    }),    ]));    }    return forkd_pid && forkd_pid->kill(0);   }   #endif    + protected int(0..1) forkd_default = 0; +  + //! Set the default value for the @expr{"forkd"@} modifier + //! to @[Process]. + //! + //! @note + //! The default default value is @expr{0@} (zero). + //! + //! @seealso + //! @[get_forkd_default()], @[Process()->create()] + void set_forkd_default(int(0..1) mode) + { +  forkd_default = mode; + } +  + //! Get the default value for the @expr{"forkd"@} modifier + //! to @[Process]. + //! + //! @note + //! The default default value is @expr{0@} (zero). + //! + //! @seealso + //! @[set_forkd_default()], @[Process()->create()] + int(0..1) get_forkd_default() + { +  return forkd_default; + } +    //! Slightly polished version of @[create_process].   //!   //! In addition to the features supported by @[create_process],   //! it also supports:   //!   //! @ul   //! @item   //! Callbacks on timeout and process termination.   //! @item   //! Using @[Tools.Standalone.forkd] via RPC to
pike.git/lib/modules/Process.pmod:103:    //! This callback is called when there is data to be read    //! from the process.    //! @member function(Process:void) "timeout_callback"    //! This callback is called if the process times out.    //! @member int "timeout"    //! The time it takes for the process to time out. Default is    //! 15 seconds.    //! @member int(0..1) "forkd"    //! Use @[Tools.Standalone.forkd] to actually spawn the process.    //! @endmapping +  //! +  //! @note +  //! The default value for the @expr{"forkd"@} modifier may be +  //! set via @[set_forkd_default()]. +  //!    //! @seealso    //! @[create_process], @[create_process()->create()], -  //! @[split_quoted_string()], @[Tools.Standalone.forkd] +  //! @[split_quoted_string()], @[Tools.Standalone.forkd], +  //! @[set_forkd_default()], @[get_forkd_default()]    protected void create( string|array(string) command_args,    void|mapping(string:mixed) modifiers )    {    if( stringp( command_args ) ) {    command_args = split_quoted_string( [string]command_args   #ifdef __NT__    ,1   #endif /* __NT__ */    );    }       mapping(string:mixed) new_modifiers = modifiers + ([]);       if (new_modifiers->keep_signals) {    // This option is currently not supported with forkd.    m_delete(new_modifiers, "forkd");    }      #if constant(Stdio.__HAVE_SEND_FD__)    // Forkd mode requires send_fd(). -  +  if (zero_type(new_modifiers->forkd)) new_modifiers->forkd = forkd_default;    if (new_modifiers->forkd && assert_forkd()) {    process_fd = Stdio.File();    forkd_pipe->    send_fd(process_fd->pipe(Stdio.PROP_BIDIRECTIONAL|Stdio.PROP_SEND_FD));    forkd_pipe->write("\0");       m_delete(new_modifiers, "forkd");    __callback = m_delete(new_modifiers, "callback");       if (zero_type(new_modifiers->uid)) {