1*84d9c625SLionel Sambuc /* $NetBSD: mntopts.h,v 1.15 2012/10/19 17:09:06 drochner Exp $ */ 22fe8fb19SBen Gras 32fe8fb19SBen Gras /*- 42fe8fb19SBen Gras * Copyright (c) 1994 52fe8fb19SBen Gras * The Regents of the University of California. All rights reserved. 62fe8fb19SBen Gras * 72fe8fb19SBen Gras * Redistribution and use in source and binary forms, with or without 82fe8fb19SBen Gras * modification, are permitted provided that the following conditions 92fe8fb19SBen Gras * are met: 102fe8fb19SBen Gras * 1. Redistributions of source code must retain the above copyright 112fe8fb19SBen Gras * notice, this list of conditions and the following disclaimer. 122fe8fb19SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 132fe8fb19SBen Gras * notice, this list of conditions and the following disclaimer in the 142fe8fb19SBen Gras * documentation and/or other materials provided with the distribution. 152fe8fb19SBen Gras * 3. Neither the name of the University nor the names of its contributors 162fe8fb19SBen Gras * may be used to endorse or promote products derived from this software 172fe8fb19SBen Gras * without specific prior written permission. 182fe8fb19SBen Gras * 192fe8fb19SBen Gras * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 202fe8fb19SBen Gras * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 212fe8fb19SBen Gras * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 222fe8fb19SBen Gras * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 232fe8fb19SBen Gras * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 242fe8fb19SBen Gras * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 252fe8fb19SBen Gras * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 262fe8fb19SBen Gras * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 272fe8fb19SBen Gras * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 282fe8fb19SBen Gras * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 292fe8fb19SBen Gras * SUCH DAMAGE. 302fe8fb19SBen Gras * 312fe8fb19SBen Gras * @(#)mntopts.h 8.7 (Berkeley) 3/29/95 322fe8fb19SBen Gras */ 332fe8fb19SBen Gras #ifndef _MNTOPTS_H_ 342fe8fb19SBen Gras #define _MNTOPTS_H_ 352fe8fb19SBen Gras 362fe8fb19SBen Gras struct mntopt { 372fe8fb19SBen Gras const char *m_option; /* option name */ 382fe8fb19SBen Gras int m_inverse; /* if a negative option, eg "dev" */ 392fe8fb19SBen Gras int m_flag; /* bit to set, eg. MNT_RDONLY */ 402fe8fb19SBen Gras int m_altloc; /* 1 => set bit in altflags */ 412fe8fb19SBen Gras }; 422fe8fb19SBen Gras 432fe8fb19SBen Gras /* User-visible MNT_ flags. */ 442fe8fb19SBen Gras #define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 } 452fe8fb19SBen Gras #define MOPT_NOCOREDUMP { "coredump", 1, MNT_NOCOREDUMP, 0 } 462fe8fb19SBen Gras #define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 } 472fe8fb19SBen Gras #define MOPT_NODEVMTIME { "devmtime", 1, MNT_NODEVMTIME, 0 } 482fe8fb19SBen Gras #define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 } 492fe8fb19SBen Gras #define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 } 502fe8fb19SBen Gras #define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 } 512fe8fb19SBen Gras #define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 } 522fe8fb19SBen Gras #define MOPT_UNION { "union", 0, MNT_UNION, 0 } 532fe8fb19SBen Gras #define MOPT_USERQUOTA { "userquota", 0, 0, 0 } 542fe8fb19SBen Gras #define MOPT_GROUPQUOTA { "groupquota", 0, 0, 0 } 552fe8fb19SBen Gras #define MOPT_NOATIME { "atime", 1, MNT_NOATIME, 0 } 562fe8fb19SBen Gras #define MOPT_SYMPERM { "symperm", 0, MNT_SYMPERM, 0 } 572fe8fb19SBen Gras #define MOPT_SOFTDEP { "softdep", 0, MNT_SOFTDEP, 0 } 582fe8fb19SBen Gras #define MOPT_LOG { "log", 0, MNT_LOG, 0 } 592fe8fb19SBen Gras #define MOPT_IGNORE { "hidden", 0, MNT_IGNORE, 0 } 60f14fb602SLionel Sambuc #define MOPT_EXTATTR { "extattr", 0, MNT_EXTATTR, 0 } 61*84d9c625SLionel Sambuc #define MOPT_DISCARD { "discard", 0, MNT_DISCARD, 0 } 622fe8fb19SBen Gras 632fe8fb19SBen Gras /* Control flags. */ 642fe8fb19SBen Gras #define MOPT_FORCE { "force", 0, MNT_FORCE, 0 } 652fe8fb19SBen Gras #define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } 662fe8fb19SBen Gras #define MOPT_RELOAD { "reload", 0, MNT_RELOAD, 0 } 672fe8fb19SBen Gras #define MOPT_GETARGS { "getargs", 0, MNT_GETARGS, 0 } 682fe8fb19SBen Gras 692fe8fb19SBen Gras /* Support for old-style "ro", "rw" flags. */ 702fe8fb19SBen Gras #define MOPT_RO { "ro", 0, MNT_RDONLY, 0 } 712fe8fb19SBen Gras #define MOPT_RW { "rw", 1, MNT_RDONLY, 0 } 722fe8fb19SBen Gras 732fe8fb19SBen Gras /* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */ 742fe8fb19SBen Gras #define MOPT_AUTO { "auto", 0, 0, 0 } 752fe8fb19SBen Gras #define MOPT_RUMP { "rump", 0, 0, 0 } 762fe8fb19SBen Gras #define MOPT_NULL { NULL, 0, 0, 0 } 772fe8fb19SBen Gras 782fe8fb19SBen Gras #define MOPT_FSTAB_COMPAT \ 792fe8fb19SBen Gras MOPT_RO, \ 802fe8fb19SBen Gras MOPT_RW, \ 812fe8fb19SBen Gras MOPT_AUTO 822fe8fb19SBen Gras 832fe8fb19SBen Gras /* Standard options which all mounts can understand. */ 842fe8fb19SBen Gras #define MOPT_STDOPTS \ 852fe8fb19SBen Gras MOPT_USERQUOTA, \ 862fe8fb19SBen Gras MOPT_GROUPQUOTA, \ 872fe8fb19SBen Gras MOPT_FSTAB_COMPAT, \ 882fe8fb19SBen Gras MOPT_NOCOREDUMP, \ 892fe8fb19SBen Gras MOPT_NODEV, \ 902fe8fb19SBen Gras MOPT_NOEXEC, \ 912fe8fb19SBen Gras MOPT_NOSUID, \ 922fe8fb19SBen Gras MOPT_RDONLY, \ 932fe8fb19SBen Gras MOPT_UNION, \ 942fe8fb19SBen Gras MOPT_IGNORE, \ 952fe8fb19SBen Gras MOPT_SYMPERM, \ 962fe8fb19SBen Gras MOPT_RUMP 972fe8fb19SBen Gras 982fe8fb19SBen Gras __BEGIN_DECLS 992fe8fb19SBen Gras typedef struct mntoptparse *mntoptparse_t; 1002fe8fb19SBen Gras mntoptparse_t getmntopts(const char *, const struct mntopt *, int *, int *); 1012fe8fb19SBen Gras const char *getmntoptstr(mntoptparse_t, const char *); 1022fe8fb19SBen Gras long getmntoptnum(mntoptparse_t, const char *); 1032fe8fb19SBen Gras void freemntopts(mntoptparse_t); 1042fe8fb19SBen Gras 1052fe8fb19SBen Gras extern int getmnt_silent; 1062fe8fb19SBen Gras __END_DECLS 1072fe8fb19SBen Gras 1082fe8fb19SBen Gras #endif /* _MNTOPTS_H_ */ 109