develooper Front page | perl.perl5.porters | Postings from July 2005

[PATCH] SigRT (again)

Thread Next
From:
H.Merijn Brand
Date:
July 27, 2005 08:26
Subject:
[PATCH] SigRT (again)
Message ID:
20050727172633.5a4a3f28@pc09
I already change the skip for sigaction.t in case either SIGRTMIN or SIGRTMAX
returns -1, as HP-UX 10.20 does, but AIX 4.3.3 is even worse, it returns 888
and 999 both bogus. The offending part in the system header file is below the
suggested patch, which cannot be applied yes, because p4 is down.

--8<--- patch
--- perl/ext/POSIX/t/sigaction.t       2005-07-25 14:15:46 +0200
+++ perl/ext/POSIX/t/sigaction.t       2005-07-27 17:11:08 +0200
@@ -180,7 +180,10 @@ ok($ok, "safe signal delivery must work"

 SKIP: {
     eval 'use POSIX qw(%SIGRT SIGRTMIN SIGRTMAX); SIGRTMIN() + SIGRTMAX()';
-    skip("no SIGRT signals", 4) if $@ || SIGRTMIN() < 0 || SIGRTMAX() < 0;
+    $@                                 # POSIX did not exort
+    || SIGRTMIN() < 0 || SIGRTMAX() < 0        # HP-UX 10.20 exports both as -1
+    || SIGRTMIN() > $Config{sig_count} # AIX 4.3.3 exports bogus 888 and 999
+       and skip("no SIGRT signals", 4);
     ok(SIGRTMAX() > SIGRTMIN(), "SIGRTMAX > SIGRTMIN");
     is(scalar %SIGRT, SIGRTMAX() - SIGRTMIN() + 1, "scalar SIGRT");
     my $sigrtmin;
-->8---

--8<--- /usr/include/sys/signal.h
#if (_XOPEN_SOURCE==500)
/*
 * sigevent structure, referred to (but not used) in asynchronous i/o.
 *
 * WARNING: The unix98 sigevent is available to user programs, but this
 *          does not itself guarantee that the kernel supports unix98 aio.
 *
 */
struct sigevent {
        union sigval            sigev_value;
        int                     sigev_signo;
        int                     sigev_notify;
#ifdef __64BIT_KERNEL
        __ptr32                 sigev_notify_function;
        __ptr32                 sigev_notify_attributes;
#else
        void                    (*sigev_notify_function)(union sigval);
        pthread_attr_t *        sigev_notify_attributes;
#endif
};

/* Values for sigev_notify */
#define SIGEV_NONE      999
#define SIGEV_SIGNAL    999
#define SIGEV_THREAD    999

#define SIGRTMIN        888
#define SIGRTMAX        999

#endif /* _XOPEN_SOURCE==500 */
#endif /* _XOPEN_SOURCE_EXTENDED */
-->8---

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2  on HP-UX 10.20, 11.00 & 11.11,
 AIX 4.3 & 5.2, SuSE 9.2 & 9.3, and Cygwin. http://www.cmve.net/~merijn
Smoking perl: http://www.test-smoke.org,    perl QA: http://qa.perl.org
 reports  to: smokers-reports@perl.org,                perl-qa@perl.org

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About