--- iaxmodem.c.orig 2007-10-06 12:22:04.000000000 -0400 +++ iaxmodem.c 2007-11-06 23:54:40.000000000 -0500 @@ -21,17 +21,18 @@ #include #include -#ifndef __OpenBSD__ +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) # ifndef USE_UNIX98_PTY # include # endif /* !USE_UNIX98_PTY */ #else +#include +#if !defined(__FreeBSD__) # include #endif +#endif -#include - #include #include #include @@ -53,6 +54,26 @@ #include #include + +#ifdef __FreeBSD__ +#include +char* strndup(const char* string, size_t n) +{ + char* copy_string = 0; + + if(0 == string || 0 == n) + return 0; + + copy_string = (char*) malloc(n + 1); + if(0 == copy_string) + return 0; + + memcpy(copy_string, string, n); + *(copy_string + n) = '\0'; + + return copy_string; +} +#endif #include #ifndef O_LARGEFILE