From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 21 08:05:09 2008 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2685106566C for ; Mon, 21 Jul 2008 08:05:09 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.241]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2958FC1C for ; Mon, 21 Jul 2008 08:05:09 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by an-out-0708.google.com with SMTP id b33so421341ana.13 for ; Mon, 21 Jul 2008 01:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=VEIq4muV1lzdEnNVH7HqiLgfryng+g+wlg5Up6cE+ZI=; b=CQUl++5WtqDMecUqSMCPYDr9gqEi6UxijoQMppvJuO3f/Wgp5Z3eSzCzwPtbFWQ/qg Fmr3mpP+fRi0JAg8kkHc/s6I8uzis3kSI0RTQ+dm9SYECCTAEizRWTiNpSb4VR0ZKuO8 fCVMK6P1C3mYBH179jLJJxckTmlWxY/bDkoNo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=mxLA2/B7pArl8vmO0JmamM0FQrM35WW723sWOBEWYBoZmx7faX1fy1/8AdxWnWS8JY 0S/X2Z/tbBlvtCxaHJWs7XDLAx359zhbRqArhCYrYMTChvQBnqDbuwxEX0PPF3IFFxhy 1kYJ4lQFSPNtaTpTRaGDeORgCHUlhUN2qS8+U= Received: by 10.100.254.18 with SMTP id b18mr1604272ani.81.1216625956736; Mon, 21 Jul 2008 00:39:16 -0700 (PDT) Received: by 10.100.111.13 with HTTP; Mon, 21 Jul 2008 00:39:16 -0700 (PDT) Message-ID: Date: Mon, 21 Jul 2008 09:39:16 +0200 From: "Antoine Brodin" Sender: antoine.brodin.freebsd@gmail.com To: "Garrett Cooper" In-Reply-To: <7d6fde3d0807201714g49eb4a80ncfcc1cc800ad595e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200807202210.m6KMA4cm032331@freefall.freebsd.org> <7d6fde3d0807201714g49eb4a80ncfcc1cc800ad595e@mail.gmail.com> X-Google-Sender-Auth: f5991f73c14f32d3 Cc: freebsd-bugs@freebsd.org Subject: Re: bin/125680: atacontrol(8): atacontrol depends on executable in /usr X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2008 08:05:09 -0000 On Mon, Jul 21, 2008 at 2:14 AM, Garrett Cooper 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