From owner-freebsd-current Thu Feb 17 7:12:10 2000 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id F08A937B758; Thu, 17 Feb 2000 07:12:05 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id CAA27623; Fri, 18 Feb 2000 02:15:11 +1100 Date: Fri, 18 Feb 2000 02:11:40 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Daniel Eischen Cc: Thimble Smith , current@FreeBSD.ORG, jasone@FreeBSD.ORG Subject: Re: pthread.h and unistd.h In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 17 Feb 2000, Daniel Eischen wrote: > On Thu, 17 Feb 2000, Thimble Smith wrote: > > > Hi. I recently updated from -stable to -current. I notice now that > > pthread.h relies on #defines that are in unistd.h; so in order to use > > pthread_attr_setscope you have to include unistd.h before pthread.h. > > > > Is this standard behaviour? I'm working with MySQL, and unistd.h is > > included after pthread.h; should I have that code changed, or should > > FreeBSD somehow compensate for this? > > I've read the POSIX spec, and it looks like pthread.h should include > unistd.h so that the #defines you refer to are properly defined. It can't include or even , at least in POSX.1-1996, because even the latter defines names that are not reserved for . E.g., defines SEEK_SET, but the only non-implementation reserved for are ones beginning with pthread_ or PTHREAD_, or ending with _t. However, including wouldn't add much to the existing namespace violation from including , , , and . > Solaris 2.5.1 pthread.h doesn't include directly, but does > include which includes . This seems to be a bug Solaris 2.5.1. Our avoids including by including to get more fundamental feature test macros for the visibility of the POSIX.1b extensions. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message