mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* ps/top doesn't show the process on a smp kernel ;)
@ 2004-03-28 16:26 khandelw
  0 siblings, 0 replies; only message in thread
From: khandelw @ 2004-03-28 16:26 UTC (permalink / raw)
  To: linux-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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-28 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-28 16:26 ps/top doesn't show the process on a smp kernel ;) khandelw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®