I have a program that uses the following open() flags:
Code:
O_RDONLY+O_NOATIME+O_LARGEFILE+O_DIRECT
read() calls work OK until EOF is reached and then an EINVAL error is returned.
The buffer is aligned with the following call:
Code:
posix_memalign((void**) &vbuff,512,BIOCC);
The program runs OK if O_DIRECT is removed.
The program has been running for years on earlier kernel versions.
Is this a bug or an API change? Need guidance.
O_DIRECT is used because the file is being read to verify integrity shortly after it was written, so reading from the cache is not wanted.
This is part of a backup utility.