Skip to content

Commit ca6f3f6

Browse files
committed
Merge branch '7136' into PHP-8.0
* 7136: Enable net_get_interfaces on IBM i PASE
2 parents 21f2ff7 + 4f51a11 commit ca6f3f6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ function getmxrr(string $hostname, &$hosts, &$weights = null): bool {}
429429

430430
/* net.c */
431431

432+
#if defined(PHP_WIN32) || HAVE_GETIFADDRS
432433
function net_get_interfaces(): array|false {}
434+
#endif
433435

434436
/* ftok.c */
435437

ext/standard/net.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727

2828
#if HAVE_GETIFADDRS
2929
# include <ifaddrs.h>
30+
#elif defined(__PASE__)
31+
/* IBM i implements getifaddrs, but under its own name */
32+
#include <as400_protos.h>
33+
#define getifaddrs Qp2getifaddrs
34+
#define freeifaddrs Qp2freeifaddrs
35+
#define ifaddrs ifaddrs_pase
36+
#define HAVE_GETIFADDRS
3037
#endif
3138

3239
#ifdef PHP_WIN32
@@ -126,7 +133,6 @@ static void iface_append_unicast(zval *unicast, zend_long flags,
126133

127134
add_next_index_zval(unicast, &u);
128135
}
129-
#endif
130136

131137
/* {{{ Returns an array in the form:
132138
array(
@@ -304,4 +310,5 @@ PHP_FUNCTION(net_get_interfaces) {
304310
ZEND_UNREACHABLE();
305311
#endif
306312
}
313+
#endif
307314
/* }}} */

0 commit comments

Comments
 (0)