Home | History | Annotate | Line # | Download | only in include
mntopts.h revision 1.14
      1  1.14      manu /*	$NetBSD: mntopts.h,v 1.14 2011/06/17 14:23:50 manu Exp $	*/
      2   1.1  jdolecek 
      3   1.1  jdolecek /*-
      4   1.1  jdolecek  * Copyright (c) 1994
      5   1.1  jdolecek  *      The Regents of the University of California.  All rights reserved.
      6   1.1  jdolecek  *
      7   1.1  jdolecek  * Redistribution and use in source and binary forms, with or without
      8   1.1  jdolecek  * modification, are permitted provided that the following conditions
      9   1.1  jdolecek  * are met:
     10   1.1  jdolecek  * 1. Redistributions of source code must retain the above copyright
     11   1.1  jdolecek  *    notice, this list of conditions and the following disclaimer.
     12   1.1  jdolecek  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1  jdolecek  *    notice, this list of conditions and the following disclaimer in the
     14   1.1  jdolecek  *    documentation and/or other materials provided with the distribution.
     15   1.3       agc  * 3. Neither the name of the University nor the names of its contributors
     16   1.1  jdolecek  *    may be used to endorse or promote products derived from this software
     17   1.1  jdolecek  *    without specific prior written permission.
     18   1.1  jdolecek  *
     19   1.1  jdolecek  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     20   1.1  jdolecek  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21   1.1  jdolecek  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22   1.1  jdolecek  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     23   1.1  jdolecek  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24   1.1  jdolecek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25   1.1  jdolecek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26   1.1  jdolecek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27   1.1  jdolecek  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28   1.1  jdolecek  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29   1.1  jdolecek  * SUCH DAMAGE.
     30   1.1  jdolecek  *
     31   1.1  jdolecek  *	@(#)mntopts.h	8.7 (Berkeley) 3/29/95
     32   1.1  jdolecek  */
     33   1.2  christos #ifndef _MNTOPTS_H_
     34   1.2  christos #define _MNTOPTS_H_
     35   1.1  jdolecek 
     36   1.1  jdolecek struct mntopt {
     37   1.1  jdolecek 	const char *m_option;	/* option name */
     38   1.1  jdolecek 	int m_inverse;		/* if a negative option, eg "dev" */
     39   1.1  jdolecek 	int m_flag;		/* bit to set, eg. MNT_RDONLY */
     40   1.1  jdolecek 	int m_altloc;		/* 1 => set bit in altflags */
     41   1.1  jdolecek };
     42   1.1  jdolecek 
     43   1.1  jdolecek /* User-visible MNT_ flags. */
     44   1.1  jdolecek #define MOPT_ASYNC		{ "async",	0, MNT_ASYNC, 0 }
     45   1.1  jdolecek #define MOPT_NOCOREDUMP		{ "coredump",	1, MNT_NOCOREDUMP, 0 }
     46   1.1  jdolecek #define MOPT_NODEV		{ "dev",	1, MNT_NODEV, 0 }
     47   1.1  jdolecek #define MOPT_NODEVMTIME		{ "devmtime",	1, MNT_NODEVMTIME, 0 }
     48   1.1  jdolecek #define MOPT_NOEXEC		{ "exec",	1, MNT_NOEXEC, 0 }
     49   1.1  jdolecek #define MOPT_NOSUID		{ "suid",	1, MNT_NOSUID, 0 }
     50   1.1  jdolecek #define MOPT_RDONLY		{ "rdonly",	0, MNT_RDONLY, 0 }
     51   1.1  jdolecek #define MOPT_SYNC		{ "sync",	0, MNT_SYNCHRONOUS, 0 }
     52   1.1  jdolecek #define MOPT_UNION		{ "union",	0, MNT_UNION, 0 }
     53   1.1  jdolecek #define MOPT_USERQUOTA		{ "userquota",	0, 0, 0 }
     54   1.1  jdolecek #define MOPT_GROUPQUOTA		{ "groupquota",	0, 0, 0 }
     55   1.1  jdolecek #define MOPT_NOATIME		{ "atime",	1, MNT_NOATIME, 0 }
     56   1.1  jdolecek #define MOPT_SYMPERM		{ "symperm",	0, MNT_SYMPERM, 0 }
     57   1.1  jdolecek #define MOPT_SOFTDEP		{ "softdep",	0, MNT_SOFTDEP, 0 }
     58  1.11    simonb #define MOPT_LOG		{ "log",	0, MNT_LOG, 0 }
     59   1.1  jdolecek #define MOPT_IGNORE		{ "hidden",	0, MNT_IGNORE, 0 }
     60  1.14      manu #define MOPT_EXTATTR		{ "extattr",	0, MNT_EXTATTR, 0 }
     61   1.1  jdolecek 
     62   1.1  jdolecek /* Control flags. */
     63   1.4   thorpej #define MOPT_FORCE		{ "force",	0, MNT_FORCE, 0 }
     64   1.1  jdolecek #define MOPT_UPDATE		{ "update",	0, MNT_UPDATE, 0 }
     65   1.1  jdolecek #define MOPT_RELOAD		{ "reload",	0, MNT_RELOAD, 0 }
     66   1.1  jdolecek #define MOPT_GETARGS		{ "getargs",	0, MNT_GETARGS,	0 }
     67   1.1  jdolecek 
     68   1.1  jdolecek /* Support for old-style "ro", "rw" flags. */
     69   1.1  jdolecek #define MOPT_RO			{ "ro",		0, MNT_RDONLY, 0 }
     70   1.1  jdolecek #define MOPT_RW			{ "rw",		1, MNT_RDONLY, 0 }
     71   1.1  jdolecek 
     72   1.1  jdolecek /* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */
     73   1.1  jdolecek #define MOPT_AUTO		{ "auto",	0, 0, 0 }
     74  1.12     pooka #define MOPT_RUMP		{ "rump",	0, 0, 0 }
     75   1.8  christos #define MOPT_NULL		{ NULL,		0, 0, 0 }
     76   1.1  jdolecek 
     77   1.1  jdolecek #define MOPT_FSTAB_COMPAT						\
     78   1.1  jdolecek 	MOPT_RO,							\
     79   1.1  jdolecek 	MOPT_RW,							\
     80   1.1  jdolecek 	MOPT_AUTO
     81   1.1  jdolecek 
     82   1.1  jdolecek /* Standard options which all mounts can understand. */
     83   1.1  jdolecek #define MOPT_STDOPTS							\
     84   1.1  jdolecek 	MOPT_USERQUOTA,							\
     85   1.1  jdolecek 	MOPT_GROUPQUOTA,						\
     86   1.1  jdolecek 	MOPT_FSTAB_COMPAT,						\
     87   1.1  jdolecek 	MOPT_NOCOREDUMP,						\
     88   1.1  jdolecek 	MOPT_NODEV,							\
     89   1.1  jdolecek 	MOPT_NOEXEC,							\
     90   1.1  jdolecek 	MOPT_NOSUID,							\
     91   1.1  jdolecek 	MOPT_RDONLY,							\
     92   1.1  jdolecek 	MOPT_UNION,							\
     93   1.1  jdolecek 	MOPT_IGNORE,							\
     94  1.13     pooka 	MOPT_SYMPERM,							\
     95  1.13     pooka 	MOPT_RUMP
     96   1.1  jdolecek 
     97   1.2  christos __BEGIN_DECLS
     98   1.2  christos typedef struct mntoptparse *mntoptparse_t;
     99   1.5     perry mntoptparse_t getmntopts(const char *, const struct mntopt *, int *, int *);
    100   1.5     perry const char *getmntoptstr(mntoptparse_t, const char *);
    101   1.5     perry long getmntoptnum(mntoptparse_t, const char *);
    102   1.5     perry void freemntopts(mntoptparse_t);
    103   1.2  christos 
    104   1.1  jdolecek extern int getmnt_silent;
    105   1.2  christos __END_DECLS
    106   1.2  christos 
    107   1.2  christos #endif /* _MNTOPTS_H_ */
    108