public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: The function ioctl bug
@ 2016-07-01 13:38 Бабенко Вячеслав
  2016-07-01 15:10 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Бабенко Вячеслав @ 2016-07-01 13:38 UTC (permalink / raw)
  To: cygwin

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;
}

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread
* The function ioctl bug
@ 2016-07-01  5:21 Бабенко Вячеслав
  2016-07-01  5:38 ` Marco Atzeri
  0 siblings, 1 reply; 4+ messages in thread
From: Бабенко Вячеслав @ 2016-07-01  5:21 UTC (permalink / raw)
  To: cygwin

Dear friends!

The function ioctl return -1 (errno equal 95) if I use cygwin-x86_64. See my code:
...
int fd = socket(AF_INET, SOCK_STREAM, 0);
if (ioctl(fd, FIONREAD, &c) == -1)
    printf("%u", errno);
...
The function ioctl return 0 if I use cygwin-x86.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-01 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-01 13:38 The function ioctl bug Бабенко Вячеслав
2016-07-01 15:10 ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2016-07-01  5:21 Бабенко Вячеслав
2016-07-01  5:38 ` Marco Atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).