nullfs.c revision 59766
155137Speter/* $FreeBSD: head/lib/libstand/nullfs.c 59766 2000-04-29 20:47:10Z jlemon $ */
238451Smsmith/*	$NetBSD: nullfs.c,v 1.1 1996/01/13 22:25:39 leo Exp $	*/
338451Smsmith
438451Smsmith/*-
538451Smsmith * Copyright (c) 1993
638451Smsmith *	The Regents of the University of California.  All rights reserved.
738451Smsmith *
838451Smsmith * This code is derived from software contributed to Berkeley by
938451Smsmith * The Mach Operating System project at Carnegie-Mellon University.
1038451Smsmith *
1138451Smsmith * Redistribution and use in source and binary forms, with or without
1238451Smsmith * modification, are permitted provided that the following conditions
1338451Smsmith * are met:
1438451Smsmith * 1. Redistributions of source code must retain the above copyright
1538451Smsmith *    notice, this list of conditions and the following disclaimer.
1638451Smsmith * 2. Redistributions in binary form must reproduce the above copyright
1738451Smsmith *    notice, this list of conditions and the following disclaimer in the
1838451Smsmith *    documentation and/or other materials provided with the distribution.
1938451Smsmith * 3. All advertising materials mentioning features or use of this software
2038451Smsmith *    must display the following acknowledgement:
2138451Smsmith *	This product includes software developed by the University of
2238451Smsmith *	California, Berkeley and its contributors.
2338451Smsmith * 4. Neither the name of the University nor the names of its contributors
2438451Smsmith *    may be used to endorse or promote products derived from this software
2538451Smsmith *    without specific prior written permission.
2638451Smsmith *
2738451Smsmith * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2838451Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2938451Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3038451Smsmith * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3138451Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3238451Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3338451Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3438451Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3538451Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3638451Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3738451Smsmith * SUCH DAMAGE.
3838451Smsmith *
3938451Smsmith *	@(#)open.c	8.1 (Berkeley) 6/11/93
4038451Smsmith *
4138451Smsmith *
4238451Smsmith * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University
4338451Smsmith * All Rights Reserved.
4438451Smsmith *
4538451Smsmith * Author: Alessandro Forin
4638451Smsmith *
4738451Smsmith * Permission to use, copy, modify and distribute this software and its
4838451Smsmith * documentation is hereby granted, provided that both the copyright
4938451Smsmith * notice and this permission notice appear in all copies of the
5038451Smsmith * software, derivative works or modified versions, and any portions
5138451Smsmith * thereof, and that both notices appear in supporting documentation.
5238451Smsmith *
5338451Smsmith * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
5438451Smsmith * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
5538451Smsmith * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
5638451Smsmith *
5738451Smsmith * Carnegie Mellon requests users of this software to return to
5838451Smsmith *
5938451Smsmith *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
6038451Smsmith *  School of Computer Science
6138451Smsmith *  Carnegie Mellon University
6238451Smsmith *  Pittsburgh PA 15213-3890
6338451Smsmith *
6438451Smsmith * any improvements or extensions that they make and grant Carnegie the
6538451Smsmith * rights to redistribute these changes.
6638451Smsmith */
6738451Smsmith
6838451Smsmith#include "stand.h"
6938451Smsmith
7038451Smsmith/*
7138451Smsmith * Null filesystem
7238451Smsmith */
7339469Smsmithint	null_open (const char *path, struct open_file *f)
7438451Smsmith{
7538451Smsmith	errno  = EIO;
7638451Smsmith	return -1;
7738451Smsmith}
7838451Smsmith
7938451Smsmithint	null_close(struct open_file *f)
8038451Smsmith{
8138451Smsmith	return 0;
8238451Smsmith}
8338451Smsmith
8455137Speterint	null_read (struct open_file *f, void *buf, size_t size, size_t *resid)
8538451Smsmith{
8638451Smsmith	errno = EIO;
8738451Smsmith	return -1;
8838451Smsmith}
8938451Smsmith
9055137Speterint	null_write (struct open_file *f, void *buf, size_t size, size_t *resid)
9138451Smsmith{
9238451Smsmith	errno = EIO;
9338451Smsmith	return -1;
9438451Smsmith}
9538451Smsmith
9638451Smsmithoff_t	null_seek (struct open_file *f, off_t offset, int where)
9738451Smsmith{
9838451Smsmith	errno = EIO;
9938451Smsmith	return -1;
10038451Smsmith}
10138451Smsmith
10238451Smsmithint	null_stat (struct open_file *f, struct stat *sb)
10338451Smsmith{
10438451Smsmith	errno = EIO;
10538451Smsmith	return -1;
10638451Smsmith}
10759766Sjlemon
10859766Sjlemonint	null_readdir(struct open_file *f, struct dirent *d)
10959766Sjlemon{
11059766Sjlemon	errno = EIO;
11159766Sjlemon	return -1;
11259766Sjlemon}
113