LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-07-2005, 03:19 AM   #1
linusclone
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
Adding a new Field to Task_struct


hi
I would like to add a new Field to Task_struct in Kernel 2.6.11. Can anyone help me out.

Thanks in advance

linusclone
 
Old 04-08-2005, 11:53 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
The task_struct is actually defined in include/linux/sched.h somewhere around line 528 (that is where it is in my vanilla Slackware 2.6.11 kernel).

When you add a field to this make sure you add it at the bottom and not the top. The first several entries are expected to be in a certain place (at least they were in the 2.4 release of the kernel... these restrictions might have been lifted in 2.6).

Feel free to add anything to this structure, but keep in mine that all processes and threads get one of these allocated so you probably don't want to make it overly bigger then it already is.

I've requested that the local moderator move this to programming as it is more relevant there, and you might get some more response should my answer not be adequate.

Also.. if you are looking for structures, functions, or anything else in the kernel you might want to check out the Linux LXR website which allows you to do a whole bunch of different searches on different versions of the source.

Last edited by jtshaw; 04-08-2005 at 11:54 AM.
 
Old 04-08-2005, 11:54 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Moved: More suitable in Programming.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what does password field mean? hongxing Linux - Software 5 11-28-2005 06:33 PM
accessing task_struct of process shukla_chanchal Linux - General 1 11-04-2005 09:27 PM
How to use task_struct to get process information?? Pratik H Pandya Programming 2 09-15-2005 03:40 AM
Adding Option field in IP header guam Linux - Networking 0 11-04-2004 10:17 AM
Stuct task_struct dami Programming 1 10-13-2003 01:13 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration