[php-src] PR #15511: main/network: Use more appropriate types
| From: | Girgias | Date: | Wed, 21 Aug 2024 00:05:56 +0000 |
| Subject: | [php-src] PR #15511: main/network: Use more appropriate types | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28091@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15511
Author: Girgias
And check directly against 0 for success for functions not returning a
zend_result.
While going through the file I noticed two things:
## poll(2) emulation
We define our own poll function when PHP_USE_POLL_2_EMULATION is set, but
I can't seem to find when it is set, is this related to Windows @cmb69 ?
## Usage of gethostbyname_r()
It seems like this function is obsolete and
> Applications should use
> [getaddrinfo(3)](https://man7.org/linux/man-pages/man3/getaddrinfo.3.html),
> [getnameinfo(3)](https://man7.org/linux/man-pages/man3/getnameinfo.3.html), and
> [gai_strerror(3)](https://man7.org/linux/man-pages/man3/gai_strerror.3.html) instead.
according to https://man7.org/linux/man-pages/man3/gethostbyname.3.html
So maybe we should review this code to use more modern functions?