需要解釋 kthread_create() 的參數

需要解釋 kthread_create() 的參數

我目前正在閱讀 Robert Love 所著的《Linux 核心開發》。在閱讀有關線程的內容時,我遇到了 kthread_create() 函數,它接受多個參數並相應地產生一個核心線程。

struct task_struct *kthread_create(int (*threadfn)(void *data),
  void *data,
  const char namefmt[],
  ...)

據我所知,第一個參數是指向函數的指針,第二個參數是threadfn()的參數,namefmt是程序的名稱。有人可以解釋一下最後那些變數參數是什麼嗎?

答案1

namefmtprintf-style 格式字串,可變參數是對應的參數(如果有)。

kthread_create說明在內核文檔中。

相關內容