1 | =head1 NAME |
1 | =head1 NAME |
2 | |
2 | |
3 | AnyEvent - provide framework for multiple event loops |
3 | AnyEvent - provide framework for multiple event loops |
4 | |
4 | |
5 | EV, Event, Glib, Tk, Perl, Event::Lib, Qt, POE - various supported event loops |
5 | EV, Event, Glib, Tk, Perl, Event::Lib, Qt and POE are various supported |
|
|
6 | event loops. |
6 | |
7 | |
7 | =head1 SYNOPSIS |
8 | =head1 SYNOPSIS |
8 | |
9 | |
9 | use AnyEvent; |
10 | use AnyEvent; |
10 | |
11 | |
… | |
… | |
930 | no warnings; |
931 | no warnings; |
931 | use strict qw(vars subs); |
932 | use strict qw(vars subs); |
932 | |
933 | |
933 | use Carp; |
934 | use Carp; |
934 | |
935 | |
935 | our $VERSION = 4.41; |
936 | our $VERSION = 4.411; |
936 | our $MODEL; |
937 | our $MODEL; |
937 | |
938 | |
938 | our $AUTOLOAD; |
939 | our $AUTOLOAD; |
939 | our @ISA; |
940 | our @ISA; |
940 | |
941 | |
… | |
… | |
1141 | AnyEvent::Util::fh_nonblocking ($SIGPIPE_W) if $SIGPIPE_W; # just in case |
1142 | AnyEvent::Util::fh_nonblocking ($SIGPIPE_W) if $SIGPIPE_W; # just in case |
1142 | } else { |
1143 | } else { |
1143 | pipe $SIGPIPE_R, $SIGPIPE_W; |
1144 | pipe $SIGPIPE_R, $SIGPIPE_W; |
1144 | fcntl $SIGPIPE_R, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_R; |
1145 | fcntl $SIGPIPE_R, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_R; |
1145 | fcntl $SIGPIPE_W, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_W; # just in case |
1146 | fcntl $SIGPIPE_W, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_W; # just in case |
|
|
1147 | |
|
|
1148 | # not strictly required, as $^F is normally 2, but let's make sure... |
|
|
1149 | fcntl $SIGPIPE_R, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC; |
|
|
1150 | fcntl $SIGPIPE_W, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC; |
1146 | } |
1151 | } |
1147 | |
1152 | |
1148 | $SIGPIPE_R |
1153 | $SIGPIPE_R |
1149 | or Carp::croak "AnyEvent: unable to create a signal reporting pipe: $!\n"; |
1154 | or Carp::croak "AnyEvent: unable to create a signal reporting pipe: $!\n"; |
1150 | |
|
|
1151 | # not strictly required, as $^F is normally 2, but let's make sure... |
|
|
1152 | fcntl $SIGPIPE_R, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC; |
|
|
1153 | fcntl $SIGPIPE_W, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC; |
|
|
1154 | |
1155 | |
1155 | $SIG_IO = AnyEvent->io (fh => $SIGPIPE_R, poll => "r", cb => \&_signal_exec); |
1156 | $SIG_IO = AnyEvent->io (fh => $SIGPIPE_R, poll => "r", cb => \&_signal_exec); |
1156 | } |
1157 | } |
1157 | |
1158 | |
1158 | my $signal = uc $arg{signal} |
1159 | my $signal = uc $arg{signal} |
… | |
… | |
1952 | use AnyEvent; |
1953 | use AnyEvent; |
1953 | |
1954 | |
1954 | Similar considerations apply to $ENV{PERL_ANYEVENT_VERBOSE}, as that can |
1955 | Similar considerations apply to $ENV{PERL_ANYEVENT_VERBOSE}, as that can |
1955 | be used to probe what backend is used and gain other information (which is |
1956 | be used to probe what backend is used and gain other information (which is |
1956 | probably even less useful to an attacker than PERL_ANYEVENT_MODEL), and |
1957 | probably even less useful to an attacker than PERL_ANYEVENT_MODEL), and |
1957 | $ENV{PERL_ANYEGENT_STRICT}. |
1958 | $ENV{PERL_ANYEVENT_STRICT}. |
1958 | |
1959 | |
1959 | |
1960 | |
1960 | =head1 BUGS |
1961 | =head1 BUGS |
1961 | |
1962 | |
1962 | Perl 5.8 has numerous memleaks that sometimes hit this module and are hard |
1963 | Perl 5.8 has numerous memleaks that sometimes hit this module and are hard |