call_usermodehelper_setup (9) - Linux Man Pages
call_usermodehelper_setup: prepare to call a usermode helper
call_usermodehelper_setup - prepare to call a usermode helper
struct subprocess_info * call_usermodehelper_setup(char
*path, char **argv, char **envp, gfp_t gfp_mask, int (*init) (struct subprocess_infocleanup) *info, struct cred *new), void (* (struct subprocess_infodata); *info), void *
- path to usermode executable
- arg vector for process
- environment for process
- gfp mask for memory allocation
- an init function
- a cleanup function
- arbitrary context sensitive data
Returns either NULL on allocation failure, or a subprocess_info structure. This should be passed to call_usermodehelper_exec to exec the process and free the structure.
The init function is used to customize the helper process prior to exec. A non-zero return code causes the process to error out, exit, and return the failure to the calling process
The cleanup function is just before ethe subprocess_info is about to be freed. This can be used for freeing the argv and envp. The Function must be runnable in either a process context or the context in which call_usermodehelper_exec is called.