Mark Johnston <[email protected]> wrote: > It's kind of a strong-armed approach, but the problem's been around for a > while and I can't think of any clever solutions - I'd love to see an > alternative solution. > > My patch against FreeBSD (pasted below) adds a function called memstr() > to DTrace. memstr() takes three arguments: addr, c, and len, and returns > a copy of addr of length len with all null-terminators replaced by c, > and with the last byte replaced by a null-terminator. In particular, > memstr() always returns a string of length len - 1, unless len == 0, in > which case we return the empty string. [...] > and execsnoop works properly. Any thoughts on this function? Have I missed > a better solution? A patch for FreeBSD is below.
Looks good (and clever) to me and seems to work as expected. Thanks a lot. I briefly looked into this a couple of months ago and was under the impression that it would require a lot more code ... Fabian
signature.asc
Description: PGP signature
