standards/53554: interval timers not cleared in fork()

Volker Stolz stolz at
Fri Jun 20 07:30:13 PDT 2003

>Number:         53554
>Category:       standards
>Synopsis:       interval timers not cleared in fork()
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-standards
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 20 07:30:11 PDT 2003
>Originator:     Volker Stolz
>Release:        FreeBSD 4.8-STABLE i386
Lehrstuhl für Informatik II
System: FreeBSD 4.8-STABLE FreeBSD 4.8-STABLE #4: Tue Apr 29 11:28:13 CEST 2003 root at i386

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.
Sample program which sets the timers, forks and checks if timers are still
enabled in the child at:

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


More information about the freebsd-standards mailing list