/*
* Utility routines.
*
- * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <features.h>
+#if defined (__GLIBC__) && !defined(__UCLIBC__)
+#include <linux/posix_types.h>
+#endif
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
/* Grumble... The 2.6.x kernel breaks asm/posix_types.h
* so we get to try and cope as best we can... */
#include <linux/version.h>
-#include <asm/posix_types.h>
-#if LINUX_VERSION_CODE >= 132608
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#define __bb_kernel_dev_t __kernel_old_dev_t
-#elif LINUX_VERSION_CODE >= 0x20600
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define __bb_kernel_dev_t __kernel_dev_t
#else
#define __bb_kernel_dev_t unsigned short