From owner-cvs-all@FreeBSD.ORG Wed Jan 4 04:24:37 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A97EC16A41F; Wed, 4 Jan 2006 04:24:37 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EE6243D4C; Wed, 4 Jan 2006 04:24:36 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k044OQ2X031772; Wed, 4 Jan 2006 15:24:26 +1100 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k044ONkm004113; Wed, 4 Jan 2006 15:24:24 +1100 Date: Wed, 4 Jan 2006 15:24:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Diomidis Spinellis In-Reply-To: <43BB0D3B.10300@aueb.gr> Message-ID: <20060104151121.T50198@delplex.bde.org> References: <88559.1136330180@critter.freebsd.dk> <43BB0D3B.10300@aueb.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, Poul-Henning Kamp , src-committers@FreeBSD.org, Diomidis Spinellis , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_syscalls.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2006 04:24:37 -0000 On Wed, 4 Jan 2006, Diomidis Spinellis wrote: > 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). >> >> I think this is wrong. We should return EINVAL if the fractional >> part is not correct. I sent private mail saying similar things in more detail. > 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 > . POSIX requires the error handling for many (most?) syscalls that deal with timevals (and timespecs?), but is sloppy for utimes(), perhaps because historical implementations are sloppy. FreeBSD does it for most (all?) other syscalls that deal with timevals, using mainly itimerfix() (which is mostly about error detection but not fixing) for timevals (including ones not related to itimers) and direct checks for timespecs. Direct checks take less code than calling a function to do the checks but more code than calling a function that both checks and "fixes". > 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. Normalization is not so easy if you avoid overflow and sign problems in the normalization. Bruce