fixed kern ver for toolchain glibc build
[hdw-linux/hdw-linux.git] / packages / base / util-linux / kernel_headers.patch
1 --- util-linux-2.12.orig/disk-utils/blockdev.c  2002-03-08 22:57:02.000000000 +0000
2 +++ util-linux-2.12/disk-utils/blockdev.c       2004-01-30 19:49:39.000000000 +0000
3 @@ -9,6 +9,7 @@
4  #include <string.h>
5  #include <unistd.h>
6  #include <sys/ioctl.h>
7 +#include <linux/version.h>
8  
9  #include "nls.h"
10  
11 @@ -24,8 +25,13 @@
12  #define BLKRASET   _IO(0x12,98)
13  #define BLKRAGET   _IO(0x12,99)
14  #define BLKSSZGET  _IO(0x12,104)
15 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
16  #define BLKBSZGET  _IOR(0x12,112,sizeof(int))
17  #define BLKBSZSET  _IOW(0x12,113,sizeof(int))
18 +#else
19 +#define BLKBSZGET  _IOR(0x12,112,int)
20 +#define BLKBSZSET  _IOW(0x12,113,int)
21 +#endif
22  #endif
23  
24  /* Maybe <linux/hdreg.h> could be included */
25 --- util-linux-2.12.orig/disk-utils/elvtune.c   2002-03-08 22:57:49.000000000 +0000
26 +++ util-linux-2.12/disk-utils/elvtune.c        2004-01-30 19:49:39.000000000 +0000
27 @@ -26,6 +26,8 @@
28  #include <sys/ioctl.h>
29  #include <unistd.h>
30  #include <stdlib.h>
31 +#include <linux/version.h>
32 +
33  #include "nls.h"
34  
35  /* this has to match with the kernel structure */
36 @@ -37,8 +39,13 @@
37         int max_bomb_segments;
38  } blkelv_ioctl_arg_t;
39  
40 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
41  #define BLKELVGET   _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t))
42  #define BLKELVSET   _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))
43 +#else
44 +#define BLKELVGET   _IOR(0x12,106,blkelv_ioctl_arg_t)
45 +#define BLKELVSET   _IOW(0x12,107,blkelv_ioctl_arg_t)
46 +#endif
47  
48  static void
49  usage(void) {
50 --- util-linux-2.12.orig/fdisk/common.h 2003-07-13 13:59:53.000000000 +0000
51 +++ util-linux-2.12/fdisk/common.h      2004-01-30 19:49:39.000000000 +0000
52 @@ -2,11 +2,18 @@
53  
54  /* including <linux/fs.h> fails */
55  #include <sys/ioctl.h>
56 +#include <linux/version.h>
57 +
58  #define BLKRRPART    _IO(0x12,95)    /* re-read partition table */
59  #define BLKGETSIZE   _IO(0x12,96)    /* return device size */
60  #define BLKFLSBUF    _IO(0x12,97)    /* flush buffer cache */
61  #define BLKSSZGET    _IO(0x12,104)   /* get block device sector size */
62 +
63 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
64  #define BLKGETSIZE64 _IOR(0x12,114,8)  /* 8 = sizeof(u64) */
65 +#else
66 +#define BLKGETSIZE64 _IOR(0x12,114,unsigned long long)
67 +#endif
68  
69  /* including <linux/hdreg.h> also fails */
70  struct hd_geometry {
71 --- util-linux-2.12.orig/mount/my_dev_t.h       2003-07-16 20:05:50.000000000 +0000
72 +++ util-linux-2.12/mount/my_dev_t.h    2004-01-30 19:49:39.000000000 +0000
73 @@ -4,4 +4,10 @@
74  /* for ancient systems use "unsigned short" */
75  
76  #include <linux/posix_types.h>
77 +#include <linux/version.h>
78 +
79 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
80  #define my_dev_t __kernel_dev_t
81 +#else
82 +#define my_dev_t int
83 +#endif