From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 16 11:10:45 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 048C51065853 for ; Fri, 16 Jan 2009 11:10:45 +0000 (UTC) (envelope-from thierry.herbelot@free.fr) Received: from smtpfb1-g21.free.fr (smtpfb1-g21.free.fr [212.27.42.9]) by mx1.freebsd.org (Postfix) with ESMTP id 724598FC2E for ; Fri, 16 Jan 2009 11:10:42 +0000 (UTC) (envelope-from thierry.herbelot@free.fr) Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by smtpfb1-g21.free.fr (Postfix) with ESMTP id AC0C67801D6 for ; Fri, 16 Jan 2009 11:53:11 +0100 (CET) Received: from smtp6-g21.free.fr (localhost [127.0.0.1]) by smtp6-g21.free.fr (Postfix) with ESMTP id 99CAAE080E5 for ; Fri, 16 Jan 2009 11:53:06 +0100 (CET) Received: from mail.herbelot.nom (bne75-4-82-227-159-103.fbx.proxad.net [82.227.159.103]) by smtp6-g21.free.fr (Postfix) with ESMTP id 9ACA6E08073 for ; Fri, 16 Jan 2009 11:53:03 +0100 (CET) Received: from tulipe.herbelot.nom (tulipe.herbelot.nom [192.168.2.5]) by mail.herbelot.nom (8.14.1/8.14.1) with ESMTP id n0GAqx88015216; Fri, 16 Jan 2009 11:52:59 +0100 (CET) From: Thierry Herbelot To: freebsd-hackers@freebsd.org Date: Fri, 16 Jan 2009 11:52:52 +0100 User-Agent: KMail/1.9.10 References: <7d6fde3d0901160041n55466290l55f737d274a40895@mail.gmail.com> <49705FA2.2020605@gmx.de> <7d6fde3d0901160235o6aa1f096q11c5096b70f3577@mail.gmail.com> In-Reply-To: <7d6fde3d0901160235o6aa1f096q11c5096b70f3577@mail.gmail.com> X-Warning: Windows can lose your files X-Op-Sys: Le FriBi de la mort qui tue X-Org: TfH&Co X-MailScanner: Found to be clean MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200901161152.53478.thierry.herbelot@free.fr> X-Mailman-Approved-At: Fri, 16 Jan 2009 12:25:33 +0000 Cc: Christoph Mallon 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 11:10:47 -0000 Le Friday 16 January 2009, Garrett Cooper a écrit : > On Fri, Jan 16, 2009 at 2:21 AM, Christoph Mallon > > #include > #include > #include > > int > main() > { > > struct stat sb; > > int o_errno; > > if (stat("/some/file/that/doesn't/exist", &sb) != 0) { > o_errno = errno; > printf("Errno: %d\n", errno); > printf("%s\n", strerror(o_errno)); > } > > return 0; > > } > with this, it's better on an amd64/ RELENG_7 machine : % diff -ub badfile.c.ori badfile.c --- badfile.c.ori 2009-01-16 11:49:44.778991057 +0100 +++ badfile.c 2009-01-16 11:49:03.470465677 +0100 @@ -1,6 +1,7 @@ #include #include #include +#include int main() Cheers TfH