[Prev][Next][Index][Thread]

Re: Clock implementation in oskit




> Is anything similar to the ANSI C clock function implemented in OSKit?

After a thorough search:

  $ cd oskit_build/lib
  $ nm liboskit_*.a | grep ' clock'

It looks like the answer is no.

freebsd/3.x/src/lib/libc/gen/clock.c does provide code for clock but
it needs getrusage which a similar thorough search suggests we don't
have.

> I am using it in a program which I am  trying to boot as a OSkit kernel. I
> am getting 'undefined reference' errors since I have not linked the
> standard libraries. I have linked liboskit_dev.a and other oskit kernel
> startup libraries though.

If all you want to do is get your program linked, you could hack one
up pretty quickly.  Choices include a version that returns the same
number all the time, a version which returns a number that increases
by 1 each time.

If you need something more realistic, you could write a version that
uses gettimeofday or the osenv_clock (see
oskit/posix/sys/gettimeofday.c and documentation for how it is used).

Alastair


Follow-Ups: References: