pthread_mutex_lock(&stat_lock);
int msg_stat(char *fmt, ...){        /* have to check if subsys is on. Else just ignore */        if(stat_file) {                va_list args;                va_start(args, fmt);                pthread_mutex_lock(&stat_lock);                vfprintf(stat_file, fmt, args);                fputs("\n", stat_file);                pthread_mutex_unlock(&stat_lock);                va_end(args);        }        return 0;}