簡體   English   中英

linux kernel 中的 ioctl 調用流程

[英]ioctl call flow in linux kernel

I am trying to understand the call flow of the ioctl call in linux kernel and I have a question - when we call ioctl from userspace, which function or module in linux kernel is responsible to convert this ioctl call to the corresponding ioctl call in the driver . 我知道驅動程序的 ioctl 不會直接從用戶空間調用。 首先調用 go 通過一些 kernel API,然后 ZDB974238714CA8DE634A7CE1D08 將依次調用驅動程序。 請幫我指出 kernel API 將 ioctl 傳輸到合適的驅動程序。

首先,我們從 此處或更多類似此處open調用路徑中找到一個struct file

然后文件描述符從數字轉換為struct file herehere

然后你只需像 這里一樣從file_operations調用ioctl但整個ioctl.c我想應該值得一個循環。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM