Subject: Re: kern/32161: m68k a.out emulation broken
To: None <christos@zoulas.com>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 05/04/2006 15:06:49
It looks compat/aoutm68k/syscalls.master should be updated
for COMPAT_30 getdents(2) and aoutm68k_sys*.[ch] files
should be regenerated.
(Umm, many people didn't read "DO NOT EDIT" comments
 in these files...)

BTW, is there no COMPAT_30 support for fhstat(2), which also
takes struct stat * (which has ino_t) as the second arg?
---
Izumi Tsutsui


Index: compat/aoutm68k/aoutm68k_syscall.h
===================================================================
RCS file: /cvsroot/src/sys/compat/aoutm68k/aoutm68k_syscall.h,v
retrieving revision 1.18
diff -u -r1.18 aoutm68k_syscall.h
--- compat/aoutm68k/aoutm68k_syscall.h	11 Dec 2005 12:19:56 -0000	1.18
+++ compat/aoutm68k/aoutm68k_syscall.h	4 May 2006 05:43:10 -0000
@@ -1,12 +1,15 @@
-/* $NetBSD: aoutm68k_syscall.h,v 1.18 2005/12/11 12:19:56 christos Exp $ */
+/* $NetBSD$ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.12 2004/09/14 17:39:18 jdolecek Exp
+ * created from	NetBSD: syscalls.master,v 1.13 2005/12/11 12:19:56 christos Exp
  */
 
+#ifndef _AOUTM68K_SYS_SYSCALL_H_
+#define	_AOUTM68K_SYS_SYSCALL_H_
+
 /* syscall: "syscall" ret: "int" args: "int" "..." */
 #define	AOUTM68K_SYS_syscall	0
 
@@ -857,9 +860,13 @@
 /* syscall: "swapctl" ret: "int" args: "int" "const void *" "int" */
 #define	AOUTM68K_SYS_swapctl	271
 
+#ifdef COMPAT_30
 /* syscall: "getdents" ret: "int" args: "int" "char *" "size_t" */
 #define	AOUTM68K_SYS_getdents	272
 
+#else
+				/* 272 is excluded compat_30_sys_getdents */
+#endif
 /* syscall: "minherit" ret: "int" args: "void *" "size_t" "int" */
 #define	AOUTM68K_SYS_minherit	273
 
@@ -992,3 +999,4 @@
 
 #define	AOUTM68K_SYS_MAXSYSCALL	308
 #define	AOUTM68K_SYS_NSYSENT	512
+#endif /* _AOUTM68K_SYS_SYSCALL_H_ */
Index: compat/aoutm68k/aoutm68k_syscallargs.h
===================================================================
RCS file: /cvsroot/src/sys/compat/aoutm68k/aoutm68k_syscallargs.h,v
retrieving revision 1.17
diff -u -r1.17 aoutm68k_syscallargs.h
--- compat/aoutm68k/aoutm68k_syscallargs.h	11 Dec 2005 12:19:56 -0000	1.17
+++ compat/aoutm68k/aoutm68k_syscallargs.h	4 May 2006 05:43:10 -0000
@@ -1,14 +1,14 @@
-/* $NetBSD: aoutm68k_syscallargs.h,v 1.17 2005/12/11 12:19:56 christos Exp $ */
+/* $NetBSD$ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.12 2004/09/14 17:39:18 jdolecek Exp
+ * created from	NetBSD: syscalls.master,v 1.13 2005/12/11 12:19:56 christos Exp
  */
 
-#ifndef _AOUTM68K_SYS__SYSCALLARGS_H_
-#define	_AOUTM68K_SYS__SYSCALLARGS_H_
+#ifndef _AOUTM68K_SYS_SYSCALLARGS_H_
+#define	_AOUTM68K_SYS_SYSCALLARGS_H_
 
 #ifdef	syscallarg
 #undef	syscallarg
@@ -194,6 +194,9 @@
 #endif
 #else
 #endif
+#ifdef COMPAT_30
+#else
+#endif
 
 struct aoutm68k_sys___stat13_args {
 	syscallarg(const char *) path;
@@ -786,8 +789,11 @@
 
 int	sys_swapctl(struct lwp *, void *, register_t *);
 
-int	sys_getdents(struct lwp *, void *, register_t *);
+#ifdef COMPAT_30
+int	compat_30_sys_getdents(struct lwp *, void *, register_t *);
 
+#else
+#endif
 int	sys_minherit(struct lwp *, void *, register_t *);
 
 int	sys_lchmod(struct lwp *, void *, register_t *);
@@ -877,4 +883,4 @@
 
 int	sys_setcontext(struct lwp *, void *, register_t *);
 
-#endif /* _AOUTM68K_SYS__SYSCALLARGS_H_ */
+#endif /* _AOUTM68K_SYS_SYSCALLARGS_H_ */
Index: compat/aoutm68k/aoutm68k_sysent.c
===================================================================
RCS file: /cvsroot/src/sys/compat/aoutm68k/aoutm68k_sysent.c,v
retrieving revision 1.19
diff -u -r1.19 aoutm68k_sysent.c
--- compat/aoutm68k/aoutm68k_sysent.c	11 Dec 2005 12:19:56 -0000	1.19
+++ compat/aoutm68k/aoutm68k_sysent.c	4 May 2006 05:43:10 -0000
@@ -1,14 +1,14 @@
-/* $NetBSD: aoutm68k_sysent.c,v 1.19 2005/12/11 12:19:56 christos Exp $ */
+/* $NetBSD$ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.12 2004/09/14 17:39:18 jdolecek Exp
+ * created from	NetBSD: syscalls.master,v 1.13 2005/12/11 12:19:56 christos Exp
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.19 2005/12/11 12:19:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD$");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ktrace.h"
@@ -889,8 +889,13 @@
 	    sys___posix_rename },		/* 270 = __posix_rename */
 	{ 3, s(struct sys_swapctl_args), 0,
 	    sys_swapctl },			/* 271 = swapctl */
-	{ 3, s(struct sys___getdents30_args), 0,
-	    sys___getdents30 },			/* 272 = getdents */
+#ifdef COMPAT_30
+	{ 3, s(struct compat_30_sys_getdents_args), 0,
+	    compat_30_sys_getdents },		/* 272 = getdents */
+#else
+	{ 0, 0, 0,
+	    sys_nosys },			/* 272 = excluded compat_30_sys_getdents */
+#endif
 	{ 3, s(struct sys_minherit_args), 0,
 	    sys_minherit },			/* 273 = minherit */
 	{ 2, s(struct sys_lchmod_args), 0,
Index: compat/aoutm68k/syscalls.master
===================================================================
RCS file: /cvsroot/src/sys/compat/aoutm68k/syscalls.master,v
retrieving revision 1.13
diff -u -r1.13 syscalls.master
--- compat/aoutm68k/syscalls.master	11 Dec 2005 12:19:56 -0000	1.13
+++ compat/aoutm68k/syscalls.master	4 May 2006 05:43:11 -0000
@@ -694,7 +694,11 @@
 270	NOARGS		{ int sys___posix_rename(const char *from, \
 			    const char *to); }
 271	NOARGS		{ int sys_swapctl(int cmd, const void *arg, int misc); }
-272	NOARGS		{ int sys_getdents(int fd, char *buf, size_t count); }
+#ifdef COMPAT_30
+272	NOARGS		{ int compat_30_sys_getdents(int fd, char *buf, size_t count); }
+#else
+272	EXCL		compat_30_sys_getdents
+#endif
 273	NOARGS		{ int sys_minherit(void *addr, size_t len, \
 			    int inherit); }
 274	NOARGS		{ int sys_lchmod(const char *path, mode_t mode); }