LibC: Add inet_pton for IPv4 addresses
This commit is contained in:
parent
c89780178f
commit
73fb085a41
|
@ -95,3 +95,12 @@ const char* inet_ntop(int af, const void* __restrict src, char* __restrict dst,
|
||||||
errno = EAFNOSUPPORT;
|
errno = EAFNOSUPPORT;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int inet_pton(int af, const char* __restrict src, void* __restrict dst)
|
||||||
|
{
|
||||||
|
if (af == AF_INET)
|
||||||
|
return inet_aton(src, static_cast<in_addr*>(dst));
|
||||||
|
|
||||||
|
errno = EAFNOSUPPORT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue