From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 8 16:17:39 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F083106580A for ; Mon, 8 Oct 2012 16:17:39 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9C58FC12 for ; Mon, 8 Oct 2012 16:17:39 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id z9so1794842dad.13 for ; Mon, 08 Oct 2012 09:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:from:date:message-id:subject:to:content-type; bh=HQ4PKGPFVfuTDVQcvy/m/Rq+8EL54vq2oyC4HGCRtKs=; b=FVA0/RRTpMIKAPD0MeB2ofw9J0UDeHjjP+miu8dmLMPAEMOfs1DjWsLGh7MWS8YA64 /mpJvjDoM2RYV2py8rVlUPU8qnBsqqs4/h+xa/ok4afsj+kufFJvvvjyi13B4T90KfrW /ufUAPB/1HuRIMfrV/hvnQTXXJxTajPYhIalI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :x-gm-message-state; bh=HQ4PKGPFVfuTDVQcvy/m/Rq+8EL54vq2oyC4HGCRtKs=; b=l+gUlrB92tXpnZ+Gz/mu7InkfNtShIHRAaWuX5nL30swUR2ULsxLHXImZexIX/JzFy YZpdIueqYS6YEyN7Hs60glkbZjZXdBiYXmVu2a4PSRlCUahEGlXsKHRg5v40XANXJp+L Mzu6hw2llIv0UGxoiEWDNXuQWrPsz8DonJkE7ZO9MlgORazip2PCbbvQSK8NRVn65zQ2 0JaiGVkiLouAGDAJ5HXMcrEyF1xXID31IZMwTbFtjKhejNv+ezxCgPmqkKaSzphsErr4 98w7eLks8idAqqdFEEqtoXf/XhH7NNh7/pJ70N+S1oLwJNEog12A3VrwUT3Rqcidp1ME /cig== Received: by 10.68.200.72 with SMTP id jq8mr54316898pbc.38.1349713058528; Mon, 08 Oct 2012 09:17:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.161.163 with HTTP; Mon, 8 Oct 2012 09:17:08 -0700 (PDT) From: Eitan Adler Date: Mon, 8 Oct 2012 12:17:08 -0400 Message-ID: To: FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnBsbR5BYdqjUYL9cz9fesooBQZzaDJMG8R+KY7j43Rth0wXNA0MQVf7jHMh7w5I0FKX3Xs Subject: -lpthread vs -pthread: does -D_REENTRANT matter? 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: Mon, 08 Oct 2012 16:17:39 -0000 The only difference between -lpthread and -pthread that I could see is that the latter also sets -D_REENTRANT. However, I can't find any uses of _REENTRANT anywhere outside of a few utilities that seem to define it manually. Testing with various manually written pthread programs resulted in identical binaries, let alone identical results. Is there an actual difference between -pthread and -lpthread or is this just a historical artifact? -- Eitan Adler