2002-09-23  Michal Ludvig  <mludvig@suse.cz>
	* configure.in: Fix regular expressions.
	* linux/syscall.h: Added missing braces in prototype of
	sys_getdents64().
	* file.c: Use '#ifdef LINUX' instead of '#ifdef linux'.
	(struct fileflags): Made extern to inhibit compiation warnings.
	(sys_getdents64): Merged LINUX and SVR4 part.
	* syscall.c(get_scno): Split multiline string into two distinct
	strings.
diff --git a/CREDITS b/CREDITS
index c6070d8..d07a052 100644
--- a/CREDITS
+++ b/CREDITS
@@ -44,3 +44,5 @@
 	Richard Hirst <rhirst@linuxcare.com>
 	Ganesan Rajagopal <rganesan@myrealbox.com>
 	Greg Banks <gbanks@pocketpenguins.com>
+	Andi Kleen <ak@suse.de>
+	Michal Ludvig <mludvig@suse.cz>
diff --git a/ChangeLog b/ChangeLog
index cd0c9e2..bb230af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2002-09-23  Michal Ludvig  <mludvig@suse.cz>
+
+	* configure.in: Fix regular expressions.
+	* linux/syscall.h: Added missing braces in prototype of 
+	sys_getdents64().
+	* file.c: Use '#ifdef LINUX' instead of '#ifdef linux'.
+	(struct fileflags): Made extern to inhibit compiation warnings.
+	(sys_getdents64): Merged LINUX and SVR4 part.
+	* syscall.c(get_scno): Split multiline string into two distinct 
+	strings.
+
 2002-05-24  John Hughes <john@calva.com>
 
 	* stream.h, net.h: Avoid possible infinite loop caused by
diff --git a/NEWS b/NEWS
index 11c8fed..41e164d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Changes in CVS (not yet released)
+==============
+* New port to AMD's x86-64 architecture. One strace binary can 
+  handle both new x86-64 and old i386 processes.
+* Fixed support for LFS64 calls.
+
 Changes in 4.4
 ==============
 * Fix Linux/ia64 support, looks like someone renamed a few things on us
diff --git a/configure.in b/configure.in
index 221b42a..41d7400 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,6 @@
 AC_INIT(strace.c)
 AC_CANONICAL_SYSTEM()
 AC_MSG_CHECKING(for supported operating system)
-changequote(,)dnl
 
 case "$host_os" in
 linux*)
@@ -19,7 +18,7 @@
 sysv5*)
 	opsys=svr4
 	;;
-irix[56]*)
+irix[[56]]*)
 	opsys=svr4
 	;;
 freebsd*)
@@ -38,7 +37,7 @@
 
 AC_MSG_CHECKING(for supported architecture)
 case "$target_cpu" in
-i[3456]86|pentium)
+i[[3456]]86|pentium)
 	arch=i386
 	;;
 ia64)
@@ -83,14 +82,13 @@
 '
 
 osarch="$opsys"
-if [ -d "$srcdir/$opsys/$arch" ]; then
+if test -d "$srcdir/$opsys/$arch"; then
 	osarch="$opsys/$arch"
 fi
 
-OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
-ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
+OPSYS=`echo $opsys | tr '[[a-z]]' '[[A-Z]]'`
+ARCH=`echo $arch | tr '[[a-z]]' '[[A-Z]]'`
 
-changequote([,])dnl
 CFLAGS="-D_GNU_SOURCE $CFLAGS"
 AC_CONFIG_HEADER(config.h)
 AC_SUBST(opsys)
diff --git a/file.c b/file.c
index bfb12ca..017874d 100644
--- a/file.c
+++ b/file.c
@@ -1,5 +1,5 @@
 /*
-#ifdef linux
+#ifdef LINUX
  * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
@@ -34,7 +34,7 @@
 #include "defs.h"
 
 #include <dirent.h>
-#ifdef linux
+#ifdef LINUX
 #define dirent kernel_dirent
 #define dirent64 kernel_dirent64
 #include <linux/types.h>
@@ -44,7 +44,7 @@
 #define kernel_dirent dirent
 #endif
 
-#ifdef linux
+#ifdef LINUX
 #  ifdef LINUXSPARC
 struct stat {
 	unsigned short	st_dev;
@@ -395,7 +395,7 @@
 }
 #endif
 
-#ifdef linux
+#ifdef LINUX
 int
 sys_llseek (tcp)
 struct tcb *tcp;
@@ -630,7 +630,7 @@
 }
 #endif /* LINUXSPARC */
 
-static struct xlat fileflags[] = {
+struct xlat fileflags[] = {
 #ifdef FREEBSD
 	{ UF_NODUMP,	"UF_NODUMP"	},
 	{ UF_IMMUTABLE,	"UF_IMMUTABLE"	},
@@ -889,7 +889,7 @@
 }
 #endif /* HAVE_STAT64 */
 
-#if defined(linux) && !defined(IA64) && !defined(HPPA)
+#if defined(LINUX) && !defined(IA64) && !defined(HPPA)
 static void
 convertoldstat(oldbuf, newbuf)
 const struct __old_kernel_stat *oldbuf;
@@ -942,7 +942,7 @@
 	convertoldstat(&statbuf, &newstatbuf);
 	realprintstat(tcp, &newstatbuf);
 }
-#endif /* linux && !IA64 */
+#endif /* LINUX && !IA64 */
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -976,7 +976,7 @@
 #endif
 }
 
-#ifdef linux
+#ifdef LINUX
 # if !defined(IA64) && !defined(HPPA)
 int
 sys_oldstat(tcp)
@@ -991,7 +991,7 @@
 	return 0;
 }
 # endif /* !IA64 && !HPPA*/
-#endif /* linux */
+#endif /* LINUX */
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -1023,7 +1023,7 @@
 #endif
 }
 
-#ifdef linux
+#ifdef LINUX
 # if !defined(IA64) && !defined(HPPA)
 int
 sys_oldfstat(tcp)
@@ -1071,7 +1071,7 @@
 #endif
 }
 
-#ifdef linux
+#ifdef LINUX
 # if !defined(IA64) && !defined(HPPA)
 int
 sys_oldlstat(tcp)
@@ -1285,7 +1285,7 @@
 
 #endif /* SVR4 || LINUXSPARC */
 
-#ifdef linux
+#ifdef LINUX
 
 static struct xlat fsmagic[] = {
 	{ 0x73757245,	"CODA_SUPER_MAGIC"	},
@@ -1319,7 +1319,7 @@
 	{ 0,		NULL			},
 };
 
-#endif /* linux */
+#endif /* LINUX */
 
 #ifndef SVR4
 
@@ -1328,7 +1328,7 @@
 int magic;
 {
 	static char buf[32];
-#ifdef linux
+#ifdef LINUX
 	char *s;
 
 	s = xlookup(fsmagic, magic);
@@ -1336,7 +1336,7 @@
 		sprintf(buf, "\"%s\"", s);
 		return buf;
 	}
-#endif /* linux */
+#endif /* LINUX */
 	sprintf(buf, "%#x", magic);
 	return buf;
 }
@@ -1372,9 +1372,9 @@
 	tprintf("f_files=%lu, f_ffree=%lu",
 		(unsigned long)statbuf.f_files,
 		(unsigned long)statbuf.f_ffree);
-#ifdef linux
+#ifdef LINUX
 	tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
-#endif /* linux */
+#endif /* LINUX */
 #endif /* !ALPHA */
 	tprintf("}");
 }
@@ -1404,7 +1404,7 @@
 	return 0;
 }
 
-#if defined(linux) && defined(__alpha)
+#if defined(LINUX) && defined(__alpha)
 
 int
 osf_statfs(tcp)
@@ -1432,7 +1432,7 @@
 	}
 	return 0;
 }
-#endif /* linux && __alpha */
+#endif /* LINUX && __alpha */
 
 #endif /* !SVR4 */
 
@@ -1751,7 +1751,7 @@
 	return 0;
 }
 
-#ifdef linux
+#ifdef LINUX
 
 static void
 printdir(tcp, addr)
@@ -1792,7 +1792,7 @@
 	return 0;
 }
 
-#endif /* linux */
+#endif /* LINUX */
 
 #ifdef FREEBSD
 struct xlat direnttypes[] = {
@@ -1838,14 +1838,14 @@
 		tprintf("{");
 	for (i = 0; i < len;) {
 		struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
-#ifdef linux
+#ifdef LINUX
 		if (!abbrev(tcp)) {
 			tprintf("%s{d_ino=%lu, d_off=%lu, ",
 				i ? " " : "", d->d_ino, d->d_off);
 			tprintf("d_reclen=%u, d_name=\"%s\"}",
 				d->d_reclen, d->d_name);
 		}
-#endif /* linux */
+#endif /* LINUX */
 #ifdef SVR4
 		if (!abbrev(tcp)) {
 			tprintf("%s{d_ino=%lu, d_off=%lu, ",
@@ -1919,22 +1919,16 @@
 		tprintf("{");
 	for (i = 0; i < len;) {
 		struct dirent64 *d = (struct dirent64 *) &buf[i];
-#ifdef linux
+#if defined(LINUX) || defined(SVR4)
 		if (!abbrev(tcp)) {
 			tprintf("%s{d_ino=%lu, d_off=%lu, ",
-				i ? " " : "", d->d_ino, d->d_off);
+				i ? " " : "", 
+				(unsigned long)d->d_ino, 
+				(unsigned long)d->d_off);
 			tprintf("d_reclen=%u, d_name=\"%s\"}",
 				d->d_reclen, d->d_name);
 		}
-#endif /* linux */
-#ifdef SVR4
-		if (!abbrev(tcp)) {
-			tprintf("%s{d_ino=%llu, d_off=%llu, ",
-				i ? " " : "", d->d_ino, d->d_off);
-			tprintf("d_reclen=%u, d_name=\"%s\"}",
-				d->d_reclen, d->d_name);
-		}
-#endif /* SVR4 */
+#endif /* LINUX || SVR4 */
 #ifdef SUNOS4
 		if (!abbrev(tcp)) {
 			tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
@@ -2012,7 +2006,7 @@
 }
 #endif
 
-#ifdef linux
+#ifdef LINUX
 int
 sys_getcwd(tcp)
 struct tcb *tcp;
@@ -2026,7 +2020,7 @@
     }
     return 0;
 }
-#endif /* linux */
+#endif /* LINUX */
 
 #ifdef FREEBSD
 int
diff --git a/linux/syscall.h b/linux/syscall.h
index e57c9aa..6fa2b7a 100644
--- a/linux/syscall.h
+++ b/linux/syscall.h
@@ -83,7 +83,7 @@
 int sys_rt_sigtimedwait(), sys_prctl(), sys_poll(), sys_vfork();
 int sys_sendfile(), sys_old_mmap(), sys_stat64(), sys_lstat64(), sys_fstat64();
 int sys_truncate64(), sys_ftruncate64(), sys_pivotroot();
-int sys_getdents64, sys_clone2();
+int sys_getdents64(), sys_clone2();
 
 
 /* sys_socketcall subcalls */
diff --git a/syscall.c b/syscall.c
index dfad8f0..3059f1c 100644
--- a/syscall.c
+++ b/syscall.c
@@ -890,8 +890,8 @@
            long correct_scno = (scno & 0xff);
            if (debug)
                fprintf(stderr,
-                   "Detected glibc bug: bogus system call number = %ld,
-correcting to %ld\n",
+                   "Detected glibc bug: bogus system call number = %ld, "
+		   "correcting to %ld\n",
                    scno,
                    correct_scno);
            scno = correct_scno;