Bug 33156

Summary: [PATCH] fork(2) man page doesn't mention setitimer behaviour
Product: Base System Reporter: peter.jeremy <peter.jeremy>
Component: kernAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.5-PRERELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description peter.jeremy 2001-12-24 22:40:00 UTC
	A child process created by fork(2) will not inherit any interval
	timers created in the parent (eg alarm(3)).  This is not clear
	from the documentation.

	It is possible that the actual behaviour is incorrect, but the
	definition of struct proc implies that the behaviour is correct.
	In any case, the documentation should match the actual behaviour.

Fix: .\" $FreeBSD: src/lib/libc/sys/fork.2,v 1.9.2.4 2001/12/14 18:34:00 ru Exp $
How-To-Repeat: 	I found the problem using the procedure in bin/33155 and ktracing
	the sshd daemon.  The behaviour is demonstrated by executing the
	following program:

main()
{
    alarm(5);
    if (fork() == 0)
	pause();
}

	Whilst the parent returns immediately , the child remains running
	indefinitely.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-09 14:38:51 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'll take this one.
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-09 14:45:03 UTC
State Changed
From-To: open->closed

Committed as rev 1.14 and merged onto RELENG_4 as 1.9.2.5 
in time for 4.5-RELEASE, thanks!