5 messages in net.java.dev.jna.usersRe: [jna-users] Calling a method by p...
FromSent OnAttachments
Alexandru Popescu ☀Feb 29, 2008 3:32 am 
Alexandru Popescu ☀Feb 29, 2008 3:34 am 
Paul LoyFeb 29, 2008 6:04 am 
Paul LoyFeb 29, 2008 6:05 am 
Timothy WallFeb 29, 2008 7:16 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] Calling a method by passing a constantActions...
From:Timothy Wall (twal@dev.java.net)
Date:Feb 29, 2008 7:16:15 am
List:net.java.dev.jna.users

This usually works well enough for single platforms. Keep in mind that the definition may vary by platform.

Off-Topic: I never found the clock tick definitions (at least under linux) to make much sense; how could a hard-coded divisor possibly represent anything related to timing when the underlying hardware might have a speed within a wide range of possibilities?

On Feb 29, 2008, at 9:04 AM, Paul Loy wrote:

Whenever I get anything like this, I simply grep the header files. i.e.:

grep -R _SC_CLK_TCK /usr/include/* /usr/include/unistd.h:#define _SC_CLK_TCK 3

so, 3 is the answer!

Paul.

On Fri, Feb 29, 2008 at 11:32 AM, Alexandru Popescu ☀
<the.mindstorm.mailinglist@gmail.c om> wrote: Hi all!

I'm very new to using JNA (and in general to interfacing Java with C -- I guess there are quite a few years since I've done this the last time).

Right now I am trying to map the sys/times.h clock_t times(struct tms *) call. According to the documentation the returned values are measured in number of clock ticks per second, and to figure out what this value is I should be calling the function long sysconf(int) where the parameter should be _SC_CLK_TCK.

My problem is that I don't have any idea about the value of _SC_CLK_TCK, so I am pretty lost on how it would be possible for me to get the sysconf invocation working.

Any ideas? Many thanks in advance,

./alex