Casey Marshall wrote: > Guilhem Lavaux wrote: >> Casey Marshall wrote: >>> Guilhem Lavaux wrote: >>>> In respect to this buggy interface, it is ok. :) >>>> >>> I fail to see why this is buggy. >>> >> Ok. >> >> 1) POSIX syscalls where originally written with no threads in mind. >> glibc uses a trick to store errno in a thread local storage using a >> special function. So the expected behaviour of storing errno just after >> the accept is true only in this case. If you use other type of threaded >> system then it may not be right (or for example if the library is buggy). >> > > Point. I said this on IRC, too, but I think the goal here should be to > make it work on Linux first, then systems about as capable as Linux, > then for the unwashed masses. If we need to use a thread-safe > alternative to using errno directly, we can add that. > Ok. So we agree. As I said on IRC by just changing a few bits of the syscalls wrapper we can render the interface saner and easy to implement for POSIX/POSIX like systems. Remember that even if there exists a standard OS implementers generally have their own interpretation of the obscure point of the interface. PThreads specification for example is well known for not specifying anything about the interplay between signals & threads. I think this should be the same thing for all other posix specifications and that is why we may want to factorize all "ifdef" into one interface/implementation which would give thread safe and constant behavior syscalls. Cheers, Guilhem.