3

In Linux, in Perl, using the FCGI module, using the Open Socket function, is it possible to create an unix domain sockets using abstract names?

I tried to create a socket starting with a null character \0wibble \zwibble \x{0}wibble and it didn't work!

It worked only using pathname, as described in unix(7):

$socket = FCGI::OpenSocket( "/tmp/wibble", 10 );

Thank you!

4

1 回答 1

3

FCGI::OpenSocket() 底层的实现不支持它。

该调用最终调用了一个 C 函数int OS_CreateLocalIpcFd(const char *bindPath, int backlog)。您可以立即推断出该bindPath参数被理解为以 NUL 结尾的字符串,而不是以 NUL 为前缀的字符串。

如果您可以为 FCGI.pm 提供自己的套接字,您可能有机会完成这项工作。

于 2013-04-24T05:24:32.060 回答