1 #include <stdio.h> 2 #include "r_util.h" 3 4 main(int argc,char * argv[])5int main(int argc, char *argv[]) { 6 int len = 0; 7 char *sterr; 8 char *output = r_sys_cmd_str("find /etc", 0, &len); 9 int result = r_sys_cmd_str_full("find /etc", 0, &output, &len, &sterr); 10 printf("RESULT: %d\n", result); 11 printf("STDOUT\n"); 12 printf("%s", output); 13 printf("STDERR\n"); 14 printf("%s", sterr); 15 printf("bytes in STDOUT: %d\n", len); 16 return 0; 17 } 18