From a kernel module, I am trying to use call_usermodehelper function to execute an executable sha1 which takes a file as argument and writes the SHA1 hash sum of the file t
The last argument for call_usermodehelper
is actually some sort of enumeration:
#define UMH_NO_WAIT 0 /* don't wait at all */
#define UMH_WAIT_EXEC 1 /* wait for the exec, but not the process */
#define UMH_WAIT_PROC 2 /* wait for the process to complete */
#define UMH_KILLABLE 4 /* wait for EXEC/PROC killable */
As you can see, with wait=1 the function waits while exec is performed, but doesn't wait the process.
If no other constraints, value UMH_WAIT_PROC gives more stable results.