If an application uses the O_DIRECT flag on an open() system call, direct I/O is used for the opened file.
To cause the O_DIRECT flag to be defined with recent glibc libraries, define _GNU_SOURCE at the beginning of a source file before any includes, or define it on the cc line when compiling.