Interesting. Thanks.
> Currently it adds 16 bytes per line logged. I think 16 is a bit too much. > The code is pretty simple and I think it should be portable. > + fprintf(term_file, "%s[%d.%ld]: ", prog, pid, > (long int)pthread_self()); The Linux man page says that pthread_t might be a struct. What OS are you running on? I think Linux uses a whole process for each thread. If you are running on Linux, try using gettid() rather than getpid(). That shouldn't take any extra space on the printed line. (Well, an extra space if the value of the ID grows by a digit when printed.) -- These are my opinions. I hate spam. _______________________________________________ devel mailing list devel@ntpsec.org https://lists.ntpsec.org/mailman/listinfo/devel