中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > file_operations下函數(shù)詳解

        file_operations下函數(shù)詳解

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


        // 刷新待處理的數(shù)據(jù),如果驅(qū)動程序沒有實現(xiàn),fsync調(diào)用將返回-EINVAL

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

        // 異步fsync

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

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

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

        // 實現(xiàn)文件鎖,設(shè)備驅(qū)動常不去實現(xiàn)此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 分散/聚集型的讀寫操作,實現(xiàn)進行涉及多個內(nèi)存區(qū)域的單次讀或?qū)懖僮鳌?br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; word-wrap: break-word" />
        ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);

        // 實現(xiàn)sendfile調(diào)用的讀取部分,將數(shù)據(jù)從一個文件描述符移到另一個,設(shè)備驅(qū)動通常將其設(shè)置為 NULL

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

        // 實現(xiàn)sendfile調(diào)用的另一部分,內(nèi)核調(diào)用將其數(shù)據(jù)發(fā)送到對應(yīng)文件,每次一個數(shù)據(jù)頁,設(shè)備驅(qū)動通常將其設(shè)置為NULL

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

        long);

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

        int (*check_flags)(int);

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

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

        // 應(yīng)用程序使用fcntl來請求目錄改變通知時,調(diào)用該方法。僅對文件系統(tǒng)有效,驅(qū)動程序不必實現(xiàn)。

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

        // 實現(xiàn)文件鎖

        };

        本文引用地址:http://www.antipu.com.cn/article/150582.htm

        上一頁 1 2 下一頁

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

        評論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉