GNU.WIKI: The GNU/Linux Knowledge Base

  [HOME] [PHP Manual] [HowTo] [ABS] [MAN1] [MAN2] [MAN3] [MAN4] [MAN5] [MAN6] [MAN7] [MAN8] [MAN9]

  [0-9] [Aa] [Bb] [Cc] [Dd] [Ee] [Ff] [Gg] [Hh] [Ii] [Jj] [Kk] [Ll] [Mm] [Nn] [Oo] [Pp] [Qq] [Rr] [Ss] [Tt] [Uu] [Vv] [Ww] [Xx] [Yy] [Zz]


       IV_POPEN_REQUEST_INIT,  iv_popen_request_submit, iv_popen_request_close
       - popen(3) for ivykis applications


       #include <iv_popen.h>

       struct iv_popen_request {
               char            *file;
               char            **argv;
               char            *type;

       void IV_POPEN_REQUEST_INIT(struct iv_popen_request *this);
       int iv_popen_request_submit(struct iv_popen_request *this);
       void iv_popen_request_close(struct iv_popen_request *this);


       iv_popen provides ivykis(3) applications with an  asynchronous  version
       of popen(3) that is integrated with the ivykis event loop.

       After    initialising    a   struct   iv_popen_request   object   using
       IV_POPEN_REQUEST_INIT and assigning its ->file and  ->argv  and  ->type
       members, one can call iv_popen_request_submit on it to fork off a child
       process which will call execvp(2) on ->file and ->argv,  while  in  the
       parent  process  returning  a  file descriptor that is connected to the
       child's standard input (if ->type equals "w") or  standard  output  (if
       ->type equals "r").

       When  the  application  is  done with the child process, it should call
       iv_popen_request_close, and  close  the  file  descriptor  returned  by
       iv_popen_request_submit (this is not done automatically).

       iv_popen will continue to monitor the child's process state while it is
       running, by registering an iv_wait(3) interest for its process ID.

       If the child process has not yet terminated when iv_popen_request_close
       is  called, iv_popen will attempt to terminate the child process in the
       background by sending it a series of SIGTERM and SIGKILL signals.

       iv_popen_request_close  must  be  called  from  the  same  thread  that
       iv_popen_request_submit was called from on this object.


       ivykis(3), iv_wait(3), execvp(2), popen(3)

  All copyrights belong to their respective owners. Other content (c) 2014-2018, GNU.WIKI. Please report site errors to
Page load time: 0.089 seconds. Last modified: November 04 2018 12:49:43.