Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Dec 2006 11:22:56 -0600
From:      "Scot Hetzel" <swhetzel@gmail.com>
To:        freebsd-emulation@freebsd.org
Subject:   linuxolator: implement settimeofday call on FreeBSD/amd64
Message-ID:  <790a9fff0612190922t1f4a3fa1m44092944485297f7@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
------=_Part_3827_27566908.1166548976559
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I noticed that the settimeofday call in the linuxolator is implemented
on FreeBSD/i386, but it is missing from FreeBSD/amd64.  The attached
patch implements the function on FreeBSD/amd64.

I have run this change thru the LTP testcases settimeofday01, and
settimeofday02.

Currently, it is failing one test in settimeofday01 due to it taking
24-30 minutes to complete and hangs the system for that duration of
time.  The test expects the difference between what it set the time to
(100 sec, 100 msec) and what it gets back from gettimeofday to be
within -500 and +500 msec.

So far it looks to be a bug in the FreeBSD kern_settimeofday function,
and not in the code that I used to implement the linux_settimeofday
function.  As I had rewritten the testcase to run on FreeBSD, and it
also hung the system for the same amount of time.

Scot

-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.

------=_Part_3827_27566908.1166548976559
Content-Type: text/x-diff; name=settimeofday.patch; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_evwj8oy8
Content-Disposition: attachment; filename="settimeofday.patch"

LS0tIGFtZDY0L2xpbnV4MzIvbGludXgzMl9kdW1teS5jLW9yaWcJMjggT2N0IDIwMDYgMTA6NTk6
NTkgLTAwMDAKKysrIGFtZDY0L2xpbnV4MzIvbGludXgzMl9kdW1teS5jCTE3IERlYyAyMDA2IDA5
OjQ1OjM1IC0wMDAwCkBAIC02NSw3ICs2Myw2IEBACiBEVU1NWShtaW5jb3JlKTsKIERVTU1ZKGZh
ZHZpc2U2NCk7CiBEVU1NWShwdHJhY2UpOwotRFVNTVkoc2V0dGltZW9mZGF5KTsKIERVTU1ZKGx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XRydXNhZ2VfYXJncyAqdWFwKQogewogCXN0cnVjdCBsX3J1
c2FnZSBzMzI7Cg==
------=_Part_3827_27566908.1166548976559--



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