[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: task_struct and it's fields
On Fri, Mar 09, 2001 at 04:32:06PM -0600, Narayana, Venkat A. wrote:
> Hi
> I am trying to write a small kernel module, which will walk thru the task
> list, i.e starting from
> init_task, and try to figure out the associated file for that task.
> While doing that, whati noticed is that the 'struct files_struct *files'
> member, would not
> allow me access it's members, i.e whenever i access them i get segmentation
> fault.
> I am not sure what wrong i am doing.
Are you checking that the *files variable is not NULL before trying to
walk the list? Not all processes have files associated with them (I
think.)
Example code of what you are trying to do would be more helpful to try
to determine your problem.
hope this helps,
greg k-h
--
greg@(kroah|wirex).com
http://immunix.org/~greg
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.surriel.com/kernelnewbies.shtml