看板 LinuxDev 關於我們 聯絡資訊
各位大神好 小弟現在碰到一個問題無法解決 狀況如下: 我在kernel space想要呼叫user space的binary file,並且傳參數給它 現在麻煩的是這個參數是run time才會知道 目前survey到一個類似的做法,但是無法傳參數 1) DECLARE_WORK產生一個work struct 2) PREPARE_WORK把我要執行的kernel function丟到一個work queue裡 這個kernel function裡呼叫call_usermodehelper來執行user space 的binary file 3) 呼叫queue_work() 請問一下 有辦法從kernel space執行user space的binary,並傳參數嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.195.12.202
roylee17:call_usermodehelper(char *path, char **argv, 08/26 21:16
roylee17: char **envp, enum umh_wait wait) 08/26 21:16
roylee17:可以傳參數不是嗎? 08/26 21:18
clanguage:do_execve()?? 08/27 00:15
cobrasgo:to 1F,應該是我寫的不好,我是指prepare work時無法傳 08/27 00:59
cobrasgo:呼叫call_usermodehelper()本身沒問題,重點是kernel 08/27 01:00
cobrasgo:function的部份 08/27 01:00