bin/125680: atacontrol(8): atacontrol depends on executable in /usr

Antoine Brodin antoine at FreeBSD.org
Mon Jul 21 08:05:09 UTC 2008


On Mon, Jul 21, 2008 at 2:14 AM, Garrett Cooper <yanefbsd at gmail.com> wrote:
> Good catch. C apps shouldn't depend on other commands' existence for
> security and performance reasons.
>
> A few comments:
> 1. Why is forking another process necessary? In your patch above
> you're forcing the parent to do the work while the child goes and
> dies, so there really isn't any benefit to forking at all other than
> just exercise fork a bit.
> 2. If you're going to fork another process, wouldn't it be wiser to
> waitpid(2) until the child's done?

Hi,

In the patch, the child does the work and the parent dies.
The "/usr/bin/nice -n 20 /bin/dd if=/dev/ar%d of=/dev/null bs=1m &"
was launched in the background (notice the "&").

Cheers,

Antoine


More information about the freebsd-bugs mailing list