Subject: Re: remember that warning about __syscall()?
To: None <Chris_G_Demetriou@ux2.sp.cs.cmu.edu, email@example.com>
From: Olaf Seibert <firstname.lastname@example.org>
Date: 01/03/1997 15:47:25
Chris G Demetriou <Chris_G_Demetriou@ux2.sp.cs.cmu.edu> wrote:
> The problem was that __syscall() was being used inconsistently --
> sometimes it was being treated as if it returned an off_t, sometimes
> it was being treated as if it returned a pointer, sometimes it was
> being treated as if it returned an 'int'.
> That's actually _correct_. It does, in fact, return those different
> types, depending on the call, rather than returning an off_t.
> however, it's impossible to prototype a function to have multiple
> return types...
__syscall() could be prototyped to return a *union* of all these things.
At the locatation where the actual value is returned, it requires a cast
of the value to this union, however, and this is not possible in
Standard C. Gcc will allow it, though. For portability, a temporary
union variable would be required.
___ Olaf 'Rhialto' Seibert D787B44DFC896063 4CBB95A5BD1DAA96
\X/ Don't dream it, Be it email@example.com