From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 19 10:54:44 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C77D616A420 for ; Sun, 19 Feb 2006 10:54:44 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id F29BF43D48 for ; Sun, 19 Feb 2006 10:54:43 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.4/8.13.3) with ESMTP id k1JAsdIZ012318 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 19 Feb 2006 11:54:39 +0100 (CET) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.4/8.13.3/Submit) id k1JAscUu012316 for hackers@freebsd.org; Sun, 19 Feb 2006 11:54:38 +0100 (CET) Date: Sun, 19 Feb 2006 11:54:38 +0100 From: Divacky Roman To: hackers@freebsd.org Message-ID: <20060219105438.GA12265@stud.fit.vutbr.cz> References: <20060218171718.GA73133@stud.fit.vutbr.cz> <20060218172152.GB11874@britannica.bec.de> <20060218173908.GA73913@stud.fit.vutbr.cz> <20060218214329.GF69162@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060218214329.GF69162@funkthat.com> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.49 on 147.229.10.14 Cc: Subject: Re: different behaviour on fbsd and linux X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2006 10:54:44 -0000 On Sat, Feb 18, 2006 at 01:43:30PM -0800, John-Mark Gurney wrote: > Divacky Roman wrote this message on Sat, Feb 18, 2006 at 18:39 +0100: > > On Sat, Feb 18, 2006 at 06:21:52PM +0100, joerg@britannica.bec.de wrote: > > > On Sat, Feb 18, 2006 at 06:17:18PM +0100, Divacky Roman wrote: > > > > execl("/bin/ls", NULL); > > > > > > This is wrong. You must specify arg0 != NULL (POSIX says so) and you > > > must NULL-terminate the *following* list. > > > > > > E.g.: > > > execl("/bin/ls", "/bin/ls", NULL); > > > is what you want to do. > > > > > > ah.. thnx.. the man page should be updated with "he > > first argument, by convention, should point to the file name associated > > with the file being executed." > > > > s/should/must then > > Nope.. it need not be the same.. in cases like this: > execl("/usr/bin/gzip", "gunzip", NULL); > > will give you gunzip behavior because the gzip binary looks at argv[0] > and changes it's behavior based upon what it finds.. look at crunchgen > for the ability to combine different programs into one binary... ok.. but I'd appreciate info that it cannot be NULL ;(