Re: [PHP-DEV] FD_SETSIZE limitation

2009-02-19 Thread Mark Karpeles
Hi, That's the reason why I started writing an ext for PHP that would implement epoll() on linux, and stuff-with-ws2 on Win32. However I don't mind making this a patch to the stream ext. Basically I get the following functions: consts: STREAM_POLL_IN (read) STREAM_POLL_OUT (write) STREAM_POLL_

Re: [PHP-DEV] FD_SETSIZE limitation

2009-02-19 Thread Moriyoshi Koizumi
Robin Burchell wrote: > On Thu, Feb 19, 2009 at 10:24 PM, Andrei Zmievski > wrote: >> Can someone explain why ext/sockets and also stream socket functions care >> about FD_SETSIZE? > > They care, because they use the select(2) syscall, which cares about > FD_SETSIZE. > select(2) itself can ha

Re: [PHP-DEV] FD_SETSIZE limitation

2009-02-19 Thread Moriyoshi Koizumi
That's because struct fd_set, which is manipulated by FD_SET, is a struct that contains a fixed-size array. Moriyoshi Andrei Zmievski wrote: > Can someone explain why ext/sockets and also stream socket functions > care about FD_SETSIZE? > > # define PHP_SAFE_FD_SET(fd, set) do { if (fd < FD_SE

Re: [PHP-DEV] FD_SETSIZE limitation

2009-02-19 Thread Robin Burchell
On Thu, Feb 19, 2009 at 10:24 PM, Andrei Zmievski wrote: > Can someone explain why ext/sockets and also stream socket functions care > about FD_SETSIZE? They care, because they use the select(2) syscall, which cares about FD_SETSIZE. -- PHP Internals - PHP Runtime Development Mailing List To un

[PHP-DEV] FD_SETSIZE limitation

2009-02-19 Thread Andrei Zmievski
Can someone explain why ext/sockets and also stream socket functions care about FD_SETSIZE? # define PHP_SAFE_FD_SET(fd, set) do { if (fd < FD_SETSIZE) FD_SET(fd, set); } while(0) On Linux, it's not a hard limitation imposed by the kernel. It's configurable via sysctl. -Andrei -- PHP Inte