Hi ,
I am writing a character device with a Linux Kernel Module and the kernel version is : 4.14.74..
Basically, a user space process with a given tgid can interact with my device through ioctl.
I need to make a new directory inside /proc/pid (where pid is the tgid of the processes that have interacted with my device) so that I can create inside this new directory some files with some logs.
Is it possible to create a new directory inside /proc/pid without re-compiling the linux kernel?
In particular, I have tried to use :
Quote:
struct proc_dir_entry *proc_create(const char *name, umode_t mode,
struct proc_dir_entry *parent,
const struct file_operations *proc_fops)
|
but I am not able to get the struct proc_dir_entry * of the pid folder I want to write in because I am not able to include fs/proc/internal.h where PDE is defined.
Is it possible somehow to include PDE or replicate its behavior in my kernel module ?
Quote:
struct file *fp = filp_open("/proc/1",....);
struct proc_dir_entry *parent ;
parent = PDE(fp->f_dentry->d_inode);
|
Since
Any solution ?