How to determine if this process has opened files with O_DIRECT?

I would like to say if the process opened the files using O_DIRECT, but I can only check it after the process was started (i.e. strace is not an option). I tried looking in / proc / $ pid / fd / to see if there was anything useful, but it wasn’t. My goal is to track whether any of the several hundred users on the system will open files using O_DIRECT. Is it possible?

+3
source share
2 answers

Since kernel 2.6.22, / proc / $ pid / fdinfo / $ fd contains a flag field, in octal. See http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.html

+1
source

, /proc .

, :
1. task_struct ( find_task_by_pid).
2. - task->files->count task->files->fd_array. 3. file->f_flags & O_DIRECT.

+2

All Articles