19 messages in net.java.dev.jna.usersRe: [jna-users] Re: Identifying symbo...
FromSent OnAttachments
Timothy WallDec 11, 2007 5:34 am 
Normen MüllerDec 11, 2007 6:35 am 
Normen MüllerDec 11, 2007 6:52 am 
Timothy WallDec 11, 2007 7:20 am 
Timothy WallDec 11, 2007 7:53 am 
Timothy WallDec 11, 2007 7:55 am 
Nikolas LotzDec 11, 2007 8:05 am 
Normen MüllerDec 11, 2007 8:27 am 
Normen MüllerDec 11, 2007 8:37 am 
Timothy WallDec 11, 2007 10:25 am 
Duncan McGregorDec 11, 2007 3:05 pm 
Normen MüllerDec 12, 2007 12:04 am 
Peter ReillyDec 12, 2007 1:34 am 
Normen MüllerDec 12, 2007 1:39 am 
Timothy WallDec 12, 2007 4:34 am 
Timothy WallDec 12, 2007 4:38 am 
Normen MüllerDec 12, 2007 4:57 am 
Normen MüllerDec 12, 2007 5:04 am 
Timothy WallDec 12, 2007 5:36 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Re: Identifying symbolic links on Mac OSX 10.5.1Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Dec 12, 2007 5:36:46 am
List:net.java.dev.jna.users

On Dec 12, 2007, at 7:57 AM, Normen Müller wrote:

On Dec 12, 2007, at 1:38 PM, Timothy Wall wrote:

looking at the JRuby version, they've got the mode packed into 16 bits at offset 8. Since PPC is big-endian and X86 is little- endian, that might be where the difference is.

Try getShort(8) instead of getInt(8); what are the values (in hex) in either case?

GREAT! Now it works! I will put your name in the source code!!!!

However I guess I still have to modify

int mode = SVNFileUtil.isOSX || SVNFileUtil.isBSD ? ourSharedMemory.getShort(8) : ourSharedMemory.getShort(16);

I guess it should rather be something like:

int mode = 0 if (SVNFileUtil.isOSX) mode = ourSharedMemory.getShort(8) if (SVNFileUtil.isBSD) mode = ourSharedMemory.getInt(16);

Otherwise this code will not work on a proper linux system, right?

if (osx) { } else if (bsd) { } else { }

Regarding your last question ``what are the values (in hex) in either case''? I don't really understand what you are asking me for :-\ Do you mean the hex value of ``mode'' variable?

yes, that's what I meant.

So to summarize, on OSX the mode field is 16 bits at offset 8 of the structure, not 32 bits. No difference is detected on little-endian systems, but the bug is made apparent on big-endian systems.

Checking sys/stat.h, sys/types.h and sys/_types.h shows that mode_t is 16 bits.