Make it work under Utah BSD 4.3
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 6 Feb 1993 05:46:32 +0000 (05:46 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 6 Feb 1993 05:46:32 +0000 (05:46 +0000)
v7/src/microcode/posixtyp.h
v7/src/microcode/tparam.c
v7/src/microcode/ux.h
v7/src/microcode/uxenv.c
v7/src/microcode/uxtop.c
v7/src/microcode/uxtrap.h

index 63290b05986387846dec743ce05a8bfede2466cf..52a3e3f7ec01c4c86ad41f82f569204ce986f6b8 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/posixtyp.h,v 1.5 1992/02/27 18:41:09 mhwu Exp $
+$Id: posixtyp.h,v 1.6 1993/02/06 05:37:01 gjr Exp $
 
-Copyright (c) 1990-91 Massachusetts Institute of Technology
+Copyright (c) 1990-1993 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -59,6 +59,14 @@ MIT in each case. */
 #define _OFF_T
 #endif
 
+#ifdef _BSD4_3
+#define _MODE_T
+#define _NLINK_T
+#define _PID_T
+#define _CLOCK_T
+#define _TIME_T
+#endif
+
 #if defined(_SUNOS4) && defined(__sys_stdtypes_h)
 #define _MODE_T
 #define _NLINK_T
index 4eb759c8dfd20fbc227a1f7fb18add12249a188a..be133bda95404c5309772280d28ff21ef839357b 100644 (file)
@@ -111,7 +111,9 @@ what you give them.   Help stamp out software-hoarding!  */
 
 #include "ansidecl.h"
 
-extern char * EXFUN (tparam, (char *, char*, int, int, ...));
+#ifndef _BSD4_3
+extern char * EXFUN (tparam, (char *, char *, int, int, ...));
+#endif
 extern char * EXFUN (tgoto, (char *, int, int));
 
 /* Assuming STRING is the value of a termcap string entry
index 8206f877414ed6aa91079975377b4471dacfcd16..99c7e6f7762edba87fd7ec97408f7c2329da51f4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: ux.h,v 1.39 1993/01/12 19:47:49 gjr Exp $
+$Id: ux.h,v 1.40 1993/02/06 05:42:05 gjr Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -52,7 +52,6 @@ MIT in each case. */
 #include <errno.h>
 #include <pwd.h>
 #include <grp.h>
-#include <utime.h>
 
 #include "oscond.h"
 #include "ansidecl.h"
@@ -197,6 +196,7 @@ extern void EXFUN (error_system_call, (int code, enum syscall_names name));
 #include <fcntl.h>
 #include <sys/wait.h>
 #include <dirent.h>
+#include <utime.h>
 
 #define DECL_GETLOGIN
 #define HAVE_APPEND
@@ -205,11 +205,14 @@ extern void EXFUN (error_system_call, (int code, enum syscall_names name));
 #define HAVE_FCNTL
 #define HAVE_GETCWD
 #define HAVE_MKDIR
+/* MKTIME is really ANSI C, but POSIX has it too ? */
+#define HAVE_MKTIME
 #define HAVE_POSIX_SIGNALS
 #define HAVE_RENAME
 #define HAVE_RMDIR
 #define HAVE_TERMIOS
 #define HAVE_TIMES
+#define HAVE_UTIME
 #define HAVE_WAITPID
 #define VOID_SIGNAL_HANDLERS
 
@@ -548,6 +551,18 @@ struct sigcontext { long sc_sp, sc_pc; };
 #define ENOSYS 0
 #endif
 
+#ifndef HAVE_UTIME
+/* It's really there, but there may not be an include file. */
+
+struct utimbuf
+{
+  time_t actime;
+  time_t modtime;
+};
+
+extern int EXFUN (utime, (CONST char *, struct utimbuf *)); 
+#endif /* HAVE_UTIME */
+
 #ifdef UNION_WAIT_STATUS
 
 typedef union wait wait_status_t;
index 0823a9464e8973f1a9fbb2afe310b48fab029784..433b5ab231b047958c13bf96ad534018b7abc8d6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: uxenv.c,v 1.9 1993/01/12 19:48:31 gjr Exp $
+$Id: uxenv.c,v 1.10 1993/02/06 05:42:47 gjr Exp $
 
 Copyright (c) 1990-1993 Massachusetts Institute of Technology
 
@@ -84,7 +84,11 @@ DEFUN (OS_encode_time ,(buffer), struct time_structure * buffer)
 #endif
   (ts -> tm_yday) = 0;
   (ts -> tm_isdst) = -1;       /* Let mktime figure it out */
+#ifdef HAVE_MKTIME
   STD_UINT_SYSTEM_CALL (syscall_mktime, t, (UX_mktime (ts)));
+#else
+  error_system_call (ENOSYS, syscall_mktime);
+#endif
   return (t);
 }
 \f
index 210feee77488da3a7f0bfdb5ddcc085819239fe4..7e4e983ac22aaf3fbcef58feae3b677d6a31bda2 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxtop.c,v 1.9 1992/06/05 20:09:00 jinx Exp $
+$Id: uxtop.c,v 1.10 1993/02/06 05:45:28 gjr Exp $
 
-Copyright (c) 1990-1 Massachusetts Institute of Technology
+Copyright (c) 1990-1993 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -220,7 +220,9 @@ DEFUN (error_code_to_syserr, (code), int code)
     case ENODEV:       return (syserr_no_such_device);
     case ENOENT:       return (syserr_no_such_file_or_directory);
     case ENOEXEC:      return (syserr_exec_format_error);
+#ifdef ENOLCK
     case ENOLCK:       return (syserr_no_locks_available);
+#endif
     case ENOMEM:       return (syserr_not_enough_space);
     case ENOSPC:       return (syserr_no_space_left_on_device);
     case ENOSYS:       return (syserr_function_not_implemented);
@@ -269,7 +271,9 @@ DEFUN (syserr_to_error_code, (syserr), enum syserr_names syserr)
     case syserr_io_error:                              return (EIO);
     case syserr_is_a_directory:                                return (EISDIR);
     case syserr_no_child_processes:                    return (ECHILD);
+#ifdef ENOLCK
     case syserr_no_locks_available:                    return (ENOLCK);
+#endif
     case syserr_no_space_left_on_device:               return (ENOSPC);
     case syserr_no_such_device:                                return (ENODEV);
     case syserr_no_such_device_or_address:             return (ENXIO);
index ddd5bed3bcfe5d00eed542249c87878d9291c9fe..10801c5f80d1c95d1aed43eeda673b8c8f62b14e 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Id: uxtrap.h,v 1.16 1992/08/29 13:10:09 jinx Exp $
+$Id: uxtrap.h,v 1.17 1993/02/06 05:46:32 gjr Exp $
 
-Copyright (c) 1990-1992 Massachusetts Institute of Technology
+Copyright (c) 1990-1993 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -90,11 +90,12 @@ MIT in each case. */
 \f
 #ifdef hp9000s800
 
-#include <sys/sysmacros.h>
+/* The bottom 2 bits of the PC are protection bits.
+   They should be masked away before looking at the PC.
+ */
 
-/* See <machine/save_state.h> included by <signal.h> */
+#define PC_VALUE_MASK                  ((~0) << 2)
 
-#ifndef sc_pc
 /* pcoq is the offset (32 bit in 64 bit virtual address space)
    in the space included in the corresponding sc_pcsq.
    head is the current instruction, tail is the next instruction
@@ -103,27 +104,29 @@ MIT in each case. */
    Both queues need to be collected for some screw cases of
    debugging and if there is ever a hope to restart the code.
  */
-#define sc_pc                          sc_pcoq_head
-#endif
 
-#define ss_gr0                         ss_flags        /* not really true */
-#define ss_rfree                       ss_gr21         /* or some such */
-#define ss_schsp                       ss_gr22
+#ifdef _HPUX
+# include <sys/sysmacros.h>
 
-#define HAVE_FULL_SIGCONTEXT
-#define FULL_SIGCONTEXT_RFREE(scp)     ((scp)->sc_sl.sl_ss.ss_rfree)
-#define FULL_SIGCONTEXT_SCHSP(scp)     ((scp)->sc_sl.sl_ss.ss_schsp)
-#define FULL_SIGCONTEXT_FIRST_REG(scp) (&((scp)->sc_sl.sl_ss.ss_gr0))
-#define FULL_SIGCONTEXT_NREGS          32
-#define PROCESSOR_NREGS                        32
+/* See <machine/save_state.h> included by <signal.h> */
 
-/* The bottom 2 bits of the PC are protection bits.
-   They should be masked away before looking at the PC.
- */
+# define HAVE_FULL_SIGCONTEXT
 
-#define PC_VALUE_MASK                  ((~0) << 2)
+# ifndef sc_pc
+#  define sc_pc                                sc_pcoq_head
+# endif /* sc_pc */
 
-#define INITIALIZE_UX_SIGNAL_CODES()                                   \
+# define ss_gr0                                ss_flags        /* not really true */
+# define ss_rfree                      ss_gr21         /* or some such */
+# define ss_schsp                      ss_gr22
+
+# define FULL_SIGCONTEXT_RFREE(scp)    ((scp)->sc_sl.sl_ss.ss_rfree)
+# define FULL_SIGCONTEXT_SCHSP(scp)    ((scp)->sc_sl.sl_ss.ss_schsp)
+# define FULL_SIGCONTEXT_FIRST_REG(scp)        (&((scp)->sc_sl.sl_ss.ss_gr0))
+# define FULL_SIGCONTEXT_NREGS         32
+# define PROCESSOR_NREGS               32
+
+# define INITIALIZE_UX_SIGNAL_CODES()                                  \
 {                                                                      \
   DECLARE_UX_SIGNAL_CODE                                               \
     (SIGILL, (~ 0L), 8, "illegal instruction trap");                   \
@@ -143,7 +146,7 @@ MIT in each case. */
     (SIGFPE, (~ 0L), 22, "assist emulation trap");                     \
 }
 
-#define SPECIAL_SIGNAL_CODE_NAMES()                                    \
+# define SPECIAL_SIGNAL_CODE_NAMES()                                   \
 {                                                                      \
   if ((signo == SIGFPE) && (code == 14))                               \
     switch ((((*scp) . sc_sl . sl_ss . ss_frexcp1) >> 26) & 0x3f)      \
@@ -178,6 +181,14 @@ MIT in each case. */
       }                                                                        \
 }
 
+#else /* not _HPUX, BSD ? */
+
+# ifndef sc_pc
+#  define sc_pc                                sc_pcoqh
+# endif /* sc_pc */
+
+#endif /* _HPUX */
+
 #endif /* hp9000s800 */
 \f
 #ifdef sun3