8000 Improve platform support by checking /dev/fd instead of /proc/self/fd · SimonFrings/reactphp-ssh-proxy@27ccbdd · GitHub 65EE
[go: up one dir, main page]

Skip to content

Commit 27ccbdd

Browse files
committed
Improve platform support by checking /dev/fd instead of /proc/self/fd
The virtual /proc/self/fd is Linux-only, while the virtual /dev/fd is available on more platforms. On Linux, the latter is simply a symlink to the former, so this shouldn't affect existing installations.
1 parent 2da0bdf commit 27ccbdd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Io/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* @return array
1212
* @internal
1313
*/
14-
function fds($path = '/proc/self/fd')
14+
function fds($path = '/dev/fd')
1515
{
16-
// try to get list of all open FDs (Linux only) or simply assume range 0-1024 (FD_SETSIZE)
16+
// try to get list of all open FDs (Linux/Mac and others) or simply assume range 0-1024 (FD_SETSIZE)
1717
$fds = @\scandir($path);
1818

1919
return $fds !== false ? $fds : \range(0, 1024);

0 commit comments

Comments
 (0)
0