vfs_syscalls_10.c revision 1.2
11.2Spgoyette/* $NetBSD: vfs_syscalls_10.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $ */ 21.2Spgoyette 31.2Spgoyette/*- 41.2Spgoyette * Copyright (c) 2018 The NetBSD Foundation, Inc. 51.2Spgoyette * All rights reserved. 61.2Spgoyette * 71.2Spgoyette * This code is derived from software contributed to The NetBSD Foundation 81.2Spgoyette * by Paul Goyette 91.2Spgoyette * 101.2Spgoyette * Redistribution and use in source and binary forms, with or without 111.2Spgoyette * modification, are permitted provided that the following conditions 121.2Spgoyette * are met: 131.2Spgoyette * 1. Redistributions of source code must retain the above copyright 141.2Spgoyette * notice, this list of conditions and the following disclaimer. 151.2Spgoyette * 2. Redistributions in binary form must reproduce the above copyright 161.2Spgoyette * notice, this list of conditions and the following disclaimer in the 171.2Spgoyette * documentation and/or other materials provided with the distribution. 181.2Spgoyette * 191.2Spgoyette * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 201.2Spgoyette * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 211.2Spgoyette * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 221.2Spgoyette * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 231.2Spgoyette * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 241.2Spgoyette * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 251.2Spgoyette * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 261.2Spgoyette * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 271.2Spgoyette * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 281.2Spgoyette * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 291.2Spgoyette * POSSIBILITY OF SUCH DAMAGE. 301.2Spgoyette */ 311.2Spgoyette 321.2Spgoyette#include <sys/cdefs.h> 331.2Spgoyette__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_10.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $"); 341.2Spgoyette 351.2Spgoyette#if defined(_KERNEL_OPT) 361.2Spgoyette#include "opt_compat_netbsd.h" 371.2Spgoyette#endif 381.2Spgoyette 391.2Spgoyette#include <sys/param.h> 401.2Spgoyette#include <sys/systm.h> 411.2Spgoyette#include <sys/namei.h> 421.2Spgoyette#include <sys/vfs_syscalls.h> 431.2Spgoyette#include <sys/compat_stub.h> 441.2Spgoyette 451.2Spgoyette#include <compat/common/compat_mod.h> 461.2Spgoyette 471.2Spgoyettestatic int 481.2Spgoyettereal_sys_openat_10(struct pathbuf **pb) 491.2Spgoyette{ 501.2Spgoyette 511.2Spgoyette *pb = pathbuf_create("."); 521.2Spgoyette return (*pb == NULL ? ENOMEM : 0); 531.2Spgoyette} 541.2Spgoyette 551.2Spgoyettevoid vfs_syscalls_10_init(void) 561.2Spgoyette{ 571.2Spgoyette 581.2Spgoyette MODULE_SET_HOOK(compat_10_openat_hook, "openat_10", real_sys_openat_10); 591.2Spgoyette} 601.2Spgoyette 611.2Spgoyettevoid vfs_syscalls_10_fini(void) 621.2Spgoyette{ 631.2Spgoyette 641.2Spgoyette MODULE_UNSET_HOOK(compat_10_openat_hook); 651.2Spgoyette} 66