Index: coda/coda-src/norton/commands.cc
===================================================================
RCS file: /coda-src/coda/coda-src/norton/commands.cc,v
retrieving revision 4.10
diff -u -c -r4.10 commands.cc
cvs server: conflicting specifications of output style
*** commands.cc 2000/08/30 19:32:21     4.10
--- commands.cc 2001/04/08 06:55:43
***************
*** 30,35 ****
--- 30,40 ----
  #include <stdio.h>
  #include <stdlib.h>
  #include "coda_string.h"
+ 
+ #if defined(__APPLE__) && defined(__MACH__)
+ #import <mach/mach.h>
+ #endif
+ 
  #ifdef __cplusplus
  }
  #endif __cplusplus
***************
*** 127,132 ****
--- 132,163 ----
  
  
  #ifdef        __MACH__
+ #ifdef __APPLE__
+ static long address_ok(vm_address_t addr, vm_size_t size, vm_prot_t perm)
+ {
+     kern_return_t  rc;
+     struct vm_region_basic_info info;
+     mach_msg_type_number_t infoCnt;
+     vm_address_t current, end;
+     mach_port_t object_name;
+     
+     infoCnt = VM_REGION_BASIC_INFO_COUNT;
+     
+     current = addr;
+     end = addr + size;
+     while (current < end) {
+         rc = vm_region(mach_task_self(), &current, &size, VM_REGION_BASIC_INFO, (vm_region_info_t)&info, &infoCnt, &object_name);
+         if (rc != KERN_SUCCESS)
+             return 0;
+         
+         if ((info.protection & perm) != perm)
+             return 0;
+ 
+         current += size;
+     }
+     return 1;
+ }
+ #else
  static
  long address_ok(vm_address_t addr, vm_size_t sz, vm_prot_t perm)
  {
***************
*** 152,158 ****
      }
      return(1);
  }
! #endif
  
  #if    defined        (__linux__) || defined(__CYGWIN32__) || defined(sun)
  #include <sys/mman.h>
--- 183,191 ----
      }
      return(1);
  }
! #endif // __APPLE__
! #endif // __MACH__
! 
  
  #if    defined        (__linux__) || defined(__CYGWIN32__) || defined(sun)
  #include <sys/mman.h>
***************
*** 167,173 ****
  }
  #endif
  
! #ifdef BSD4_4
  #include <sys/mman.h>
  #define vm_address_t caddr_t
  #define vm_size_t    size_t
--- 200,206 ----
  }
  #endif
  
! #if defined(BSD4_4) && !defined(__APPLE__)
  #include <sys/mman.h>
  #define vm_address_t caddr_t
  #define vm_size_t    size_t
Index: coda/coda-src/venus/venusrecov.cc
===================================================================
RCS file: /coda-src/coda/coda-src/venus/venusrecov.cc,v
retrieving revision 4.50
diff -u -c -r4.50 venusrecov.cc
cvs server: conflicting specifications of output style
*** venusrecov.cc       2000/09/23 19:45:26     4.50
--- venusrecov.cc       2001/04/08 06:55:44
***************
*** 107,112 ****
--- 107,114 ----
  static const char *VM_RVMADDR = (char *)0x03000000;
  #elif defined(sun)
  static const char *VM_RVMADDR = (char *)0x40000000;
+ #elif defined(__APPLE__) && defined(__MACH__)  // Darwin and Mac OS X
+ static const char *VM_RVMADDR = (char *)0x50000000;
  #else
  #error "Please define RVM address for this platform."
  #endif
Index: coda/coda-src/vice/smon.cc
===================================================================
RCS file: /coda-src/coda/coda-src/vice/smon.cc,v
retrieving revision 4.19
diff -u -c -r4.19 smon.cc
cvs server: conflicting specifications of output style
*** smon.cc     2001/02/16 12:04:34     4.19
--- smon.cc     2001/04/08 06:55:44
***************
*** 377,382 ****
--- 377,386 ----
  static int GetRawStatistics(SmonStatistics *stats)
  {
  #ifdef __MACH__
+ #ifdef __APPLE__
+ #warning Need to port this to Mach 3.0 on Mac OS X
+     return -1;
+ #else
      static    int     kmem = 0;
      static      int     hertz = 0;
      int               i;
***************
*** 433,438 ****
--- 437,443 ----
      for (i = 0; i < DK_NDRIVE; i++) {
        stats->TotalIO += xfer[i];
      }
+ #endif // __APPLE__
  #else
      return 0;
  #endif
Index: coda/coda-src/volutil/vol-peekpoke.cc
===================================================================
RCS file: /coda-src/coda/coda-src/volutil/vol-peekpoke.cc,v
retrieving revision 4.13
diff -u -c -r4.13 vol-peekpoke.cc
cvs server: conflicting specifications of output style
*** vol-peekpoke.cc     2000/08/09 21:17:07     4.13
--- vol-peekpoke.cc     2001/04/08 06:55:45
***************
*** 51,56 ****
--- 51,62 ----
  #include <rpc2/rpc2.h>
  #include <volutil.h>
  
+ 
+ #if defined(__APPLE__) && defined(__MACH__)
+ #import <mach/mach.h>
+ #import <nlist.h>
+ #endif
+ 
  #ifdef __cplusplus
  }
  #endif __cplusplus
***************
*** 73,78 ****
--- 79,111 ----
                srvname = strdup(strcat(strcat(buf, "/"), s));
        else    printf("%s: unable to find the current directory\n", s);
  }
+ 
+ #if defined(__APPLE__) && defined(__MACH__)
+ static long checkaddress(vm_address_t addr, vm_size_t size, vm_prot_t perm)
+ {
+     kern_return_t  rc;
+     struct vm_region_basic_info info;
+     mach_msg_type_number_t infoCnt;
+     vm_address_t current, end;
+     mach_port_t object_name;
+     
+     infoCnt = VM_REGION_BASIC_INFO_COUNT;
+     
+     current = addr;
+     end = addr + size;
+     while (current < end) {
+         rc = vm_region(mach_task_self(), &current, &size, VM_REGION_BASIC_INFO, (vm_region_info_t)&info, &infoCnt, &object_name);
+         if (rc != KERN_SUCCESS)
+             return RPC2_FAIL;
+         
+         if ((info.protection & perm) != perm)
+             return RPC2_FAIL;
+ 
+         current += size;
+     }
+     return RPC2_SUCCESS;
+ }
+ #endif
  
  #ifdef __MACH__
  
Index: coda/lib-src/kernel-includes/coda.h
===================================================================
RCS file: /coda-src/coda/lib-src/kernel-includes/coda.h,v
retrieving revision 1.51
diff -u -c -r1.51 coda.h
cvs server: conflicting specifications of output style
*** coda.h      2000/09/29 11:53:55     1.51
--- coda.h      2001/04/08 06:55:45
***************
*** 127,132 ****
--- 127,138 ----
  #undef __BIT_TYPES_DEFINED__
  #endif
  
+ // tjw@omnigroup.com: Someone that knows autoconf should add tests for these types rather than doing this crud
+ #if defined(__APPLE__) && defined(__MACH__)
+ // Mac OS X / Darwin
+ #define __BIT_TYPES_DEFINED__
+ #endif
+ 
  #ifndef __BIT_TYPES_DEFINED__
  #define __BIT_TYPES_DEFINED__
  typedef signed char         int8_t;
Index: lwp/src/process.S
===================================================================
RCS file: /coda-src/lwp/src/process.S,v
retrieving revision 4.3
diff -u -c -r4.3 process.S
cvs server: conflicting specifications of output style
*** process.S   2000/07/21 22:37:40     4.3
--- process.S   2001/04/08 06:55:45
***************
*** 676,682 ****
        
  #endif /* __arm32__ or __arm__ */
  
! #if defined(__powerpc__)
  
  /* Comments:
   *    1. Registers R10..R31 and CR0..CR7 are saved
--- 676,682 ----
        
  #endif /* __arm32__ or __arm__ */
  
! #if defined(__powerpc__) || defined(__ppc__)
  
  /* Comments:
   *    1. Registers R10..R31 and CR0..CR7 are saved
***************
*** 725,731 ****
  #define EXT(x) x
  
  #else /* NeXT && __APPLE__ */
! #define EXT(x) _x
  #endif
  
  /*
--- 725,731 ----
  #define EXT(x) x
  
  #else /* NeXT && __APPLE__ */
! #define EXT(x) _##x
  #endif
  
  /*
Index: rpc2/rpc2-src/debug.c
===================================================================
RCS file: /coda-src/rpc2/rpc2-src/debug.c,v
retrieving revision 4.18
diff -u -c -r4.18 debug.c
cvs server: conflicting specifications of output style
*** debug.c     2000/08/17 22:08:28     4.18
--- debug.c     2001/04/08 06:55:46
***************
*** 61,68 ****
        if ( rc ) {
                return "BADTIME";
        } else {
                strftime(mytime, sizeof(mytime), "%H:%M:%S", 
!                        localtime(&t.tv_sec));
                mytime[8] = 0;
                return mytime;
        }
--- 61,71 ----
        if ( rc ) {
                return "BADTIME";
        } else {
+                 time_t sec;
+                 
+                 sec = t.tv_sec;
                strftime(mytime, sizeof(mytime), "%H:%M:%S", 
!                        localtime(&sec));
                mytime[8] = 0;
                return mytime;
        }
Index: rvm/include/rvm_lwp.h
===================================================================
RCS file: /coda-src/rvm/include/rvm_lwp.h,v
retrieving revision 4.7
diff -u -c -r4.7 rvm_lwp.h
cvs server: conflicting specifications of output style
*** rvm_lwp.h   1999/11/15 22:54:34     4.7
--- rvm_lwp.h   2001/04/08 06:55:46
***************
*** 21,39 ****
  #include <lwp/lwp.h>
  #include <lwp/lock.h>
  
! #ifdef RVM_LWPPID
! extern PROCESS rvm_lwppid;
! #else /* !RVM_LWPPID */
! #define RVM_LWPPID
! PROCESS                     rvm_lwppid;     /* LWP process id */
! #endif /* !RVM_LWPPID */
  
  #ifndef MACRO_BEGIN
  #define MACRO_BEGIN                   do {
  #define MACRO_END                     } while(0)
  #endif /* MACRO_BEGIN */
  
! #define STACKSIZE     1024 * 16
  #define BOGUSCODE     (BOGUS_USE_OF_CTHREADS)  /* force compilation error */
  
  #define RVM_MUTEX                     struct Lock
--- 21,34 ----
  #include <lwp/lwp.h>
  #include <lwp/lock.h>
  
! extern PROCESS rvm_lwppid;     /* LWP process id */
  
  #ifndef MACRO_BEGIN
  #define MACRO_BEGIN                   do {
  #define MACRO_END                     } while(0)
  #endif /* MACRO_BEGIN */
  
! #define RVM_STACKSIZE 1024 * 16
  #define BOGUSCODE     (BOGUS_USE_OF_CTHREADS)  /* force compilation error */
  
  #define RVM_MUTEX                     struct Lock
***************
*** 44,50 ****
  
  /* Supported cthread definitions */
  
  #define cthread_t                     PROCESS
! #define cthread_fork(fname, arg)      (LWP_CreateProcess((fname), STACKSIZE, \
                                          LWP_NORMAL_PRIORITY,  \
                                          (char *)arg,          \
                                          (char *)"rvm_thread", \
--- 39,45 ----
  
  /* Supported cthread definitions */
  
  #define cthread_t                     PROCESS
! #define cthread_fork(fname, arg)      (LWP_CreateProcess((fname), RVM_STACKSIZE, \
                                          LWP_NORMAL_PRIORITY,  \
                                          (char *)arg,          \
                                          (char *)"rvm_thread", \
Index: rvm/rvm/rvm_init.c
===================================================================
RCS file: /coda-src/rvm/rvm/rvm_init.c,v
retrieving revision 4.11
diff -u -c -r4.11 rvm_init.c
cvs server: conflicting specifications of output style
*** rvm_init.c  1999/12/16 22:36:28     4.11
--- rvm_init.c  2001/04/08 06:55:46
***************
*** 31,36 ****
--- 31,40 ----
  
  char                rvm_errmsg;         /* internal error message ptr */
  
+ #ifdef RVM_USELWP
+ PROCESS rvm_lwppid;     /* LWP process id */
+ #endif
+ 
  /* initialization control */
  /* Cannot statically initialize locks with pthreads. */
  static RVM_MUTEX    init_lock = MUTEX_INITIALIZER;
Index: rvm/rvm/rvm_printers.c
===================================================================
RCS file: /coda-src/rvm/rvm/rvm_printers.c,v
retrieving revision 4.3
diff -u -c -r4.3 rvm_printers.c
cvs server: conflicting specifications of output style
*** rvm_printers.c      1999/02/22 17:32:54     4.3
--- rvm_printers.c      2001/04/08 06:55:46
***************
*** 43,49 ****
                                                           coalesce histogram defs */
  extern rvm_length_t trans_elims_vec[trans_elims_len]; /* ranges eliminated by trans
                                                           coalesce histogram defs */
! rvm_length_t        trans_coalesces_vec[trans_coalesces_len]; /* transactions
                                                                   coalesed per flush */
  
  /* print rvm_offset_t */
  static int pr_offset(offset,stream)   
--- 43,49 ----
                                                           coalesce histogram defs */
  extern rvm_length_t trans_elims_vec[trans_elims_len]; /* ranges eliminated by trans
                                                           coalesce histogram defs */
! extern rvm_length_t        trans_coalesces_vec[trans_coalesces_len]; /* transactions
                                                                   coalesed per flush */
  
  /* print rvm_offset_t */
  static int pr_offset(offset,stream)   
Index: rvm/rvm/rvm_status.c
===================================================================
RCS file: /coda-src/rvm/rvm/rvm_status.c,v
retrieving revision 4.5
diff -u -c -r4.5 rvm_status.c
cvs server: conflicting specifications of output style
*** rvm_status.c        1999/12/16 22:39:58     4.5
--- rvm_status.c        2001/04/08 06:55:47
***************
*** 42,48 ****
                                                           coalesce histogram defs */
  extern rvm_length_t trans_elims_vec[trans_elims_len]; /* ranges eliminated by trans
                                                           coalesce histogram defs */
! rvm_length_t        trans_coalesces_vec[trans_coalesces_len]; /* transactions
                                                                   coalesed per flush */
  
  rvm_length_t        rvm_optimizations = 0;  /* optimizations switches */
--- 42,48 ----
                                                           coalesce histogram defs */
  extern rvm_length_t trans_elims_vec[trans_elims_len]; /* ranges eliminated by trans
                                                           coalesce histogram defs */
! extern rvm_length_t        trans_coalesces_vec[trans_coalesces_len]; /* transactions
                                                                   coalesed per flush */
  
  rvm_length_t        rvm_optimizations = 0;  /* optimizations switches */
