forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to know the error string of the error?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
huyi_zg



Joined: 12 Oct 2006
Posts: 7

PostPosted: Mon Oct 16, 2006 5:29 pm    Post subject: how to know the error string of the error? Reply with quote

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
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Oct 17, 2006 4:50 am    Post subject: Reply with quote

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
View user's profile Send private message
huyi_zg



Joined: 12 Oct 2006
Posts: 7

PostPosted: Tue Oct 17, 2006 10:17 am    Post subject: Reply with quote

thanks jimparis.

how to make error thread safe? Can I use TLS?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Oct 17, 2006 4:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Oct 18, 2006 2:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group