First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 31927
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Ito Kazumitsu <kaz@maczuka.gcd.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 31927 depends on: Show dependency tree
Show dependency graph
Bug 31927 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2007-05-14 23:16
gnu_java_nio_VMChannel.c has this code:

  if (ioctl (fd, FIONREAD, &avail) == -1)
      JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));

But FreeBSD's ioctl with FIONREAD fails because of errno = 25
(Inappropriate ioctl for device).

native/jni/native-lib/cpio.c has a similar code:

#if defined (FIONREAD)
  ssize_t n;

  if (ioctl (fd, FIONREAD, (char *)&n) != 0)
        return errno;

This checking for FIONREAD does not work for FreeBSD because
FreeBSD does have FIONREAD but it cannot be used for calculating
available bytes.

------- Comment #1 From Casey Marshall 2007-05-15 00:27 -------
It should work for sockets, but not files, right? Does it work on pipes?

It might be better to redefine available() for files as (file.length -
file.pos).

------- Comment #2 From Ito Kazumitsu 2007-05-15 15:41 -------
> It should work for sockets, but not files, right? Does it work on pipes?  Right. No problem with sockets. I am not sure about pipes, but maybe OK. It works on named pipes.  

------- Comment #3 From Ito Kazumitsu 2007-06-26 22:34 -------
Fixed. The cvs-commit message went to Bug #30377 by my mistake.

First Last Prev Next    No search results available      Search page      Enter new bug