From owner-freebsd-questions@FreeBSD.ORG Fri Feb 9 17:40:34 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FC5416A405 for ; Fri, 9 Feb 2007 17:40:34 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id F202813C48D for ; Fri, 9 Feb 2007 17:40:33 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from hymn01.u.washington.edu (hymn01.u.washington.edu [140.142.8.55]) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id l19HeX2N021453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 9 Feb 2007 09:40:33 -0800 Received: from localhost (localhost [127.0.0.1]) by hymn01.u.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id l19HeXPU018170 for ; Fri, 9 Feb 2007 09:40:33 -0800 X-Auth-Received: from [192.55.52.1] by hymn01.u.washington.edu via HTTP; Fri, 09 Feb 2007 09:40:33 PST Date: Fri, 9 Feb 2007 09:40:33 -0800 (PST) From: youshi10@u.washington.edu To: freebsd-questions@freebsd.org In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.2.9.92933 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='SUPERLONG_LINE 0.05, NO_REAL_NAME 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' Subject: Re: Trying to join an already exited pthread X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2007 17:40:34 -0000 On Fri, 9 Feb 2007, Daniel Eischen wrote: > On Thu, 8 Feb 2007, Garrett Cooper wrote: >> >> Actually, now that I think about it the calls I made with ps in the program >> are valid for Linux but not for FreeBSD (they're for getting thread >> listings). Hence error code 2. >> >> From intro(2): >> >> 2 ENOENT No such file or directory. A component of a specified pathname >> did not exist, or >> the pathname was an empty >> string. >> >> Didn't think that a bad command would return errno=2 though.. > > And hopefully you've realized that your code is totally bogus > since pthread_foo() don't set errno. All the pthread_foo() > functions _return_ the error. If your code is not checking > the return values from those functions, it is wrong on every > platform, not just FreeBSD. > > -- > DE Well, right. I was just being lazy by checking errno, instead of checking the return value of pthread_*. It wasn't meant to be anything more than a simple set of tests. I thought that errno was set on errors though, but after reading the manpage more carefully it turns out that this is not the case. I'll see if I can fix my checks. Thanks for bringing this to my attention! -Garrett