Re: Problem with fileno()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Problem with fileno()

Pedro Alves-4
On Monday 06 July 2009 13:06:39, Johnny Willemsen wrote:

> Hi,
>
> > > > int fileno (FILE*);
> > > > void *_fileno (FILE*);
> > >
> > > I think this will not work.
> >
> > Why?  I'm curious; are you using fileno instead of _fileno?
>
> I missed the _
>
> > If you're porting some code to CE that is using the posixy
> > open/read/write etc. and getting at the file descriptor with
> > fileno functions, then having fileno be consistent with the rest
> > of the world means close to 0 porting and changes in generic code.
> > Only in specific win32/CE bits of your code would you need to get
> > the handle behind the file descriptor --- and in those isolated
> > bits of code, you'd do a (void*) cast, away from "generic" code.
> >
> > OTOH, if you force fileno to return void* always, then, a porter
> > is forced to change the app's "generic" code, which is likely to be
> > more hair for not much buck; and it's likely that there are more
> > of those "generic" bits, than there are "CE specific bits".
> >
> > This is my view anyway.
>
> Ok, I think the best is to revert the change Danny made based on my report
> and then I will update ACE. We have a wrapper around fileno that has the
> possibility for a cast.

FYI: I've finally done this.

--
Pedro Alves

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel