From 7980426a6ffb35567c8a7b83fe0acef2c3033bd4 Mon Sep 17 00:00:00 2001 From: Yusuke Sato Date: Wed, 19 Aug 2015 23:58:45 -0700 Subject: Add FORK_EXECVP_OPTION_CAPTURE_OUTPUT to logwrap.h This allows raw popen calls in e.g. system/netd/ to be replaced with android_fork_execvp_ext(). Change-Id: I159ece7369fa38ff8782024bef0d7cfafe74ecee --- logwrapper/include/logwrap/logwrap.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'logwrapper/include') diff --git a/logwrapper/include/logwrap/logwrap.h b/logwrapper/include/logwrap/logwrap.h index 449461f65..89a8fddcc 100644 --- a/logwrapper/include/logwrap/logwrap.h +++ b/logwrapper/include/logwrap/logwrap.h @@ -73,7 +73,9 @@ __BEGIN_DECLS #define LOG_FILE 4 /* Write data to child's stdin. */ -#define FORK_EXECVP_OPTION_INPUT 0 +#define FORK_EXECVP_OPTION_INPUT 0 +/* Capture data from child's stdout and stderr. */ +#define FORK_EXECVP_OPTION_CAPTURE_OUTPUT 1 struct AndroidForkExecvpOption { int opt_type; @@ -82,6 +84,12 @@ struct AndroidForkExecvpOption { const uint8_t* input; size_t input_len; } opt_input; + struct { + void (*on_output)(const uint8_t* /*output*/, + size_t /*output_len*/, + void* /* user_pointer */); + void* user_pointer; + } opt_capture_output; }; }; -- cgit v1.2.3