1*599546b3Sderaadt /* $OpenBSD: nullfs.c,v 1.7 2003/08/11 06:23:09 deraadt Exp $ */
221c66822Sderaadt /* $NetBSD: open.c,v 1.9 1995/09/19 09:16:52 thorpej Exp $ */
321c66822Sderaadt
421c66822Sderaadt /*-
521c66822Sderaadt * Copyright (c) 1993
621c66822Sderaadt * The Regents of the University of California. All rights reserved.
721c66822Sderaadt *
821c66822Sderaadt * This code is derived from software contributed to Berkeley by
921c66822Sderaadt * The Mach Operating System project at Carnegie-Mellon University.
1021c66822Sderaadt *
1121c66822Sderaadt * Redistribution and use in source and binary forms, with or without
1221c66822Sderaadt * modification, are permitted provided that the following conditions
1321c66822Sderaadt * are met:
1421c66822Sderaadt * 1. Redistributions of source code must retain the above copyright
1521c66822Sderaadt * notice, this list of conditions and the following disclaimer.
1621c66822Sderaadt * 2. Redistributions in binary form must reproduce the above copyright
1721c66822Sderaadt * notice, this list of conditions and the following disclaimer in the
1821c66822Sderaadt * documentation and/or other materials provided with the distribution.
1929295d1cSmillert * 3. Neither the name of the University nor the names of its contributors
2021c66822Sderaadt * may be used to endorse or promote products derived from this software
2121c66822Sderaadt * without specific prior written permission.
2221c66822Sderaadt *
2321c66822Sderaadt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2421c66822Sderaadt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2521c66822Sderaadt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2621c66822Sderaadt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2721c66822Sderaadt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2821c66822Sderaadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2921c66822Sderaadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3021c66822Sderaadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3121c66822Sderaadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3221c66822Sderaadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3321c66822Sderaadt * SUCH DAMAGE.
3421c66822Sderaadt *
3521c66822Sderaadt * @(#)open.c 8.1 (Berkeley) 6/11/93
3621c66822Sderaadt *
3721c66822Sderaadt *
3821c66822Sderaadt * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University
3921c66822Sderaadt * All Rights Reserved.
4021c66822Sderaadt *
4121c66822Sderaadt * Author: Alessandro Forin
4221c66822Sderaadt *
4321c66822Sderaadt * Permission to use, copy, modify and distribute this software and its
4421c66822Sderaadt * documentation is hereby granted, provided that both the copyright
4521c66822Sderaadt * notice and this permission notice appear in all copies of the
4621c66822Sderaadt * software, derivative works or modified versions, and any portions
4721c66822Sderaadt * thereof, and that both notices appear in supporting documentation.
4821c66822Sderaadt *
4921c66822Sderaadt * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
5021c66822Sderaadt * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
5121c66822Sderaadt * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
5221c66822Sderaadt *
5321c66822Sderaadt * Carnegie Mellon requests users of this software to return to
5421c66822Sderaadt *
5521c66822Sderaadt * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
5621c66822Sderaadt * School of Computer Science
5721c66822Sderaadt * Carnegie Mellon University
5821c66822Sderaadt * Pittsburgh PA 15213-3890
5921c66822Sderaadt *
6021c66822Sderaadt * any improvements or extensions that they make and grant Carnegie the
6121c66822Sderaadt * rights to redistribute these changes.
6221c66822Sderaadt */
6321c66822Sderaadt
6421c66822Sderaadt #include "stand.h"
6521c66822Sderaadt
6621c66822Sderaadt /*
6721c66822Sderaadt * Null filesystem
6821c66822Sderaadt */
69e76f679cSmickey int
null_open(char * path,struct open_file * f)70e76f679cSmickey null_open(char *path, struct open_file *f)
7121c66822Sderaadt {
72e76f679cSmickey return EIO;
7321c66822Sderaadt }
7421c66822Sderaadt
75e76f679cSmickey int
null_close(struct open_file * f)76e76f679cSmickey null_close(struct open_file *f)
7721c66822Sderaadt {
7821c66822Sderaadt return 0;
7921c66822Sderaadt }
8021c66822Sderaadt
81561ec4dcSmillert ssize_t
null_read(struct open_file * f,void * buf,size_t size,size_t * resid)82e76f679cSmickey null_read(struct open_file *f, void *buf, size_t size, size_t *resid)
83e76f679cSmickey {
84e76f679cSmickey return EIO;
85e76f679cSmickey }
86e76f679cSmickey
87561ec4dcSmillert ssize_t
null_write(struct open_file * f,void * buf,size_t size,size_t * resid)88e76f679cSmickey null_write(struct open_file *f, void *buf, size_t size, size_t *resid)
89e76f679cSmickey {
90e76f679cSmickey return EIO;
91e76f679cSmickey }
92e76f679cSmickey
93e76f679cSmickey off_t
null_seek(struct open_file * f,off_t offset,int where)94e76f679cSmickey null_seek(struct open_file *f, off_t offset, int where)
9521c66822Sderaadt {
9621c66822Sderaadt errno = EIO;
9721c66822Sderaadt return -1;
9821c66822Sderaadt }
9921c66822Sderaadt
100e76f679cSmickey int
null_stat(struct open_file * f,struct stat * sb)101e76f679cSmickey null_stat(struct open_file *f, struct stat *sb)
10221c66822Sderaadt {
103e76f679cSmickey return EIO;
10421c66822Sderaadt }
10521c66822Sderaadt
106e76f679cSmickey #ifndef NO_READDIR
107e76f679cSmickey int
null_readdir(struct open_file * f,char * name)108e76f679cSmickey null_readdir(struct open_file *f, char *name)
10921c66822Sderaadt {
110e76f679cSmickey return EIO;
11121c66822Sderaadt }
112e76f679cSmickey #endif
113