X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=RI8M jl7f7fMCSJtu8hyatI+D9AgG1W7FQj1Itqs0WCXohj0Dy3CQLEgnXlA1b46lbVKk LXmQ49niJ7fSXvkevAwkmRvUvj1oYiMLk0fyYoDUmCvNHw4kI7GBaNQBw6l3DqaI 3rod+fEy3mbfYJvboVMEWgDzQPhUaaiu/PdUQnI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=7qP3AC6MqU g/ZcCfPu8H6qgm5i8=; b=i5jDQ0I7eiX0QL6IavBq48eRhgQP5uC0GiflHSc40v MeMaRS6mSYO3N+ap+UlOFIgAW3PuDrgXF3lrdWthrj1iARrSE5keQ0Vj7drgxxhv b0lkyv/lAcD76BD9pz/cPzUQUwgfAmS7JaXOt8qGxc9I+y2T84Jzi3rJIdGMHHZB U= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Timothy, timothy, 348C, 348c X-HELO: mail-wm0-f68.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=FIDgT3jjKj2b/5tO5G/wK8K6LhyWelEA55+xteymPQY=; b=cCNmBboiwcJwk364XapfKesF2ueuTzddIi1Asye9eh2wC7PSBLbOE3wLSXjUAE7Sv6 CKAhu03FFNV9OZPUx923St15rif5C0QBUicfqBFG6Omgg8Ha5LNDPlyp0xIi32aJNlt/ TDhs8ypvtMYk/vpPknLWhhxUuhiGiekik3Myq5+dj+orb/gYOcyuSSVXJ5AetLZ5evGN JLfQgOIddZSFrfoiQ2O3r9f8fWEtQsdzgx93Ix2l02NiiH7GamdJKIpvV1ZJUe21Qo3j qaFa1L0cTb65uRsYxt8kQULoLFR90qI6GH3Olk2Q7b1Glp8uGqk34BE6r0SwqjSvFoSL Us0Q== X-Gm-Message-State: AOPr4FXxNArUVHUl2R+cJ54UnryU+IedvPBYZJQYsTD2cnqJS9JRi81GAklRoB8mJqcaCg== X-Received: by 10.194.62.110 with SMTP id x14mr5758390wjr.68.1461099616288; Tue, 19 Apr 2016 14:00:16 -0700 (PDT) Subject: Re: pthread_attr_init() returning errors To: cygwin AT cygwin DOT com References: From: =?UTF-8?Q?V=c3=a1clav_Haisman?= Message-ID: <57169C53.7040302@gmail.com> Date: Tue, 19 Apr 2016 23:00:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dorOlMWGJOeEEeMXtGfApqnaGanRoFT7L" X-IsSubscribed: yes --dorOlMWGJOeEEeMXtGfApqnaGanRoFT7L Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 19.4.2016 21:49, Canham, Timothy K (348C) wrote: > I have some code to start a task that suddenly started failing. This is p= retty mature code. Here is the code fragment with my added printf() >=20 > pthread_attr_t att; > int stat =3D pthread_attr_init(&att); > if (stat !=3D 0) { > printf("pthread_attr_init: (%d)(%d): %s\n",stat,errno,strerro= r(stat)); > // return > } >=20 > Here is the output: >=20 > pthread_attr_init: (16)(0): Device or resource busy >=20 > If I don't return in the if statement, the subsequent pthread_create() se= ems to work just fine. Does it work if you do `memset(&att, 0, sizeof(att));` before the `pthread_attr_init(&att)`? --=20 VH --dorOlMWGJOeEEeMXtGfApqnaGanRoFT7L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlcWnF0ACgkQlv+b6dkC1zaBgAD7BJBADWG6xM/pPYFhhKbRANVC tezTj8rNcHMl8rpW4PgBAL60vDrb0j6yJs1FJM0J+QEWYwmBEBCoIvsNXFQXDCNp =ARvL -----END PGP SIGNATURE----- --dorOlMWGJOeEEeMXtGfApqnaGanRoFT7L--