Index: netbsd32.h =================================================================== RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32.h,v retrieving revision 1.118 diff -p -u -u -r1.118 netbsd32.h --- netbsd32.h 10 May 2018 02:36:07 -0000 1.118 +++ netbsd32.h 11 Aug 2018 03:39:52 -0000 @@ -965,7 +965,7 @@ struct netbsd32_tmpfs_args { /* from */ struct netbsd32_iso_args { netbsd32_charp fspec; - struct export_args30 _pad1; + struct netbsd32_export_args30 _pad1; int flags; }; @@ -1021,8 +1021,6 @@ struct netbsd32_mountd_exports_list { netbsd32_export_argsp mel_exports; }; -/* no struct export_args30 yet */ - /* from */ struct netbsd32_nfs_args { int32_t version; /* args structure version number */ @@ -1060,6 +1058,17 @@ struct netbsd32_msdosfs_args { int gmtoff; /* v3: offset from UTC in seconds */ }; +/* from */ +struct netbsd32_layer_args { + netbsd32_charp target; /* Target of loopback */ + struct netbsd32_export_args30 _pad1; /* compat with old userland tools */ +}; + +/* from */ +struct netbsd32_null_args { + struct netbsd32_layer_args la; /* generic layerfs args */ +}; + struct netbsd32_posix_spawn_file_actions_entry { enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE } fae_action; Index: netbsd32_fs.c =================================================================== RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32_fs.c,v retrieving revision 1.80 diff -p -u -u -r1.80 netbsd32_fs.c --- netbsd32_fs.c 1 Jun 2017 02:45:08 -0000 1.80 +++ netbsd32_fs.c 11 Aug 2018 03:39:52 -0000 @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_fs. #include #include #include +#include #define NFS_ARGS_ONLY #include @@ -799,6 +800,7 @@ netbsd32___mount50(struct lwp *l, const struct netbsd32_nfs_args nfs_args; struct netbsd32_msdosfs_args msdosfs_args; struct netbsd32_tmpfs_args tmpfs_args; + struct netbsd32_null_args null_args; } fs_args32; union { struct ufs_args ufs_args; @@ -807,6 +809,7 @@ netbsd32___mount50(struct lwp *l, const struct nfs_args nfs_args; struct msdosfs_args msdosfs_args; struct tmpfs_args tmpfs_args; + struct null_args null_args; } fs_args; const char *type = SCARG_P32(uap, type); const char *path = SCARG_P32(uap, path); @@ -953,6 +956,20 @@ netbsd32___mount50(struct lwp *l, const data_seg = UIO_SYSSPACE; data = &fs_args.nfs_args; data_len = sizeof(fs_args.nfs_args); + } else if (strcmp(mtype, MOUNT_NULL) == 0) { + if (data_len > sizeof(fs_args32.null_args)) + return EINVAL; + if ((flags & MNT_GETARGS) == 0) { + error = copyin(data, &fs_args32.null_args, + sizeof(fs_args32.null_args)); + if (error) + return error; + fs_args.null_args.la.target = + NETBSD32PTR64(fs_args32.null_args.la.target); + } + data_seg = UIO_SYSSPACE; + data = &fs_args.null_args; + data_len = sizeof(fs_args.null_args); } else { data_seg = UIO_USERSPACE; } @@ -1032,6 +1049,13 @@ netbsd32___mount50(struct lwp *l, const fs_args.nfs_args.hostname); error = copyout(&fs_args32.nfs_args, data, sizeof(fs_args32.nfs_args)); + } else if (strcmp(mtype, MOUNT_NULL) == 0) { + if (data_len != sizeof(fs_args.null_args)) + return EINVAL; + NETBSD32PTR32(fs_args32.null_args.la.target, + fs_args.null_args.la.target); + error = copyout(&fs_args32.null_args, data, + sizeof(fs_args32.null_args)); } } return error;