aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Evans <jasone@FreeBSD.org>1999-12-16 21:53:39 +0000
committerJason Evans <jasone@FreeBSD.org>1999-12-16 21:53:39 +0000
commit346b6c5db8529e329f3ab4e161a75d8a3ddefdef (patch)
treeedcd9f0c34c7f500bac532c758a8b7eab4ca4635
parent968b1a711df2de027e91da8751082b2a55406f81 (diff)
downloadsrc-346b6c5db8529e329f3ab4e161a75d8a3ddefdef.tar.gz
src-346b6c5db8529e329f3ab4e161a75d8a3ddefdef.zip
Move POSIX feature constants from pthread.h to unistd.h, as required by
1003.1c-1995. Undefine _POSIX_THREAD_SAFE_FUNCTIONS, since we do not implement all of the necessary interfaces. At least getgrgid_r(), getrnam_r(), getpwuid_r(), getpwnam_r(), getc_unlocked(), getchar_unlocked(), putc_unlocked(), and putchar_unlocked() are missing. Due to a likely typo in 1003.1c-1995, we are not technically allowed to define _POSIX_THREADS without defining _POSIX_THREAD_SAFE_FUNCTIONS, but either way we're non-compliant, so I'm leaving _POSIX_THREADS defined. PR: bin/8281
Notes
Notes: svn path=/head/; revision=54699
-rw-r--r--include/pthread.h17
-rw-r--r--sys/sys/unistd.h24
2 files changed, 24 insertions, 17 deletions
diff --git a/include/pthread.h b/include/pthread.h
index f4c8220f1d18..f67720dada29 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -54,21 +54,6 @@
#define PTHREAD_THREADS_MAX ULONG_MAX
/*
- * Compile time symbolic constants for portability specifications:
- *
- * Note that those commented out are not currently supported by the
- * implementation.
- */
-#define _POSIX_THREADS
-#define _POSIX_THREAD_ATTR_STACKADDR
-#define _POSIX_THREAD_ATTR_STACKSIZE
-#define _POSIX_THREAD_PRIORITY_SCHEDULING
-#define _POSIX_THREAD_PRIO_INHERIT
-#define _POSIX_THREAD_PRIO_PROTECT
-/* #define _POSIX_THREAD_PROCESS_SHARED */
-#define _POSIX_THREAD_SAFE_FUNCTIONS
-
-/*
* Flags for threads and thread attributes.
*/
#define PTHREAD_DETACHED 0x1
@@ -174,10 +159,8 @@ struct pthread_once {
#endif
#define PTHREAD_PRIO_NONE 0
-#ifdef _POSIX_THREAD_PRIO_PROTECT
#define PTHREAD_PRIO_INHERIT 1
#define PTHREAD_PRIO_PROTECT 2
-#endif
/*
* Mutex types (Single UNIX Specification, Version 2, 1997).
diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h
index 7503cddf2574..5776bc5425a0 100644
--- a/sys/sys/unistd.h
+++ b/sys/sys/unistd.h
@@ -62,6 +62,30 @@
/* may disable terminal special characters */
#define _POSIX_VDISABLE 0xff
+/*
+ * Threads features:
+ *
+ * Note that those commented out are not currently supported by the
+ * implementation.
+ */
+#define _POSIX_THREADS
+#define _POSIX_THREAD_ATTR_STACKADDR
+#define _POSIX_THREAD_ATTR_STACKSIZE
+#define _POSIX_THREAD_PRIORITY_SCHEDULING
+#define _POSIX_THREAD_PRIO_INHERIT
+#define _POSIX_THREAD_PRIO_PROTECT
+/* #define _POSIX_THREAD_PROCESS_SHARED */
+/*
+ * 1003.1c-1995 says on page 38 (2.9.3, paragraph 3) that if _POSIX_THREADS is
+ * defined, then _POSIX_THREAD_SAFE_FUNCTIONS must also be defined. (This is
+ * likely a typo (reversed dependency), in which case we would be compliant if
+ * the typo were officially acknowledged.) However, we do not support all of
+ * the required _r() interfaces, which means we cannot legitimately define
+ * _POSIX_THREAD_SAFE_FUNCTIONS. Therefore, we are non-compliant here in two
+ * ways.
+ */
+/* #define _POSIX_THREAD_SAFE_FUNCTIONS */
+
/* access function */
#define F_OK 0 /* test for existence of file */
#define X_OK 0x01 /* test for execute or search permission */