×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    11

    Process termination check

    Hi,

    First my design:
    I have a process "abc" which creates & starts a child process "xyz" depending on some commands received. Now, let's say "abc" creates 3 "xyz" processes one after another. Now the design is each time "abc" starts up, it needs to check whether any of the processes it has started earlier has already exited or not, so that it can reuse the slot in some process table

    In linux, this checking at start up can be done by calling kill(pid, 0) which sends a signal to the process (as given by pid) and decides whether process has exited or not

    Now the question, in symbian, how will this check of whether the process has already exited be done?
    I saw RProcess:Logon but am not sure how it works and I guess it does not fill the bill here as I cannot wait for the child process to be completed

    Any one has idea/solution?

    Thanks in advance

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Process termination check

    you can search the process by name like:


    TFindProcess aProcess2(_L("*"));
    TFullName aResult;
    TBuf<32> aPtr(_L("aa"));
    while(aProcess2.Next(aResult)==KErrNone){
    TInt idx = aResult.Find(aPtr);
    if(idx!=KErrNotFound)
    {
    //found process
    }
    }


    hope this will help you.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    11

    Re: Process termination check

    Thx. I am using the same logic to kill a process... below is the code

    TFindProcess aProcess2(_L("*"));
    TFullName aResult;

    TBuf<32> aPtr(_L("cvm"));
    while(aProcess2.Next(aResult)==KErrNone){
    TInt idx = aResult.Find(aPtr);
    if(idx!=KErrNotFound)
    {
    fprintf(stdout, "Process found\n");
    RProcess curProc;
    TInt ret = curProc.Open(aProcess2);
    if(ret != KErrNone) {
    fprintf(stderr, "Opening of cvm process %d failed\n",procid);
    }else fprintf(stdout, "Opening of cvm process succeeded\n");
    curProc.Kill(KErrNone);
    curProc.Close();
    }
    else fprintf(stdout, "Process not found\n");

    But it gives me useranic KERN-EXEC:46..
    I have PowerMgmt capability in both launcher and launched "cvm process but it still fails to kill the launched process from the launcher...Any thing more I need to do in the code?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,696

    Re: Process termination check

    Depending on the IDE you use, it might happen that the PowerMgmt capability has not been actually added to your code. Try a full re-build, removing old output files (and a re-import maybe).

Similar Threads

  1. PlatSec - Process Isolation check under 9.1
    By SimonJudge in forum Symbian
    Replies: 18
    Last Post: 2008-06-06, 09:43
  2. launching a new process in Series 60 3rd
    By tal.shahar@mobile-mx.com in forum Symbian
    Replies: 0
    Last Post: 2006-11-01, 08:28
  3. GSM/GPRS Drivers check FAILED
    By hblume in forum Multimodecards
    Replies: 3
    Last Post: 2004-01-28, 21:37
  4. SMS Msg using VB Application
    By gurup83 in forum General Messaging
    Replies: 2
    Last Post: 2002-07-11, 04:48
  5. Replies: 0
    Last Post: 2002-05-30, 06:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×