mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: khandelw@cs.fsu.edu
To: linux-kernel@vger.kernel.org
Subject: ps/top doesn't show the process on a smp kernel ;)
Date: Sun, 28 Mar 2004 11:26:11 -0500	[thread overview]
Message-ID: <1080491171.9b65f4fce8899@system.cs.fsu.edu> (raw)

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>

                 reply	other threads:[~2004-03-28 16:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1080491171.9b65f4fce8899@system.cs.fsu.edu \
    --to=khandelw@cs.fsu.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®