Try to compile this and see if you get 127.0.0.1 printed
#include ns.h
main()
{
struct in_addr addr;
addr.s_addr = inet_addr(127.0.0.1);
printf(%s\n, ns_inet_ntoa(addr));
}
gcc -I /usr/local/ns/include -o a a.c /usr/local/ns/lib/libnsthread.so
Michael A. Cleverly wrote:
I've
On Linux HAVE_INET_NTOP is defined, i assume on OpenBSD not and
the part with the union is not working
char *
ns_inet_ntoa(struct in_addr addr)
{
Tls *tlsPtr = GetTls();
#if defined(HAVE_INET_NTOP)
inet_ntop(AF_INET, addr, tlsPtr-nabuf, sizeof(tlsPtr-nabuf));
#else
union {
On 2/6/07, Vlad Seryakov [EMAIL PROTECTED] wrote:
On Linux HAVE_INET_NTOP is defined, i assume on OpenBSD not and
the part with the union is not working
It should be defined, because it seems to have it:
http://www.openbsd.org/cgi-bin/man.cgi?query=inet_ntop
Anyway, our custom test for
Try this one:
#include ns.h
main()
{
unsigned char b[4];
struct in_addr addr;
addr.s_addr = inet_addr(127.0.0.1);
memcpy(b, addr.s_addr, 4);
printf(%u.%u.%u.%u\n, b[0], b[1], b[2], b[3]);
}
Stephen Deasey wrote:
On 2/6/07, Vlad Seryakov [EMAIL PROTECTED] wrote:
On Linux
On 2/6/07, Michael A. Cleverly [EMAIL PROTECTED] wrote:
On 2/6/07, Vlad Seryakov [EMAIL PROTECTED] wrote:
Try to compile this and see if you get 127.0.0.1 printed
#include ns.h
main()
{
struct in_addr addr;
addr.s_addr = inet_addr(127.0.0.1);
printf(%s\n,
On 2/6/07, Vlad Seryakov [EMAIL PROTECTED] wrote:
Try this one:
#include ns.h
main()
{
unsigned char b[4];
struct in_addr addr;
addr.s_addr = inet_addr(127.0.0.1);
memcpy(b, addr.s_addr, 4);
printf(%u.%u.%u.%u\n, b[0], b[1], b[2], b[3]);
}
That produces 127.0.0.1 on
On 2/6/07, Stephen Deasey [EMAIL PROTECTED] wrote:
On 2/6/07, Vlad Seryakov [EMAIL PROTECTED] wrote:
On Linux HAVE_INET_NTOP is defined, i assume on OpenBSD not and
the part with the union is not working
It should be defined, because it seems to have it: