Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some syscall return values to not match their prototypes

 
Post new topic   Reply to topic    Syllable Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Wed May 06, 2009 4:34 pm    Post subject: Some syscall return values to not match their prototypes Reply with quote

This was noticed when debugging and issue with get_msg_x(). The prototype is:

status_t get_msg_x(...);

which suggests that if the call times out, the syscall should return ETIME directly to the caller. In testing it has been found that what actually happens is that errno is set to ETIME and the syscall returns -1. This is clearly different to what is suggested by the prototype and differs from the usual Syllable calling conventions.

The issue appears to be that the Glibc implementation for get_msg_x() is essentially:

status_t get_msg_x(...)
{
return INLINE_SYSCALL( raw_get_msg_x, ... );
}

The INLINE_SYSCALL macro will capture any "abnormal" return values from the syscall and sets errno on our behalf, returning -1 to the caller to indicate the abnormal return from the syscall.

The specific wrapper for get_msg_x()/raw_get_msg_x() could clearly be made smarter to implicitly handle such a condition, but it may also bee that other syscalls show the same behaviour. Other syscalls will have to be checked, especially those listed directly in syscalls.list.

It is unknown what effect fixing these syscalls may have on dependent code.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Bugs All times are GMT - 6 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