SunOS compile support: add -lrt to support nanosleep(); add definition of strndup()

This commit is contained in:
Aaron Lewis 2016-12-29 17:03:46 +08:00
parent 796992d82d
commit 34f5d55b84
2 changed files with 26 additions and 1 deletions

6
configure vendored
View file

@ -1220,6 +1220,10 @@ if [ "X" != "X$DEBUG" ]; then
echo DEBUG: STRIP=$STRIP
fi
if [ "$SYSS" = "SunOS" ]; then
XLIBS="$XLIBS -lrt"
fi
echo "Writing Makefile.in ..."
if [ "X" != "X$FHS" ]; then
echo "MANDIR = /share/man/man1" >> Makefile.in
@ -1263,7 +1267,7 @@ if [ "x$WINDRES" = "x" ]; then
echo HYDRA_LOGO= >> Makefile
echo PWI_LOGO= >> Makefile
fi
if [ "$GCCSEC" = "yes" ]; then
if [ "$GCCSEC" = "yes" ] && [ "$SYSS" != "SunOS" ]; then
echo "SEC=$GCCSECOPT" >> Makefile
else
echo "SEC=" >> Makefile

View file

@ -114,6 +114,27 @@ ptr_header_node header_exists(ptr_header_node * ptr_head, char *header_name, cha
return found_header;
}
#if defined(__sun)
/* Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu> */
char *
strndup (const char *s, size_t n)
{
char *result;
size_t len = strlen (s);
if (n < len)
len = n;
result = (char *) malloc (len + 1);
if (!result)
return 0;
memcpy (result, s, len);
result[len] = '\0';
return(result);
}
#endif
int append_cookie(char *name, char *value, ptr_cookie_node *last_cookie)
{
ptr_cookie_node new_ptr = (ptr_cookie_node) malloc(sizeof(t_cookie_node));