summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorpeter <peter@openbsd.org>1998-07-21 19:47:51 +0000
committerpeter <peter@openbsd.org>1998-07-21 19:47:51 +0000
commit93b473297fa69d95dbfa87ca874a58d76c732290 (patch)
tree25cdb5cb5b71bff04b2c34b3c33be0e45bccda11 /lib/libpthread
parentsync (diff)
downloadwireguard-openbsd-93b473297fa69d95dbfa87ca874a58d76c732290.tar.xz
wireguard-openbsd-93b473297fa69d95dbfa87ca874a58d76c732290.zip
this will now compile on i386 if you move arch/i386/machdep.h to
arch/i386/pthread/machdep.h - not an ideal solution. Correct fix is welcome. I am quiting work on this for today, so other hackers are welcome to take it up for the rest of the day/night. More from me tomorrow.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/Makefile18
-rw-r--r--lib/libpthread/gen/ctime.c1
-rw-r--r--lib/libpthread/gen/ttyname.c2
-rw-r--r--lib/libpthread/pthreads/Makefile.inc17
-rw-r--r--lib/libpthread/pthreads/fd.c3
-rw-r--r--lib/libpthread/pthreads/fd_kern.c4
-rw-r--r--lib/libpthread/pthreads/signal.c3
-rw-r--r--lib/libpthread/stdio/xprintf.c14
-rw-r--r--lib/libpthread/stdlib/getopt.c1
-rw-r--r--lib/libpthread/tests/Makefile10
10 files changed, 33 insertions, 40 deletions
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile
index 866c4456a5c..6bd1d145d68 100644
--- a/lib/libpthread/Makefile
+++ b/lib/libpthread/Makefile
@@ -5,16 +5,16 @@
.include <bsd.own.mk>
LIB=pthread
-NOPIC= no
-CPPFLAGS+= -I. -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE_ARCH}
+NOPIC=no
+CPPFLAGS+=-DPTHREAD_KERNEL -I. -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE_ARCH}
+.include "${.CURDIR}/include/Makefile.inc"
.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc"
-#.include "${.CURDIR}/pthreads/Makefile.inc"
-#.include "${.CURDIR}/stdlib/Makefile.inc"
-#.include "${.CURDIR}/stdio/Makefile.inc"
-#.include "${.CURDIR}/string/Makefile.inc"
-#.include "${.CURDIR}/gen/Makefile.inc"
-#.include "${.CURDIR}/net/Makefile.inc"
-#.include "${.CURDIR}/scripts/Makefile.inc"
+.include "${.CURDIR}/pthreads/Makefile.inc"
+.include "${.CURDIR}/stdlib/Makefile.inc"
+.include "${.CURDIR}/stdio/Makefile.inc"
+.include "${.CURDIR}/string/Makefile.inc"
+.include "${.CURDIR}/gen/Makefile.inc"
+.include "${.CURDIR}/net/Makefile.inc"
.include <bsd.lib.mk>
diff --git a/lib/libpthread/gen/ctime.c b/lib/libpthread/gen/ctime.c
index e7980296e50..c496e9dfb23 100644
--- a/lib/libpthread/gen/ctime.c
+++ b/lib/libpthread/gen/ctime.c
@@ -46,7 +46,6 @@ static char sccsid[] = "@(#)ctime.c 5.26 (Berkeley) 2/23/91";
*/
/*LINTLIBRARY*/
-#include "config.h"
#include <pthread.h>
#include <sys/param.h>
#include <fcntl.h>
diff --git a/lib/libpthread/gen/ttyname.c b/lib/libpthread/gen/ttyname.c
index 0998cad1f78..0fe6abe4386 100644
--- a/lib/libpthread/gen/ttyname.c
+++ b/lib/libpthread/gen/ttyname.c
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)ttyname.c 5.10 (Berkeley) 5/6/91";
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
-#include "config.h"
+#include <sys/__path.h>
static pthread_mutex_t ttyname_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_key_t ttyname_key;
diff --git a/lib/libpthread/pthreads/Makefile.inc b/lib/libpthread/pthreads/Makefile.inc
index 98ac0b520cc..4e3f7d41df6 100644
--- a/lib/libpthread/pthreads/Makefile.inc
+++ b/lib/libpthread/pthreads/Makefile.inc
@@ -11,28 +11,33 @@ SRCS+= cleanup.c cond.c fd.c fd_kern.c fd_pipe.c file.c globals.c malloc.c \
OBJS+= syscalls.o
+AVAILABLE_SYSCALLS = open write read creat close fcntl lseek dup pipe fchmod fchown execve fstat lstat link unlink chdir chown chmod stat rename ioctl fstatfs sigsuspend sigaction sigprocmask getdents waitsys poll putmsg getmsg pgrpsys exit readv writev fork
+
+SYSCALL_TEMPLATE = ${.CURDIR}/arch/${MACHINE}/syscall-template.S
+SYSCALL_S = ${.CURDIR}/arch/${MACHINE}/syscall.S
+
.if !defined(NOPIC)
SOBJS+= syscalls.so
-SYSCALL_PIC_COMPILE= $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -DPIC -c ${.CURDIR}/syscall-template.S -o ${.OBJDIR}/syscalls/S$$syscall.so
+SYSCALL_PIC_COMPILE= $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -DPIC -c ${SYSCALL_TEMPLATE} -o ${.OBJDIR}/syscalls/S$$syscall.so
.else
SYSCALL_PIC_COMPILE= true
.endif
.if !defined(NOPROFILE)
POBJS+= syscalls.po
-SYSCALL_PROF_COMPILE= $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -pg -c ${.CURDIR}/syscall-template.S -o ${.OBJDIR}/syscalls/S$$syscall.po
+SYSCALL_PROF_COMPILE= $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -pg -c ${SYSCALL_TEMPLATE} -o ${.OBJDIR}/syscalls/S$$syscall.po
.else
SYSCALL_PROF_COMPILE= true
.endif
-syscalls.o syscalls.so syscalls.po : syscall-template.S
+syscalls.o syscalls.so syscalls.po : ${SYSCALL_TEMPLATE}
-rm -rf ${.OBJDIR}/syscalls
mkdir ${.OBJDIR}/syscalls
for syscall in $(AVAILABLE_SYSCALLS) ; do \
case " $(SYSCALL_EXCEPTIONS) " in \
*" "$$syscall" "*) ;; \
*) echo $$syscall ; \
- $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -c ${.CURDIR}/syscall-template.S -o ${.OBJDIR}/syscalls/S$$syscall.o ; \
+ $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -c ${SYSCALL_TEMPLATE} -o ${.OBJDIR}/syscalls/S$$syscall.o ; \
$(SYSCALL_PIC_COMPILE) ; \
$(SYSCALL_PROF_COMPILE) ;; \
esac ; \
@@ -48,13 +53,13 @@ syscalls.o syscalls.so syscalls.po : syscall-template.S
rm -r ${.OBJDIR}/syscalls
syscall.o: syscall.S
- cpp ${CPPFLAGS} ${.CURDIR}/syscall.S > syscall.i
+ cpp ${CPPFLAGS} ${SYSCALL_S} > syscall.i
as syscall.i
rm syscall.i
mv a.out syscall.o
syscall.po: syscall.S
- cpp ${CPPFLAGS} ${.CURDIR}/syscall.S > syscall.i
+ cpp ${CPPFLAGS} ${SYSCALL_S} > syscall.i
as syscall.i
rm syscall.i
mv a.out syscall.po
diff --git a/lib/libpthread/pthreads/fd.c b/lib/libpthread/pthreads/fd.c
index b7bf501dbab..e603c0da0f9 100644
--- a/lib/libpthread/pthreads/fd.c
+++ b/lib/libpthread/pthreads/fd.c
@@ -39,7 +39,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: fd.c,v 1.1.1.2 1998/07/21 13:19:53 peter Exp $";
+static const char rcsid[] = "$Id: fd.c,v 1.2 1998/07/21 19:48:00 peter Exp $";
#endif
#include <pthread.h>
@@ -49,7 +49,6 @@ static const char rcsid[] = "$Id: fd.c,v 1.1.1.2 1998/07/21 13:19:53 peter Exp $
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/ioctl.h>
-#include "config.h"
#ifdef HAVE_SYS_FILIO_H
#include <sys/filio.h> /* For ioctl */
#endif
diff --git a/lib/libpthread/pthreads/fd_kern.c b/lib/libpthread/pthreads/fd_kern.c
index 42489569ab7..be2fc5ec90f 100644
--- a/lib/libpthread/pthreads/fd_kern.c
+++ b/lib/libpthread/pthreads/fd_kern.c
@@ -39,7 +39,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: fd_kern.c,v 1.1.1.2 1998/07/21 13:19:55 peter Exp $";
+static const char rcsid[] = "$Id: fd_kern.c,v 1.2 1998/07/21 19:48:02 peter Exp $";
#endif
#include <pthread.h>
@@ -57,8 +57,6 @@ static const char rcsid[] = "$Id: fd_kern.c,v 1.1.1.2 1998/07/21 13:19:55 peter
#include <pthread/posix.h>
#include <string.h>
-#include "config.h"
-
#if defined (HAVE_SYSCALL_SENDTO) && !defined (HAVE_SYSCALL_SEND)
pthread_ssize_t machdep_sys_send (int fd, const void *msg, size_t len,
diff --git a/lib/libpthread/pthreads/signal.c b/lib/libpthread/pthreads/signal.c
index 9f96607b4e7..b96bee7e38f 100644
--- a/lib/libpthread/pthreads/signal.c
+++ b/lib/libpthread/pthreads/signal.c
@@ -36,12 +36,11 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: signal.c,v 1.1.1.2 1998/07/21 13:20:22 peter Exp $";
+static const char rcsid[] = "$Id: signal.c,v 1.2 1998/07/21 19:48:04 peter Exp $";
#endif
#include <pthread.h>
#include <signal.h>
-#include <config.h>
/* This will force init.o to get dragged in; if you've got support for
C++ initialization, that'll cause pthread_init to be called at
diff --git a/lib/libpthread/stdio/xprintf.c b/lib/libpthread/stdio/xprintf.c
index cbf2d997cd0..9617ddcaec0 100644
--- a/lib/libpthread/stdio/xprintf.c
+++ b/lib/libpthread/stdio/xprintf.c
@@ -6,8 +6,8 @@
*/
/*
** NAME: $Source: /home/cvs/src/lib/libpthread/stdio/Attic/xprintf.c,v $
-** VERSION: $Revision: 1.1.1.1 $
-** DATE: $Date: 1998/07/21 13:22:19 $
+** VERSION: $Revision: 1.2 $
+** DATE: $Date: 1998/07/21 19:48:06 $
**
** ONELINER: A replacement for formatted printing programs.
**
@@ -725,7 +725,7 @@ int sprintf(char *buf, const char *fmt, ...){
rc = vxprintf(sout,&arg,fmt,ap);
va_end(ap);
}
-int vsprintf(char *buf,const char *fmt,va_list ap){
+int vsprintf(char *buf,const char *fmt,pthread_va_list ap){
struct s_strargument arg;
arg.next = buf;
arg.last = 0;
@@ -744,7 +744,7 @@ int snprintf(char *buf, size_t n, const char *fmt, ...){
rc = vxprintf(sout,&arg,fmt,ap);
va_end(ap);
}
-int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap){
+int vsnprintf(char *buf, size_t n, const char *fmt, pthread_va_list ap){
struct s_strargument arg;
arg.next = buf;
arg.last = &buf[n-1];
@@ -825,7 +825,7 @@ char *mprintf(const char *zFormat, ...){
** The name is changed to TclVMPrintf() to conform with Tcl naming
** conventions.
*/
-char *vmprintf(const char *zFormat,va_list ap){
+char *vmprintf(const char *zFormat,pthread_va_list ap){
struct sgMprintf sMprintf;
char zBuf[200];
sMprintf.nChar = 0;
@@ -866,7 +866,7 @@ int fprintf(FILE *pOut, const char *zFormat, ...){
va_end(ap);
return retc;
}
-int vfprintf(FILE *pOut, const char *zFormat, va_list ap){
+int vfprintf(FILE *pOut, const char *zFormat, pthread_va_list ap){
return vxprintf(fout,pOut,zFormat,ap);
}
int printf(const char *zFormat, ...){
@@ -878,6 +878,6 @@ int printf(const char *zFormat, ...){
va_end(ap);
return retc;
}
-int vprintf(const char *zFormat, va_list ap){
+int vprintf(const char *zFormat, pthread_va_list ap){
return vxprintf(fout,stdout,zFormat,ap);
}
diff --git a/lib/libpthread/stdlib/getopt.c b/lib/libpthread/stdlib/getopt.c
index 88164ef34a1..20d2e7b8ea3 100644
--- a/lib/libpthread/stdlib/getopt.c
+++ b/lib/libpthread/stdlib/getopt.c
@@ -39,7 +39,6 @@ static char sccsid[] = "@(#)getopt.c 4.13 (Berkeley) 2/23/91";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <config.h>
/*
* get option letter from argument vector
diff --git a/lib/libpthread/tests/Makefile b/lib/libpthread/tests/Makefile
index 5ba9f9a3927..626cc39e93f 100644
--- a/lib/libpthread/tests/Makefile
+++ b/lib/libpthread/tests/Makefile
@@ -8,17 +8,11 @@
# -Initial cut for pthreads.
#
-CC = ../pgcc -notinstalled
-CPP = gcc -E
-srctop = /dr1/my/masters/mysql/mit-pthreads
-srcdir = /dr1/my/masters/mysql/mit-pthreads/tests
-VPATH = /dr1/my/masters/mysql/mit-pthreads/tests
CDEBUGFLAGS = -g -O2 -Werror
-INCLUDES= -I../include -I.. -I$(srctop)/include
+INCLUDES= -I../arch/${MACHINE} -I../include -I.. -I$(srctop)/include
CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(ADDL_CFLAGS) -DSRCDIR=\"$(srcdir)\"
-LIBS = -lm -lgcc -L../obj/ -lpthread
-#LIBS = -static
+LIBS = -static -lm -lgcc -L../obj.${MACHINE}/ -lpthread
# This list used to include test_select, but that test doesn't terminate.
TESTS = test_create test_pthread_join test_switch test_sleep test_readdir \