Subject: standards/19930: _POSIX_THREADS defined in wrong header and has wrong value
To: None <gnats-bugs@gnats.netbsd.org>
From: Nick Hudson <skrll@netbsd.org>
List: netbsd-bugs
Date: 01/19/2003 14:12:45
>Number:         19930
>Category:       standards
>Synopsis:       _POSIX_THREADS defined in wrong header and has wrong value
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 19 06:18:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Nick Hudson
>Release:        NetBSD 1.6M
>Organization:
	None
>Environment:
System: NetBSD btcl045611 1.6M NetBSD 1.6M (TECRA8100) #0: Sun Jan 19 09:36:02 UTC 2003 nick@btcl045611:/home/nick/work/netbsd/nathanw_sa/src/sys/arch/i386/compile/TECRA8100 i386
Architecture: i386
Machine: i386
>Description:
	_POSIX_THREADS and other _POSIX_* defines should be visible on the inclusion
	of unistd.h according to SUSv3. Also, SUSv3 says the value should be 0, -1, or
	200112L. Not sure which should be used.
>How-To-Repeat:
	Source inspection
>Fix:
Index: lib/libpthread/pthread.h
===================================================================
RCS file: /cvsroot/src/lib/libpthread/pthread.h,v
retrieving revision 1.1.2.21
diff -c -r1.1.2.21 pthread.h
*** lib/libpthread/pthread.h	2003/01/16 03:35:44	1.1.2.21
--- lib/libpthread/pthread.h	2003/01/19 14:11:40
***************
*** 172,179 ****
   */
  #define PTHREAD_CANCELED	((void *) 1)
  
- #define	_POSIX_THREADS
- 
  #define PTHREAD_DESTRUCTOR_ITERATIONS	4	/* Min. required */
  #define PTHREAD_KEYS_MAX	256
  #define PTHREAD_STACK_MIN	4096 /* XXX Pulled out of my butt */
--- 172,177 ----
Index: sys/sys/unistd.h
===================================================================
RCS file: /cvsroot/src/sys/sys/unistd.h,v
retrieving revision 1.21
diff -c -r1.21 unistd.h
*** sys/sys/unistd.h	2002/12/19 23:31:57	1.21
--- sys/sys/unistd.h	2003/01/19 14:11:40
***************
*** 85,91 ****
  #define	_POSIX_MEMORY_PROTECTION 1
  				/* monotonic clock */
  #define	_POSIX_MONOTONIC_CLOCK	200112L
! 
  
  /* access function */
  #define	F_OK		0	/* test for existence of file */
--- 85,100 ----
  #define	_POSIX_MEMORY_PROTECTION 1
  				/* monotonic clock */
  #define	_POSIX_MONOTONIC_CLOCK	200112L
! 				/* threads */
! #define	_POSIX_THREADS		200112L
! 				/* barriers */
! #define	_POSIX_BARRIERS		200112L
! 				/* timers */
! #define	_POSIX_TIMERS		200112L
! 				/* spin locks */
! #define	_POSIX_SPIN_LOCKS	200112L
! 				/* reader/writer locks */
! #define	_POSIX_READER_WRITER_LOCKS	200112L
  
  /* access function */
  #define	F_OK		0	/* test for existence of file */
>Release-Note:
>Audit-Trail:
>Unformatted: