libncp: Include <string.h> instead of <strings.h> for strlen() etc. prototypes.
[dragonfly.git] / contrib / wpa_supplicant-0.5.8 / os_none.c
blob7404e2293af5d4c6a669ed10ed1469baf0f4b244
1 /*
2 * wpa_supplicant/hostapd / Empty OS specific functions
3 * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
14 * This file can be used as a starting point when adding a new OS target. The
15 * functions here do not really work as-is since they are just empty or only
16 * return an error value. os_internal.c can be used as another starting point
17 * or reference since it has example implementation of many of these functions.
20 #include "includes.h"
22 #include "os.h"
24 void os_sleep(os_time_t sec, os_time_t usec)
29 int os_get_time(struct os_time *t)
31 return -1;
35 int os_mktime(int year, int month, int day, int hour, int min, int sec,
36 os_time_t *t)
38 return -1;
42 int os_daemonize(const char *pid_file)
44 return -1;
48 void os_daemonize_terminate(const char *pid_file)
53 int os_get_random(unsigned char *buf, size_t len)
55 return -1;
59 unsigned long os_random(void)
61 return 0;
65 char * os_rel2abs_path(const char *rel_path)
67 return NULL; /* strdup(rel_path) can be used here */
71 int os_program_init(void)
73 return 0;
77 void os_program_deinit(void)
82 int os_setenv(const char *name, const char *value, int overwrite)
84 return -1;
88 int os_unsetenv(const char *name)
90 return -1;
94 char * os_readfile(const char *name, size_t *len)
96 return NULL;
100 void * os_zalloc(size_t size)
102 return NULL;
106 #ifdef OS_NO_C_LIB_DEFINES
107 void * os_malloc(size_t size)
109 return NULL;
113 void * os_realloc(void *ptr, size_t size)
115 return NULL;
119 void os_free(void *ptr)
124 void * os_memcpy(void *dest, const void *src, size_t n)
126 return dest;
130 void * os_memmove(void *dest, const void *src, size_t n)
132 return dest;
136 void * os_memset(void *s, int c, size_t n)
138 return s;
142 int os_memcmp(const void *s1, const void *s2, size_t n)
144 return 0;
148 char * os_strdup(const char *s)
150 return NULL;
154 size_t os_strlen(const char *s)
156 return 0;
160 int os_strcasecmp(const char *s1, const char *s2)
163 * Ignoring case is not required for main functionality, so just use
164 * the case sensitive version of the function.
166 return os_strcmp(s1, s2);
170 int os_strncasecmp(const char *s1, const char *s2, size_t n)
173 * Ignoring case is not required for main functionality, so just use
174 * the case sensitive version of the function.
176 return os_strncmp(s1, s2, n);
180 char * os_strchr(const char *s, int c)
182 return NULL;
186 char * os_strrchr(const char *s, int c)
188 return NULL;
192 int os_strcmp(const char *s1, const char *s2)
194 return 0;
198 int os_strncmp(const char *s1, const char *s2, size_t n)
200 return 0;
204 char * os_strncpy(char *dest, const char *src, size_t n)
206 return dest;
210 char * os_strstr(const char *haystack, const char *needle)
212 return NULL;
216 int os_snprintf(char *str, size_t size, const char *format, ...)
218 return 0;
220 #endif /* OS_NO_C_LIB_DEFINES */