不工作O_DIRECT标志 [英] O_DIRECT flag not working

查看:148
本文介绍了不工作O_DIRECT标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

董事会简介:

我的工作有它ST40芯片基本上用于捕捉DVB流和电视屏幕上显示的董事会。该主板在Linux操作系统上运行。

I am working on a board that has ST40 chip on it basically used for capturing the DVB stream and displaying it on the TV. The board is running on Linux OS.

问题描述:

我想从使用O_DIRECT标志USB大文件(大约2 GB)读取数据。
下面是相关code片断:

I am trying to read data from a large file(approximately 2 GB) on USB using O_DIRECT flag. Here is the relevant code snippet:

char subblk[BLKSIZE];
open (filename2,O_CREAT|O_WRONLY|O_DIRECT,S_IRWXU|S_IRWXG|S_IRWXO);
read (fp,subblk,BLKSIZE);

报告说,读失败,出现错误22号 - EINVAL 22 / *无效参数

要澄清这个编程问题,或者一些体系结构相关问题是否,我跑我的桌面系统上的同一code,它的工作完全没有问题,我能够打印什么,我刚才读的字符。这是什么在我的船上ST40失败的原因是什么?

To clarify whether this a programming issue or some architecture dependent problem, I ran the same code on my Desktop system, it worked perfectly fine and I was able to print the characters what I just read. What is the reason it is failing on my ST40 board?

推荐答案

O_DIRECT标志使用DMA内部,并在我的内核,不启用DMA。这是基本的原因是工作在我的台式机,但没有功能上的董事会。他们有不同的内核在他们在其中DMA启用和其他在DMA未启用。

O_DIRECT flag uses DMA internally and in my kernel, DMA is not enabled. This is the basic reason why it was working on my Desktop pc but not functional on the Board.. They had different kernels in them one in which DMA was enabled and other in which DMA was not enabled..

这篇关于不工作O_DIRECT标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆