<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > file_operations下函數詳解

file_operations下函數詳解

作者: 時(shí)間:2011-06-21 來(lái)源:網(wǎng)絡(luò ) 收藏

struct {

struct module *owner;

// 指向擁有該結構的模塊的指針,避免正在操作時(shí)被卸載,一般為初始化為T(mén)HIS_MODULES

loff_t (*llseek) (struct file *, loff_t, int);

// llseek用來(lái)修改文件當前的讀寫(xiě)位置,返回新位置

// loff_t為一個(gè)長(cháng)偏移量。當此指針為空,seek調用將會(huì )以不可預期的方式修改file結構中的位置計數器。

ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);

// 從設備中同步讀取數據。讀取成功返回讀取的字節數。設置為NULL,調用時(shí)返回-EINVAL

ssize_t (*aio_read) (struct kiocb *, char __user *, size_t, loff_t);

// 初始化一個(gè)異步的讀取操作,為NULL時(shí)全部通過(guò)read處理

ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);

// 向設備發(fā)送數據。

ssize_t (*aio_write) (struct kiocb *, const char __user *, size_t, loff_t);

// 初始化一個(gè)異步的寫(xiě)入操作。

int (*readdir) (struct file *, void *, filldir_t);

// 僅用于讀取目錄,對于設備文件,該字段為 NULL

unsigned int (*poll) (struct file *, struct poll_table_struct *);

// 返回一個(gè)位掩碼,用來(lái)指出非阻塞的讀取或寫(xiě)入是否可能。

// 將pool定義為 NULL,設備會(huì )被認為即可讀也可寫(xiě)。

int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);

// 提供一種執行設備特殊命令的方法。不設置入口點(diǎn),返回-ENOTTY

long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);

// 不使用BLK的文件系統,將使用此種指針代替ioctl

long (*compat_ioctl) (struct file *, unsigned int, unsigned long);

// 在64位系統上,32位的ioctl調用,將使用此指針代替

int (*mmap) (struct file *, struct vm_area_struct *);

// 用于請求將設備內存映射到進(jìn)程地址空間。如果無(wú)此方法,將訪(fǎng)問(wèn)-ENODEV。

int (*open) (struct inode *, struct file *);

// 如果為空,設備的打開(kāi)操作永遠成功,但系統不會(huì )通知驅動(dòng)程序

// 由VFS調用,當VFS打開(kāi)一個(gè)文件,即建立了一個(gè)新的struct file,之后調用open方法分配文件結構。open屬于struct

inode_operations。

int (*flush) (struct file *);

// 發(fā)生在進(jìn)程關(guān)閉設備文件描述符副本,執行并等待,若設置為NULL,內核將忽略用戶(hù)應用程序的請求。

int (*release) (struct inode *, struct file *);

// file結構釋放時(shí),將調用此指針函數,release與open相同可設置為NULL

int (*fsync) (struct file *, struct dentry *, int datasync);


上一頁(yè) 1 2 下一頁(yè)

關(guān)鍵詞: 詳解 函數 file_operations

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>