Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757056AbYFWMpQ (ORCPT ); Mon, 23 Jun 2008 08:45:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753397AbYFWMpE (ORCPT ); Mon, 23 Jun 2008 08:45:04 -0400 Received: from smtp-vbr5.xs4all.nl ([194.109.24.25]:3840 "EHLO smtp-vbr5.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753384AbYFWMpD (ORCPT ); Mon, 23 Jun 2008 08:45:03 -0400 Date: Mon, 23 Jun 2008 14:43:21 +0200 (CEST) From: Roman Zippel X-X-Sender: roman@localhost.localdomain To: Michael Kerrisk cc: Bart Van Assche , Michael Kerrisk , lkml , Thomas Gleixner , john stultz , Ingo Molnar Subject: Re: nanosleep() uses CLOCK_MONOTONIC, should be CLOCK_REALTIME? In-Reply-To: Message-ID: References: <485E00CD.9060503@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1293 Lines: 29 Hi, On Mon, 23 Jun 2008, Michael Kerrisk wrote: > >> Is there a reason to use CLOCK_MONOTONIC, instead of CLOCK_REALTIME? Is it > >> intentional? If yes, then I should document this in the man-pages. If not, > >> then it should be fixed. > > > > CLOCK_MONOTONIC works fine even if ntpd steps the clock forward or > > backward, CLOCK_REALTIME not. So the man page should be fixed. > > Thanks for your reply, but I'm not quite convinced yet. The things > is: the Solaris man page also says "CLOCK_REALTIME". (Of course that > man page may just be parroting the standard.) Could there not be some > reasonable semantics for a nanosleep() that was based on > CLOCK_REALTIME? CLOCK_MONOTONIC is optional, that's probably the reason it's not mentioned there. If you check the man page for clock_settime, it specifically mentions that pending relative timer (including nanosleep) aren't affected by the changed time, thus if CLOCK_MONOTONIC and CLOCK_REALTIME advance equally, it doesn't matter which you use for relative timer. bye, Roman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/