After consideration, IMO, writing macros for this problem would be tedious.
Some OS defines off_t as long, some as int, endian further complicates the
cast problem. If use macro way, there may be at least [off_t size
array].length * [endian].types different macro, which is confusing.

Cast jlong to off_t would be simpler. Compiler automatically does the
conversion for us. This conversion is safe, since the passed in offset is
guaranteed in integer scope in java layer, and off_t >= int. I have provided
another patch. Would any committer take a look?

Best regards.

2007/3/13, Yang Paulex <[EMAIL PROTECTED]>:

2007/3/13, Stepan Mishura <[EMAIL PROTECTED]>:
>
> On 3/12/07, Vladimir Ivanov wrote:
>
> > If changes to the file OSFileSystemLinux32.c were reverted and
> > classlib+drlvm were rebuilt this test passed.
> > Command to revert:
> > classlib/trunk> svn up -r517104
> > modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
>
>
> Yes, I can reproduce the failure on x86_64 on Linux and if I revert
update
> the test passes.
>
> Paulex, could you look into your commit r517145?:
> patch for HARMONY-3334([classlib][luni-native] Native Method
> XXX_transferImpl in luni/src/main/native/luni/unix/OSFileSystemLinux32.c
> did
> not handle endian properly)


Patch reverted at revision r517562, thank you to point it out and sorry
for
inconvenience, instead of the tricky and error prone way, seems defining
some macros for big endian architecture is the right thing to do :-(.

Thanks,
> Stepan.
>
>
>
>
> > thanks, Vladimir
> >
> > On 3/12/07, Vladimir Ivanov <[EMAIL PROTECTED]> wrote:
> > > This test passed on r517014 and failed starting from r517145.
> > >
> > >  thanks, Vladimir
> > >
> > > On 3/12/07, Vladimir Ivanov <[EMAIL PROTECTED]> wrote:
> > > > Hello everyone,
> > > > the classlib test
> > > >
org.apache.harmony.nio.tests.java.nio.channels.FileChannelTestfailed
> > > > now on the SUSE 9 Linux on x86_64 platform. This failure is
stable.
> I
> > > > try to identify the guilty commit.
> > > >
> > > >  Thanks, Vladimir
> > > >
> > > > Execution log:
> > > > Test: test_transferToJJLWritableByteChannel_SocketChannelClass:
> > > > org.apache.harmony.nio.tests.java.nio.channels.FileChannelTest
> > > > java.io.IOException
> > > >        at org.apache.harmony.luni.platform.OSFileSystem.transfer(
> > OSFileSystem.java:238)
> > > >        at
> > org.apache.harmony.nio.internal.FileChannelImpl.kernelTransfer(
> > FileChannelImpl.java:455)
> > > >        at
org.apache.harmony.nio.internal.FileChannelImpl.transferTo
> (
> > FileChannelImpl.java:443)
> > > >        at
> >
>
org.apache.harmony.nio.tests.java.nio.channels.FileChannelTest.test_transferToJJLWritableByteChannel_SocketChannel
> > (FileChannelTest.java:3058)
> > > >        at java.lang.reflect.VMReflection.invokeMethod(
> > VMReflection.java)
> > > >
> > >
> >
>
>
>
> --
> Stepan Mishura
> Intel Enterprise Solutions Software Division
>



--
Paulex Yang
China Software Development laboratory
IBM




--
Spark Shen
China Software Development Lab, IBM

Reply via email to