lkml.org 
[lkml]   [2004]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectps/top doesn't show the process on a smp kernel ;)
Hello,
This is the simple program that I tried on a - 2.4.20-30.9smp #1 SMP Wed Feb
4 20:36:46 EST 2004 i686 i686 i386 GNU/Linux (kernel) machine.

The ps command doesn't show me the process. /proc/ shows that these process are
present in the system. When I uncomment the call getpid(). Then it shows me the
process. I am not able to understand this behavior and I hope this is the right
place to post this question/bug.


<snip>

#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>

int main()
{
int i = 3;
pid_t pid, pidarr[3];

for(i = 0; i < 3;i ++) {
if ( (pid = fork()) == 0) {
while(1){
/* getpid(); */
}
}
pidarr[i] = pid;
}
for(i = 0; i < 3;i ++) {
waitpid(pidarr[i], NULL, 0);
}
return 0;
}

</snip>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.030 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site