Associated Files

The file element of the task structure is of type files_struct. The definition is as follows: <sched.h>

struct files_struct {

atomic_t count; struct fdtable *fdt;

struct fdtable fdtab; int next_fd;

struct embedded_fd_set close_on_exec_init; struct embedded_fd_set open_fds_init; struct file * fd_array[NR_OPEN_DEFAULT];

next_fd denotes the number of the file descriptor that will be used when a new file is opened. close_on_exec_init and open_fds_init are bitmaps. close_on_exec contains a set bit for all file descriptors that will be closed on exec. open_fds_init is the initial set of file descriptors. struct embedded_fd_set is just a simple unsigned long encapsulated in a special structure.

Continue reading here: Info

Was this article helpful?

0 0