AFS-PAG
view release on metacpan or search on metacpan
# include our own instead of Perl's before building any source, since all of
# the files (copied from rra-c-util, so we don't want to change them) include
# config.h as the first action. Second, Module::Build can only handle one
# directory of supplemental source files.
#
# We deal with both of these issues by creating stub files in a subdirectory
# named glue that include glue/config.h and then the actual C source file.
for my $file (@c_files) {
my $glue_file = File::Spec->catfile('glue', basename($file));
open(my $wrapper, '>', $glue_file);
say {$wrapper} '#include <glue/config.h>'
or die "Cannot write to $glue_file: $!\n";
say {$wrapper} "#include <$file>"
or die "Cannot write to $glue_file: $!\n";
close($wrapper);
}
# Generate the build script.
$build->create_build_script;
kafs/kafs.c view on Meta::CPAN
/*
* On some platforms, k_hasafs needs to try a system call. This attempt may
* fail with SIGSYS. We therefore set a signal handler that changes a static
* variable if SIGSYS is received.
*
* It's really ugly to do this in library or PAM module in so many ways.
* Static variables are evil, changing signal handlers out from under an
* application is evil, and the interaction of signals and threads is probably
* nasty. The only things that make this better is that this case will never
* be triggered in the normal case of AFS being loaded and the only time that
* we change this static variable is to say that the call failed, so there
* shouldn't be a collision of updates from multiple calls.
*
* It's probably safe to just ignore SIGSYS instead, but this feels more
* thorough.
*/
static volatile sig_atomic_t syscall_okay = 1;
/*
* Signal handler to catch failed system calls and change the okay flag.
( run in 0.432 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )