nullfs.c revision 199767f8919635c4928607450d9e0abb932109ce
fa9e4066f08beec538e775443c5be79dd423fcabahrens/* $NetBSD: nullfs.c,v 1.1 1996/01/13 22:25:39 leo Exp $ */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*-
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Copyright (c) 1993
f48205be61a214698b763ff550ab9e657525104ccasper * The Regents of the University of California. All rights reserved.
f48205be61a214698b763ff550ab9e657525104ccasper *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * This code is derived from software contributed to Berkeley by
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The Mach Operating System project at Carnegie-Mellon University.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Redistribution and use in source and binary forms, with or without
fa9e4066f08beec538e775443c5be79dd423fcabahrens * modification, are permitted provided that the following conditions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * are met:
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 1. Redistributions of source code must retain the above copyright
fa9e4066f08beec538e775443c5be79dd423fcabahrens * notice, this list of conditions and the following disclaimer.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 2. Redistributions in binary form must reproduce the above copyright
fa9e4066f08beec538e775443c5be79dd423fcabahrens * notice, this list of conditions and the following disclaimer in the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * documentation and/or other materials provided with the distribution.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 4. Neither the name of the University nor the names of its contributors
fa9e4066f08beec538e775443c5be79dd423fcabahrens * may be used to endorse or promote products derived from this software
fa9e4066f08beec538e775443c5be79dd423fcabahrens * without specific prior written permission.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
27dd1e87cd3d939264769dd4af7e6a529cde001fMark Shellenbaum * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1eb4e906ec75b9bde421954ace46ef137b0fc9ebKevin Crowe * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
fa9e4066f08beec538e775443c5be79dd423fcabahrens * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * SUCH DAMAGE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @(#)open.c 8.1 (Berkeley) 6/11/93
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University
fa9e4066f08beec538e775443c5be79dd423fcabahrens * All Rights Reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Author: Alessandro Forin
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Permission to use, copy, modify and distribute this software and its
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * documentation is hereby granted, provided that both the copyright
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * notice and this permission notice appear in all copies of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * software, derivative works or modified versions, and any portions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * thereof, and that both notices appear in supporting documentation.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Carnegie Mellon requests users of this software to return to
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * School of Computer Science
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Carnegie Mellon University
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Pittsburgh PA 15213-3890
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * any improvements or extensions that they make and grant Carnegie the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * rights to redistribute these changes.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <sys/cdefs.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw__FBSDID("$FreeBSD$");
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include "stand.h"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Null filesystem
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwint null_open (const char *path, struct open_file *f)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return EINVAL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwint null_close(struct open_file *f)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return 0;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwint null_read (struct open_file *f, void *buf, size_t size, size_t *resid)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return EIO;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwint null_write (struct open_file *f, void *buf, size_t size, size_t *resid)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return EIO;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwoff_t null_seek (struct open_file *f, off_t offset, int where)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw errno = EIO;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return -1;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwint null_stat (struct open_file *f, struct stat *sb)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return EIO;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwint null_readdir(struct open_file *f, struct dirent *d)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return EIO;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw