BSD 4_3_Net_2 release
[unix-history] / usr / src / include / fstab.h
index 7651b2e..5359313 100644 (file)
@@ -1,38 +1,79 @@
-/*     fstab.h 4.1     83/05/03        */
-
 /*
 /*
- * File system table, see fstab (5)
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
  *
  *
- * Used by dump, mount, umount, swapon, fsck, df, ...
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
  *
- * The fs_spec field is the block special name.
- * Programs that want to use the character special name must
- * create that name by prepending a 'r' after the right most slash.
+ *     @(#)fstab.h     5.12 (Berkeley) 4/3/91
  */
 
  */
 
-#define        FSTAB           "/etc/fstab"
-#define        FSNMLG          32
+#ifndef _FSTAB_H_
+#define _FSTAB_H_
 
 
-#define        FSTABFMT        "%32s:%32s:%2s:%d:%d\n"
-#define        FSTABARG(p)     (p)->fs_spec, (p)->fs_file, \
-                       (p)->fs_type, &(p)->fs_freq, &(p)->fs_passno
-#define FSTABNARGS     5
+/*
+ * File system table, see fstab(5).
+ *
+ * Used by dump, mount, umount, swapon, fsck, df, ...
+ *
+ * For ufs fs_spec field is the block special name.  Programs that want to
+ * use the character special name must create that name by prepending a 'r'
+ * after the right most slash.  Quota files are always named "quotas", so
+ * if type is "rq", then use concatenation of fs_file and "quotas" to locate
+ * quota file.
+ */
+#define        _PATH_FSTAB     "/etc/fstab"
+#define        FSTAB           "/etc/fstab"    /* deprecated */
 
 
-#define        FSTAB_RW        "rw"    /* read write device */
-#define        FSTAB_RO        "ro"    /* read only device */
-#define        FSTAB_SW        "sw"    /* swap device */
-#define        FSTAB_XX        "xx"    /* ignore totally */
+#define        FSTAB_RW        "rw"            /* read/write device */
+#define        FSTAB_RQ        "rq"            /* read/write with quotas */
+#define        FSTAB_RO        "ro"            /* read-only device */
+#define        FSTAB_SW        "sw"            /* swap device */
+#define        FSTAB_XX        "xx"            /* ignore totally */
 
 
-struct fstab{
-       char    fs_spec[FSNMLG];        /* block special device name */
-       char    fs_file[FSNMLG];        /* file system path prefix */
-       char    fs_type[3];             /* rw,ro,sw or xx */
+struct fstab {
+       char    *fs_spec;               /* block special device name */
+       char    *fs_file;               /* file system path prefix */
+       char    *fs_vfstype;            /* File system type, ufs, nfs */
+       char    *fs_mntops;             /* Mount options ala -o */
+       char    *fs_type;               /* FSTAB_* from fs_mntops */
        int     fs_freq;                /* dump frequency, in days */
        int     fs_passno;              /* pass number on parallel dump */
 };
 
        int     fs_freq;                /* dump frequency, in days */
        int     fs_passno;              /* pass number on parallel dump */
 };
 
-struct fstab *getfsent();
-struct fstab *getfsspec();
-struct fstab *getfsfile();
-int    setfsent();
-int    endfsent();
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+struct fstab *getfsent __P((void));
+struct fstab *getfsspec __P((const char *));
+struct fstab *getfsfile __P((const char *));
+int setfsent __P((void));
+void endfsent __P((void));
+__END_DECLS
+
+#endif /* !_FSTAB_H_ */