Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Oct 2003 12:00:30 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/58647: itimers aren't cleared on fork()
Message-ID:  <200310282000.h9SK0Uow036197@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/58647; it has been noted by GNATS.

From: John Baldwin <jhb@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/58647: itimers aren't cleared on fork()
Date: Tue, 28 Oct 2003 14:55:18 -0500 (EST)

 It seems that fork() doesn't explicitly clear the realtimer, rather
 p_realtimer is in the zero'd section of struct proc whereas the
 p_itimer array with the old real timer and the other two interval
 timers is in the copy section of p_stat.  The patch below moves
 p_itimer to the zero section of p_stat instead:
 
 Index: resourcevar.h
 ===================================================================
 RCS file: /usr/cvs/src/sys/sys/resourcevar.h,v
 retrieving revision 1.35
 diff -u -r1.35 resourcevar.h
 --- resourcevar.h       20 Apr 2003 13:54:04 -0000      1.35
 +++ resourcevar.h       28 Oct 2003 19:51:10 -0000
 @@ -52,11 +52,10 @@
  #define        pstat_startzero p_ru
         struct  rusage p_ru;            /* stats for this proc */
         struct  rusage p_cru;           /* sum of stats for reaped children */
 -#define        pstat_endzero   pstat_startcopy
 -
 -#define        pstat_startcopy p_timer
         struct  itimerval p_timer[3];   /* virtual-time timers */
 +#define        pstat_endzero   pstat_startcopy
  
 +#define        pstat_startcopy p_prof
         struct uprof {                  /* profile arguments */
                 caddr_t pr_base;        /* buffer base */
                 u_long  pr_size;        /* buffer size */
 
 -- 
 
 John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
 "Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310282000.h9SK0Uow036197>