[311] in Pthreads mailing list archive
Patch for pthreads (NetBSD-1.1/i386).
daemon@ATHENA.MIT.EDU (Jesus M. Gonzalez)
Sun May 5 19:53:08 1996
Date: Mon, 6 May 1996 01:10:30 +0200
From: "Jesus M. Gonzalez" <jgb@gsyc.inf.uc3m.es>
To: Christopher Provenzano <proven@MIT.EDU>
Cc: pthreads@MIT.EDU
Since I've had some problems with my e-mail connectivity,
I resend this message which I sent to proven some time ago,
and he probably didn't got. I also add some comments
reflecting new info.
------------------------------------------
Hi!
I'm not sure if this message should be addressed to you
or to the mailing list, but since I had your address in my mbox...
Anyway. I've compiled pthreads-1_60_beta5 for NetBSD-1.1/i386.
With it I've been able of porting again gnat tasking to NetBSD.
This time the port is much better (at least it seems to run a lot
of test programs). I have to say that beta5 is a very good job.
I had been tinkering with beta4_1, and had some problems with gnat tasking...
Almost all of them went away with the new version.
BTW. Gnat was made to run with POSIX threads, but
development was done on top op FSU threads (on sunos-4.1).
Having it running on your threads says a lot about how standard
is the standard, and how mature is your implementation.
Gnat runs now in NetBSD on top of your unmodifed threads (with
only the trivial patch at the end of this message). Thanks for your
good job.
>>>>>>>>>>>>>>>>>>
Since then I've found some problems with gnat tasking.
I'm after it, trying to uncover the bugs. I'm still not sure if
they are related to gnat, to pthreads or (most probably) to my binding.
>>>>>>>>>>>>>>>>>>
Jesus.
PS. How do you prefer to name your threads? Provenzano's pthreads?
or MIT phtreads? Just to write it in the Gnat sources...
PPS: I had some questions from you pending since mid-95... Here
are the answers:
. Now there is a Web page for Gnat. It is http://www.gnat.com
. As long as I know, the other platform in which Gnat
runs with your threads is Linux. Sean McNeil did the job. He also
helped me a lot.
PPPS: The patches. They are just some new fields in FILE structure,
some new lines to Makefile.in and some files for netbsd-1.1 machdep
(most of them copies of netbsd-1.0a or netbsd-1.0). If you prefer a
context diff, just let me know.
>>>>>>>>>>>>>>>>>>>>>>>
It would be nice if somebody with NetBSD knowledge give this
patches a try, and see if they are the *best thing to do*....
>>>>>>>>>>>>>>>>>>>>>>>
diff -rc --new-file pthreads-1_60_beta5/config/configure pthreads-1_60_beta5.netbsd/config/configure
*** pthreads-1_60_beta5/config/configure Sat Mar 9 03:50:48 1996
--- pthreads-1_60_beta5.netbsd/config/configure Sun Apr 7 19:39:16 1996
***************
*** 1054,1060 ****
name=i386-bsdi-1.1
sysincludes=bsdi-1.1
;;
! i386-*-netbsd1.0A | i386-*-netbsd1.1*)
name=i386-netbsd-1.0
sysincludes=netbsd-1.0
syscall=i386-netbsd-1.0a
--- 1054,1066 ----
name=i386-bsdi-1.1
sysincludes=bsdi-1.1
;;
! i386-*-netbsd1.1*)
! name=i386-netbsd-1.1
! sysincludes=netbsd-1.1
! syscall=i386-netbsd-1.1
! except="fork lseek pipe sigsuspend sigprocmask"
! ;;
! i386-*-netbsd1.0A)
name=i386-netbsd-1.0
sysincludes=netbsd-1.0
syscall=i386-netbsd-1.0a
diff -rc --new-file pthreads-1_60_beta5/config/configure.in pthreads-1_60_beta5.netbsd/config/configure.in
*** pthreads-1_60_beta5/config/configure.in Sat Mar 9 03:51:01 1996
--- pthreads-1_60_beta5.netbsd/config/configure.in Sun Apr 7 19:31:57 1996
***************
*** 167,173 ****
name=i386-bsdi-1.1
sysincludes=bsdi-1.1
;;
! i386-*-netbsd1.0A | i386-*-netbsd1.1*)
name=i386-netbsd-1.0
sysincludes=netbsd-1.0
syscall=i386-netbsd-1.0a
--- 167,179 ----
name=i386-bsdi-1.1
sysincludes=bsdi-1.1
;;
! i386-*-netbsd1.1*)
! name=i386-netbsd-1.1
! sysincludes=netbsd-1.1
! syscall=i386-netbsd-1.1
! except="fork lseek pipe sigsuspend sigprocmask"
! ;;
! i386-*-netbsd1.0A)
name=i386-netbsd-1.0
sysincludes=netbsd-1.0
syscall=i386-netbsd-1.0a
diff -rc --new-file pthreads-1_60_beta5/include/stdio.h pthreads-1_60_beta5.netbsd/include/stdio.h
*** pthreads-1_60_beta5/include/stdio.h Wed Jun 14 09:15:56 1995
--- pthreads-1_60_beta5.netbsd/include/stdio.h Fri Apr 5 14:49:05 1996
***************
*** 97,102 ****
--- 97,110 ----
struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
int _lbfsize; /* 0 or -_bf._size, for inline putc */
+ #ifdef __NetBSD__
+ void *_cookie; /* cookie passed to io functions */
+ int (*_close) __P((void *));
+ int (*_read) __P((void *, char *, int));
+ fpos_t (*_seek) __P((void *, fpos_t, int));
+ int (*_write) __P((void *, const char *, int));
+ #endif /*__NetBSD__*/
+
/* separate buffer for long sequences of ungetc() */
struct __sbuf _ub; /* ungetc buffer */
unsigned char *_up; /* saved _p when _p is doing ungetc data */
***************
*** 111,117 ****
--- 119,129 ----
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
+ #ifdef __NetBSD__
+ fpos_t _offset;
+ #else
int _offset; /* current lseek offset */
+ #endif /* __NetBSD__ */
} FILE;
__BEGIN_DECLS
diff -rc --new-file pthreads-1_60_beta5/machdep/engine-i386-netbsd-1.1.c pthreads-1_60_beta5.netbsd/machdep/engine-i386-netbsd-1.1.c
*** pthreads-1_60_beta5/machdep/engine-i386-netbsd-1.1.c Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/engine-i386-netbsd-1.1.c Sun Apr 7 19:20:48 1996
***************
*** 0 ****
--- 1,218 ----
+ /* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Chris Provenzano.
+ * 4. The name of Chris Provenzano may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+ #ifndef lint
+ static const char rcsid[] = "engine-i386-netbsd-1.0.c,v 1.55.4.1 1995/12/13 05:42:07 proven Exp";
+ #endif
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include "pthread.h"
+
+ /* ==========================================================================
+ * machdep_save_state()
+ */
+ int machdep_save_state(void)
+ {
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+ }
+
+ /* ==========================================================================
+ * machdep_save_state()
+ */
+ int machdep_save_float_state(struct pthread * pthread)
+ {
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+ }
+
+ /* ==========================================================================
+ * machdep_restore_state()
+ */
+ void machdep_restore_state(void)
+ {
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+ }
+
+ /* ==========================================================================
+ * machdep_restore_float_state()
+ */
+ int machdep_restore_float_state(void)
+ {
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+ }
+
+ /* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+ void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+ {
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+ }
+
+ /* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+ void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+ {
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+ }
+
+ /* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+ void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+ {
+ return(machdep_pthread->machdep_stack);
+ }
+
+ /* ==========================================================================
+ * machdep_pthread_start()
+ */
+ void machdep_pthread_start(void)
+ {
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+ }
+
+ /* ==========================================================================
+ * __machdep_stack_free()
+ */
+ void __machdep_stack_free(void * stack)
+ {
+ free(stack);
+ }
+
+ /* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+ void * __machdep_stack_alloc(size_t size)
+ {
+ void * stack;
+
+ return(malloc(size));
+ }
+
+ /* ==========================================================================
+ * __machdep_pthread_create()
+ */
+ void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+ {
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+ }
+
+ /* ==========================================================================
+ * machdep_sys_creat()
+ */
+ machdep_sys_creat(char * path, int mode)
+ {
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+ }
+
+ /* ==========================================================================
+ * machdep_sys_wait3()
+ */
+ machdep_sys_wait3(int * b, int c, int * d)
+ {
+ return(machdep_sys_wait4(0, b, c, d));
+ }
+
+ /* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+ machdep_sys_waitpid(int a, int * b, int c)
+ {
+ return(machdep_sys_wait4(a, b, c, NULL));
+ }
+
+ /* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+ machdep_sys_getdtablesize()
+ {
+ return(sysconf(_SC_OPEN_MAX));
+ }
+
diff -rc --new-file pthreads-1_60_beta5/machdep/engine-i386-netbsd-1.1.h pthreads-1_60_beta5.netbsd/machdep/engine-i386-netbsd-1.1.h
*** pthreads-1_60_beta5/machdep/engine-i386-netbsd-1.1.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/engine-i386-netbsd-1.1.h Sun Apr 7 19:20:17 1996
***************
*** 0 ****
--- 1,97 ----
+ /* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * engine-i386-netbsd-1.0.h,v 1.53.4.1 1995/12/13 05:42:11 proven Exp
+ *
+ */
+
+ #include <unistd.h>
+ #include <setjmp.h>
+ #include <sys/time.h>
+
+ /*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+ #define SEMAPHORE_CLEAR 0
+ #define SEMAPHORE_SET 1
+
+ #define SEMAPHORE_TEST_AND_SET(lock) \
+ ({ \
+ long temp = SEMAPHORE_SET; \
+ \
+ __asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+ temp; \
+ })
+
+ #define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+ /*
+ * New types
+ */
+ typedef long semaphore;
+
+ /*
+ * sigset_t macros
+ */
+ #define SIG_ANY(sig) (sig)
+ #define SIGMAX 31
+
+ /*
+ * New Strutures
+ */
+ struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+ };
+
+ /*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+ #define MACHDEP_PTHREAD_INIT \
+ { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+ /*
+ * Minimum stack size
+ */
+ #define PTHREAD_STACK_MIN 1024
+
+ /*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+ #define __FD_NONBLOCK O_NONBLOCK
+
+ /*
+ * New functions
+ */
+
+ __BEGIN_DECLS
+
+ #if defined(PTHREAD_KERNEL)
+
+ #define __machdep_stack_get(x) (x)->machdep_stack
+ #define __machdep_stack_set(x, y) (x)->machdep_stack = y
+ #define __machdep_stack_repl(x, y) \
+ { \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+ }
+
+ void * __machdep_stack_alloc __P((size_t));
+ void __machdep_stack_free __P((void *));
+
+ int machdep_save_state __P((void));
+
+ #endif
+
+ __END_DECLS
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__math.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__math.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__math.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__math.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,6 ----
+ /*
+ * ANSI/POSIX
+ */
+ extern char __infinity[];
+ #define HUGE_VAL (*(double *) __infinity)
+
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__path.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__path.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__path.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__path.h Sun Apr 7 18:41:18 1996
***************
*** 0 ****
--- 1,14 ----
+ /*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * __path.h,v 1.1 1995/01/03 12:53:32 proven Exp
+ */
+
+ #ifndef _SYS__PATH_H_
+ #define _SYS__PATH_H_
+
+ #define _PATH_PTY "/dev/"
+ #define _PATH_TZDIR "/usr/share/zoneinfo"
+ #define _PATH_TZFILE "/etc/localtime"
+
+ #endif /* !_SYS__PATH_H_ */
+
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__signal.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__signal.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__signal.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__signal.h Sun Apr 7 18:41:18 1996
***************
*** 0 ****
--- 1,8 ----
+ #include <sys/signal.h>
+
+ #define __SIGEMPTYSET 0
+ #define __SIGFILLSET 0xffffffff
+ #define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
+ #define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
+ #define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
+
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__stdio.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__stdio.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__stdio.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__stdio.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,8 ----
+
+ #include <machine/ansi.h>
+ #ifdef _BSD_SIZE_T_
+ typedef _BSD_SIZE_T_ size_t;
+ #undef _BSD_SIZE_T_
+ #endif
+
+ typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__stdlib.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__stdlib.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__stdlib.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__stdlib.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,60 ----
+ /*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __stdlib.h,v 1.1 1995/01/03 12:53:34 proven Exp
+ */
+
+ #ifndef _SYS___STDLIB_H_
+ #define _SYS___STDLIB_H_
+
+ #include <machine/ansi.h>
+
+ #ifdef _BSD_SIZE_T_
+ typedef _BSD_SIZE_T_ size_t;
+ #undef _BSD_SIZE_T_
+ #endif
+
+ #ifdef _BSD_WCHAR_T_
+ typedef _BSD_WCHAR_T_ wchar_t;
+ #undef _BSD_WCHAR_T_
+ #endif
+
+ #ifndef __NORETURN
+ #define __NORETURN
+ #endif
+
+ #ifndef NULL
+ #define NULL 0
+ #endif
+
+ #endif /* _STDLIB_H_ */
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__string.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__string.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__string.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__string.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,20 ----
+
+ #include <machine/ansi.h>
+ #ifdef _BSD_SIZE_T_
+ typedef _BSD_SIZE_T_ size_t;
+ #undef _BSD_SIZE_T_
+ #endif
+
+ /* Non-standard NetBSD string routines. */
+ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+ __BEGIN_DECLS
+ int bcmp __P((const void *, const void *, size_t));
+ void bcopy __P((const void *, void *, size_t));
+ void bzero __P((void *, size_t));
+ char *index __P((const char *, int));
+ char *rindex __P((const char *, int));
+ char *strdup __P((const char *));
+ void strmode __P((int, char *));
+ char *strsep __P((char **, const char *));
+ __END_DECLS
+ #endif
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__time.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__time.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__time.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__time.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,69 ----
+ /*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * __time.h,v 1.1 1994/12/13 07:18:55 proven Exp
+ */
+
+ #ifndef _SYS__TIME_H_
+ #define _SYS__TIME_H_
+
+ #include <machine/ansi.h>
+
+ #ifdef _BSD_CLOCK_T_
+ typedef _BSD_CLOCK_T_ clock_t;
+ #undef _BSD_CLOCK_T_
+ #endif
+
+ #ifdef _BSD_TIME_T_
+ typedef _BSD_TIME_T_ time_t;
+ #undef _BSD_TIME_T_
+ #endif
+
+ #ifdef _BSD_SIZE_T_
+ typedef _BSD_SIZE_T_ size_t;
+ #undef _BSD_SIZE_T_
+ #endif
+
+ #define CLOCKS_PER_SEC 100
+
+ #if !defined(_ANSI_SOURCE)
+ #define CLK_TCK 100
+ #endif /* not ANSI */
+
+ #endif /* !_SYS__TIME_H_ */
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/__unistd.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__unistd.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/__unistd.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/__unistd.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,107 ----
+ /*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __unistd.h,v 1.1 1995/01/03 12:53:35 proven Exp
+ */
+
+ #ifndef _SYS___UNISTD_H_
+ #define _SYS___UNISTD_H_
+
+ #include <sys/types.h>
+
+ #ifndef NULL
+ #define NULL 0
+ #endif
+
+ /* compile-time symbolic constants */
+ #define _POSIX_JOB_CONTROL /* implementation supports job control */
+
+ #ifdef _NOT_AVAILABLE
+ #define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
+ #endif
+
+ #define _POSIX_VERSION 198808L
+ #define _POSIX2_VERSION 199212L
+
+ /* execution-time symbolic constants */
+ /* chown requires appropriate privileges */
+ #define _POSIX_CHOWN_RESTRICTED 1
+ /* too-long path components generate errors */
+ #define _POSIX_NO_TRUNC 1
+ /* may disable terminal special characters */
+ #define _POSIX_VDISABLE ((unsigned char)'\377')
+
+ /* configurable pathname variables */
+ #define _PC_LINK_MAX 1
+ #define _PC_MAX_CANON 2
+ #define _PC_MAX_INPUT 3
+ #define _PC_NAME_MAX 4
+ #define _PC_PATH_MAX 5
+ #define _PC_PIPE_BUF 6
+ #define _PC_CHOWN_RESTRICTED 7
+ #define _PC_NO_TRUNC 8
+ #define _PC_VDISABLE 9
+
+ /* configurable system variables */
+ #define _SC_ARG_MAX 1
+ #define _SC_CHILD_MAX 2
+ #define _SC_CLK_TCK 3
+ #define _SC_NGROUPS_MAX 4
+ #define _SC_OPEN_MAX 5
+ #define _SC_JOB_CONTROL 6
+ #define _SC_SAVED_IDS 7
+ #define _SC_VERSION 8
+ #define _SC_BC_BASE_MAX 9
+ #define _SC_BC_DIM_MAX 10
+ #define _SC_BC_SCALE_MAX 11
+ #define _SC_BC_STRING_MAX 12
+ #define _SC_COLL_WEIGHTS_MAX 13
+ #define _SC_EXPR_NEST_MAX 14
+ #define _SC_LINE_MAX 15
+ #define _SC_RE_DUP_MAX 16
+ #define _SC_2_VERSION 17
+ #define _SC_2_C_BIND 18
+ #define _SC_2_C_DEV 19
+ #define _SC_2_CHAR_TERM 20
+ #define _SC_2_FORT_DEV 21
+ #define _SC_2_FORT_RUN 22
+ #define _SC_2_LOCALEDEF 23
+ #define _SC_2_SW_DEV 24
+ #define _SC_2_UPE 25
+ #define _SC_STREAM_MAX 26
+ #define _SC_TZNAME_MAX 27
+
+ /* configurable system strings */
+ #define _CS_PATH 1
+
+ #endif
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/compat.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/compat.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/compat.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/compat.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,43 ----
+ /* ==== compat.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Chris Provenzano.
+ * 4. The name of Chris Provenzano may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * compat.h,v 1.50 1994/08/08 03:44:05 proven Exp
+ *
+ * Description : COmpat header to make socket code compile.
+ *
+ * 1.00 94/08/01 proven
+ * -Started coding this file.
+ */
+
+ #ifndef _SYS_COMPAT_H_
+ #define _SYS_COMPAT_H_
+
+ #endif
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/dirent.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/dirent.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/dirent.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/dirent.h Sun Apr 7 20:48:12 1996
***************
*** 0 ****
--- 1,83 ----
+ /* $NetBSD: dirent.h,v 1.9 1994/12/13 15:58:20 mycroft Exp $ */
+
+ /*-
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)dirent.h 8.3 (Berkeley) 8/10/94
+ */
+
+ /*
+ * The dirent structure defines the format of directory entries returned by
+ * the getdirentries(2) system call.
+ *
+ * A directory entry has a struct dirent at the front of it, containing its
+ * inode number, the length of the entry, and the length of the name
+ * contained in the entry. These are followed by the name padded to a 4
+ * byte boundary with null bytes. All names are guaranteed null terminated.
+ * The maximum length of a name in a directory is MAXNAMLEN.
+ */
+
+ struct dirent {
+ u_int32_t d_fileno; /* file number of entry */
+ u_int16_t d_reclen; /* length of this record */
+ u_int8_t d_type; /* file type, see below */
+ u_int8_t d_namlen; /* length of string in d_name */
+ #ifdef _POSIX_SOURCE
+ char d_name[255 + 1]; /* name must be no longer than this */
+ #else
+ #define MAXNAMLEN 255
+ char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
+ #endif
+ };
+
+ /* to be posix. Sources that use d_ino should really be using d_fileno */
+
+ #define d_ino d_fileno
+
+ /*
+ * File types
+ */
+ #define DT_UNKNOWN 0
+ #define DT_FIFO 1
+ #define DT_CHR 2
+ #define DT_DIR 4
+ #define DT_BLK 6
+ #define DT_REG 8
+ #define DT_LNK 10
+ #define DT_SOCK 12
+ #define DT_WHT 14
+
+ /*
+ * Convert between stat structure types and directory types.
+ */
+ #define IFTODT(mode) (((mode) & 0170000) >> 12)
+ #define DTTOIF(dirtype) ((dirtype) << 12)
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/errno.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/errno.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/errno.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/errno.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,160 ----
+ /* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
+
+ /*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ */
+
+ #ifndef _SYS_ERRNO_H_
+ #define _SYS_ERRNO_H_
+
+ #define EPERM 1 /* Operation not permitted */
+ #define ENOENT 2 /* No such file or directory */
+ #define ESRCH 3 /* No such process */
+ #define EINTR 4 /* Interrupted system call */
+ #define EIO 5 /* Input/output error */
+ #define ENXIO 6 /* Device not configured */
+ #define E2BIG 7 /* Argument list too long */
+ #define ENOEXEC 8 /* Exec format error */
+ #define EBADF 9 /* Bad file descriptor */
+ #define ECHILD 10 /* No child processes */
+ #define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+ #define ENOMEM 12 /* Cannot allocate memory */
+ #define EACCES 13 /* Permission denied */
+ #define EFAULT 14 /* Bad address */
+ #ifndef _POSIX_SOURCE
+ #define ENOTBLK 15 /* Block device required */
+ #endif
+ #define EBUSY 16 /* Device busy */
+ #define EEXIST 17 /* File exists */
+ #define EXDEV 18 /* Cross-device link */
+ #define ENODEV 19 /* Operation not supported by device */
+ #define ENOTDIR 20 /* Not a directory */
+ #define EISDIR 21 /* Is a directory */
+ #define EINVAL 22 /* Invalid argument */
+ #define ENFILE 23 /* Too many open files in system */
+ #define EMFILE 24 /* Too many open files */
+ #define ENOTTY 25 /* Inappropriate ioctl for device */
+ #ifndef _POSIX_SOURCE
+ #define ETXTBSY 26 /* Text file busy */
+ #endif
+ #define EFBIG 27 /* File too large */
+ #define ENOSPC 28 /* No space left on device */
+ #define ESPIPE 29 /* Illegal seek */
+ #define EROFS 30 /* Read-only file system */
+ #define EMLINK 31 /* Too many links */
+ #define EPIPE 32 /* Broken pipe */
+
+ /* math software */
+ #define EDOM 33 /* Numerical argument out of domain */
+ #define ERANGE 34 /* Result too large */
+
+ /* non-blocking and interrupt i/o */
+ #define EAGAIN 35 /* Resource temporarily unavailable */
+ #ifndef _POSIX_SOURCE
+ #define EWOULDBLOCK EAGAIN /* Operation would block */
+ #define EINPROGRESS 36 /* Operation now in progress */
+ #define EALREADY 37 /* Operation already in progress */
+
+ /* ipc/network software -- argument errors */
+ #define ENOTSOCK 38 /* Socket operation on non-socket */
+ #define EDESTADDRREQ 39 /* Destination address required */
+ #define EMSGSIZE 40 /* Message too long */
+ #define EPROTOTYPE 41 /* Protocol wrong type for socket */
+ #define ENOPROTOOPT 42 /* Protocol not available */
+ #define EPROTONOSUPPORT 43 /* Protocol not supported */
+ #define ESOCKTNOSUPPORT 44 /* Socket type not supported */
+ #define EOPNOTSUPP 45 /* Operation not supported */
+ #define EPFNOSUPPORT 46 /* Protocol family not supported */
+ #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
+ #define EADDRINUSE 48 /* Address already in use */
+ #define EADDRNOTAVAIL 49 /* Can't assign requested address */
+
+ /* ipc/network software -- operational errors */
+ #define ENETDOWN 50 /* Network is down */
+ #define ENETUNREACH 51 /* Network is unreachable */
+ #define ENETRESET 52 /* Network dropped connection on reset */
+ #define ECONNABORTED 53 /* Software caused connection abort */
+ #define ECONNRESET 54 /* Connection reset by peer */
+ #define ENOBUFS 55 /* No buffer space available */
+ #define EISCONN 56 /* Socket is already connected */
+ #define ENOTCONN 57 /* Socket is not connected */
+ #define ESHUTDOWN 58 /* Can't send after socket shutdown */
+ #define ETOOMANYREFS 59 /* Too many references: can't splice */
+ #define ETIMEDOUT 60 /* Operation timed out */
+ #define ECONNREFUSED 61 /* Connection refused */
+
+ #define ELOOP 62 /* Too many levels of symbolic links */
+ #endif /* _POSIX_SOURCE */
+ #define ENAMETOOLONG 63 /* File name too long */
+
+ /* should be rearranged */
+ #ifndef _POSIX_SOURCE
+ #define EHOSTDOWN 64 /* Host is down */
+ #define EHOSTUNREACH 65 /* No route to host */
+ #endif /* _POSIX_SOURCE */
+ #define ENOTEMPTY 66 /* Directory not empty */
+
+ /* quotas & mush */
+ #ifndef _POSIX_SOURCE
+ #define EPROCLIM 67 /* Too many processes */
+ #define EUSERS 68 /* Too many users */
+ #define EDQUOT 69 /* Disc quota exceeded */
+
+ /* Network File System */
+ #define ESTALE 70 /* Stale NFS file handle */
+ #define EREMOTE 71 /* Too many levels of remote in path */
+ #define EBADRPC 72 /* RPC struct is bad */
+ #define ERPCMISMATCH 73 /* RPC version wrong */
+ #define EPROGUNAVAIL 74 /* RPC prog. not avail */
+ #define EPROGMISMATCH 75 /* Program version wrong */
+ #define EPROCUNAVAIL 76 /* Bad procedure for program */
+ #endif /* _POSIX_SOURCE */
+
+ #define ENOLCK 77 /* No locks available */
+ #define ENOSYS 78 /* Function not implemented */
+
+ #ifndef _POSIX_SOURCE
+ #define EFTYPE 79 /* Inappropriate file type or format */
+ #define EAUTH 80 /* Authentication error */
+ #define ENEEDAUTH 81 /* Need authenticator */
+ #define ELAST 81 /* Must be equal largest errno */
+ #endif /* _POSIX_SOURCE */
+
+ #endif
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/time.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/time.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/time.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/time.h Sun Apr 7 20:52:17 1996
***************
*** 0 ****
--- 1,157 ----
+ /* $NetBSD: time.h,v 1.16 1995/06/15 23:08:11 cgd Exp $ */
+
+ /*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)time.h 8.2 (Berkeley) 7/10/94
+ */
+
+ #ifndef _SYS_TIME_H_
+ #define _SYS_TIME_H_
+
+ #include <sys/types.h>
+
+ /*
+ * Structure returned by gettimeofday(2) system call,
+ * and used in other calls.
+ */
+ struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+ };
+
+ /*
+ * Structure defined by POSIX.4 to be like a timeval.
+ */
+ struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* and nanoseconds */
+ };
+
+ /* NetBSD want ts_sec and ts_nsec for timespec */
+ #define ts_sec tv_sec
+ #define ts_nsec tv_nsec
+
+ #define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+ }
+ #define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+ }
+
+ struct timezone {
+ int tz_minuteswest; /* minutes west of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+ };
+ #define DST_NONE 0 /* not on dst */
+ #define DST_USA 1 /* USA style dst */
+ #define DST_AUST 2 /* Australian style dst */
+ #define DST_WET 3 /* Western European dst */
+ #define DST_MET 4 /* Middle European dst */
+ #define DST_EET 5 /* Eastern European dst */
+ #define DST_CAN 6 /* Canada */
+
+ /* Operations on timevals. */
+ #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+ #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+ #define timercmp(tvp, uvp, cmp) \
+ (((tvp)->tv_sec == (uvp)->tv_sec) ? \
+ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec))
+ #define timeradd(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
+ if ((vvp)->tv_usec >= 1000000) { \
+ (vvp)->tv_sec++; \
+ (vvp)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+ #define timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+
+ /*
+ * Names of the interval timers, and structure
+ * defining a timer setting.
+ */
+ #define ITIMER_REAL 0
+ #define ITIMER_VIRTUAL 1
+ #define ITIMER_PROF 2
+
+ struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+ };
+
+ /*
+ * Getkerninfo clock information structure
+ */
+ struct clockinfo {
+ int hz; /* clock frequency */
+ int tick; /* micro-seconds per hz tick */
+ int tickadj; /* clock skew rate for adjtime() */
+ int stathz; /* statistics clock frequency */
+ int profhz; /* profiling clock frequency */
+ };
+
+ #ifdef _KERNEL
+ int itimerfix __P((struct timeval *tv));
+ int itimerdecr __P((struct itimerval *itp, int usec));
+ void microtime __P((struct timeval *tv));
+ #else /* !_KERNEL */
+ #include <time.h>
+
+ #ifndef _POSIX_SOURCE
+ #include <sys/cdefs.h>
+
+ __BEGIN_DECLS
+ int adjtime __P((const struct timeval *, struct timeval *));
+ int getitimer __P((int, struct itimerval *));
+ int gettimeofday __P((struct timeval *, struct timezone *));
+ int setitimer __P((int, const struct itimerval *, struct itimerval *));
+ int settimeofday __P((const struct timeval *, const struct timezone *));
+ int utimes __P((const char *, const struct timeval *));
+ __END_DECLS
+ #endif /* !POSIX */
+
+ #endif /* !_KERNEL */
+
+ #endif /* !_SYS_TIME_H_ */
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/timers.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/timers.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/timers.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/timers.h Sun Apr 7 18:41:17 1996
***************
*** 0 ****
--- 1,45 ----
+ /* ==== timers.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Chris Provenzano.
+ * 4. The name of Chris Provenzano may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * timers.h,v 1.50 1994/08/08 03:44:09 proven Exp
+ *
+ * Description : Basic timers header.
+ *
+ * 1.00 94/06/13 proven
+ * -Started coding this file.
+ */
+
+ #ifndef _SYS_TIMERS_H_
+ #define _SYS_TIMERS_H_
+
+ #include <sys/time.h>
+
+ #endif
diff -rc --new-file pthreads-1_60_beta5/machdep/netbsd-1.1/wait.h pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/wait.h
*** pthreads-1_60_beta5/machdep/netbsd-1.1/wait.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/netbsd-1.1/wait.h Sun Apr 7 20:16:27 1996
***************
*** 0 ****
--- 1,146 ----
+ /* $NetBSD: wait.h,v 1.9 1995/03/26 20:25:07 jtc Exp $ */
+
+ /*
+ * Copyright (c) 1982, 1986, 1989, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)wait.h 8.2 (Berkeley) 7/10/94
+ */
+
+ /*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+ /*
+ * Macros to test the exit status returned by wait
+ * and extract the relevant values.
+ */
+
+
+ #ifdef _POSIX_SOURCE
+ #define _W_INT(i) (i)
+ #else
+ #define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
+ #define WCOREFLAG 0200
+ #endif
+
+ #define _WSTATUS(x) (_W_INT(x) & 0177)
+ #define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
+ #define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
+ #define WSTOPSIG(x) (_W_INT(x) >> 8)
+ #define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
+ #define WTERMSIG(x) (_WSTATUS(x))
+ #define WIFEXITED(x) (_WSTATUS(x) == 0)
+ #define WEXITSTATUS(x) (_W_INT(x) >> 8)
+ #ifndef _POSIX_SOURCE
+ #define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
+
+ #define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+ #define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
+ #endif
+
+ /*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+ #define WNOHANG 1 /* don't hang in wait */
+ #define WUNTRACED 2 /* tell about stopped, untraced children */
+
+ #ifndef _POSIX_SOURCE
+ /* POSIX extensions and 4.2/4.3 compatability: */
+
+ /*
+ * Tokens for special values of the "pid" parameter to wait4.
+ */
+ #define WAIT_ANY (-1) /* any process */
+ #define WAIT_MYPGRP 0 /* any process in my process group */
+
+ #include <machine/endian.h>
+
+ /*
+ * Deprecated:
+ * Structure of the information in the status word returned by wait4.
+ * If w_stopval==WSTOPPED, then the second structure describes
+ * the information returned, else the first.
+ */
+ union wait {
+ int w_status; /* used in syscall */
+ /*
+ * Terminated process status.
+ */
+ struct {
+ #if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Termsig:7, /* termination signal */
+ w_Coredump:1, /* core dump indicator */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Filler:16; /* upper bits filler */
+ #endif
+ #if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Coredump:1, /* core dump indicator */
+ w_Termsig:7; /* termination signal */
+ #endif
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+ #if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Filler:16; /* upper bits filler */
+ #endif
+ #if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Stopval:8; /* == W_STOPPED if stopped */
+ #endif
+ } w_S;
+ };
+ #define w_termsig w_T.w_Termsig
+ #define w_coredump w_T.w_Coredump
+ #define w_retcode w_T.w_Retcode
+ #define w_stopval w_S.w_Stopval
+ #define w_stopsig w_S.w_Stopsig
+
+ #define WSTOPPED _WSTOPPED
+ #endif /* _POSIX_SOURCE */
+
+
diff -rc --new-file pthreads-1_60_beta5/machdep/posix-netbsd-1.1.h pthreads-1_60_beta5.netbsd/machdep/posix-netbsd-1.1.h
*** pthreads-1_60_beta5/machdep/posix-netbsd-1.1.h Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/posix-netbsd-1.1.h Sun Apr 7 19:21:09 1996
***************
*** 0 ****
--- 1,31 ----
+ /* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * posix-netbsd-1.0.h,v 1.53 1995/02/17 03:41:34 proven Exp
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+ #ifndef _PTHREAD_POSIX_H_
+ #define _PTHREAD_POSIX_H_
+
+ #include <sys/cdefs.h>
+
+ /* More stuff for compiling */
+ #if defined(__GNUC__)
+ #define __INLINE extern inline
+ #else
+ #define __INLINE static
+ #endif
+
+ /* Make sure we have size_t defined */
+ #include <pthread/types.h>
+
+ #ifndef __WAIT_STATUS
+ #define __WAIT_STATUS int *
+ #endif
+
+ #endif
diff -rc --new-file pthreads-1_60_beta5/machdep/syscall-i386-netbsd-1.1.S pthreads-1_60_beta5.netbsd/machdep/syscall-i386-netbsd-1.1.S
*** pthreads-1_60_beta5/machdep/syscall-i386-netbsd-1.1.S Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/syscall-i386-netbsd-1.1.S Sun Apr 7 19:21:38 1996
***************
*** 0 ****
--- 1,162 ----
+ /* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+ #ifndef lint
+ .text
+ .asciz "syscall-i386-netbsd-1.0a.S,v 1.2 1995/09/26 21:04:52 raeburn Exp";
+ #endif
+
+ #if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+ #endif /* SYSLIBC_SCCS and not lint */
+
+ #include <machine/asm.h>
+ #include <sys/syscall.h>
+
+ /*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+ /* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+ _machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+ 2:
+ ret;
+
+ /* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+ _machdep_sys___syscall:;
+
+ movl $(SYS___syscall), %eax;
+ int $0x80;
+ jb 3f;
+ ret
+
+ /* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _machdep_sys_sigsuspend;
+
+ _machdep_sys_sigsuspend:;
+
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend), %eax;
+ int $0x80;
+ jb 3f;
+ ret
+
+ 3:
+
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
+ /* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .globl _machdep_sys_lseek;
+
+ _machdep_sys_lseek:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x14(%ebp);
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0;
+ pushl 0x8(%ebp);
+ pushl $0x0;
+ pushl $(SYS_lseek);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+ /* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl _machdep_sys_sigprocmask;
+
+ _machdep_sys_sigprocmask:;
+
+ movl 8(%esp),%ecx
+ movl (%ecx),%ecx
+ movl %ecx,8(%esp)
+ movl $(SYS_sigprocmask), %eax;
+ int $0x80;
+ jb 3b;
+ ret
+
+ /* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _machdep_sys_pipe;
+
+ _machdep_sys_pipe:;
+
+ movl $(SYS_pipe), %eax;
+ int $0x80;
+ jb 3b;
+ movl 4(%esp),%ecx
+ movl %eax,(%ecx)
+ movl %edx,4(%ecx)
+ xorl %eax,%eax
+ ret
+
diff -rc --new-file pthreads-1_60_beta5/machdep/syscall-template-i386-netbsd-1.1.S pthreads-1_60_beta5.netbsd/machdep/syscall-template-i386-netbsd-1.1.S
*** pthreads-1_60_beta5/machdep/syscall-template-i386-netbsd-1.1.S Thu Jan 1 01:00:00 1970
--- pthreads-1_60_beta5.netbsd/machdep/syscall-template-i386-netbsd-1.1.S Sun Apr 7 19:22:08 1996
***************
*** 0 ****
--- 1,49 ----
+ #include <machine/asm.h>
+ #include <sys/syscall.h>
+
+ #ifdef __STDC__
+
+ #define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+ _machdep_sys_##x:; \
+ \
+ movl $(SYS_##x), %eax; \
+ int $0x80; \
+ jb 1b; \
+ ret;
+
+ #else
+
+ #define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+ _machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ int $0x80; \
+ jb 1b; \
+ ret;
+
+ #endif
+
+
+ /*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+ /* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+ 1:
+ neg %eax
+ ret
+
+ #define XSYSCALL(NAME) SYSCALL(NAME)
+
+ XSYSCALL(SYSCALL_NAME)
--
Jesus M. Gonzalez Barahona | addr.: c/ Butarque, 15
Grupo de Sistemas y Comunicaciones | 28911 Leganes, Spain
Departamento de Informatica | tel: +34 1 624 94 58
Universidad Carlos III de Madrid | fax: +34 1 624 94 30
e-mail: jgb@gsyc.inf.uc3m.es | www: http://ordago.gsyc.inf.uc3m.es/~jgb
--
Jesus M. Gonzalez Barahona | addr.: c/ Butarque, 15
Grupo de Sistemas y Comunicaciones | 28911 Leganes, Spain
Departamento de Informatica | tel: +34 1 624 94 58
Universidad Carlos III de Madrid | fax: +34 1 624 94 30
e-mail: jgb@gsyc.inf.uc3m.es | www: http://ordago.gsyc.inf.uc3m.es/~jgb