You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/03/15 11:55:21 UTC

implementing APR::Process

I need to pass $$ on the perl side and on the APR side it has to 
re-emerge as apr_proc_t. I see that it's not implemented yet.:

!<apr_proc_t>
    pid
    in
    out
    err
</apr_proc_t>

I've a few questions:

1. the apr_proc_t definition is:

/** The APR process type */
struct apr_proc_t {
     /** The process ID */
     pid_t pid;
     /** Parent's side of pipe to child's stdin */
     apr_file_t *in;
     /** Parent's side of pipe to child's stdout */
     apr_file_t *out;
     /** Parent's side of pipe to child's stdouterr */
     apr_file_t *err;
#ifdef WIN32
     /** Must retain the handle as any clone may not have the
      *  the same permissions
      */
     HANDLE hproc;
#endif
};

where is the hproc handle? should we hadle it? I've no clue whether 
it'll work on winFU without hproc. but see 2.

2. creating an APR::Process object constructor:

$apr_proc_obj = APR::PRocess->new($pid, $in, $out, $err);

requires $in, $out, $err to be apr_file_t so we need to implement:
apr_perlio_PerlIO_to_apr_file and apr_perlio_FILE_to_apr_file
which should extract apr_os_file_t from PerlIO/FILE and use 
apr_os_file_put() to create apr_file_t. I know how to get fd() from 
PerlIO/FILE which gives me apr_os_file_t for unix. How do I get winFU 
HANDLE and similar constructs for other platforms from PerlIO/FILE?

is that's the place where the missing from apr_structures.map 'HANDLE 
hproc' comes to plays? so it's just an internal member that we shouldn't 
give an access to? or is it the pid that should be returned for WinFU?

3. Probably need to implement accessors which will be able to retrieve 
all the members on the perl side. Getting PID is easy, and for io 
handles we already have conversion functions in apr_perlio.



_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org