Board Introduction:
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.
Problem Description:
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);
It says read failed with error number 22 - "EINVAL 22 /* Invalid argument"
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?