2 messages in net.java.dev.jna.usersRe: [jna-users] How to access "stdout" ?
FromSent OnAttachments
rzoJan 6, 2009 11:54 am 
Timothy WallJan 6, 2009 12:06 pm 
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] How to access "stdout" ?Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Jan 6, 2009 12:06:13 pm
List:net.java.dev.jna.users

Use "nm" on the command line (or maybe 'otool' on OSX). I think I looked this up once and on OSX stdout is a macro to something decidedly non-trivial. Check your /usr/include/stdio.h; mine says it's either "__stdoutp" or "&__sF[1]".

"dlopen" and friends doesn't provide any listing functionality for listing symbols; you'd have to parse the local shared library format yourself to get that information.

BTW, there's a dedicated function, NativeLibrary.getGlobalVariableAddress() which looks up the address of a global.

On Jan 6, 2009, at 2:55 PM, rzo wrote:

Hello,

Pointer stdout = NativeLibrary.getInstance ("c").getFunction("stdout").getPointer(0);

works fine on Linux. However on macosx 10.5. I am getting a "symbol not found" error.

Is there a way from within java/jna to list the list of symbols of a library ?