From owner-freebsd-threads@FreeBSD.ORG Fri Jul 12 21:10:02 2013 Return-Path: Delivered-To: freebsd-threads@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 508E1A28 for ; Fri, 12 Jul 2013 21:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4204C1F14 for ; Fri, 12 Jul 2013 21:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CLA10t099124 for ; Fri, 12 Jul 2013 21:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6CLA1a7099123; Fri, 12 Jul 2013 21:10:01 GMT (envelope-from gnats) Date: Fri, 12 Jul 2013 21:10:01 GMT Message-Id: <201307122110.r6CLA1a7099123@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org Cc: From: Petr Salinger Subject: Re: threads/180496: clock_gettime() does not return CPU-time for zombie processes X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Petr Salinger List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 21:10:02 -0000 The following reply was made to PR threads/180496; it has been noted by GNATS. From: Petr Salinger To: Konstantin Belousov Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: threads/180496: clock_gettime() does not return CPU-time for zombie processes Date: Fri, 12 Jul 2013 22:59:51 +0200 (CEST) > Please try this. The clock_gettime() call on zombie clock worked > for me. Perfect. Many thanks. > Note that the check for clock_getres() on the reapped process clock > failed since we do not check for pid validity, all processes has > the same clock. I do not see much sense in adding the useless check. I agree that such check is technically useless. I cannot imagine usage of such restriction. The only reason of this check is wording of POSIX standard in http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html "The clock_getres(), clock_gettime(), and clock_settime() functions shall fail if: [EINVAL] The clock_id argument does not specify a known clock." But this behaviour can be easily added in userspace wrapper. Similarly as " The clock_settime() function shall fail if: [EINVAL] The value of the clock_id argument is CLOCK_MONOTONIC." The kernel returns EPERM for ordinary user. Would be possible to MFC SYS_clock_getcpuclockid2 and related kernel changes into STABLE-9 ? Thanks again Petr