From 97471aa00111632eb17c83542c2b1bfcbd222d36 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 14 Nov 2004 01:41:41 +0000 Subject: [PATCH] Partial sync from FreeBSD, add dummy syscalls for extended attribte operations to return ENOATTR rather then ENOSYS (which causes a core dump). Reported-by: John Duncan --- sys/emulation/linux/i386/linux_dummy.c | 23 ++++- sys/emulation/linux/i386/linux_proto.h | 108 ++++++++++++++++++++++- sys/emulation/linux/i386/linux_syscall.h | 17 +++- sys/emulation/linux/i386/linux_sysent.c | 30 +++---- sys/emulation/linux/i386/linux_union.h | 17 +++- sys/emulation/linux/i386/syscalls.conf | 3 +- sys/emulation/linux/i386/syscalls.master | 28 +++--- 7 files changed, 189 insertions(+), 37 deletions(-) diff --git a/sys/emulation/linux/i386/linux_dummy.c b/sys/emulation/linux/i386/linux_dummy.c index 8b94be388f..5422733af6 100644 --- a/sys/emulation/linux/i386/linux_dummy.c +++ b/sys/emulation/linux/i386/linux_dummy.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/linux/linux_dummy.c,v 1.21.2.7 2003/01/02 20:41:33 kan Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linux_dummy.c,v 1.5 2003/11/15 03:52:33 daver Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linux_dummy.c,v 1.6 2004/11/14 01:41:41 dillon Exp $ */ #include @@ -70,3 +70,24 @@ DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); DUMMY(madvise); +DUMMY(fadvise64); + +#define DUMMY_XATTR(s) \ +int \ +linux_ ## s ## xattr( struct linux_ ## s ## xattr_args *arg) \ +{ \ + return (ENOATTR); \ +} + +DUMMY_XATTR(set); +DUMMY_XATTR(lset); +DUMMY_XATTR(fset); +DUMMY_XATTR(get); +DUMMY_XATTR(lget); +DUMMY_XATTR(fget); +DUMMY_XATTR(list); +DUMMY_XATTR(llist); +DUMMY_XATTR(flist); +DUMMY_XATTR(remove); +DUMMY_XATTR(lremove); +DUMMY_XATTR(fremove); diff --git a/sys/emulation/linux/i386/linux_proto.h b/sys/emulation/linux/i386/linux_proto.h index 7e09d7b034..358b21e701 100644 --- a/sys/emulation/linux/i386/linux_proto.h +++ b/sys/emulation/linux/i386/linux_proto.h @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $DragonFly: src/sys/emulation/linux/i386/linux_proto.h,v 1.12 2004/03/11 09:53:19 hmp Exp $ - * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.4 2003/10/21 01:05:09 daver Exp + * $DragonFly: src/sys/emulation/linux/i386/linux_proto.h,v 1.13 2004/11/14 01:41:41 dillon Exp $ + * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.5 2004/03/11 09:53:19 hmp Exp */ #ifndef _LINUX_SYSPROTO_H_ @@ -1252,6 +1252,97 @@ struct linux_fcntl64_args { l_uint cmd; char cmd_[PAD_(l_uint)]; l_ulong arg; char arg_[PAD_(l_ulong)]; }; +struct linux_setxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_lsetxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_fsetxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_getxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_lgetxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_fgetxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_listxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_llistxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_flistxattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_removexattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_lremovexattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_fremovexattr_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; +struct linux_fadvise64_args { +#ifdef _KERNEL + struct sysmsg sysmsg; +#endif + union usrmsg usrmsg; + register_t dummy; +}; #ifdef _KERNEL @@ -1409,6 +1500,19 @@ int linux_mincore (struct linux_mincore_args *); int linux_madvise (struct linux_madvise_args *); int linux_getdents64 (struct linux_getdents64_args *); int linux_fcntl64 (struct linux_fcntl64_args *); +int linux_setxattr (struct linux_setxattr_args *); +int linux_lsetxattr (struct linux_lsetxattr_args *); +int linux_fsetxattr (struct linux_fsetxattr_args *); +int linux_getxattr (struct linux_getxattr_args *); +int linux_lgetxattr (struct linux_lgetxattr_args *); +int linux_fgetxattr (struct linux_fgetxattr_args *); +int linux_listxattr (struct linux_listxattr_args *); +int linux_llistxattr (struct linux_llistxattr_args *); +int linux_flistxattr (struct linux_flistxattr_args *); +int linux_removexattr (struct linux_removexattr_args *); +int linux_lremovexattr (struct linux_lremovexattr_args *); +int linux_fremovexattr (struct linux_fremovexattr_args *); +int linux_fadvise64 (struct linux_fadvise64_args *); #endif /* _KERNEL */ diff --git a/sys/emulation/linux/i386/linux_syscall.h b/sys/emulation/linux/i386/linux_syscall.h index 5fccc58760..7044f289b3 100644 --- a/sys/emulation/linux/i386/linux_syscall.h +++ b/sys/emulation/linux/i386/linux_syscall.h @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $DragonFly: src/sys/emulation/linux/i386/linux_syscall.h,v 1.12 2004/03/11 09:53:19 hmp Exp $ - * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.4 2003/10/21 01:05:09 daver Exp + * $DragonFly: src/sys/emulation/linux/i386/linux_syscall.h,v 1.13 2004/11/14 01:41:41 dillon Exp $ + * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.5 2004/03/11 09:53:19 hmp Exp */ #define LINUX_SYS_exit 1 @@ -213,5 +213,18 @@ #define LINUX_SYS_linux_madvise 219 #define LINUX_SYS_linux_getdents64 220 #define LINUX_SYS_linux_fcntl64 221 +#define LINUX_SYS_linux_setxattr 226 +#define LINUX_SYS_linux_lsetxattr 227 +#define LINUX_SYS_linux_fsetxattr 228 +#define LINUX_SYS_linux_getxattr 229 +#define LINUX_SYS_linux_lgetxattr 230 +#define LINUX_SYS_linux_fgetxattr 231 +#define LINUX_SYS_linux_listxattr 232 +#define LINUX_SYS_linux_llistxattr 233 +#define LINUX_SYS_linux_flistxattr 234 +#define LINUX_SYS_linux_removexattr 235 +#define LINUX_SYS_linux_lremovexattr 236 +#define LINUX_SYS_linux_fremovexattr 237 +#define LINUX_SYS_linux_fadvise64 250 #define LINUX_SYS_exit_group 252 #define LINUX_SYS_MAXSYSCALL 268 diff --git a/sys/emulation/linux/i386/linux_sysent.c b/sys/emulation/linux/i386/linux_sysent.c index a4b11115ce..391f427fb1 100644 --- a/sys/emulation/linux/i386/linux_sysent.c +++ b/sys/emulation/linux/i386/linux_sysent.c @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $DragonFly: src/sys/emulation/linux/i386/linux_sysent.c,v 1.12 2004/03/11 09:53:19 hmp Exp $ - * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.4 2003/10/21 01:05:09 daver Exp + * $DragonFly: src/sys/emulation/linux/i386/linux_sysent.c,v 1.13 2004/11/14 01:41:41 dillon Exp $ + * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.5 2004/03/11 09:53:19 hmp Exp */ #include "opt_compat.h" @@ -243,18 +243,18 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys }, /* 223 = none */ { 0, (sy_call_t *)nosys }, /* 224 = linux_gettid */ { 0, (sy_call_t *)nosys }, /* 225 = linux_readahead */ - { 0, (sy_call_t *)nosys }, /* 226 = linux_setxattr */ - { 0, (sy_call_t *)nosys }, /* 227 = linux_lsetxattr */ - { 0, (sy_call_t *)nosys }, /* 228 = linux_fsetxattr */ - { 0, (sy_call_t *)nosys }, /* 229 = linux_getxattr */ - { 0, (sy_call_t *)nosys }, /* 230 = linux_lgetxattr */ - { 0, (sy_call_t *)nosys }, /* 231 = linux_fgetxattr */ - { 0, (sy_call_t *)nosys }, /* 232 = linux_listxattr */ - { 0, (sy_call_t *)nosys }, /* 233 = linux_llistxattr */ - { 0, (sy_call_t *)nosys }, /* 234 = linux_flistxattr */ - { 0, (sy_call_t *)nosys }, /* 235 = linux_removexattr */ - { 0, (sy_call_t *)nosys }, /* 236 = linux_lremovexattr */ - { 0, (sy_call_t *)nosys }, /* 237 = linux_fremovexattr */ + { 0, (sy_call_t *)linux_setxattr }, /* 226 = linux_setxattr */ + { 0, (sy_call_t *)linux_lsetxattr }, /* 227 = linux_lsetxattr */ + { 0, (sy_call_t *)linux_fsetxattr }, /* 228 = linux_fsetxattr */ + { 0, (sy_call_t *)linux_getxattr }, /* 229 = linux_getxattr */ + { 0, (sy_call_t *)linux_lgetxattr }, /* 230 = linux_lgetxattr */ + { 0, (sy_call_t *)linux_fgetxattr }, /* 231 = linux_fgetxattr */ + { 0, (sy_call_t *)linux_listxattr }, /* 232 = linux_listxattr */ + { 0, (sy_call_t *)linux_llistxattr }, /* 233 = linux_llistxattr */ + { 0, (sy_call_t *)linux_flistxattr }, /* 234 = linux_flistxattr */ + { 0, (sy_call_t *)linux_removexattr }, /* 235 = linux_removexattr */ + { 0, (sy_call_t *)linux_lremovexattr }, /* 236 = linux_lremovexattr */ + { 0, (sy_call_t *)linux_fremovexattr }, /* 237 = linux_fremovexattr */ { 0, (sy_call_t *)nosys }, /* 238 = linux_tkill */ { 0, (sy_call_t *)nosys }, /* 239 = linux_sendfile64 */ { 0, (sy_call_t *)nosys }, /* 240 = linux_futex */ @@ -267,7 +267,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)nosys }, /* 250 = linux_fadvise64 */ + { 0, (sy_call_t *)linux_fadvise64 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys }, /* 251 = */ { AS(sys_exit_args), (sy_call_t *)sys_exit }, /* 252 = exit_group */ { 0, (sy_call_t *)nosys }, /* 253 = linux_lookup_dcookie */ diff --git a/sys/emulation/linux/i386/linux_union.h b/sys/emulation/linux/i386/linux_union.h index e41d83aec8..239e33de5e 100644 --- a/sys/emulation/linux/i386/linux_union.h +++ b/sys/emulation/linux/i386/linux_union.h @@ -2,8 +2,8 @@ * Union of syscall args for messaging. * * DO NOT EDIT-- this file is automatically generated. - * $DragonFly: src/sys/emulation/linux/i386/linux_union.h,v 1.8 2004/03/11 09:53:19 hmp Exp $ - * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.4 2003/10/21 01:05:09 daver Exp + * $DragonFly: src/sys/emulation/linux/i386/linux_union.h,v 1.9 2004/11/14 01:41:41 dillon Exp $ + * created from DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.5 2004/03/11 09:53:19 hmp Exp */ union sysunion { @@ -165,4 +165,17 @@ union sysunion { struct linux_madvise_args linux_madvise; struct linux_getdents64_args linux_getdents64; struct linux_fcntl64_args linux_fcntl64; + struct linux_setxattr_args linux_setxattr; + struct linux_lsetxattr_args linux_lsetxattr; + struct linux_fsetxattr_args linux_fsetxattr; + struct linux_getxattr_args linux_getxattr; + struct linux_lgetxattr_args linux_lgetxattr; + struct linux_fgetxattr_args linux_fgetxattr; + struct linux_listxattr_args linux_listxattr; + struct linux_llistxattr_args linux_llistxattr; + struct linux_flistxattr_args linux_flistxattr; + struct linux_removexattr_args linux_removexattr; + struct linux_lremovexattr_args linux_lremovexattr; + struct linux_fremovexattr_args linux_fremovexattr; + struct linux_fadvise64_args linux_fadvise64; }; diff --git a/sys/emulation/linux/i386/syscalls.conf b/sys/emulation/linux/i386/syscalls.conf index 92893d6f3e..ba2c3a0cbf 100644 --- a/sys/emulation/linux/i386/syscalls.conf +++ b/sys/emulation/linux/i386/syscalls.conf @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/i386/linux/syscalls.conf,v 1.5 1999/08/28 00:45:25 peter Exp $ -# $DragonFly: src/sys/emulation/linux/i386/syscalls.conf,v 1.3 2003/07/24 01:41:24 dillon Exp $ +# $DragonFly: src/sys/emulation/linux/i386/syscalls.conf,v 1.4 2004/11/14 01:41:41 dillon Exp $ sysnames="/dev/null" sysproto="linux_proto.h" sysunion="linux_union.h" @@ -8,6 +8,7 @@ syshdr="linux_syscall.h" syssw="linux_sysent.c" sysmk="/dev/null" syshide="/dev/null" +sysargs="/dev/null" syscallprefix="LINUX_SYS_" switchname="linux_sysent" namesname="linux_syscallnames" diff --git a/sys/emulation/linux/i386/syscalls.master b/sys/emulation/linux/i386/syscalls.master index cf36354474..cff1cc85e7 100644 --- a/sys/emulation/linux/i386/syscalls.master +++ b/sys/emulation/linux/i386/syscalls.master @@ -1,4 +1,4 @@ - $DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.5 2004/03/11 09:53:19 hmp Exp $ + $DragonFly: src/sys/emulation/linux/i386/syscalls.master,v 1.6 2004/11/14 01:41:41 dillon Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; $FreeBSD: src/sys/i386/linux/syscalls.master,v 1.30.2.8 2003/01/02 20:41:33 kan Exp $ @@ -343,18 +343,18 @@ 223 UNIMPL LINUX none 224 UNIMPL LINUX linux_gettid 225 UNIMPL LINUX linux_readahead -226 UNIMPL LINUX linux_setxattr -227 UNIMPL LINUX linux_lsetxattr -228 UNIMPL LINUX linux_fsetxattr -229 UNIMPL LINUX linux_getxattr -230 UNIMPL LINUX linux_lgetxattr -231 UNIMPL LINUX linux_fgetxattr -232 UNIMPL LINUX linux_listxattr -233 UNIMPL LINUX linux_llistxattr -234 UNIMPL LINUX linux_flistxattr -235 UNIMPL LINUX linux_removexattr -236 UNIMPL LINUX linux_lremovexattr -237 UNIMPL LINUX linux_fremovexattr +226 STD LINUX { int linux_setxattr(void); } +227 STD LINUX { int linux_lsetxattr(void); } +228 STD LINUX { int linux_fsetxattr(void); } +229 STD LINUX { int linux_getxattr(void); } +230 STD LINUX { int linux_lgetxattr(void); } +231 STD LINUX { int linux_fgetxattr(void); } +232 STD LINUX { int linux_listxattr(void); } +233 STD LINUX { int linux_llistxattr(void); } +234 STD LINUX { int linux_flistxattr(void); } +235 STD LINUX { int linux_removexattr(void); } +236 STD LINUX { int linux_lremovexattr(void); } +237 STD LINUX { int linux_fremovexattr(void); } 238 UNIMPL LINUX linux_tkill 239 UNIMPL LINUX linux_sendfile64 240 UNIMPL LINUX linux_futex @@ -367,7 +367,7 @@ 247 UNIMPL LINUX linux_io_getevents 248 UNIMPL LINUX linux_io_submit 249 UNIMPL LINUX linux_io_cancel -250 UNIMPL LINUX linux_fadvise64 +250 STD LINUX { int linux_fadvise64(void); } 251 UNIMPL LINUX 252 NOPROTO LINUX { void sys_exit(int rval); } exit_group sys_exit_args void 253 UNIMPL LINUX linux_lookup_dcookie -- 2.32.0