From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 18 21:14:02 2006 Return-Path: X-Original-To: freebsd-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 1543116A420 for ; Sat, 18 Feb 2006 21:14:02 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6B9243D48 for ; Sat, 18 Feb 2006 21:14:01 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id k1ILCuu8050524; Sat, 18 Feb 2006 14:12:56 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 18 Feb 2006 14:13:15 -0700 (MST) Message-Id: <20060218.141315.100064292.imp@bsdimp.com> To: stefan@fafoe.narf.at From: "M. Warner Losh" In-Reply-To: <20060218174216.GC578@wombat.fafoe.narf.at> References: <20060218171718.GA73133@stud.fit.vutbr.cz> <20060218172152.GB11874@britannica.bec.de> <20060218174216.GC578@wombat.fafoe.narf.at> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sat, 18 Feb 2006 14:13:01 -0700 (MST) Cc: freebsd-hackers@freebsd.org, joerg@britannica.bec.de 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: Sat, 18 Feb 2006 21:14:02 -0000 In message: <20060218174216.GC578@wombat.fafoe.narf.at> Stefan Farfeleder writes: : 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. : : execl("/bin/ls", "/bin/ls", (char *)NULL); as NULL might expand to an : integer 0. This is one of the times that the difference is important, since this function is a varadic one, and you must always cast when passing through varadic args. Warner