diff options
Diffstat (limited to 'freebsd/contrib/wpa/src/utils/os_unix.c')
-rw-r--r-- | freebsd/contrib/wpa/src/utils/os_unix.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/freebsd/contrib/wpa/src/utils/os_unix.c b/freebsd/contrib/wpa/src/utils/os_unix.c index a3abce4c..7f101d71 100644 --- a/freebsd/contrib/wpa/src/utils/os_unix.c +++ b/freebsd/contrib/wpa/src/utils/os_unix.c @@ -25,6 +25,11 @@ #include <mach/mach_time.h> #endif /* __MACH__ */ +#ifdef __rtems__ +#include <unistd.h> +#endif /* __rtems__ */ + + #include "os.h" #include "common.h" @@ -225,7 +230,7 @@ static int os_daemon(int nochdir, int noclose) int os_daemonize(const char *pid_file) { -#if defined(__uClinux__) || defined(__sun__) +#if defined(__uClinux__) || defined(__sun__) || defined(__rtems__) return -1; #else /* defined(__uClinux__) || defined(__sun__) */ #ifdef __FreeBSD__ @@ -282,6 +287,9 @@ int os_get_random(unsigned char *buf, size_t len) if (TEST_FAIL()) return -1; +#ifdef __rtems__ + return getentropy(buf, len); +#else /* __rtems__ */ f = fopen("/dev/urandom", "rb"); if (f == NULL) { printf("Could not open /dev/urandom.\n"); @@ -292,6 +300,7 @@ int os_get_random(unsigned char *buf, size_t len) fclose(f); return rc != len ? -1 : 0; +#endif /* __rtems__ */ } |