Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

Rep: Reputation: 0
Is there a PID 0?


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!

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

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
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, 07:12 PM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 16,099

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

Original Poster
Rep: Reputation: 0

Very helpful, thank you.

Old 05-05-2011, 09:02 AM   #5
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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 04:57 PM.

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