cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: ioctl includes missing #ifdefs

From: <Jeff_Curley_at_playstation.sony.com>
Date: Mon, 17 Nov 2008 11:23:05 -0800

Dan> What operating system? Obviously not Linux...

Actually it's for game development I'm not sure it's accurrate to say it's
running any operating system when the console is running a game. If it is
running something it's completely obfuscated away from the developer so I
just don't know the answer to that. :(

Dan> That's also going to fail in the same way if EAGAIN isn't defined.
I've
split the checks onto two lines which should work in all cases.

Well I tried that as well, and for the Cell SDK it still failed, I ended up
breaking it into this following:

#if !defined(SN_TARGET_PS3)
# if defined(EAGAIN) && EAGAIN != EWOULDBLOCK
      /* On some platforms EAGAIN and EWOULDBLOCK are the
       * same value, and on others they are different, hence
       * the odd #if
       */
    case EAGAIN:
# endif
#endif

Dan> That sounds like a Cell-specific case all right. Would something like
this:

I'll give this a try and see if it helps.

Thanks for the response! :)

--Jeff Curley
Sony Computer Entertainment America
Senior Programmer
(858) 824-5692

                                                                           
             Dan Fandrich
             <dan_at_coneharveste
             rs.com> To
             Sent by: curl-library_at_cool.haxx.se
             curl-library-boun cc
             ces_at_cool.haxx.se
                                                                   Subject
                                       Re: ioctl includes missing #ifdefs
             11/14/2008 03:14
             PM
                                                                           
                                                                           
             Please respond to
                  libcurl
                development
             <curl-library_at_coo
                l.haxx.se>
                                                                           
                                                                           

On Fri, Nov 14, 2008 at 12:02:33PM -0800, Jeff_Curley_at_playstation.sony.com
wrote:
> In porting over to Cell I noticed a few includes missing ifdef's around

What operating system? Obviously not Linux...

> them like the following:
>
> lib\dict.c
> lib\file.c
> lib\telnet.c
> lib\tftp.c
>
> are all missing checks around ioctl.h
> #include <sys/ioctl.h>

Good point. I've fixed those.

> In connect.c the function singleipconnect()
>
> has the following line:
> #if defined(EAGAIN) && EAGAIN != EWOULDBLOCK
>
> that's checking to see if EAGAIN and EWOULDBLOCK are different to see if
it
> can add the EAGAIN case.

That's also going to fail in the same way if EAGAIN isn't defined. I've
split the checks onto two lines which should work in all cases.

> Secondly, if you look closely at this code you will see that EAGAIN is
> defined to the value 0x80010001, but on Cell there is a
> SYS_NET_ERROR_EAGAIN that is used and indeed is the same value as
> EWOULDBLOCK. That is to say Cell defines EAGAIN as one value, and
> SYS_NET_ERROR_EAGAIN as another value. EAGAIN on Cell isn't a valid
return
> value for the connect function, in fact neither is SYS_NET_ERROR_EAGAIN.
So
> in other words on Cell we'll need to avoid adding the EAGAIN case for
> connect() calls.

That sounds like a Cell-specific case all right. Would something like this:

#ifdef SYS_NET_ERROR_EAGAIN
#undef EAGAIN
#define EAGAIN SYS_NET_ERROR_EAGAIN
#endif

in setup.h solve the problem?

>>> Dan

--
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-11-17