Structs and Unions

Version 4 by jon_haslam
on Nov 27, 2007 07:47.

compared with
Current by Brian_Leonard
on Oct 22, 2009 16:42.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View page history
\\Let's suppose you want to create a more sophisticated system call tracing program in D that records a number of things about each [{{read}}(2)|http://docs.sun.com/doc/819-2241/read-2?a=view] and [{{write}}(2)|http://docs.sun.com/doc/819-2241/write-2?a=view] system call executed by your shell, such as the elapsed time, number of calls, and the largest byte count passed as an argument. You could write a D clause to record these properties in three separate associative arrays as shown in the following example:
{noformat}
int maxbytes; /* declare maxbytes */
syscall::read:entry, syscall::write:entry
/pid == 12345/

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact