mirror of https://git.musl-libc.org/git/musl
Browse Source
despite being practically deprecated, these functions are still part
of the standard and thus cannot reside in a file that also contains
namespace pollution. this reverts some of the changes made in commit
e40f48a421.
rs-1.0
3 changed files with 21 additions and 16 deletions
@ -0,0 +1,11 @@ |
|||
#include <sys/socket.h> |
|||
#include <netinet/in.h> |
|||
#include <arpa/inet.h> |
|||
#include "__dns.h" |
|||
|
|||
in_addr_t inet_addr(const char *p) |
|||
{ |
|||
struct sockaddr_in sin; |
|||
if (__ipparse(&sin, AF_INET, p)) return -1; |
|||
return sin.sin_addr.s_addr; |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
#include <arpa/inet.h> |
|||
#include <stdio.h> |
|||
|
|||
char *inet_ntoa(struct in_addr in) |
|||
{ |
|||
static char buf[16]; |
|||
unsigned char *a = (void *)∈ |
|||
snprintf(buf, sizeof buf, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); |
|||
return buf; |
|||
} |
|||
Loading…
Reference in new issue