Why does call_usermodehelper fail most of the times?

后端 未结 1 1316
无人及你
无人及你 2020-12-21 11:43

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

相关标签:
1条回答
  • 2020-12-21 11:44

    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.

    0 讨论(0)
提交回复
热议问题