source: scripts/patches/util-linux-2.12a-kernel_headers-1.patch@ 0429023

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 0429023 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100644
File size: 3.1 KB
RevLine 
[617118d]1Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
2Date: 2004-01-30
3Initial Package Version: 2.12
4Origin: Gentoo
5Description: Fixes Compile Issues with the 2.6 Kernel
6
7diff -Naur util-linux-2.12.orig/disk-utils/blockdev.c util-linux-2.12/disk-utils/blockdev.c
8--- util-linux-2.12.orig/disk-utils/blockdev.c 2002-03-08 22:57:02.000000000 +0000
9+++ util-linux-2.12/disk-utils/blockdev.c 2004-01-30 19:49:39.000000000 +0000
10@@ -9,6 +9,7 @@
11 #include <string.h>
12 #include <unistd.h>
13 #include <sys/ioctl.h>
14+#include <linux/version.h>
15
16 #include "nls.h"
17
18@@ -24,8 +25,13 @@
19 #define BLKRASET _IO(0x12,98)
20 #define BLKRAGET _IO(0x12,99)
21 #define BLKSSZGET _IO(0x12,104)
22+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
23 #define BLKBSZGET _IOR(0x12,112,sizeof(int))
24 #define BLKBSZSET _IOW(0x12,113,sizeof(int))
25+#else
26+#define BLKBSZGET _IOR(0x12,112,int)
27+#define BLKBSZSET _IOW(0x12,113,int)
28+#endif
29 #endif
30
31 /* Maybe <linux/hdreg.h> could be included */
32diff -Naur util-linux-2.12.orig/disk-utils/elvtune.c util-linux-2.12/disk-utils/elvtune.c
33--- util-linux-2.12.orig/disk-utils/elvtune.c 2002-03-08 22:57:49.000000000 +0000
34+++ util-linux-2.12/disk-utils/elvtune.c 2004-01-30 19:49:39.000000000 +0000
35@@ -26,6 +26,8 @@
36 #include <sys/ioctl.h>
37 #include <unistd.h>
38 #include <stdlib.h>
39+#include <linux/version.h>
40+
41 #include "nls.h"
42
43 /* this has to match with the kernel structure */
44@@ -37,8 +39,13 @@
45 int max_bomb_segments;
46 } blkelv_ioctl_arg_t;
47
48+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
49 #define BLKELVGET _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t))
50 #define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))
51+#else
52+#define BLKELVGET _IOR(0x12,106,blkelv_ioctl_arg_t)
53+#define BLKELVSET _IOW(0x12,107,blkelv_ioctl_arg_t)
54+#endif
55
56 static void
57 usage(void) {
58diff -Naur util-linux-2.12.orig/fdisk/common.h util-linux-2.12/fdisk/common.h
59--- util-linux-2.12.orig/fdisk/common.h 2003-07-13 13:59:53.000000000 +0000
60+++ util-linux-2.12/fdisk/common.h 2004-01-30 19:49:39.000000000 +0000
61@@ -2,11 +2,18 @@
62
63 /* including <linux/fs.h> fails */
64 #include <sys/ioctl.h>
65+#include <linux/version.h>
66+
67 #define BLKRRPART _IO(0x12,95) /* re-read partition table */
68 #define BLKGETSIZE _IO(0x12,96) /* return device size */
69 #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
70 #define BLKSSZGET _IO(0x12,104) /* get block device sector size */
71+
72+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
73 #define BLKGETSIZE64 _IOR(0x12,114,8) /* 8 = sizeof(u64) */
74+#else
75+#define BLKGETSIZE64 _IOR(0x12,114,unsigned long long)
76+#endif
77
78 /* including <linux/hdreg.h> also fails */
79 struct hd_geometry {
80diff -Naur util-linux-2.12.orig/mount/my_dev_t.h util-linux-2.12/mount/my_dev_t.h
81--- util-linux-2.12.orig/mount/my_dev_t.h 2003-07-16 20:05:50.000000000 +0000
82+++ util-linux-2.12/mount/my_dev_t.h 2004-01-30 19:49:39.000000000 +0000
83@@ -4,4 +4,10 @@
84 /* for ancient systems use "unsigned short" */
85
86 #include <linux/posix_types.h>
87+#include <linux/version.h>
88+
89+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
90 #define my_dev_t __kernel_dev_t
91+#else
92+#define my_dev_t int
93+#endif
Note: See TracBrowser for help on using the repository browser.