久久ER99热精品一区二区-久久精品99国产精品日本-久久精品免费一区二区三区-久久综合九色综合欧美狠狠

新聞中心

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

file_operations下函數詳解

作者: 時間:2011-06-21 來源:網絡 收藏


// 刷新待處理的數據,如果驅動程序沒有實現,fsync調用將返回-EINVAL

int (*aio_fsync) (struct kiocb *, int datasync);

// 異步fsync

int (*fasync) (int, struct file *, int);

// 通知設備FASYNC標志發生變化,如果設備不支持異步通知,該字段可以為NULL

int (*lock) (struct file *, int, struct file_lock *);

// 實現文件鎖,設備驅動常不去實現此lock

ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);

ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);

// readv和writev 分散/聚集型的讀寫操作,實現進行涉及多個內存區域的單次讀或寫操作。

ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);

// 實現sendfile調用的讀取部分,將數據從一個文件描述符移到另一個,設備驅動通常將其設置為 NULL

ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);

// 實現sendfile調用的另一部分,內核調用將其數據發送到對應文件,每次一個數據頁,設備驅動通常將其設置為NULL

unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned

long);

// 在進程地址空間找到一個合適的位置,以便將底層設備中的內存段映射到該位置。大部分驅動可將其設置為NULL

int (*check_flags)(int);

// 允許模塊檢查傳遞給fcntl(F_SETEL…)調用的標志

int (*dir_notify)(struct file *filp, unsigned long arg);

// 應用程序使用fcntl來請求目錄改變通知時,調用該方法。僅對文件系統有效,驅動程序不必實現。

int (*flock) (struct file *, int, struct file_lock *);

// 實現文件鎖

};

本文引用地址:http://cqxgywz.com/article/150582.htm

上一頁 1 2 下一頁

評論


相關推薦

技術專區

關閉