From b63e40988fde13ccd11dea845bd9008c56b21cdb Mon Sep 17 00:00:00 2001 From: bje Date: Sat, 12 Sep 1998 07:59:34 +0000 Subject: 1998-09-12 Ben Elliston * {most}.c: Include 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. --- ChangeLog | 10 ++++++++++ Makefile | 2 +- attr.c | 4 +++- cancel.c | 2 ++ cleanup.c | 4 +++- condvar.c | 2 ++ config.h | 4 ++-- create.c | 2 ++ fork.c | 3 +++ misc.c | 2 ++ mutex.c | 2 ++ private.c | 2 ++ sched.c | 4 ++++ signal.c | 6 ++++++ sync.c | 2 ++ tsd.c | 2 ++ 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 + + * {most}.c: Include 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 * 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 +#include + #include "pthread.h" #include "implement.h" -#include 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 + #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 + #include #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 + #include #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 + #include #include #include 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 + #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 + #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 + #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 + #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 + #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 + /* 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 + #include "pthread.h" #include "implement.h" -- cgit v1.2.3