| View previous topic :: View next topic |
| Author |
Message |
huyi_zg
Joined: 12 Oct 2006 Posts: 7
|
Posted: Mon Oct 16, 2006 5:29 pm Post subject: how to know the error string of the error? |
|
|
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? |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Tue Oct 17, 2006 4:50 am Post subject: |
|
|
| Quote: | | 1.is there a way to know the error string? | Check /usr/local/pspdev/psp/sdk/include/pspkerror.h
| Quote: | | 2.is errno in libc thread safe? | I don't think so, newlib generally doesn't know about PSP threads. |
|
| Back to top |
|
 |
huyi_zg
Joined: 12 Oct 2006 Posts: 7
|
Posted: Tue Oct 17, 2006 10:17 am Post subject: |
|
|
thanks jimparis.
how to make error thread safe? Can I use TLS? |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Tue Oct 17, 2006 4:04 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Wed Oct 18, 2006 2:01 am Post subject: |
|
|
| 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 :/ |
|
| Back to top |
|
 |
|