Process files, relationship between files in mm_struct and files_struct?

In task_struct we can find:

struct mm_struct *mm, *active_mm;
struct files_struct *files;  

files_struct contains pointers to up to 256 file data structures, each of which describes a file used by this process.

struct file * fd_array[NR_OPEN_DEFAULT];

mm_struct contains vm_area_struct.

struct vm_area_struct * mmap;           /* list of VMAs */

And in vm_area_struct we can find:

struct file * vm_file;          /* File we map to (can be NULL). */

So my question is:

  1. What is the relationship between files in fd_array and vm_file?

  2. Will all the files shown in fd_array also be displayed in vm_area_struct as shown? Or will all files displayed in vm_area_struct be displayed in fd_array?

Thank,

a busy cat
(source: duartes.org )

+5
source share
1 answer

fd_array - , (, open(), socket() ), , VMA - , ( , mmap()). , fd_array VMA .

+1

All Articles