Hi, Jan Vesely wrote: >I looked through the changes when they landed, and it's not clear to me "how you handle multiple threads/fibrils." I don't need to do that explicitly.
" Traditional errno has the disadvantage of making all the functions non-reentrant (if you want trust the errno value upon return)." The C and UNIX standards define errno as a macro. That in effect allows the implementation to make it sensitive to any contexts it wishes to (e.g. threads, signal handlers, interrupts). In practice in unix-like systems errno is thread-local and as such it is safe to use in the context of threads (how did you expect this to work in Linux/unix? ;-) ) but not in the context of signal handlers. In HelenOS errno is a macro that expands to a call to a function that returns the value of a fibril-local variable. As such it is safe to use with fibrils. Signals are not an issue for HelenOS. "Introducing such restriction seems like a step back" There is no 'restriction' I can see here. I see it as a very vey small improvement. As long as we are using something which looks like the UNIX API (and which camps in its name space), its better to have the real thing rather than something which only looks like the real thing but it really is not. Sure there are better ways to report error. But if I were to make that change, I would (1) change the names not to conflict with the UNIX functions (2) if I am making all those changes, I would make more changes (3) if I am making more changes, I'd rather redesign the API from scratch That's way beyond the scope of what I was originally trying to accomplish, which was: make small changes to make all APIs in HelenOS agnostic to Exxx sign (so that I can change the sign and fix other incompatibilities to make libposix a "normal" library and make "native" and "libposix-using" components interlinkable... Cheers, Jiri "as there are other solutions to the problem (like having a error output parameter, that would also change the signature to find all uses at compile time)."
_______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
