how to get pid from system() call in c/c++?

Discussion in 'C++' started by wavelet, Sep 1, 2005.

  1. wavelet

    wavelet Guest

    main()
    {
    system("call B");
    printf("main..");
    }

    How can I get the process id of system call
    in c/c++ language?

    What I want to do is to kill that process after
    sometimes later.

    Thx.
    wavelet, Sep 1, 2005
    #1
    1. Advertising

  2. wavelet

    Zara Guest

    wavelet wrote:
    > main()
    > {
    > system("call B");
    > printf("main..");
    > }
    >
    > How can I get the process id of system call
    > in c/c++ language?
    >
    > What I want to do is to kill that process after
    > sometimes later.
    >


    All this is OS and/or implementation dependent. You should check in
    comp.os. <your operating system>.

    Best regards
    Zara, Sep 1, 2005
    #2
    1. Advertising

  3. wavelet wrote:
    > main()
    > {
    > system("call B");
    > printf("main..");
    > }
    >
    > How can I get the process id of system call
    > in c/c++ language?
    >
    > What I want to do is to kill that process after
    > sometimes later.


    system() does not return until the process has finished. There is
    nothing left to kill after the call.
    Maxim Yegorushkin, Sep 1, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray5531
    Replies:
    8
    Views:
    780
    Ray5531
    Jun 22, 2005
  2. Joe Schmoe

    How to get PID of invoked COM object?

    Joe Schmoe, Nov 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,155
    Bruce Barker
    Nov 16, 2005
  3. Robert M. Gary

    Get PID w/o JNI

    Robert M. Gary, Mar 18, 2005, in forum: Java
    Replies:
    3
    Views:
    4,562
    Michiel Konstapel
    Mar 21, 2005
  4. walker

    how can get other process pid

    walker, Nov 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    278
    walker
    Nov 24, 2003
  5. Ting Wang
    Replies:
    2
    Views:
    79
    Ting Wang
    Jul 21, 2004
Loading...

Share This Page