summaryrefslogtreecommitdiffstats
path: root/regress/sys/kern/sosplice/error/args-unix-EPROTONOSUPPORT.pl
blob: 8eca55b43e21fb3eb850d1d3aaa83b3c5f1b3bae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# test EPROTONOSUPPORT for splicing unix sockets

use strict;
use warnings;
use IO::Socket;
use BSD::Socket::Splice "SO_SPLICE";
use IO::Socket::UNIX;

our %args = (
    errno => 'EPROTONOSUPPORT',
    func => sub {
	my $s = IO::Socket::UNIX->new(
	    Type => SOCK_STREAM,
	) or die "socket failed: $!";

	my $ss = IO::Socket::UNIX->new(
	    Type => SOCK_STREAM,
	) or die "socket splice failed: $!";

	$s->setsockopt(SOL_SOCKET, SO_SPLICE, pack('i', $ss->fileno()))
	    and die "splice unix sockets succeeded";
    },
);