I've followed this great document on invoking user apps from the kernel: http://www.ibm.com/developerworks/linux/library/l-user-space-apps/index.html
But I'm now interested in how to get the output from the apps that have been run. I tried passing in redirection operators to write the output to a file.. Eg:
char *argv[] = { "/usr/bin/ls", ">>", "/tmp/list", NULL};
call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
No such luck. I came across call_usermodehelperpipe
and wondered if that would be what I'm after, but I haven't been able to grasp how to use it or find any documents like the above one on it.
Thanks in advance for suggestions / help!