Man page - iv_popen_request_submit(3)
Packages contas this manual
- iv_fd_pump_init(3)
- iv_timer_register(3)
- iv_timer_unregister(3)
- iv_fd_pump(3)
- iv_wait_interest_register(3)
- iv_event_raw_post(3)
- iv_timer_registered(3)
- iv_signal_unregister(3)
- iv_thread(3)
- iv_signal(3)
- iv_inited(3)
- iv_tls_user_ptr(3)
- iv_event_raw_unregister(3)
- iv_popen_request_submit(3)
- iv_fd_set_handler_out(3)
- ivykis(3)
- iv_tls(3)
- iv_fd_unregister(3)
- iv_examples(3)
- iv_wait_interest_register_spawn(3)
- iv_invalidate_now(3)
- iv_work_pool_create(3)
- iv_inotify_watch_register(3)
- iv_inotify(3)
- iv_validate_now(3)
- iv_task_registered(3)
- iv_fatal(3)
- iv_event_raw_register(3)
- iv_thread_create(3)
- iv_quit(3)
- iv_task(3)
- iv_task_register(3)
- iv_fd_set_handler_in(3)
- iv_set_fatal_msg_handler(3)
- iv_event_post(3)
- iv_deinit(3)
- iv_init(3)
- iv_event_register(3)
- iv_fd(3)
- iv_fd_registered(3)
- iv_work_pool_submit_work(3)
- iv_time(3)
- iv_inotify_watch_unregister(3)
- iv_event_raw(3)
- iv_fd_pump_destroy(3)
- iv_fd_register_try(3)
- iv_signal_register(3)
- iv_inotify_unregister(3)
- iv_event(3)
- iv_thread_set_debug_state(3)
- iv_work_pool_put(3)
- iv_fd_pump_is_done(3)
- iv_fd_register(3)
- iv_inotify_register(3)
- iv_task_unregister(3)
- iv_timer(3)
- iv_event_unregister(3)
- iv_wait(3)
- iv_fd_pump_pump(3)
- iv_work(3)
- iv_fd_set_handler_err(3)
- iv_tls_user_register(3)
- iv_popen(3)
- iv_main(3)
- iv_wait_interest_unregister(3)
- iv_popen_request_close(3)
apt-get install libivykis-dev
Manual
| iv_popen(3) | ivykis programmer's manual | iv_popen(3) |
NAME
IV_POPEN_REQUEST_INIT, iv_popen_request_submit, iv_popen_request_close - popen(3) for ivykis applications
SYNOPSIS
#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);
DESCRIPTION
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.
SEE ALSO
ivykis(3), iv_wait(3), execvp(2), popen(3)
| 2010-09-04 | ivykis |