[dtrace-discuss] clearing element from array of struct

Michael Shapiro
Sat, 02 Jul 2005 23:05:34 -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

We don''t have one yet -- this is on my list of things to fix in the
near future.  It will either be assignment to zero or an undef() function.

-Mike

--
Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/