+/*
+ * The following code is defensive programming against a bug in the
+ * pdp-11 overlay implementation. Sometimes it goes nuts and asks
+ * for an overlay with some garbage number, which generates an emt
+ * trap. This is a less than elegant solution, but it is somewhat
+ * better than core dumping and losing your work, leaving your tty
+ * in a weird state, etc.
+ */
+int _ovno;
+onemt()
+{
+ int oovno;
+
+ signal(SIGEMT, onemt);
+ oovno = _ovno;
+ /* 2 and 3 are valid on 11/40 type vi, so */
+ if (_ovno < 0 || _ovno > 3)
+ _ovno = 0;
+ error("emt trap, _ovno is %d @ - try again");
+}