<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

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

          file_operations下函數(shù)詳解

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


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

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

          // 異步fsync

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

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

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

          // 實(shí)現(xiàn)文件鎖,設(shè)備驅(qū)動(dòng)常不去實(shí)現(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 分散/聚集型的讀寫操作,實(shí)現(xiàn)進(jìn)行涉及多個(gè)內(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 *);

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

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

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

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

          long);

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

          int (*check_flags)(int);

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

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

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

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

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

          };

          本文引用地址:http://www.ex-cimer.com/article/150582.htm

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

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

          評(píng)論


          相關(guān)推薦

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

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();