$search
00001 /* 00002 * wpa_supplicant/hostapd / Empty OS specific functions 00003 * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation. 00008 * 00009 * Alternatively, this software may be distributed under the terms of BSD 00010 * license. 00011 * 00012 * See README and COPYING for more details. 00013 * 00014 * This file can be used as a starting point when adding a new OS target. The 00015 * functions here do not really work as-is since they are just empty or only 00016 * return an error value. os_internal.c can be used as another starting point 00017 * or reference since it has example implementation of many of these functions. 00018 */ 00019 00020 #include "includes.h" 00021 00022 #include "os.h" 00023 00024 void os_sleep(os_time_t sec, os_time_t usec) 00025 { 00026 } 00027 00028 00029 int os_get_time(struct os_time *t) 00030 { 00031 return -1; 00032 } 00033 00034 00035 int os_mktime(int year, int month, int day, int hour, int min, int sec, 00036 os_time_t *t) 00037 { 00038 return -1; 00039 } 00040 00041 00042 int os_daemonize(const char *pid_file) 00043 { 00044 return -1; 00045 } 00046 00047 00048 void os_daemonize_terminate(const char *pid_file) 00049 { 00050 } 00051 00052 00053 int os_get_random(unsigned char *buf, size_t len) 00054 { 00055 return -1; 00056 } 00057 00058 00059 unsigned long os_random(void) 00060 { 00061 return 0; 00062 } 00063 00064 00065 char * os_rel2abs_path(const char *rel_path) 00066 { 00067 return NULL; /* strdup(rel_path) can be used here */ 00068 } 00069 00070 00071 int os_program_init(void) 00072 { 00073 return 0; 00074 } 00075 00076 00077 void os_program_deinit(void) 00078 { 00079 } 00080 00081 00082 int os_setenv(const char *name, const char *value, int overwrite) 00083 { 00084 return -1; 00085 } 00086 00087 00088 int os_unsetenv(const char *name) 00089 { 00090 return -1; 00091 } 00092 00093 00094 char * os_readfile(const char *name, size_t *len) 00095 { 00096 return NULL; 00097 } 00098 00099 00100 void * os_zalloc(size_t size) 00101 { 00102 return NULL; 00103 } 00104 00105 00106 #ifdef OS_NO_C_LIB_DEFINES 00107 void * os_malloc(size_t size) 00108 { 00109 return NULL; 00110 } 00111 00112 00113 void * os_realloc(void *ptr, size_t size) 00114 { 00115 return NULL; 00116 } 00117 00118 00119 void os_free(void *ptr) 00120 { 00121 } 00122 00123 00124 void * os_memcpy(void *dest, const void *src, size_t n) 00125 { 00126 return dest; 00127 } 00128 00129 00130 void * os_memmove(void *dest, const void *src, size_t n) 00131 { 00132 return dest; 00133 } 00134 00135 00136 void * os_memset(void *s, int c, size_t n) 00137 { 00138 return s; 00139 } 00140 00141 00142 int os_memcmp(const void *s1, const void *s2, size_t n) 00143 { 00144 return 0; 00145 } 00146 00147 00148 char * os_strdup(const char *s) 00149 { 00150 return NULL; 00151 } 00152 00153 00154 size_t os_strlen(const char *s) 00155 { 00156 return 0; 00157 } 00158 00159 00160 int os_strcasecmp(const char *s1, const char *s2) 00161 { 00162 /* 00163 * Ignoring case is not required for main functionality, so just use 00164 * the case sensitive version of the function. 00165 */ 00166 return os_strcmp(s1, s2); 00167 } 00168 00169 00170 int os_strncasecmp(const char *s1, const char *s2, size_t n) 00171 { 00172 /* 00173 * Ignoring case is not required for main functionality, so just use 00174 * the case sensitive version of the function. 00175 */ 00176 return os_strncmp(s1, s2, n); 00177 } 00178 00179 00180 char * os_strchr(const char *s, int c) 00181 { 00182 return NULL; 00183 } 00184 00185 00186 char * os_strrchr(const char *s, int c) 00187 { 00188 return NULL; 00189 } 00190 00191 00192 int os_strcmp(const char *s1, const char *s2) 00193 { 00194 return 0; 00195 } 00196 00197 00198 int os_strncmp(const char *s1, const char *s2, size_t n) 00199 { 00200 return 0; 00201 } 00202 00203 00204 char * os_strncpy(char *dest, const char *src, size_t n) 00205 { 00206 return dest; 00207 } 00208 00209 00210 size_t os_strlcpy(char *dest, const char *src, size_t size) 00211 { 00212 return 0; 00213 } 00214 00215 00216 char * os_strstr(const char *haystack, const char *needle) 00217 { 00218 return NULL; 00219 } 00220 00221 00222 int os_snprintf(char *str, size_t size, const char *format, ...) 00223 { 00224 return 0; 00225 } 00226 #endif /* OS_NO_C_LIB_DEFINES */