Article Figure 1 Listing 1 Listing 2 Table 1 aug2006.tar

Listing 1 log_example.c: Sample code to run under system call tracer

/* Compile with "gcc log_example.c -o log_example" */

#include <stdio.h>

void log_state(FILE *f, int state) {
         fprintf(f, "State = %d\n", state);
}

int main(int argc, char *argv[]) {
         FILE *f;
         int state = 10;
         f = fopen("mylog", "a");
         log_state(f, state);
         fclose(f);
         return 0;
}