From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 16 18:38:14 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7C21106564A for ; Fri, 16 Jan 2009 18:38:14 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep17-int.chello.at (viefep17-int.chello.at [62.179.121.37]) by mx1.freebsd.org (Postfix) with ESMTP id 217218FC20 for ; Fri, 16 Jan 2009 18:38:13 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from edge04.upc.biz ([192.168.13.239]) by viefep17-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20090116183812.NOE13616.viefep17-int.chello.at@edge04.upc.biz>; Fri, 16 Jan 2009 19:38:12 +0100 Received: from lizard.fafoe.narf.at ([213.47.85.26]) by edge04.upc.biz with edge id 4JeA1b02c0a5KZh04JeBug; Fri, 16 Jan 2009 19:38:12 +0100 X-SourceIP: 213.47.85.26 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id 03D04BCF2; Fri, 16 Jan 2009 19:38:06 +0100 (CET) Date: Fri, 16 Jan 2009 19:38:06 +0100 From: Stefan Farfeleder To: Nate Eldredge Message-ID: <20090116183806.GB1355@lizard.fafoe.narf.at> Mail-Followup-To: Nate Eldredge , Garrett Cooper , Thierry Herbelot , freebsd-hackers@freebsd.org, Christoph Mallon References: <7d6fde3d0901160041n55466290l55f737d274a40895@mail.gmail.com> <49705FA2.2020605@gmx.de> <7d6fde3d0901160235o6aa1f096q11c5096b70f3577@mail.gmail.com> <200901161152.53478.thierry.herbelot@free.fr> <7d6fde3d0901161006r79f0cac4yf80c9c5079152b87@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Thierry Herbelot , Garrett Cooper , Christoph Mallon , freebsd-hackers@freebsd.org Subject: Re: Confused by segfault with legitimate call to strerror(3) on amd64 / sysctl (3) setting `odd' errno's 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: Fri, 16 Jan 2009 18:38:15 -0000 On Fri, Jan 16, 2009 at 10:33:15AM -0800, Nate Eldredge wrote: > Pop quiz: which of the following statements is correct? > > #include > #include > > execl("/bin/sh", "/bin/sh", 0); > execl("/bin/sh", "/bin/sh", NULL); None, as NULL is allowed to expand to 0. You have to write execl("/bin/sh", "/bin/sh", (char *)0);