Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jun 2003 16:21:42 +0200 (CEST)
From:      Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        standards@freebsd.org
Subject:   interval timers not cleared in fork()
Message-ID:  <200306201421.h5KELfUh011622@menelaos.informatik.rwth-aachen.de>

next in thread | raw e-mail | index | archive | help

>Submitter-Id:	current-users
>Originator:	Volker Stolz
>Organization:	Lehrstuhl für Informatik II
>Confidential:	no 
>Synopsis:	interval timers not cleared in fork()
>Severity:	serious
>Priority:	low
>Category:	standards
>Class:		sw-bug
>Release:	FreeBSD 4.8-STABLE i386
>Environment:
System: FreeBSD menelaos.informatik.rwth-aachen.de 4.8-STABLE FreeBSD 4.8-STABLE #4: Tue Apr 29 11:28:13 CEST 2003 root@menelaos.informatik.rwth-aachen.de:/usr/obj/usr/src/sys/MENELAOS i386


>Description:
The FreeBSD man page says on calling fork():
"All interval timers are cleared; see setitimer(2)."

SUSv2 says that on invoking fork():
 - If the Timers option is supported, per-process timers created by the
    parent are not inherited by the child process.

However, a quick test reveals that only the REAL timer is stopped, PROF
and VIRTUAL keep running.
>How-To-Repeat:
Sample program which sets the timers, forks and checks if timers are still
enabled in the child at: http://www.foldr.org/~stolz/timer.c

virtual set: interval=1 500 value=1 500
REAL get: interval=0 0 value=0 0
PROF get: interval=1 500 value=1 500
VIRTUAL get: interval=1 500 value=1 500

>Fix:



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