Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757723AbYFWICy (ORCPT ); Mon, 23 Jun 2008 04:02:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752518AbYFWICG (ORCPT ); Mon, 23 Jun 2008 04:02:06 -0400 Received: from mail.jambit.com ([62.245.207.83]:55855 "EHLO mail.jambit.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753976AbYFWICD (ORCPT ); Mon, 23 Jun 2008 04:02:03 -0400 Message-ID: <485E00CD.9060503@gmail.com> Date: Sun, 22 Jun 2008 09:35:41 +0200 From: Michael Kerrisk User-Agent: Thunderbird 2.0.0.12 (X11/20071114) MIME-Version: 1.0 To: lkml CC: Thomas Gleixner , john stultz , Ingo Molnar , Roman Zippel Subject: nanosleep() uses CLOCK_MONOTONIC, should be CLOCK_REALTIME? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1148 Lines: 36 Thomas, (I gues you are the right target for this?) The POSIX.1 specification of nanosleep() says: But, except for the case of being interrupted by a signal, the suspension time shall not be less than the time specified by rqtp, as measured by the system clock CLOCK_REALTIME. However, reading kernel/hrtimer.c:sys_nanosleep(), it appears that CLOCK_MONOTONIC is used. return hrtimer_nanosleep(&tu, rmtp, HRTIMER_MODE_REL, CLOCK_MONOTONIC); 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. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ man-pages onlne: http://www.kernel.org/doc/man-pages/online_pages.html Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html -- 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/