diff options
author | KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com> | 2020-08-04 15:27:43 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-01-06 09:27:28 +0900 |
commit | 22ff642d242f580322286fd82d12d688333847ce (patch) | |
tree | 1445cebde8b2fab7acce21abc818c75f2009b106 /include/dlt/dlt_common.h | |
parent | 2b92c259db950c2aef03f14e47e4994546765265 (diff) | |
download | DLT-daemon-22ff642d242f580322286fd82d12d688333847ce.tar.gz |
dlt_common: Execute system command using execvp
Add function dlt_execute_command() to execute system command using
execvp.
Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
Diffstat (limited to 'include/dlt/dlt_common.h')
-rw-r--r-- | include/dlt/dlt_common.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h index 71b9c10..aa10796 100644 --- a/include/dlt/dlt_common.h +++ b/include/dlt/dlt_common.h @@ -1618,6 +1618,14 @@ void dlt_getloginfo_conv_ascii_to_id(char *rp, int *rp_count, char *wp, int len) */ void dlt_hex_ascii_to_binary(const char *ptr, uint8_t *binary, int *size); +/** + * Helper function to execute the execvp function in a new child process. + * @param filename file path to store the stdout of command (NULL if not required) + * @param command execution command followed by arguments with NULL-termination + * @return negative value if there was an error + */ +int dlt_execute_command(char *filename, char *command, ...); + # ifdef __cplusplus } # endif |