Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#37 porting fixes for scsh 0.5.1 on NetBSD 1

open
Olin Shivers
build (18)
5
2001-05-28
2001-05-28
No

From: Bill Sommerfeld
<sommerfeld@orchard.arlington.ma.us>
To: scsh-bugs@martigny.ai.mit.edu
Subject: porting fixes for scsh 0.5.1 on NetBSD 1.4
Date: Fri, 04 Jun 1999 11:47:01 -0400

NetBSD 1.4 has revised sigset_t to support up to 128
signals; however,
it's (luckily) only defining 33 at the moment.

The following diffs provide support for saving the
first 48 bits of
the signal mask (which is all scsh has room to save),
as well as
making SIGPWR visible within scsh.

- Bill

*** scsh/bsd/sigset.h.original Fri Oct 13 23:33:55
1995
--- scsh/bsd/sigset.h Fri Jun 4 10:55:41 1999
***************
*** 2,10 ****
--- 2,34 ----
** These macros are OS-dependent, and must be
defined per-OS.
*/

+ #if defined(__NetBSD__)
+ #include <sys/param.h>
+ #endif
+
+ #if defined(__NetBSD__) && defined
(__NetBSD_Version__) && (__NetBSD_Version__\ >= 103080000)
+ /* Barf */
+
+ #if _NSIG > 48
+ #error Too many signals! Fix scsh to save more of
them!
+ #endif
+
+ #define make_sigset(maskp, hi, lo) do { __sigemptyset
(maskp); \ + (maskp)->__bits[0] = ((hi)<<24)|(lo); \ + (maskp)->__bits[1] = ((hi)>>8); \ + } while(0)
+
+ /* Not a procedure: */
+ #define split_sigset(mask, hip, lop) \ + ((*(hip)=((mask.__bits[0]>>24)&0xff) |
(mask.__bits[1]<<8)), \ + (*(lop)=(mask.__bits[0]&0xffffff)))
+
+ #else
+
#define make_sigset(maskp, hi, lo) (*maskp=((hi)<<24)
|(lo))

/* Not a procedure: */
#define split_sigset(mask, hip, lop) \ ((*(hip)=(mask>>24)&0xff), \ (*(lop)=(mask&0xffffff)))
+ #endif

--- scsh/bsd/signals.scm.~1~ Thu Sep 12 02:00:17
1996
+++ scsh/bsd/signals.scm Fri Jun 4 11:15:50
1999
@@ -65,6 +65,9 @@
;; User defined
(usr1 30) ; user defined signal 1
(usr2 31) ; user defined signal 2
+
+ ;; NetBSD 1.4
+ (pwr 32) ; impending power failure
)

(define signals-ignored-by-default

--- scsh/bsd/signals1.c.~1~ Thu Sep 12 02:01:30
1996
+++ scsh/bsd/signals1.c Fri Jun 4 11:33:37 1999
@@ -5,6 +5,10 @@
/* Make sure our exports match up w/the
implementation: */
#include "../signals1.h"

+#if defined(__NetBSD__)
+#include <sys/param.h>
+#endif
+
/* This table converts Unix signal numbers to
S48/scsh interrupt numbers.
** If the signal doesn't have an interrupt number,
the entry is -1.
** (Only asynchronous signals have interrupt numbers.)
@@ -45,10 +49,13 @@
scshint_winch, /* SIGWINCH */
scshint_info, /* SIGINFO */
scshint_usr1, /* SIGUSR1 */
- scshint_usr2 /* SIGUSR2 */
+ scshint_usr2, /* SIGUSR2 */
+#if defined(__NetBSD__) && defined
(__NetBSD_Version__) && (__NetBSD_Version__ \ >= 103080000)
+ scshint_pwr, /* SIGPWR */
+#endif
};

-const int max_sig = 31; /* SIGUSR2 */
+const int max_sig = (sizeof(sig2int)/sizeof(int)) - 1;

/*
scshint_alarm

Discussion