Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2001 12:41:16 -0800 (PST)
From:      Swamy Ananthanarayan <swamy25@yahoo.com>
To:        freebsd-hackers@freebsd.org
Subject:   Reading kernel side time and kldload
Message-ID:  <20010213204116.32382.qmail@web9613.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hello,

I would like to be able to read time from the kernel
side without using microtime or getmicrotime. I
understand that time can be examined directly by
reading (struct timeval) time. From reading the
mailing list archives, it seems that direct access of
the time struct is not atomic..and that you must use,

#include <sys/time.h>
extern struct timeval time;

int s = splclock();
struct timeval temp_tv = time;
splx(s);

The preceding code is part of a module that I am
writing. It compiles fine but when I go to load the
module, it complains,

kldload: can't load ./chardev_clock.ko: Exec format
error

When I remove the above piece of code and use
microtime instead..it works fine. Any ideas?

Thank you

Swamy

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010213204116.32382.qmail>