raising the head after a three-weeks refactoring
[m6w6/ext-psi] / psi.d / netdb.psi
index 3eca2915c84438512c427f93d9e109c102814be5..f37476d186275cf701243b34c6db58e287700871 100644 (file)
@@ -44,10 +44,15 @@ function psi\gai_strerror(int $errcode) : string {
 }
 
 // extern int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)
-function psi\getaddrinfo(string $node, string $service, array $hints, object &$res = NULL) : int {
+function psi\getaddrinfo(string $node, string $service, array $hints = NULL, object &$res = NULL) : int {
        let node = strval($node);
        let service = strval($service);
-       let hints = &arrval($hints);
+       let hints = &arrval($hints,
+               intval($ai_flags),
+               intval($ai_family),
+               intval($ai_socktype),
+               intval($ai_protocol)
+       );
        let res = &NULL;
        return to_int(getaddrinfo);
        set $res = to_array(**res,