summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbje <bje>1998-09-12 07:59:34 +0000
committerbje <bje>1998-09-12 07:59:34 +0000
commitb63e40988fde13ccd11dea845bd9008c56b21cdb (patch)
treee2db70ba088ec35c71c59781551775c4847ac0f0
parentbebf4fe4f6ae3d8296a6b9144876d08e5de2261a (diff)
1998-09-12 Ben Elliston <bje@cygnus.com>
* {most}.c: Include <errno.h> to get POSIX error values. * signal.c (pthread_sigmask): Only provide if HAVE_SIGSET_T is defined. * config.h: #undef features, don't #define them. This will be generated by autoconf very soon.
-rw-r--r--ChangeLog10
-rw-r--r--Makefile2
-rw-r--r--attr.c4
-rw-r--r--cancel.c2
-rw-r--r--cleanup.c4
-rw-r--r--condvar.c2
-rw-r--r--config.h4
-rw-r--r--create.c2
-rw-r--r--fork.c3
-rw-r--r--misc.c2
-rw-r--r--mutex.c2
-rw-r--r--private.c2
-rw-r--r--sched.c4
-rw-r--r--signal.c6
-rw-r--r--sync.c2
-rw-r--r--tsd.c2
16 files changed, 48 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 633a2ca..918b3b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+1998-09-12 Ben Elliston <bje@cygnus.com>
+
+ * {most}.c: Include <errno.h> to get POSIX error values.
+
+ * signal.c (pthread_sigmask): Only provide if HAVE_SIGSET_T is
+ defined.
+
+ * config.h: #undef features, don't #define them. This will be
+ generated by autoconf very soon.
+
1998-08-11 Ben Elliston <bje@cygnus.com>
* Makefile (LIB): Define.
diff --git a/Makefile b/Makefile
index d67612a..dd2e1cc 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ CFLAGS = -I. -DHAVE_CONFIG_H -Wall
OBJS = attr.o cancel.o cleanup.o condvar.o create.o dll.o \
exit.o fork.o global.o misc.o mutex.o private.o sched.o \
- signal.o sync.o tsd.o windows.o
+ signal.o sync.o tsd.o
INCL = implement.h pthread.h windows.h
diff --git a/attr.c b/attr.c
index 72b5011..999935f 100644
--- a/attr.c
+++ b/attr.c
@@ -5,9 +5,11 @@
* This translation unit implements operations on thread attribute objects.
*/
+#include <errno.h>
+#include <string.h>
+
#include "pthread.h"
#include "implement.h"
-#include <string.h>
static int
is_attr(const pthread_attr_t *attr)
diff --git a/cancel.c b/cancel.c
index e79ee08..28d2cbc 100644
--- a/cancel.c
+++ b/cancel.c
@@ -5,6 +5,8 @@
* POSIX thread functions related to thread cancellation.
*/
+#include <errno.h>
+
#include "pthread.h"
#include "implement.h"
diff --git a/cleanup.c b/cleanup.c
index 472b7c6..7a7ea4e 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -6,6 +6,8 @@
* threads.
*/
+#include <errno.h>
+
#include <malloc.h>
#include "pthread.h"
#include "implement.h"
@@ -29,7 +31,7 @@ _pthread_handler_push(int stack,
if (new_thread == NULL)
{
- return ENOMEM;
+ return 0; /* NOMEM */
}
new_thread->routine = routine;
diff --git a/condvar.c b/condvar.c
index dc98ec4..2615756 100644
--- a/condvar.c
+++ b/condvar.c
@@ -5,6 +5,8 @@
* This translation unit implements condition variables and their primitives.
*/
+#include <errno.h>
+
#include <windows.h>
#include "pthread.h"
diff --git a/config.h b/config.h
index a3b0201..c502d2c 100644
--- a/config.h
+++ b/config.h
@@ -1,2 +1,2 @@
-#define HAVE_SIGNAL_H
-#define HAVE_SIGSET_T
+#undef HAVE_SIGNAL_H
+#undef HAVE_SIGSET_T
diff --git a/create.c b/create.c
index b350b74..0afa31f 100644
--- a/create.c
+++ b/create.c
@@ -6,6 +6,8 @@
* thread.
*/
+#include <errno.h>
+
#include <windows.h>
#include <process.h>
#include <string.h>
diff --git a/fork.c b/fork.c
index 3379e41..3a25c48 100644
--- a/fork.c
+++ b/fork.c
@@ -5,6 +5,9 @@
* Implementation of fork() for POSIX threads.
*/
+/* FIXME! */
+#define ENOMEM 0
+
#include "pthread.h"
#include "implement.h"
diff --git a/misc.c b/misc.c
index 086521e..2408af1 100644
--- a/misc.c
+++ b/misc.c
@@ -5,6 +5,8 @@
* This translation unit implements miscellaneous thread functions.
*/
+#include <errno.h>
+
#include "pthread.h"
int
diff --git a/mutex.c b/mutex.c
index 2f51144..d53c356 100644
--- a/mutex.c
+++ b/mutex.c
@@ -5,6 +5,8 @@
* This translation unit implements mutual exclusion (mutex) primitives.
*/
+#include <errno.h>
+
#include "pthread.h"
#include "implement.h"
diff --git a/private.c b/private.c
index 444086d..e3fac58 100644
--- a/private.c
+++ b/private.c
@@ -6,6 +6,8 @@
* the implementation and may be used throughout it.
*/
+#include <errno.h>
+
#include "pthread.h"
#include "implement.h"
diff --git a/sched.c b/sched.c
index 7153881..e3c3ae7 100644
--- a/sched.c
+++ b/sched.c
@@ -5,6 +5,10 @@
* POSIX thread functions that deal with thread scheduling.
*/
+#define ENOSUP 0
+
+#include <errno.h>
+
#include "pthread.h"
#include "implement.h"
diff --git a/signal.c b/signal.c
index 6fb9de0..30189d9 100644
--- a/signal.c
+++ b/signal.c
@@ -5,9 +5,13 @@
* POSIX thread-aware signal functions.
*/
+#include <errno.h>
+
#include "pthread.h"
#include "implement.h"
+#ifdef HAVE_SIGSET_T
+
int
pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
{
@@ -70,3 +74,5 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
return 0;
}
+
+#endif /* HAVE_SIGSET_T */
diff --git a/sync.c b/sync.c
index 87d5a30..b2b8323 100644
--- a/sync.c
+++ b/sync.c
@@ -6,6 +6,8 @@
* synchronisation.
*/
+#include <errno.h>
+
/* POSIX STANDARD: A thread may pass a value pointer to some data via
pthread_exit(). That pointer will be stored in a location supplied
as an argument to pthread_join().
diff --git a/tsd.c b/tsd.c
index 599ef73..02069a9 100644
--- a/tsd.c
+++ b/tsd.c
@@ -5,6 +5,8 @@
* POSIX thread functions which implement thread-specific data (TSD).
*/
+#include <errno.h>
+
#include "pthread.h"
#include "implement.h"