1--TEST--
2Support for paths in the abstract namespace (bind, sendmsg, recvmsg)
3--SKIPIF--
4<?php
5if (!extension_loaded('sockets'))
6	die('skip sockets extension not available.');
7
8if (PHP_OS != 'Linux') {
9	die('skip For Linux only');
10}
11?>
12--FILE--
13<?php
14include __DIR__."/mcast_helpers.php.inc";
15
16$path = "\x00/bar_foo";
17
18echo "creating send socket\n";
19$sends1 = socket_create(AF_UNIX, SOCK_DGRAM, 0) or die("err");
20socket_set_nonblock($sends1) or die("Could not put in non-blocking mode");
21
22echo "creating receive socket\n";
23$s = socket_create(AF_UNIX, SOCK_DGRAM, 0) or die("err");
24socket_bind($s, $path) or die("err");
25
26$r = socket_sendmsg($sends1, [
27	"name" => [ "path" => $path],
28	"iov" => ["test ", "thing", "\n"],
29], 0);
30var_dump($r);
31checktimeout($s, 500);
32
33if (!socket_recv($s, $buf, 20, 0)) die("recv");
34print_r($buf);
35?>
36--EXPECTF--
37creating send socket
38creating receive socket
39int(11)
40test thing
41