LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-04-2011, 03:16 PM   #1
Galbatross
LQ Newbie
 
Registered: May 2011
Location: Melbourne, FL
Posts: 2

Rep: Reputation: 0
Is there a PID 0?


Hello,

I'm currently doing some debugging and I'm attempting to find out which task is running between two events. I'm using a bus analyzer to trigger after I configure my hardware and stopping it once an overflow event takes place. During this period, I write the PID of the current task running every millisecond by checking the variable 'currnet->pid'. It seems that the task's PID right before my overflow event is 0. A quick 'ps' reveals that there is not a task 0.

I'm curious if anyone would know off-hand what a PID 0 represents? If I had to guess, I would say it's an interrupt handler, but I can't be positive. Any feedback is very appreciated!

Thanks,
Galbatross.
 
Old 05-04-2011, 03:30 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The lowest PID in UNIX/Linux is PID 1 which is init. All processes are children of init in the process table heirarchy.

My guess is that you're not seeing PID 0 but rather are getting a non-existent value being interpreted as "0" before you have a PID number assigned.
 
Old 05-04-2011, 06:12 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Nope. This comes up continually.
Have a read of this for example.
 
Old 05-05-2011, 07:49 AM   #4
Galbatross
LQ Newbie
 
Registered: May 2011
Location: Melbourne, FL
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks

Very helpful, thank you.

Galbatross
 
Old 05-05-2011, 08:02 AM   #5
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
if you're pleased with the answer, please mark this thread as solved !

Have a nice day and enjoy LQ

 
  


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 is the more easier way to check the pid and kill the pid cmx08 Linux - General 5 09-09-2008 10:57 PM
reading pid from pid file in C language shifter Programming 1 05-14-2008 10:49 AM
kill pid.... won't work with 'pid' variable given.. sachitha Programming 6 03-06-2006 07:48 PM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 10:32 PM
ERROR: Couldn't write pid to pid file lawrencegoodman Linux - Newbie 2 02-13-2004 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:23 PM.

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