Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2013 21:10:01 GMT
From:      Petr Salinger <Petr.Salinger@seznam.cz>
To:        freebsd-threads@FreeBSD.org
Subject:   Re: threads/180496: clock_gettime() does not return CPU-time for zombie processes
Message-ID:  <201307122110.r6CLA1a7099123@freefall.freebsd.org>

Next in thread | Raw E-Mail | Index | Archive | Help
The following reply was made to PR threads/180496; it has been noted by GNATS.

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: Konstantin Belousov <kostikbel@gmail.com>
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



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?201307122110.r6CLA1a7099123>