/*
** mg_sysdep.c for  in 
** 
** Made by vianney rancurel
** Login   <vianney@epita.fr>
** 
** Started on  Wed Aug 25 12:13:32 1999 vianney rancurel
** Last update Thu Oct 28 20:15:35 1999 
*/
#include "mg.h"
#ifndef HAVE_USLEEP
# include <sys/time.h>
#endif

#ifndef HAVE_STRDUP
char			*strdup(s)
char			*s;
{
  char			*new;
  
  if ((new = malloc((strlen(s) + 1) * sizeof (char))) == NULL)
    return (NULL);
  strcpy(new,s);
  return (new);
}
#endif

#ifndef HAVE_USLEEP
int			usleep(us)
int			us;
{
   struct timeval	tv;

   tv.tv_sec = us / 1000000;
   tv.tv_usec = us % 1000000;
   return (select(0,NULL,NULL,NULL,&tv));
}
#endif

#ifndef HAVE_STRERROR
char			*strerror(errcode)
int			errcode;
{
  return (sys_errlist[errcode]);
}
#endif
