Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/osf1 return error if unsupported sigaltstack flag...



details:   https://anonhg.NetBSD.org/src/rev/54e17b43a33c
branches:  trunk
changeset: 472468:54e17b43a33c
user:      cgd <cgd%NetBSD.org@localhost>
date:      Fri Apr 30 05:24:04 1999 +0000

description:
return error if unsupported sigaltstack flags used

diffstat:

 sys/compat/osf1/osf1_signal.c |  19 ++++++++++++++-----
 sys/compat/osf1/osf1_signal.h |   4 ++--
 2 files changed, 16 insertions(+), 7 deletions(-)

diffs (68 lines):

diff -r 5dbcd26dac9f -r 54e17b43a33c sys/compat/osf1/osf1_signal.c
--- a/sys/compat/osf1/osf1_signal.c     Fri Apr 30 05:09:43 1999 +0000
+++ b/sys/compat/osf1/osf1_signal.c     Fri Apr 30 05:24:04 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: osf1_signal.c,v 1.12 1999/04/26 05:35:08 cgd Exp $     */
+/*     $NetBSD: osf1_signal.c,v 1.13 1999/04/30 05:24:04 cgd Exp $     */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -242,19 +242,27 @@
     {  0                                                               },
 };
 
-void
+int
 osf1_to_bsd_sigaltstack(oss, bss)
        const struct osf1_sigaltstack *oss;
        struct sigaltstack *bss;
 {
+       unsigned long leftovers;
 
        bss->ss_sp = oss->ss_sp;
        bss->ss_size = oss->ss_size;
 
         /* translate flags */
        bss->ss_flags = emul_flags_translate(osf1_sigaltstack_flags_xtab,
-            oss->ss_flags, NULL);
-       /* XXX error if we can't translate */
+            oss->ss_flags, &leftovers);
+
+       if (leftovers != 0) {
+               printf("osf1_to_bsd_sigaltstack: leftovers = 0x%lx\n",
+                   leftovers);
+               return (EINVAL);
+       }
+
+       return (0);
 }
 
 void
@@ -347,7 +355,8 @@
                nbss = stackgap_alloc(&sg, sizeof(struct sigaltstack));
                if ((error = copyin(noss, &tmposs, sizeof(tmposs))) != 0)
                        return error;
-               osf1_to_bsd_sigaltstack(&tmposs, &tmpbss);
+               if ((error = osf1_to_bsd_sigaltstack(&tmposs, &tmpbss)) != 0)
+                       return error;
                if ((error = copyout(&tmpbss, nbss, sizeof(tmpbss))) != 0)
                        return error;
        } else
diff -r 5dbcd26dac9f -r 54e17b43a33c sys/compat/osf1/osf1_signal.h
--- a/sys/compat/osf1/osf1_signal.h     Fri Apr 30 05:09:43 1999 +0000
+++ b/sys/compat/osf1/osf1_signal.h     Fri Apr 30 05:24:04 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: osf1_signal.h,v 1.3 1999/04/26 01:22:18 cgd Exp $      */
+/*     $NetBSD: osf1_signal.h,v 1.4 1999/04/30 05:24:04 cgd Exp $      */
 
 #ifndef _OSF1_SIGNAL_H
 #define _OSF1_SIGNAL_H
@@ -48,7 +48,7 @@
 extern int osf1_to_linux_sig[];
 void bsd_to_osf1_sigaltstack __P((const struct sigaltstack *, struct osf1_sigaltstack *));
 void bsd_to_osf1_sigset __P((const sigset_t *, osf1_sigset_t *));
-void osf1_to_bsd_sigaltstack __P((const struct osf1_sigaltstack *, struct sigaltstack *));
+int osf1_to_bsd_sigaltstack __P((const struct osf1_sigaltstack *, struct sigaltstack *));
 void osf1_to_bsd_sigset __P((const osf1_sigset_t *, sigset_t *));
 
 #endif /* !_OSF1_SIGNAL_H */



Home | Main Index | Thread Index | Old Index