Deleted Added
sdiff udiff text old ( 84768 ) new ( 90045 )
full compact
1/*
2 * Copyright (c) 1980, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35#if 0
36static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93";
37#else
38static char rcsid[] =
39 "$FreeBSD: head/lib/libc/gen/fstab.c 84768 2001-10-10 17:48:44Z bde $";
40#endif
41#endif /* LIBC_SCCS and not lint */
42
43#include "namespace.h"
44#include <sys/param.h>
45#include <sys/mount.h>
46#include <sys/stat.h>
47
48#include <errno.h>
49#include <fstab.h>
50#include <paths.h>
51#include <stdio.h>
52#include <stdlib.h>
53#include <string.h>
54#include <unistd.h>
55#include "un-namespace.h"
56
57static FILE *_fs_fp;
58static struct fstab _fs_fstab;
59static int LineNo = 0;
60
61static void error __P((int));
62static void fixfsfile __P((void));
63static int fstabscan __P((void));
64
65static void
66fixfsfile()
67{
68 static char buf[sizeof(_PATH_DEV) + MNAMELEN];
69 struct stat sb;
70 struct statfs sf;
71

--- 124 unchanged lines hidden (view full) ---

196{
197 if ((!_fs_fp && !setfsent()) || !fstabscan())
198 return((struct fstab *)NULL);
199 return(&_fs_fstab);
200}
201
202struct fstab *
203getfsspec(name)
204 register const char *name;
205{
206 if (setfsent())
207 while (fstabscan())
208 if (!strcmp(_fs_fstab.fs_spec, name))
209 return(&_fs_fstab);
210 return((struct fstab *)NULL);
211}
212
213struct fstab *
214getfsfile(name)
215 register const char *name;
216{
217 if (setfsent())
218 while (fstabscan())
219 if (!strcmp(_fs_fstab.fs_file, name))
220 return(&_fs_fstab);
221 return((struct fstab *)NULL);
222}
223

--- 41 unchanged lines hidden ---