File Coverage

ChildSubReaper.xs
Criterion Covered Total %
statement 1 2 50.0
branch 1 4 25.0
condition n/a
subroutine n/a
pod n/a
total 2 6 33.3


line stmt bran cond sub pod time code
1             #define PERL_NO_GET_CONTEXT
2             #include "EXTERN.h"
3             #include "perl.h"
4             #include "XSUB.h"
5              
6             #include
7              
8             #if defined(__linux__)
9             # include
10             # ifdef PR_SET_CHILD_SUBREAPER
11             # define HARNESS_HAVE_SUBREAPER 1
12             # endif
13             #endif
14              
15             #ifndef HARNESS_HAVE_SUBREAPER
16             # define HARNESS_HAVE_SUBREAPER 0
17             #endif
18              
19             MODULE = Test2::Harness2::ChildSubReaper PACKAGE = Test2::Harness2::ChildSubReaper
20              
21             int
22             have_subreaper_support()
23             CODE:
24 4 50         RETVAL = HARNESS_HAVE_SUBREAPER;
25             OUTPUT:
26             RETVAL
27              
28             int
29             set_child_subreaper(on)
30             int on
31             CODE:
32             #if HARNESS_HAVE_SUBREAPER
33 0 0         RETVAL = (prctl(PR_SET_CHILD_SUBREAPER, on ? 1 : 0, 0, 0, 0) == 0) ? 1 : 0;
34             #else
35             PERL_UNUSED_VAR(on);
36             errno = ENOSYS;
37             RETVAL = 0;
38             #endif
39             OUTPUT:
40             RETVAL