I am working in Linux and i have a little bit confusion that whether i can access the PCB of process or not? if yes then what content of it we can access it and print them on to the terminal and if not then why not?
thanks for answering …..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If by PCB, you mean the Process Control Block, yes and no…
No, because it’s in the kernel address space and cannot be accessed directly by user processes. The kernel makes some information from the PCB available under
/proc– see the manpage forproc(5)for details. This information is generally available in plain text form and can be easily displayed – try, for example:Yes, because using kernel debugging facilities the
struct task_struct(and other related structures) for a process can be accessed. This is not an easy task; you’ll need a good understanding of the kernel source code. The basic idea will be to try to locate the structure in/proc/kcoreor/proc/kmem. You will need administrative (root) rights and a very good understanding of the kernel memory layout. This should be done only for kernel debugging or exploration – please don’t do this in production code, particularly as the layout of internal kernel structures changes without warning between kernel versions!