nullfs.c revision 84221
151694Sroger/* $NetBSD: nullfs.c,v 1.1 1996/01/13 22:25:39 leo Exp $ */ 251694Sroger 351694Sroger/*- 451694Sroger * Copyright (c) 1993 551694Sroger * The Regents of the University of California. All rights reserved. 651694Sroger * 751694Sroger * This code is derived from software contributed to Berkeley by 851694Sroger * The Mach Operating System project at Carnegie-Mellon University. 951694Sroger * 1051694Sroger * Redistribution and use in source and binary forms, with or without 1151694Sroger * modification, are permitted provided that the following conditions 1251694Sroger * are met: 13139749Simp * 1. Redistributions of source code must retain the above copyright 1451694Sroger * notice, this list of conditions and the following disclaimer. 1551694Sroger * 2. Redistributions in binary form must reproduce the above copyright 1651694Sroger * notice, this list of conditions and the following disclaimer in the 1751694Sroger * documentation and/or other materials provided with the distribution. 1851694Sroger * 3. All advertising materials mentioning features or use of this software 1951694Sroger * must display the following acknowledgement: 2051694Sroger * This product includes software developed by the University of 2151694Sroger * California, Berkeley and its contributors. 2251694Sroger * 4. Neither the name of the University nor the names of its contributors 2351694Sroger * may be used to endorse or promote products derived from this software 2451694Sroger * without specific prior written permission. 2551694Sroger * 2651694Sroger * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2751694Sroger * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2851694Sroger * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2951694Sroger * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3051694Sroger * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3151694Sroger * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3251694Sroger * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3351694Sroger * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3451694Sroger * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3551694Sroger * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3651694Sroger * SUCH DAMAGE. 3751694Sroger * 3851694Sroger * @(#)open.c 8.1 (Berkeley) 6/11/93 3951694Sroger * 4051694Sroger * 4151694Sroger * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University 4251694Sroger * All Rights Reserved. 4351694Sroger * 4451694Sroger * Author: Alessandro Forin 4551694Sroger * 4651694Sroger * Permission to use, copy, modify and distribute this software and its 4751694Sroger * documentation is hereby granted, provided that both the copyright 48138936Sjulian * notice and this permission notice appear in all copies of the 49138936Sjulian * software, derivative works or modified versions, and any portions 50138936Sjulian * thereof, and that both notices appear in supporting documentation. 51138936Sjulian * 52138936Sjulian * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 53138936Sjulian * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 54138936Sjulian * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 55138936Sjulian * 56138936Sjulian * Carnegie Mellon requests users of this software to return to 57138936Sjulian * 58138936Sjulian * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 59138936Sjulian * School of Computer Science 60138936Sjulian * Carnegie Mellon University 61138936Sjulian * Pittsburgh PA 15213-3890 62138936Sjulian * 63152375Snetchild * any improvements or extensions that they make and grant Carnegie the 64152375Snetchild * rights to redistribute these changes. 6551694Sroger */ 6651694Sroger 6751694Sroger#include <sys/cdefs.h> 6851694Sroger__FBSDID("$FreeBSD: head/lib/libstand/nullfs.c 84221 2001-09-30 22:28:01Z dillon $"); 6951694Sroger 7051694Sroger#include "stand.h" 7151694Sroger 7251694Sroger/* 7351694Sroger * Null filesystem 7451694Sroger */ 7551694Srogerint null_open (const char *path, struct open_file *f) 7651694Sroger{ 7751694Sroger errno = EIO; 7851694Sroger return -1; 7951694Sroger} 8051694Sroger 8151694Srogerint null_close(struct open_file *f) 8251694Sroger{ 8351694Sroger return 0; 8451694Sroger} 8551694Sroger 8651694Srogerint null_read (struct open_file *f, void *buf, size_t size, size_t *resid) 8751694Sroger{ 8851694Sroger errno = EIO; 8951694Sroger return -1; 9051694Sroger} 9151694Sroger 9251694Srogerint null_write (struct open_file *f, void *buf, size_t size, size_t *resid) 9351694Sroger{ 9451694Sroger errno = EIO; 9551694Sroger return -1; 96140655Sjulian} 9751694Sroger 9851694Srogeroff_t null_seek (struct open_file *f, off_t offset, int where) 9951694Sroger{ 10051694Sroger errno = EIO; 10151694Sroger return -1; 10251694Sroger} 10351694Sroger 10451694Srogerint null_stat (struct open_file *f, struct stat *sb) 105{ 106 errno = EIO; 107 return -1; 108} 109 110int null_readdir(struct open_file *f, struct dirent *d) 111{ 112 errno = EIO; 113 return -1; 114} 115