Profile cover photo
Profile photo
Ruei-Min Jiang
76 followers -
good programmer code, great programmer steal!!
good programmer code, great programmer steal!!

76 followers
About
Posts

Post has shared content
nice tutorial for python~~
Originally shared by ****
Basic Python
Basic Python
youtube.com
Add a comment...

In linux kernel, a file descriptor can have many purposes such as socket, normal file, eventfd, pipefd...etc.
Each process has its own file descriptor table which is located in task_struct->files field. Therefore, I can loop through the file descriptor table to find the file descriptors that the process is opened.

I'm just curious, instead of comparing the address of the f_op to determine the type of the file descriptor, is there another way to achieve the same goal?

I know that some of the kernel functions use f_op to determine the type of the file descriptor which make sense. However, some of the symbols are not export by default.
Therefore, I can't use the symbol directly, instead I have to hard code the address of the symbol which I think is a very bad way.

Is there other way to determine the type of the file descriptor instead of using the above method?

Thank you very much and sorry about my poor English :)

Post has attachment

Hello everyone, I'm not sure is it the right place to ask this question.
I know that linux use light weight process to implement thread(every thread is a light weight process)
Therefore, in the kernel point of view, every thread is a process.
I'm just curios that will the process list contain all the light weight process, or just the process with the thread group id.
Wait while more posts are being loaded