NetBSD implements O_CLOEXEC, so let us use it to avoid
inadvertant FD sharing. It also has the same value for SIGWINCH
as Linux and the other BSDs we support.
use SDBM_File; # part of Perl standard library
use Fcntl qw(O_RDWR O_CREAT);
use File::Temp 0.19 (); # 0.19 for ->newdir
use SDBM_File; # part of Perl standard library
use Fcntl qw(O_RDWR O_CREAT);
use File::Temp 0.19 (); # 0.19 for ->newdir
-my %e = (freebsd => 0x100000, linux => 0x80000, openbsd => 0x10000);
+my %e = (
+ freebsd => 0x100000,
+ linux => 0x80000,
+ netbsd => 0x400000,
+ openbsd => 0x10000,
+);
my $O_CLOEXEC = $e{$^O} // 0;
sub new {
my $O_CLOEXEC = $e{$^O} // 0;
sub new {
my $self = fields::new($class);
my %signo = map {;
my $cb = $sig->{$_};
my $self = fields::new($class);
my %signo = map {;
my $cb = $sig->{$_};
+ # SIGWINCH is 28 on FreeBSD, NetBSD, OpenBSD
my $num = ($_ eq 'WINCH' && $^O =~ /linux|bsd/i) ? 28 : do {
my $m = "SIG$_";
POSIX->$m;
my $num = ($_ eq 'WINCH' && $^O =~ /linux|bsd/i) ? 28 : do {
my $m = "SIG$_";
POSIX->$m;