00001 /* 00002 * hdhomerun_os_posix.h 00003 * 00004 * Copyright © 2006-2010 Silicondust USA Inc. <www.silicondust.com>. 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 3 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 00018 * 00019 * As a special exception to the GNU Lesser General Public License, 00020 * you may link, statically or dynamically, an application with a 00021 * publicly distributed version of the Library to produce an 00022 * executable file containing portions of the Library, and 00023 * distribute that executable file under terms of your choice, 00024 * without any of the additional requirements listed in clause 4 of 00025 * the GNU Lesser General Public License. 00026 * 00027 * By "a publicly distributed version of the Library", we mean 00028 * either the unmodified Library as distributed by Silicondust, or a 00029 * modified version of the Library that is distributed under the 00030 * conditions defined in the GNU Lesser General Public License. 00031 */ 00032 00033 #define _FILE_OFFSET_BITS 64 00034 #include <stdlib.h> 00035 #include <stdio.h> 00036 #include <stdarg.h> 00037 #include <string.h> 00038 #include <unistd.h> 00039 #include <errno.h> 00040 #include <fcntl.h> 00041 #include <signal.h> 00042 #include <sys/types.h> 00043 #include <sys/socket.h> 00044 #include <sys/time.h> 00045 #include <sys/timeb.h> 00046 #include <sys/wait.h> 00047 #include <netinet/in.h> 00048 #include <arpa/inet.h> 00049 #include <netdb.h> 00050 #include <pthread.h> 00051 00052 typedef int bool_t; 00053 00054 #if !defined(_DARWIN_C_SOURCE) 00055 typedef void (*sig_t)(int); 00056 #endif 00057 00058 #define LIBTYPE 00059 #define console_vprintf vprintf 00060 #define console_printf printf 00061 #define THREAD_FUNC_PREFIX void * 00062 00063 #ifdef __cplusplus 00064 extern "C" { 00065 #endif 00066 00067 extern LIBTYPE uint32_t random_get32(void); 00068 extern LIBTYPE uint64_t getcurrenttime(void); 00069 extern LIBTYPE void msleep_approx(uint64_t ms); 00070 extern LIBTYPE void msleep_minimum(uint64_t ms); 00071 00072 #ifdef __cplusplus 00073 } 00074 #endif
1.6.3