This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: The function ioctl bug

Hi Viacheslav,

On Jul  1 23:38, ÐÐÐÐÐÐÐ ÐÑÑÐÑÐÐÐ wrote:
> Dear friends!
> The function ioctl return -1 (errno equal 95) if I use cygwin-x86_64 but return 0 if I use cygwin-x86.
> #include <stdio.h>
> #include <sys/socket.h>
> #include <sys/ioctl.h>
> #include <unistd.h>
> #include <errno.h>
> int main()
> {
>     int c;
>     int fd = socket(AF_INET, SOCK_STREAM, 0);
>     if (ioctl(fd, FIONREAD, &c) == -1)
>         printf("errno:%u\n", errno);
>     close(fd);
>     return 0;
> }

My fault.  As result of a header change in newlib I also changed the
definition of FIONREAD and others in <asm/socket.h>, but failed to make
sure to call Winsock's ioctlsocket with the correctly specified Winsock
FIONREAD.  This only affects x86_64 as you noticed.

I applied a patch to fix this issue and uploaded new developer
snapshots to

(Note that recent snapshots don't work on XP and Server 2003 anymore)

Please give them a try.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]