WIN-28: fix POSIX file descriptor numbering assumptions
Tom Tromey
tromey@redhat.com
Tue Feb 26 08:46:00 GMT 2002
>>>>> "Adam" == Adam Megacz <gcj@lists.megacz.com> writes:
Adam> I assume I should _Jv_Malloc(sizeof(file_descriptor_type)),
Adam> right? It would be cool if I could assume that a file descriptor
Adam> is never larger than a pointer (no malloc needed), but this is
Adam> probably too ugly.
I think it depends on the platform.
For POSIX we know a file descriptor is an int. We don't want to
malloc anything in this case; we just want to cast the int back and
forth with RawData.
For Windows assuming that a file descriptor is a pointer is probably
safe. So again no allocation required.
Tom
More information about the Java
mailing list