One way to make this work correctly would be to remove the logmask as a global variable and, instead, put the logic mask in the group structure or in the TCB structure.  That would make logmask thread safe (in the second case).  This would be the preferred solution. This solution would work.  The other suggestions will not work and just implement more complex version of the broken code.
Actually, putting the logmask in TLS (with the errno) would be better solution.  In some configurations, at least, that would avoid a system call.

Reply via email to