From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOBjk-00074z-M2 for qemu-devel@nongnu.org; Wed, 30 Jul 2008 09:29:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOBji-00073j-OP for qemu-devel@nongnu.org; Wed, 30 Jul 2008 09:29:03 -0400 Received: from [199.232.76.173] (port=47803 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOBji-00073U-JP for qemu-devel@nongnu.org; Wed, 30 Jul 2008 09:29:02 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:49811) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KOBjh-0005B9-Sl for qemu-devel@nongnu.org; Wed, 30 Jul 2008 09:29:02 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] replacing gettimeofday with clock_gettime in hw/serial Date: Wed, 30 Jul 2008 14:28:30 +0100 References: <489040FF.1070601@eu.citrix.com> In-Reply-To: <489040FF.1070601@eu.citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807301428.30863.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefano Stabellini On Wednesday 30 July 2008, Stefano Stabellini wrote: > This patch substitutes gettimeofday with clock_gettime in hw/serial.c. > > gettimeofday is unsafe because can lead to incorrect behaviors if the user > changes the system's date. This code is just plain wrong to start with. Devices should not depend on host time. Paul