Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.nanvix
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ CONFIGURE_OPTS = \
ac_cv_func_getsockname=yes \
ac_cv_func_inet_aton=no \
ac_cv_func_inet_ntoa=yes \
ac_cv_func_inet_pton=no \
ac_cv_func_inet_pton=yes \
ac_cv_func_statvfs=no \
ac_cv_func_fstatvfs=no \
ac_cv_func_fdopendir=no
Expand Down
18 changes: 0 additions & 18 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,24 +485,6 @@ _Py_nanvix_inet_addr(const char *cp)
}
#define inet_addr(cp) _Py_nanvix_inet_addr(cp)

/* Nanvix libc's inet_ntop() is a stub that always returns ENOSYS.
Provide a simple replacement for AF_INET. */
static const char *
_Py_nanvix_inet_ntop(int af, const void *src, char *dst, socklen_t size)
{
if (af == AF_INET) {
const unsigned char *b = (const unsigned char *)src;
int n = snprintf(dst, size, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
if (n < 0 || (socklen_t)n >= size) {
errno = ENOSPC;
return NULL;
}
return dst;
}
errno = EAFNOSUPPORT;
return NULL;
}
#define inet_ntop(af, src, dst, size) _Py_nanvix_inet_ntop(af, src, dst, size)
#endif /* __nanvix__ */

#ifdef MS_WINDOWS
Expand Down
Loading