compat.c revision 4b60c4a5d6e6d45f483f4a954825ea9007e1ea11
/*
compat.c : Compatibility functions for OSes not having them
Copyright (c) 2002 Timo Sirainen
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "lib.h"
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <syslog.h>
#ifndef INADDR_NONE
# define INADDR_NONE INADDR_BROADCAST
#endif
#if !defined (HAVE_STRCASECMP) && !defined (HAVE_STRICMP)
{
}
}
{
}
}
#endif
#ifndef HAVE_INET_ATON
{
if (addr == INADDR_NONE)
return 0;
return 1;
}
#endif
#ifndef HAVE_VSYSLOG
{
t_push();
t_pop();
}
#endif
#ifndef HAVE_GETPAGESIZE
int my_getpagesize(void)
{
#ifdef _SC_PAGESIZE
return sysconf(_SC_PAGESIZE);
#else
# ifdef __GNUC__
# endif
return 4096;
#endif
}
#endif
#ifndef HAVE_WRITEV
{
int i;
written = 0;
if (ret < 0)
return -1;
break;
}
if (written > SSIZE_T_MAX) {
return -1;
}
}
#endif
#ifndef HAVE_PREAD
{
if (old_offset == -1)
return -1;
return -1;
if (ret < 0)
return -1;
return -1;
return ret;
}
{
if (old_offset == -1)
return -1;
return -1;
if (ret < 0)
return -1;
return -1;
return ret;
}
#endif
#ifdef PREAD_WRAPPERS
{
}
{
}
#endif