delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/07/20/04:11:32

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Subject: ioctl: FIONREAD and ENOTTY
From: "Yaakov (Cygwin/X)" <yselkowitz AT users DOT sourceforge DOT net>
To: cygwin AT cygwin DOT com
Date: Wed, 20 Jul 2011 03:11:14 -0500
Message-ID: <1311149476.7796.50.camel@YAAKOV04>
Mime-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Linux, ioctl(2) returns several different errors[1]:

EBADF  d is not a valid descriptor.
EFAULT argp references an inaccessible memory area.
EINVAL Request or argp is not valid.
ENOTTY d is not associated with a character special device.
ENOTTY The specified request does not apply to the kind of object that
       the descriptor d references.

In the case of FIONREAD, Cygwin doesn't seem to distinguish between
EINVAL and ENOTTY, and this causes at least one major bug:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35536

I have patched GCJ and GNU classpath to work around it, but this really
needs to be fixed in Cygwin itself.


Yaakov

[1] http://www.kernel.org/doc/man-pages/online/pages/man2/ioctl.2.html



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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019