loop inside process table - Minix

This is a discussion on loop inside process table - Minix ; Hi all, i am working on a project in which i have to look to the value of a flag of each process in the ptable. so, i looked at the code from forkexit.c, and i used this lines: ______________ ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: loop inside process table

  1. loop inside process table

    Hi all,

    i am working on a project in which i have to look to the value of a
    flag of each process in the ptable.
    so, i looked at the code from forkexit.c, and i used this lines:
    ______________
    |from do_waitpid:|
    ______________|
    register struct proc *rp;

    for (rp = &mproc[0]; rp < &mproc[NR_PROCS]; rp++) {
    {
    if (rp->mp_pid = getpid())
    {
    rp->mp_flags = etc..
    etc...
    }
    }


    now what happens is that the system hangs and i'm thinking the problem
    is something from this code.. maybe do i have to initialize something
    in a particular way or what else?? can you suggest me anything??

    Thanks
    CB


  2. Re: loop inside process table

    i might be misreading this, but is this an assignment to field mp_pid where
    you intended to test for equality?

    "carlitos" wrote in message
    news:1170696510.426118.160990@a34g2000cwb.googlegr oups.com...
    > Hi all,
    >
    > i am working on a project in which i have to look to the value of a
    > flag of each process in the ptable.
    > so, i looked at the code from forkexit.c, and i used this lines:
    > ______________
    > |from do_waitpid:|
    > ______________|
    > register struct proc *rp;
    >
    > for (rp = &mproc[0]; rp < &mproc[NR_PROCS]; rp++) {
    > {
    > if (rp->mp_pid = getpid())
    > {
    > rp->mp_flags = etc..
    > etc...
    > }
    > }
    >
    >
    > now what happens is that the system hangs and i'm thinking the problem
    > is something from this code.. maybe do i have to initialize something
    > in a particular way or what else?? can you suggest me anything??
    >
    > Thanks
    > CB
    >




  3. Re: loop inside process table

    On Feb 6, 2:45 am, "michael" <_> wrote:
    > i might be misreading this, but is this an assignment to field mp_pid where
    > you intended to test for equality?
    >


    sorry, copying the code to here i made a writing mistake

    this is the correct one:
    ______________
    |from do_waitpid:|
    ______________|
    register struct proc *rp;

    for (rp = &mproc[0]; rp < &mproc[NR_PROCS]; rp++) {
    {
    if (rp->mp_pid == getpid())
    {
    rp->mp_flags = etc..
    etc...
    }
    }



+ Reply to Thread