1.is there a way to know the error string?
example:
I have invoked this method: sceIoGetThreadCwd, and get the return value ret(ret < 0), how to know what's the error reason?
2.is errno in libc thread safe?
how to know the error string of the error?
Making it fully thread safe would require a lot of changes in newlib, there are many places that assume global file handles, one working directory, etc. It would probably be easier to just keep all of your libc stuff in one thread. Or add your own locks anywhere you're calling newlib functions to make sure you only do things from one thread at a time.
Well the Sony newlib uses the TLS in user threads along with the built in bits of newlib to provide per-thread values, but it is just more work than I can be arsed to spend considering I avoid newlib at all costs ;) Newlib can be made thread safe relatively easily it is just down to providing support to handle the data, one thing you would probably have to do though would be to setup the TLS at the start of every thread which would be slightly annoying, not simple way to make it automatic :/