2018年10月2日 星期二

不定參數印 log

From the UNIXProcess_md.c

#ifdef DEBUG_PROCESS 
/* Debugging process code is difficult; where to write debug output? */
static void debugPrint(char *format, ...)
{ 
    FILE *tty = fopen("/dev/tty", "w");
    va_list ap;                                                                                                                                                    
    va_start(ap, format);
    vfprintf(tty, format, ap);
    va_end(ap); 
    fclose(tty);
}
 
#endif /* DEBUG_PROCESS */
 

不定參數印 log

From the UNIXProcess_md.c #ifdef DEBUG_PROCESS   /* Debugging process code is difficult; where to write debug output? */ static void deb...