/* OK, this should be in dhcpcd.c
* It's here to make dhcpcd more readable */
-#ifdef __linux__
+#ifndef HAVE_SRANDOMDEV
void srandomdev (void)
{
int fd;
#endif
/* strlcpy is nice, shame glibc does not define it */
-#ifdef __GLIBC__
-# if ! defined (__UCLIBC__) && ! defined (__dietlibc__)
+#ifndef HAVE_STRLCPY
size_t strlcpy (char *dst, const char *src, size_t size)
{
const char *s = src;
return (src - s - 1);
}
-# endif
#endif
/* Close our fd's */
#include <stdio.h>
#include <string.h>
+#define HAVE_STRLCPY
/* Only GLIBC doesn't support strlcpy */
#ifdef __GLIBC__
# if ! defined(__UCLIBC__) && ! defined (__dietlibc__)
+# undef HAVE_STRLCPY
size_t strlcpy (char *dst, const char *src, size_t size);
# endif
#endif
-#ifdef __linux__
+#define HAVE_SRANDOMDEV
+#if defined(__linux__) || defined(__NetBSD__)
+# undef HAVE_SRANDOMDEV
void srandomdev (void);
#endif