[dtrace-discuss] clearing element from array of struct

Brendan Gregg
Sat, 02 Jul 2005 18:54:24 -0000

G''Day Folks,

This question should be a quickie - what''s the syntax to delete an
element
from an array of struct? (I''m being good and using structs now). eg,

   struct ioinfo {
           int uid;
           int pid;
           int ppid;
           string args;
           string comm;
           uint64_t time;
           char rw;
   };

   struct ioinfo start[uint64_t, uint64_t];

now if I try to zero an entry later on with,

   start[this->dev, this->blk] = 0;

I get,

   in action list: operands have incompatible types: "struct ioinfo" =
"int"

would zero''ing out each element one by one free memory like one would
hope, or have I just missed the right syntax? (I may have missed the
syntax - it''s almost 5am :).

thanks,

Brendan