+ my $fh = popen_rd([qw(echo hello)]);
+ ok(fileno($fh) >= 0, 'tied fileno works');
+ my $l = <$fh>;
+ is($l, "hello\n", 'tied readline works');
+ $l = <$fh>;
+ ok(!$l, 'tied readline works for EOF');
+}
+
+{
+ my $fh = popen_rd([qw(printf foo\nbar)]);
+ ok(fileno($fh) >= 0, 'tied fileno works');
+ my @line = <$fh>;
+ is_deeply(\@line, [ "foo\n", 'bar' ], 'wantarray works on readline');
+}
+
+{
+ my $fh = popen_rd([qw(echo hello)]);
+ my $buf;
+ is(sysread($fh, $buf, 6), 6, 'sysread got 6 bytes');
+ is($buf, "hello\n", 'tied gets works');
+ is(sysread($fh, $buf, 6), 0, 'sysread got EOF');
+ $? = 1;
+ ok(close($fh), 'close succeeds');
+ is($?, 0, '$? set properly');
+}
+
+{
+ my $fh = popen_rd([qw(false)]);
+ ok(!close($fh), 'close fails on false');
+ isnt($?, 0, '$? set properly: '.$?);
+}
+
+SKIP: {
+ eval {
+ require BSD::Resource;
+ defined(BSD::Resource::RLIMIT_CPU())
+ } or skip 'BSD::Resource::RLIMIT_CPU missing', 3;