*** ./include/pthread/fd.h.orig Wed Aug 17 16:59:16 1994 --- ./include/pthread/fd.h Wed Aug 17 16:59:36 1994 *************** *** 58,70 **** #define FD_RDWR (FD_READ | FD_WRITE) struct fd_ops { ! int (*write)(); ! int (*read)(); int (*close)(); int (*fcntl)(); int (*writev)(); int (*readv)(); ! int (*seek)(); }; union fd_data { --- 58,70 ---- #define FD_RDWR (FD_READ | FD_WRITE) struct fd_ops { ! ssize_t (*write)(); ! ssize_t (*read)(); int (*close)(); int (*fcntl)(); int (*writev)(); int (*readv)(); ! off_t (*seek)(); }; union fd_data { *** ./include/errno.h.orig Wed Aug 17 16:53:20 1994 --- ./include/errno.h Wed Aug 17 16:53:44 1994 *************** *** 34,45 **** * errno.h,v 1.3 1993/05/20 16:22:09 cgd Exp */ ! #ifndef _ERRNO_H_ ! #define _ERRNO_H_ #include extern int * __error(); #define errno (* __error()) ! #endif /* _ERRNO_H_ */ --- 34,45 ---- * errno.h,v 1.3 1993/05/20 16:22:09 cgd Exp */ ! #ifndef _PTHREADS_ERRNO_H_ ! #define _PTHREADS_ERRNO_H_ #include extern int * __error(); #define errno (* __error()) ! #endif /* _PTHREADS_ERRNO_H_ */ *** ./machdep/bsdi-1.1/compat.h.orig Wed Aug 17 16:33:24 1994 --- ./machdep/bsdi-1.1/compat.h Wed Aug 17 16:33:32 1994 *************** *** 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. + * + * $Id: 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 *** ./machdep/bsdi-1.1/timers.h.orig Wed Aug 17 16:37:29 1994 --- ./machdep/bsdi-1.1/timers.h Wed Aug 17 17:32:07 1994 *************** *** 42,45 **** --- 42,59 ---- #include + struct timespec { + time_t ts_sec; + long ts_nsec; + }; + + #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ + (ts)->ts_sec = (tv)->tv_sec; \ + (ts)->ts_nsec = (tv)->tv_usec * 1000; \ + } + #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (ts)->ts_sec; \ + (tv)->tv_usec = (ts)->ts_nsec / 1000; \ + } + #endif *** ./machdep/bsdi-1.1/dirent.h.orig Wed Aug 17 17:26:29 1994 --- ./machdep/bsdi-1.1/dirent.h Wed Aug 17 17:28:29 1994 *************** *** 61,66 **** --- 61,73 ---- #endif }; + /* + * There should probably be no need for this. In the BSDI sources, + * it is excluded if _POSIX_SOURCE is defined, and pthreads are supposed + * to be posix. Sources that use d_ino should really be using d_fileno. + * mbd + */ + #define d_ino d_fileno /* backward compatibility */ #endif /* !_SYS_DIRENT_H_ */ *** ./machdep/engine-i386-bsdi-1.1.h.orig Wed Aug 17 16:20:45 1994 --- ./machdep/engine-i386-bsdi-1.1.h Wed Aug 17 16:30:16 1994 *************** *** 1,165 **** - /* ==== 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[] = "$Id: engine-i386-bsdi-1.1.h,v 1.50 1994/08/08 03:42:22 proven Exp $"; - #endif - - #include - #include - #include - #include "pthread.h" - - /* ========================================================================== - * machdep_save_state() - */ - int machdep_save_state(void) - { - return(_setjmp(pthread_run->machdep_data.machdep_state)); - } - - /* ========================================================================== - * machdep_restore_state() - */ - void machdep_restore_state(void) - { - _longjmp(pthread_run->machdep_data.machdep_state, 1); - } - - /* ========================================================================== - * 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} }; - - if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) { - 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(); - sig_check_and_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_pthread_create() - */ - void machdep_pthread_create(struct machdep_pthread *machdep_pthread, - void *(* start_routine)(), void *start_argument, long stack_size, - void *stack_start, long nsec) - { - machdep_pthread->machdep_stack = stack_start; - - 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_send() - */ - machdep_sys_send(int s, const void *buf, int len, int flags) - { - return(machdep_sys_sendto(s, buf, len, flags, (struct sockaddr*)NULL, 0)); - } - - /* ========================================================================== - * machdep_sys_recv() - */ - machdep_sys_recv(int s, void *buf, int len, int flags) - { - return(machdep_sys_recvfrom(s, buf, len, flags, (struct sockaddr*)NULL, 0)); - } - END-of-machdep/engine-i386-bsdi-1.1.c - echo x - machdep/engine-i386-bsdi-1.1.h - sed 's/^X//' >machdep/engine-i386-bsdi-1.1.h << 'END-of-machdep/engine-i386-bsdi-1.1.h' /* ==== machdep.h ============================================================ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu * ! * $Id: engine-i386-bsdi-1.1.h,v 1.50 1994/08/08 03:42:22 proven Exp $ * */ --- 1,7 ---- /* ==== machdep.h ============================================================ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu * ! * $Id: engine-i386-netbsd-1.0.h,v 1.50 1994/08/08 03:42:36 proven Exp $ * */ *************** *** 239,242 **** #endif __END_DECLS - --- 81,83 ---- *** ./machdep/engine-i386-bsdi-1.1.c.orig Wed Aug 17 16:30:49 1994 --- ./machdep/engine-i386-bsdi-1.1.c Wed Aug 17 16:30:51 1994 *************** *** 0 **** --- 1,180 ---- + /* ==== 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[] = "$Id: engine-i386-netbsd-1.0.c,v 1.50 1994/08/08 03:42:34 proven Exp $"; + #endif + + #include + #include + #include + #include + #include "pthread.h" + + /* ========================================================================== + * machdep_save_state() + */ + int machdep_save_state(void) + { + return(_setjmp(pthread_run->machdep_data.machdep_state)); + } + + /* ========================================================================== + * machdep_restore_state() + */ + void machdep_restore_state(void) + { + _longjmp(pthread_run->machdep_data.machdep_state, 1); + } + + /* ========================================================================== + * 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} }; + + if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) { + 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(); + sig_check_and_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_pthread_create() + */ + void machdep_pthread_create(struct machdep_pthread *machdep_pthread, + void *(* start_routine)(), void *start_argument, long stack_size, + void *stack_start, long nsec) + { + machdep_pthread->machdep_stack = stack_start; + + 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_send() + */ + machdep_sys_send(int s, const void *buf, int len, int flags) + { + return(machdep_sys_sendto(s, buf, len, flags, (struct sockaddr*)NULL, 0)); + } + + /* ========================================================================== + * machdep_sys_recv() + */ + machdep_sys_recv(int s, void *buf, int len, int flags) + { + return(machdep_sys_recvfrom(s, buf, len, flags, (struct sockaddr*)NULL, 0)); + } *** ./machdep/posix-bsdi-1.1.h.orig Wed Aug 17 17:20:15 1994 --- ./machdep/posix-bsdi-1.1.h Wed Aug 17 17:20:49 1994 *************** *** 3,9 **** * * Description : Convert an Ultrix-4.2 system to a more or less POSIX system. * ! * $Id: posix-bsdi-1.1.h,v 1.50 1994/08/08 03:42:54 proven Exp $ * * 1.00 93/07/20 proven * -Started coding this file. --- 3,9 ---- * * Description : Convert an Ultrix-4.2 system to a more or less POSIX system. * ! * $Id: posix-bsdi-1.1.h,v 1.50 1994/08/08 03:43:03 proven Exp $ * * 1.00 93/07/20 proven * -Started coding this file. *************** *** 14,24 **** --- 14,34 ---- #include + /* More stuff for compiling */ + #if defined(__GNUC__) + #define __INLINE extern inline + #else + #define __INLINE static + #endif + /* Make sure we have size_t defined */ #include #include #define __NORETURN + #ifndef __WAIT_STATUS + #define __WAIT_STATUS int * #endif + #endif *** ./machdep/syscall-i386-bsdi-1.1.S.orig Wed Aug 17 17:35:09 1994 --- ./machdep/syscall-i386-bsdi-1.1.S Wed Aug 17 17:56:54 1994 *************** *** 45,60 **** #ifndef lint .text ! .asciz "$Id: syscall-i386-bsdi-1.1.S,v 1.50 1994/08/08 03:43:13 proven Exp $"; #endif #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ - /* - #include - */ #include #define SYSCALL(x) \ --- 45,57 ---- #ifndef lint .text ! .asciz "$Id: syscall-i386-bsdi-1.1.S,v 1.50 1994/08/08 03:43:21 proven Exp $"; #endif #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include #define SYSCALL(x) \ *************** *** 153,158 **** --- 150,195 ---- */ SYSCALL(fstat) + /* ========================================================================== + * machdep_sys_fchown() + */ + SYSCALL(fchown) + + /* ========================================================================== + * machdep_sys_fchmod() + */ + SYSCALL(fchmod) + + /* ========================================================================== + * machdep_sys_chown() + */ + SYSCALL(chown) + + /* ========================================================================== + * machdep_sys_chmod() + */ + SYSCALL(chmod) + + /* ========================================================================== + * machdep_sys_chdir() + */ + SYSCALL(chdir) + + /* ========================================================================== + * machdep_sys_chdir() + */ + SYSCALL(link) + + /* ========================================================================== + * machdep_sys_chdir() + */ + SYSCALL(unlink) + + /* ========================================================================== + * machdep_sys_chdir() + */ + SYSCALL(rename) + /* ========================================================================== * Nonstandard calls used to make the system work * *************** *** 166,171 **** --- 203,213 ---- */ SYSCALL(getdirentries) + /* ========================================================================== + * machdep_sys_wait4() + */ + SYSCALL(wait4) + /* ========================================================================== * Berkeley socket stuff * *************** *** 229,231 **** --- 271,287 ---- */ SYSCALL(recvfrom) + /* ========================================================================== + * machdep_sys_sendmsg() + */ + SYSCALL(sendmsg) + + /* ========================================================================== + * machdep_sys_recvmsg() + */ + SYSCALL(recvmsg) + + /* ========================================================================== + * machdep_sys_shutdown() - Is this correct? + */ + SYSCALL(shutdown) *** ./pthreads/fd_kern.c.orig Wed Aug 17 16:55:15 1994 --- ./pthreads/fd_kern.c Wed Aug 17 17:08:22 1994 *************** *** 406,412 **** /* ========================================================================== * lseek() */ ! int __fd_kern_lseek(int fd, int flags, off_t offset, int whence) { return(machdep_sys_lseek(fd, offset, whence)); } --- 406,412 ---- /* ========================================================================== * lseek() */ ! off_t __fd_kern_lseek(int fd, int flags, off_t offset, int whence) { return(machdep_sys_lseek(fd, offset, whence)); } *************** *** 1015,1021 **** --- 1015,1025 ---- * send() */ /* int send(int fd, char* msg, int len, int flags) */ + #ifdef __bsdi__ + int send(int fd, const void * msg, int len, int flags) + #else ssize_t send(int fd, const void * msg, size_t len, int flags) + #endif { semaphore *lock, *plock; int ret; *************** *** 1059,1066 **** --- 1063,1075 ---- */ /* int sendto(int fd, char* msg, int len, int flags, struct sockaddr *to, int to_len) */ + #ifdef __bsdi__ + int sendto(int fd, const void * msg, int len, int flags, + const struct sockaddr *to, int to_len) + #else ssize_t sendto(int fd, const void * msg, size_t len, int flags, const struct sockaddr *to, int to_len) + #endif { semaphore *lock, *plock; int ret; *************** *** 1102,1108 **** --- 1111,1121 ---- /* ========================================================================== * sendmsg() */ + #ifdef __bsdi__ + int sendmsg(int fd, const struct msghdr *msg, int flags) + #else ssize_t sendmsg(int fd, const struct msghdr *msg, int flags) + #endif { semaphore *lock, *plock; int passed_fd, ret, i; *************** *** 1171,1177 **** --- 1184,1194 ---- * recv() */ /* int recv(int fd, char * buf, int len, int flags) */ + #ifdef __bsdi__ + int recv(int fd, void * buf, int len, int flags) + #else ssize_t recv(int fd, void * buf, size_t len, int flags) + #endif { semaphore *lock, *plock; int ret; *************** *** 1215,1222 **** --- 1232,1244 ---- */ /* int recvfrom(int fd, char * buf, int len, int flags, struct sockaddr *from, int * from_len) */ + #ifdef __bsdi__ + int recvfrom(int fd, void * buf, int len, int flags, + struct sockaddr * from, int * from_len) + #else ssize_t recvfrom(int fd, void * buf, size_t len, int flags, struct sockaddr * from, int * from_len) + #endif { semaphore *lock, *plock; int ret; *************** *** 1257,1263 **** --- 1279,1289 ---- /* ========================================================================== * recvmsg() */ + #ifdef __bsdi__ + int recvmsg(int fd, struct msghdr *msg, int flags) + #else ssize_t recvmsg(int fd, struct msghdr *msg, int flags) + #endif { semaphore *lock, *plock; struct stat stat_buf; *** ./pthreads/sleep.c.orig Wed Aug 17 17:12:49 1994 --- ./pthreads/sleep.c Wed Aug 17 17:13:58 1994 *************** *** 322,327 **** --- 322,339 ---- /* ========================================================================== * usleep() */ + #ifdef __bsdi__ + void usleep(unsigned int useconds) + { + struct timespec time_to_sleep; + + if (useconds) { + time_to_sleep.ts_nsec = (useconds % 1000000) * 1000; + time_to_sleep.ts_sec = useconds / 1000000; + __sleep(&time_to_sleep); + } + } + #else unsigned int usleep(unsigned int useconds) { struct timespec time_to_sleep; *************** *** 334,339 **** --- 346,352 ---- } return(useconds); } + #endif /* ========================================================================== * sleep() *** ./pthreads/specific.c.orig Wed Aug 17 17:15:03 1994 --- ./pthreads/specific.c Wed Aug 17 17:16:39 1994 *************** *** 184,190 **** pthread_yield(); } if (key_table[key].count) { ! ret = pthread_run->specific_data[key]; } else { ret = NULL; } --- 184,194 ---- pthread_yield(); } if (key_table[key].count) { ! /* ! * XXX Do we really want to cast this const pointer ! * to a non-const? - mbd ! */ ! ret = (void *)pthread_run->specific_data[key]; } else { ret = NULL; }