mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Enable net_get_interfaces on IBM i PASE
On IBM i, getifaddrs is available renamed as Qp2getifaddrs; freeifaddrs and struct ifaddr follow a similar fate. I assume this is in case AIX decides to add it (as if). As such, just use the same implementation, but rename the standard ones to the IBM i definitions and include its header.
This commit is contained in:
parent
21f2ff79de
commit
4f51a11a84
2 changed files with 10 additions and 1 deletions
|
@ -429,7 +429,9 @@ function getmxrr(string $hostname, &$hosts, &$weights = null): bool {}
|
|||
|
||||
/* net.c */
|
||||
|
||||
#if defined(PHP_WIN32) || HAVE_GETIFADDRS
|
||||
function net_get_interfaces(): array|false {}
|
||||
#endif
|
||||
|
||||
/* ftok.c */
|
||||
|
||||
|
|
|
@ -27,6 +27,13 @@
|
|||
|
||||
#if HAVE_GETIFADDRS
|
||||
# include <ifaddrs.h>
|
||||
#elif defined(__PASE__)
|
||||
/* IBM i implements getifaddrs, but under its own name */
|
||||
#include <as400_protos.h>
|
||||
#define getifaddrs Qp2getifaddrs
|
||||
#define freeifaddrs Qp2freeifaddrs
|
||||
#define ifaddrs ifaddrs_pase
|
||||
#define HAVE_GETIFADDRS
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
|
@ -126,7 +133,6 @@ static void iface_append_unicast(zval *unicast, zend_long flags,
|
|||
|
||||
add_next_index_zval(unicast, &u);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* {{{ Returns an array in the form:
|
||||
array(
|
||||
|
@ -304,4 +310,5 @@ PHP_FUNCTION(net_get_interfaces) {
|
|||
ZEND_UNREACHABLE();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
/* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue