[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FDclone-users:00673] Re: Linux 2.6.18で dosdisk.c コンパイルエラー (_syscall5マクロ)



At Sun, 10 Dec 2006 01:27:12 +0900,
Takashi SHIRAI wrote:
>  USELLSEEK を #undef しても何の解決にもなっていないので、現
> 行で考えられる対処は __KERNEL__ の定義しかないと思います。
> 
> ---- Cut Here ----
> diff -u ../old/FD-2.09a/dosdisk.c ./dosdisk.c
> --- ../old/FD-2.09a/dosdisk.c	Tue Oct 31 00:00:00 2006
> +++ ./dosdisk.c	Fri Dec  8 22:26:52 2006
> @@ -10,8 +10,14 @@
>  #include <errno.h>
>  #include <fcntl.h>
>  
> +#ifdef	USELLSEEK
> +#define	__KERNEL__
> +#endif
>  #ifndef	NOUNISTDH
>  #include <unistd.h>
> +#endif
> +#ifdef	USELLSEEK
> +#undef	__KERNEL__
>  #endif
>  
>  #ifndef	NOSTDLIBH
> ---- Cut Here ----

 このスレッドはこれで収束してしまったようですが、みなさんの環境では
これでOKだったんでしょうか。私の手元の Linux 2.6.17 環境ではビルドが
通りませんでした。

 以下の修正で直ります。2.09b からの差分です。

--- dosdisk.c.orig	2006-12-22 00:00:00.000000000 +0900
+++ dosdisk.c	2007-01-06 18:34:04.000000000 +0900
@@ -10,15 +10,9 @@
 #include <errno.h>
 #include <fcntl.h>
 
-#ifdef	USELLSEEK
-#define	__KERNEL__		/* For _syscall5() on Linux kernel >=2.6.18 */
-#endif
 #ifndef	NOUNISTDH
 #include <unistd.h>
 #endif
-#ifdef	USELLSEEK
-#undef	__KERNEL__
-#endif
 
 #ifndef	NOSTDLIBH
 #include <stdlib.h>
@@ -93,7 +87,13 @@
 #ifdef	LINUX
 #include <mntent.h>
 #include <sys/mount.h>
+#ifdef	USELLSEEK
+#define	__KERNEL__		/* For _syscall5() on Linux kernel >=2.6.18 */
+#endif
 #include <linux/unistd.h>
+#ifdef	USELLSEEK
+#undef	__KERNEL__
+#endif
 # ifndef	BLKFLSBUF
 # include <linux/fs.h>
 # endif


-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"Different eyes see different things,
    Different hearts beat on different strings --
       But there are times for you and me when all such things agree"