From owner-freebsd-hackers Tue Feb 13 12:41:19 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from web9613.mail.yahoo.com (web9613.mail.yahoo.com [216.136.131.12]) by hub.freebsd.org (Postfix) with SMTP id 8CE0F37B503 for ; Tue, 13 Feb 2001 12:41:16 -0800 (PST) Message-ID: <20010213204116.32382.qmail@web9613.mail.yahoo.com> Received: from [128.113.65.207] by web9613.mail.yahoo.com; Tue, 13 Feb 2001 12:41:16 PST Date: Tue, 13 Feb 2001 12:41:16 -0800 (PST) From: Swamy Ananthanarayan Subject: Reading kernel side time and kldload To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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