premute signals on binaries
Saul Lubkin
lubkin at cs.rochester.edu
Fri Jul 13 04:09:33 AEST 1990
I have a problem attempting to permute the significance of certain signals for
an already existing, stripped, executable binary compiled with cc.
Here are the details. Since r3.2, all versions of System V Unix for the
[34]86 are supposed to be binary-compatible, at least for character
applications. This was basically so, until SCO's version 1 and Interactive
System's version 2.2 came out. Both of these are POSIX/FIPS compliant. In
particular, they support the POSIX versions of the five job control signals.
For example, in ISC 2.2, these are #defined, in <sys/signal.h>, as
#define SIGCONT 23 /* continue if stopped */
#define SIGSTOP 24 /* stop signal (cannot be caught or ignored) */
#define SIGTSTP 25 /* interactive stop signal */
#define SIGTTIN 26 /* background read attempted */
#define SIGTTOU 27 /* background write attempted */
Unfortunately, in SCO's version, the first three of these are #defined
differently (a cyclic permutation, as I recall -- e.g., SIGSTOP is 23, etc.)
The last two (SIGTTIN and SIGTTOU) are the same.
This inconsistancy should eventually disappear, in about a year, when both
companies move up to Sys V, r4, which will specify a binary standard for these
signals, forcing one (or the other or both) to redo theses #define's.
My problem is: I wish to run SCO's ksh (which was compiled by SCO from the
latest version of AT&T's Toolkit, and supports job control), under ISC's
operating system. (ISC has a csh supporting job control -- One would have the
analogous problem trying to run that under SCO's operating system).
Clearly, the ideal would be to use a good binary editor (which I have), and
somehow find every use in SCO ksh of these three signals, replacing with the
ISC number each time. I don't know if this is possible on a STRIPPED binary.
(Alternatively, perhaps one can rename SCO ksh "scoksh" and write a wrapper
aroung scoksh, and call the wrapper "ksh". The wrapper would simply intercept
all signals sent to the process, replace them by their SCO equivalents, and
send this on to scoksh. Problems: (1) How to catch SIGSTOP (says "cannot be
caught or ignored"); (2) And what to do about signals SENT OUT by scoksh to
executing processes?)
I've cross-posted this, as I though the problem would be of interst to all
three groups.
Any advice would be appreciated. Please email to me, as I don't read most of
these groups regularly. I'll summarize.
Thanks in advance,
Sincerely yours,
Saul Lubkin
More information about the Comp.unix.questions
mailing list