| Summary: | [PATCH] fork(2) man page doesn't mention setitimer behaviour | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | peter.jeremy <peter.jeremy> | ||||
| Component: | kern | Assignee: | Sheldon Hearn <sheldonh> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.5-PRERELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-bugs->sheldonh I'll take this one. 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! |
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.