summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCharles Lane <lane@DUPHY4.Physics.Drexel.Edu>2001-11-29 09:18:51 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-29 21:01:31 +0000
commit2e34cc90b22e8d09149d579a4d5db71a1836c9ca (patch)
tree9f5df4db4a9bab7b0e3ce131160908bac5c1dc3a /vms
parent172b427308d6c743395c4894b0e752cb7cd59c93 (diff)
downloadperl-2e34cc90b22e8d09149d579a4d5db71a1836c9ca.tar.gz
VMS pre7 default signal handling
Message-Id: <011129141454.666c6@DUPHY4.Physics.Drexel.Edu> p4raw-id: //depot/perl@13371
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c35
-rw-r--r--vms/vmsish.h2
2 files changed, 28 insertions, 9 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 7ecb29fed5..fc2ae303f1 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -1125,14 +1125,10 @@ Perl_my_sigaction (pTHX_ int sig, const struct sigaction* act,
#define _MY_SIG_MAX 17
-int
-Perl_my_kill(int pid, int sig)
+unsigned int
+Perl_sig_to_vmscondition(int sig)
{
- int iss;
- int sys$sigprc(unsigned int *pidadr,
- struct dsc$descriptor_s *prcname,
- unsigned int code);
- static unsigned long sig_code[_MY_SIG_MAX+1] =
+ static unsigned int sig_code[_MY_SIG_MAX+1] =
{
0, /* 0 ZERO */
SS$_HANGUP, /* 1 SIGHUP */
@@ -1167,11 +1163,28 @@ Perl_my_kill(int pid, int sig)
}
#endif
- if (!pid || sig < _SIG_MIN || sig > _SIG_MAX || sig > _MY_SIG_MAX || !sig_code[sig]) {
+ if (sig < _SIG_MIN) return 0;
+ if (sig > _MY_SIG_MAX) return 0;
+ return sig_code[sig];
+}
+
+
+int
+Perl_my_kill(int pid, int sig)
+{
+ int iss;
+ unsigned int code;
+ int sys$sigprc(unsigned int *pidadr,
+ struct dsc$descriptor_s *prcname,
+ unsigned int code);
+
+ code = Perl_sig_to_vmscondition(sig);
+
+ if (!pid || !code) {
return -1;
}
- iss = sys$sigprc((unsigned int *)&pid,0,sig_code[sig]);
+ iss = sys$sigprc((unsigned int *)&pid,0,code);
if (iss&1) return 0;
switch (iss) {
@@ -4387,6 +4400,10 @@ vms_image_init(int *argcp, char ***argvp)
{ sizeof rsz, JPI$_RIGHTS_SIZE, &rsz, &dummy},
{ 0, 0, 0, 0} };
+#ifdef KILL_BY_SIGPRC
+ (void) Perl_csighandler_init();
+#endif
+
_ckvmssts_noperl(sys$getjpiw(0,NULL,NULL,jpilist,iosb,NULL,NULL));
_ckvmssts_noperl(iosb[0]);
for (i = 0; i < sizeof iprv / sizeof(unsigned long int); i++) {
diff --git a/vms/vmsish.h b/vms/vmsish.h
index a21c9e3982..573f254cb8 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -773,7 +773,9 @@ FILE * Perl_my_tmpfile ();
int Perl_my_sigaction (pTHX_ int, const struct sigaction*, struct sigaction*);
#endif
#ifdef KILL_BY_SIGPRC
+unsigned int Perl_sig_to_vmscondition (int);
int Perl_my_kill (int, int);
+void Perl_csighandler_init (void);
#endif
int Perl_my_utime (pTHX_ char *, struct utimbuf *);
void Perl_vms_image_init (int *, char ***);