Bug 35536 - ioctl and FIONREAD on Cygwin
Summary: ioctl and FIONREAD on Cygwin
Status: UNCONFIRMED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: 0.96.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-11 09:46 UTC by Mario Latronico
Modified: 2010-10-15 08:59 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Latronico 2008-03-11 09:46:21 UTC
On Cygwin (on X86) ioctl on FIONREAD returns EINVAL on the errno variable instead of ENOTTY. So on the file native/jni/java-nio/gnu_java_nio_VMChannel.c the function Java_gnu_java_nio_VMChannel_available (JNIEnv *env,                                       jclass c __attribute__((unused)), jint fd) should control also for EINVAL on errno variable. For example, starting from line 1601 (from today cvs):

if (ioctl (fd, FIONREAD, &avail) == -1)
{
#if defined(ENOTTY) && defined(HAVE_FSTAT)
  if (errno == ENOTTY)


the last line on cygwin should be 

if (errno == ENOTTY || errno = EINVAL)


The configure string is :
./configure --without-x --disable-gtk-peer --disable-gconf-peer --disable-plugin
Comment 1 Yaakov Selkowitz 2010-05-11 09:04:20 UTC
Thank you!  Now I understand why GNU classpath I/O wasn't working quite right on Cygwin.  While perhaps this should be changed in Cygwin, in the meantime I am incorporating this fix into the Cygwin Ports classpath package and I'll try to let the gcc4 maintainer know about this as well.
Comment 2 Mario Latronico 2010-10-15 08:59:57 UTC
(In reply to comment #1)
> Thank you!  Now I understand why GNU classpath I/O wasn't working quite right
> on Cygwin.  While perhaps this should be changed in Cygwin, in the meantime I
> am incorporating this fix into the Cygwin Ports classpath package and I'll try
> to let the gcc4 maintainer know about this as well.

Sorry to answer too late, I was trying to port classpath on wince (if I remeber well, it has passed too much time and I work no more on that project) and I found this problem. 

Anyway, I'm happy to see that this report helped to solve another problem.