1 /* This header makes it possible to redefine system calls to the
2 * file system. This way, minix servers can re-route the data
3 * that libgcov tries to send to the file system. This is
4 * necessary, because the servers can't access the file system
5 * directly. Instead, they will copy the data to a helping user
6 * space process, which will call the file system for them.
7 * For more information, see the <minix/gcov.h> header file.
12 #include <sys/types.h>
15 /* These function pointers initially point to the standard system library
16 * functions (fopen, etc). All calls to these system library functions are
17 * then redefined to calls to these function pointers. Because the pointers
18 * still point to the original functions, all functionality is unchanged.
19 * Therefore, libgcov won't act differently when linked to applications.
20 * But, when these pointers are redefined by code within the minix servers,
21 * the file system calls get replaced by other functionality.
24 #define fopen(...) _gcov_fopen(__VA_ARGS__)
25 #define fread(...) _gcov_fread(__VA_ARGS__)
26 #define fwrite(...) _gcov_fwrite(__VA_ARGS__)
27 #define fclose(...) _gcov_fclose(__VA_ARGS__)
28 #define fseek(...) _gcov_fseek(__VA_ARGS__)
29 #define getenv(...) _gcov_getenv(__VA_ARGS__)
32 /* wrapper to make it possible to disable gcov_exit on a process exit (for mfs) */
36 void gcov_exit_wrapper(void){