Bug 27570 - incorrect argument type for ioctl in native methods
Summary: incorrect argument type for ioctl in native methods
Status: NEW
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-12 08:43 UTC by Kevin Spiteri
Modified: 2006-05-16 18:12 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-05-16 18:12:25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Spiteri 2006-05-12 08:43:47 UTC
In the directory native/target/generic:

In file target_generic_network.h,
in macro TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_AVAILABLE,
the result of FIONREAD ioctl is stored in int.

In file target_generic_file.h,
in macro TARGET_NATIVE_FILE_AVAILABLE,
the result of FIONREAD ioctl is stored in ssize_t.

I am not sure which one is correct, but they are inconsistent and one would probably fail on 64-bit systems where int and ssize_t have different sizes.
Comment 1 Tom Tromey 2006-05-16 18:12:25 UTC
On most platforms, FIONREAD takes an int*.
However at least one version of Irix requires a size_t*

http://gcc.gnu.org/ml/libstdc++/2004-02/msg00012.html

Note that libgcj simply uses int and we haven't had complaints.