From owner-freebsd-standards@FreeBSD.ORG Sun Jun 20 08:52:25 2010 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CA9106566B for ; Sun, 20 Jun 2010 08:52:24 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id AF0D68FC1A for ; Sun, 20 Jun 2010 08:52:24 +0000 (UTC) Received: by qyk11 with SMTP id 11so1042207qyk.13 for ; Sun, 20 Jun 2010 01:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=WDRiAdsK26ptOu2tDbkVyCWG3ElYcex2825BOLsL0XI=; b=ZStHYAuBudy15kMmL/dPKkn3UwK9TMl8wSeeyl3HlnnSrqcxkXUUxek7/PYUDKx8ik +fJ/1z+Y6NGF5D4sRPFZTQ7REOCyXmPODqhzWH1GG/sWYQBdTbWrF90t7dAbJJo87Fgn piRmwac2q0kpDVAbKHQBh1CFQYChv4eDCiOlw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=RhTLFZ/d7vDtaTmxtpSdrbWGllBwL17atLhpuKgEFgC+gpPzQ3xQknC9j/vacjODm7 YaD8lmuLOI4dBneyPEIxdKqmx40YPj0a2LRavLGT/2auAPxuP3st68xRp7YSF0BAQh19 +RaaFB8wqTI1j59P3usw+k9gMTwvRlUWLaelQ= MIME-Version: 1.0 Received: by 10.224.64.76 with SMTP id d12mr2241116qai.208.1277023942265; Sun, 20 Jun 2010 01:52:22 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Sun, 20 Jun 2010 01:52:22 -0700 (PDT) Date: Sun, 20 Jun 2010 01:52:22 -0700 Message-ID: From: Garrett Cooper To: standards@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Question over POSIX compliancy of pthread_once_t X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 08:52:25 -0000 PTHREAD_ONCE_INIT / pthread_once_t isn't tersely defined according to pthread(3) or sys/types.h at on the opengroup pages [1, 2, 3] FreeBSD defines it as follows: /usr/include/pthread.h:#define PTHREAD_ONCE_INIT { PTHREAD_NEEDS_INIT, NULL } /* ... */ /* * Once definitions. */ struct pthread_once { int state; pthread_mutex_t mutex; }; glibc-2.7 has PTHREAD_ONCE_INIT defined differently [4]: 208 /* Single execution handling. */ 209 #define PTHREAD_ONCE_INIT 0 I can't determine which one is semantically correct. Thanks, -Garrett 1. http://www.opengroup.org/onlinepubs/000095399/basedefs/pthread.h.html 2. http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html 3. http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html 4. http://fxr.watson.org/fxr/source/nptl/sysdeps/pthread/pthread.h?v=GLIBC27#L209 PS I found a workaround for this issue at compile-time and run-time in the test, but I found this to be an odd delta.