diff options
author | Yusuke Sato <yusukes@google.com> | 2015-08-19 23:58:45 -0700 |
---|---|---|
committer | Yusuke Sato <yusukes@google.com> | 2015-08-21 17:14:59 -0700 |
commit | 7980426a6ffb35567c8a7b83fe0acef2c3033bd4 (patch) | |
tree | 4d032a99954e11ac76d7b8b5680f2e307e63e9a1 /logwrapper/include | |
parent | a1b2036f4daf9e0de0fe616e5f371d75f6b2357d (diff) | |
download | system_core-7980426a6ffb35567c8a7b83fe0acef2c3033bd4.tar.gz system_core-7980426a6ffb35567c8a7b83fe0acef2c3033bd4.tar.bz2 system_core-7980426a6ffb35567c8a7b83fe0acef2c3033bd4.zip |
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
Diffstat (limited to 'logwrapper/include')
-rw-r--r-- | logwrapper/include/logwrap/logwrap.h | 10 |
1 files changed, 9 insertions, 1 deletions
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; }; }; |