From owner-freebsd-current Sun Aug 3 02:45:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA16887 for current-outgoing; Sun, 3 Aug 1997 02:45:05 -0700 (PDT) Received: from peedub.gj.org (newpc.muc.ditec.de [194.120.126.33]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA16873 for ; Sun, 3 Aug 1997 02:44:58 -0700 (PDT) Received: from peedub.gj.org (localhost [127.0.0.1]) by peedub.gj.org (8.8.6/8.6.9) with ESMTP id LAA19759 for ; Sun, 3 Aug 1997 11:44:13 GMT Message-Id: <199708031144.LAA19759@peedub.gj.org> X-Mailer: exmh version 2.0delta 6/3/97 To: freebsd-current@freebsd.org Subject: Re: clock_settime() error? Reply-To: Gary Jennejohn In-reply-to: Your message of "Sat, 03 Aug 1997 08:26:39 +0200." <199708030626.IAA06139@zibbi.mikom.csir.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Aug 1997 11:44:12 +0000 From: Gary Jennejohn Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk John Hay writes: >Hi, > >I have been playing with the latest xntpd and I got "Can't set time of >day: Invalid argument" errors when it tried to step the time. I have >traced it to the clock_settime() system call in kern_time.c. I think >the test on line 171 is invalid: > >------- > if ((error = copyin(SCARG(uap, tp), &ats, sizeof(ats))) != 0) > return (error); > if (atv.tv_usec < 0 || ats.tv_nsec >= 1000000000) > ^^^^^^^^^^^ > return (EINVAL); > TIMESPEC_TO_TIMEVAL(&atv, &ats); >------- > >At that time atv.tv_usec hasn't been assigned yet. It is only assigned a >value two lines late in the TIMESPEC_TO_TIMEVAL() macro. Shouldn't it be >ats.tv_sec? Or ats.tv_nsec maybe? > looks to me like it should be ats.tv_usec. It's checking the passed-in ^ values. --- Gary Jennejohn Home - Gary.Jennejohn@munich.netsurf.de Work - gjennejohn@frt.dec.com