From owner-cvs-src@FreeBSD.ORG Tue Jan 3 23:49:27 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.ORG Delivered-To: cvs-src@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57B4C16A443; Tue, 3 Jan 2006 23:49:27 +0000 (GMT) (envelope-from dds@aueb.gr) Received: from mx-out-04.forthnet.gr (mx-out.forthnet.gr [193.92.150.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A71F43DF6; Tue, 3 Jan 2006 23:48:19 +0000 (GMT) (envelope-from dds@aueb.gr) Received: from mx-av-02.forthnet.gr (mx-av.forthnet.gr [193.92.150.27]) by mx-out-04.forthnet.gr (8.13.5/8.13.5) with ESMTP id k03NmCE3019487; Wed, 4 Jan 2006 01:48:12 +0200 Received: from mx-in-04.forthnet.gr (mx-in-04.forthnet.gr [193.92.150.163]) by mx-av-02.forthnet.gr (8.13.5/8.13.5) with ESMTP id k03NmCxe013566; Wed, 4 Jan 2006 01:48:12 +0200 Received: from [192.168.136.16] (ppp65-adsl-173.ath.forthnet.gr [62.1.29.173]) by mx-in-04.forthnet.gr (8.13.5/8.13.5) with ESMTP id k03Lmklk015858; Tue, 3 Jan 2006 23:48:47 +0200 Authentication-Results: mx-in-04.forthnet.gr from=dds@aueb.gr; sender-id=neutral; spf=neutral Message-ID: <43BB0D3B.10300@aueb.gr> Date: Wed, 04 Jan 2006 01:48:11 +0200 From: Diomidis Spinellis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en, el, en-us, de MIME-Version: 1.0 To: Poul-Henning Kamp References: <88559.1136330180@critter.freebsd.dk> In-Reply-To: <88559.1136330180@critter.freebsd.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, Diomidis Spinellis , cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern vfs_syscalls.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2006 23:49:27 -0000 Poul-Henning Kamp wrote: > In message <200601032158.k03LwMGP031138@repoman.freebsd.org>, Diomidis Spinellis writes: > >>dds 2006-01-03 21:58:22 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/kern vfs_syscalls.c >> Log: >> Normalize the tv_usec part of the utimes(2) arguments to ensure >> that a file's atime and mtime are only set to correct fractional >> second values (0-999999000ns with the current interface). >> Prior to this change users could create files with values outside >> that range. Moreover, on 32-bit machines tv_usec offsets larger than >> 4.3s would result in an unnormalized AND wrong timestamp value, >> due to overflow. > > > I think this is wrong. We should return EINVAL if the fractional > part is not correct. I saw that one coming :-) Solaris (SunOS 5.10) returns EINVAL, Mac OS X Tiger and Linux 2.4.21 appear to ignore the field, and NetBSD 1.5 follows our buggy behavior. POSIX is silent on the matter, and does not specify EINVAL in the list of prescribed errno values . However, POSIX, in general, allows returning additional error codes: Implementations may support additional errors not included in this list, may generate errors included in this list under circumstances other than those described here, or may contain extensions or limitations that prevent some errors from occurring. The ERRORS section on each reference page specifies whether an error shall be returned, or whether it may be returned. Implementations shall not generate a different error number from the ones described here for error conditions described in this volume of IEEE Std 1003.1-2001, but may generate additional errors unless explicitly disallowed for a particular function. On the other hand, normalization is easy, relatively efficient, follows the letter of the standard, and will not break existing software. As a precedent, consider that Unix traditionaly normalizes filename paths. Diomidis - dds@