#include <sys/types.h>
#include <dirent.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <sys/socket.h>
#define NODEFINE
#include <u.h>
#include <libc.h>
#include <fcall.h>
#include "fd.h"
int
pm_sleep(long ms)
{
struct timeval tv;
tv.tv_usec = (ms%1000)*1000;
tv.tv_sec = ms/1000;
if(select(0, NULL, NULL, NULL, &tv) < 0){
pm_oserror();
return -1;
}
return 0;
}
syntax highlighted by Code2HTML, v. 0.9.1