Home | History | Annotate | Line # | Download | only in common
vfs_syscalls_40.c revision 1.5
      1  1.5  pgoyette /*	$NetBSD: vfs_syscalls_40.c,v 1.5 2019/01/27 02:08:39 pgoyette Exp $	*/
      2  1.1        ad 
      3  1.1        ad /*-
      4  1.1        ad  * Copyright (c) 2008 The NetBSD Foundation, Inc.
      5  1.1        ad  * All rights reserved.
      6  1.1        ad  *
      7  1.1        ad  * Redistribution and use in source and binary forms, with or without
      8  1.1        ad  * modification, are permitted provided that the following conditions
      9  1.1        ad  * are met:
     10  1.1        ad  * 1. Redistributions of source code must retain the above copyright
     11  1.1        ad  *    notice, this list of conditions and the following disclaimer.
     12  1.1        ad  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1        ad  *    notice, this list of conditions and the following disclaimer in the
     14  1.1        ad  *    documentation and/or other materials provided with the distribution.
     15  1.1        ad  *
     16  1.1        ad  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17  1.1        ad  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  1.1        ad  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  1.1        ad  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20  1.1        ad  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  1.1        ad  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  1.1        ad  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  1.1        ad  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  1.1        ad  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  1.1        ad  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  1.1        ad  * POSSIBILITY OF SUCH DAMAGE.
     27  1.1        ad  */
     28  1.1        ad 
     29  1.1        ad /*
     30  1.1        ad  * Copyright (c) 1989, 1993
     31  1.1        ad  *	The Regents of the University of California.  All rights reserved.
     32  1.1        ad  * (c) UNIX System Laboratories, Inc.
     33  1.1        ad  * All or some portions of this file are derived from material licensed
     34  1.1        ad  * to the University of California by American Telephone and Telegraph
     35  1.1        ad  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
     36  1.1        ad  * the permission of UNIX System Laboratories, Inc.
     37  1.1        ad  *
     38  1.1        ad  * Redistribution and use in source and binary forms, with or without
     39  1.1        ad  * modification, are permitted provided that the following conditions
     40  1.1        ad  * are met:
     41  1.1        ad  * 1. Redistributions of source code must retain the above copyright
     42  1.1        ad  *    notice, this list of conditions and the following disclaimer.
     43  1.1        ad  * 2. Redistributions in binary form must reproduce the above copyright
     44  1.1        ad  *    notice, this list of conditions and the following disclaimer in the
     45  1.1        ad  *    documentation and/or other materials provided with the distribution.
     46  1.1        ad  * 3. Neither the name of the University nor the names of its contributors
     47  1.1        ad  *    may be used to endorse or promote products derived from this software
     48  1.1        ad  *    without specific prior written permission.
     49  1.1        ad  *
     50  1.1        ad  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     51  1.1        ad  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     52  1.1        ad  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     53  1.1        ad  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     54  1.1        ad  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     55  1.1        ad  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     56  1.1        ad  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     57  1.1        ad  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     58  1.1        ad  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     59  1.1        ad  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     60  1.1        ad  * SUCH DAMAGE.
     61  1.1        ad  *
     62  1.1        ad  *	@(#)vfs_syscalls.c	8.42 (Berkeley) 7/31/95
     63  1.1        ad  */
     64  1.1        ad 
     65  1.1        ad #include <sys/cdefs.h>
     66  1.5  pgoyette __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_40.c,v 1.5 2019/01/27 02:08:39 pgoyette Exp $");
     67  1.5  pgoyette 
     68  1.5  pgoyette #if defined(_KERNEL_OPT)
     69  1.5  pgoyette #include "opt_compat_netbsd.h"
     70  1.5  pgoyette #endif
     71  1.1        ad 
     72  1.1        ad #include <sys/param.h>
     73  1.1        ad #include <sys/systm.h>
     74  1.1        ad #include <sys/mount.h>
     75  1.5  pgoyette #include <sys/syscall.h>
     76  1.5  pgoyette #include <sys/syscallvar.h>
     77  1.1        ad #include <sys/syscallargs.h>
     78  1.1        ad 
     79  1.5  pgoyette #include <compat/common/compat_mod.h>
     80  1.5  pgoyette 
     81  1.5  pgoyette static const struct syscall_package vfs_syscalls_40_syscalls[] = {
     82  1.5  pgoyette 	{ SYS_compat_40_mount, 0, (sy_call_t *)compat_40_sys_mount },
     83  1.5  pgoyette 	{ 0, 0, NULL },
     84  1.5  pgoyette };
     85  1.5  pgoyette 
     86  1.1        ad int
     87  1.1        ad compat_40_sys_mount(struct lwp *l, const struct compat_40_sys_mount_args *uap, register_t *retval)
     88  1.1        ad {
     89  1.1        ad 	/* {
     90  1.1        ad 		syscallarg(const char *) type;
     91  1.1        ad 		syscallarg(const char *) path;
     92  1.1        ad 		syscallarg(int) flags;
     93  1.1        ad 		syscallarg(void *) data;
     94  1.1        ad 	} */
     95  1.1        ad 	register_t dummy;
     96  1.1        ad 
     97  1.4      maxv 	return do_sys_mount(l, SCARG(uap, type), UIO_USERSPACE, SCARG(uap, path),
     98  1.1        ad 	    SCARG(uap, flags), SCARG(uap, data), UIO_USERSPACE, 0, &dummy);
     99  1.1        ad }
    100  1.5  pgoyette 
    101  1.5  pgoyette int
    102  1.5  pgoyette vfs_syscalls_40_init(void)
    103  1.5  pgoyette {
    104  1.5  pgoyette 
    105  1.5  pgoyette 	return syscall_establish(NULL, vfs_syscalls_40_syscalls);
    106  1.5  pgoyette }
    107  1.5  pgoyette 
    108  1.5  pgoyette int
    109  1.5  pgoyette vfs_syscalls_40_fini(void)
    110  1.5  pgoyette {
    111  1.5  pgoyette 
    112  1.5  pgoyette 	return syscall_disestablish(NULL, vfs_syscalls_40_syscalls);
    113  1.5  pgoyette }
    114