From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 11 22:55:37 2010 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 6BA6F106564A for ; Thu, 11 Mar 2010 22:55:37 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout028.mac.com (asmtpout028.mac.com [17.148.16.103]) by mx1.freebsd.org (Postfix) with ESMTP id 56DD58FC12 for ; Thu, 11 Mar 2010 22:55:37 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp028.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KZ500EF00VQ3190@asmtp028.mac.com>; Thu, 11 Mar 2010 13:55:07 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1003110202 From: Marcel Moolenaar In-reply-to: <201003111624.51018.jkim@FreeBSD.org> Date: Thu, 11 Mar 2010 13:55:02 -0800 Message-id: <8EE3605E-6E39-44A1-9E3A-5A37E1921D27@mac.com> References: <201003111624.51018.jkim@FreeBSD.org> To: Jung-uk Kim X-Mailer: Apple Mail (2.1077) Cc: freebsd-hackers@freebsd.org Subject: Re: [RFC] Saving the latest errno from syscalls. 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: Thu, 11 Mar 2010 22:55:37 -0000 On Mar 11, 2010, at 1:24 PM, Jung-uk Kim wrote: > While I was debugging syscalls, I found a very useful field in struct > thread, td_errno. It seems it was added for dtrace but it is only > populated on amd64 and i386. Is the attached patch acceptable for > maintainers of other platforms? Isn't it better to do it in cpu_set_syscall_retval()? That way you catch all cases, plus you can save the translated error as well... -- Marcel Moolenaar xcllnt@mac.com