"Fossies" - the Fresh Open Source Software Archive

Member "dmd2/src/druntime/import/core/sys/freebsd/sys/mount.d" (20 Nov 2020, 8632 Bytes) of package /linux/misc/dmd.2.094.2.linux.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) D source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 //Written in the D programming language
    2 
    3 /++
    4     D header file for FreeBSD's sys/mount.h.
    5 
    6     Copyright: Copyright 2018 -
    7     License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
    8     Authors:   $(HTTP jmdavisprog.com, Jonathan M Davis)
    9  +/
   10 module core.sys.freebsd.sys.mount;
   11 
   12 version (FreeBSD):
   13 
   14 import core.stdc.config : c_long;
   15 import core.sys.posix.sys.stat : stat_t;
   16 import core.sys.posix.sys.types : uid_t;
   17 
   18 extern(C) @nogc nothrow:
   19 
   20 struct fsid_t
   21 {
   22     int[2] val;
   23 }
   24 
   25 enum MAXFIDSZ = 16;
   26 
   27 struct fid
   28 {
   29     ushort         fid_len;
   30     ushort         fid_data0;
   31     char[MAXFIDSZ] fid_data = 0;
   32 }
   33 
   34 enum MFSNAMELEN = 16;
   35 enum MNAMELEN   = 88;
   36 enum STATFS_VERSION = 0x20030518;
   37 
   38 struct statfs_t
   39 {
   40     uint f_version;
   41     uint f_type;
   42     ulong f_flags;
   43     ulong f_bsize;
   44     ulong f_iosize;
   45     ulong f_blocks;
   46     ulong f_bfree;
   47     long  f_bavail;
   48     ulong f_files;
   49     long  f_ffree;
   50     ulong f_syncwrites;
   51     ulong f_asyncwrites;
   52     ulong f_syncreads;
   53     ulong f_asyncreads;
   54     ulong[10] f_spare;
   55     uint f_namemax;
   56     uid_t f_owner;
   57     fsid_t f_fsid;
   58     char[80] f_charspare = 0;
   59     char[MFSNAMELEN] f_fstypename = 0;
   60     char[MNAMELEN] f_mntfromname = 0;
   61     char[MNAMELEN] f_mntonname = 0;
   62 }
   63 
   64 
   65 enum ulong MNT_RDONLY = 0x0000000000000001;
   66 enum ulong MNT_SYNCHRONOUS = 0x0000000000000002;
   67 enum ulong MNT_NOEXEC = 0x0000000000000004;
   68 enum ulong MNT_NOSUID = 0x0000000000000008;
   69 enum ulong MNT_NFS4ACLS = 0x0000000000000010;
   70 enum ulong MNT_UNION = 0x0000000000000020;
   71 enum ulong MNT_ASYNC = 0x0000000000000040;
   72 enum ulong MNT_SUIDDIR = 0x0000000000100000;
   73 enum ulong MNT_SOFTDEP = 0x0000000000200000;
   74 enum ulong MNT_NOSYMFOLLOW = 0x0000000000400000;
   75 enum ulong MNT_GJOURNAL = 0x0000000002000000;
   76 enum ulong MNT_MULTILABEL = 0x0000000004000000;
   77 enum ulong MNT_ACLS = 0x0000000008000000;
   78 enum ulong MNT_NOATIME = 0x0000000010000000;
   79 enum ulong MNT_NOCLUSTERR = 0x0000000040000000;
   80 enum ulong MNT_NOCLUSTERW = 0x0000000080000000;
   81 enum ulong MNT_SUJ = 0x0000000100000000;
   82 enum ulong MNT_AUTOMOUNTED = 0x0000000200000000;
   83 
   84 enum ulong MNT_EXRDONLY = 0x0000000000000080;
   85 enum ulong MNT_EXPORTED = 0x0000000000000100;
   86 enum ulong MNT_DEFEXPORTED = 0x0000000000000200;
   87 enum ulong MNT_EXPORTANON = 0x0000000000000400;
   88 enum ulong MNT_EXKERB = 0x0000000000000800;
   89 enum ulong MNT_EXPUBLIC = 0x0000000020000000;
   90 
   91 enum ulong MNT_LOCAL  = 0x0000000000001000;
   92 enum ulong MNT_QUOTA  = 0x0000000000002000;
   93 enum ulong MNT_ROOTFS = 0x0000000000004000;
   94 enum ulong MNT_USER   = 0x0000000000008000;
   95 enum ulong MNT_IGNORE = 0x0000000000800000;
   96 
   97 enum MNT_VISFLAGMASK = MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC |
   98                        MNT_NOSUID | MNT_UNION | MNT_SUJ |
   99                        MNT_ASYNC | MNT_EXRDONLY  | MNT_EXPORTED |
  100                        MNT_DEFEXPORTED | MNT_EXPORTANON| MNT_EXKERB |
  101                        MNT_LOCAL | MNT_USER  | MNT_QUOTA |
  102                        MNT_ROOTFS | MNT_NOATIME   | MNT_NOCLUSTERR |
  103                        MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP |
  104                        MNT_IGNORE | MNT_EXPUBLIC  | MNT_NOSYMFOLLOW |
  105                        MNT_GJOURNAL | MNT_MULTILABEL | MNT_ACLS |
  106                        MNT_NFS4ACLS | MNT_AUTOMOUNTED;
  107 
  108 enum MNT_UPDATEMASK = MNT_NOSUID | MNT_NOEXEC |
  109                       MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC |
  110                       MNT_NOATIME |
  111                       MNT_NOSYMFOLLOW | MNT_IGNORE |
  112                       MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR |
  113                       MNT_ACLS | MNT_USER | MNT_NFS4ACLS  |
  114                       MNT_AUTOMOUNTED;
  115 
  116 enum ulong MNT_UPDATE = 0x0000000000010000;
  117 enum ulong MNT_DELEXPORT = 0x0000000000020000;
  118 enum ulong MNT_RELOAD = 0x0000000000040000;
  119 enum ulong MNT_FORCE = 0x0000000000080000;
  120 enum ulong MNT_SNAPSHOT = 0x0000000001000000;
  121 enum ulong MNT_NONBUSY = 0x0000000004000000;
  122 enum ulong MNT_BYFSID = 0x0000000008000000;
  123 enum ulong MNT_CMDFLAGS = MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD |
  124                           MNT_FORCE  | MNT_SNAPSHOT  | MNT_NONBUSY |
  125                           MNT_BYFSID;
  126 
  127 enum uint MNTK_UNMOUNTF = 0x00000001;
  128 enum uint MNTK_ASYNC = 0x00000002;
  129 enum uint MNTK_SOFTDEP = 0x00000004;
  130 enum uint MNTK_NOINSMNTQ = 0x00000008;
  131 enum uint MNTK_DRAINING = 0x00000010;
  132 enum uint MNTK_REFEXPIRE = 0x00000020;
  133 enum uint MNTK_EXTENDED_SHARED = 0x00000040;
  134 enum uint MNTK_SHARED_WRITES = 0x00000080;
  135 enum uint MNTK_NO_IOPF = 0x00000100;
  136 enum uint MNTK_VGONE_UPPER = 0x00000200;
  137 enum uint MNTK_VGONE_WAITER = 0x00000400;
  138 enum uint MNTK_LOOKUP_EXCL_DOTDOT = 0x00000800;
  139 enum uint MNTK_MARKER = 0x00001000;
  140 enum uint MNTK_UNMAPPED_BUFS = 0x00002000;
  141 enum uint MNTK_USES_BCACHE = 0x00004000;
  142 enum uint MNTK_NOASYNC = 0x00800000;
  143 enum uint MNTK_UNMOUNT = 0x01000000;
  144 enum uint MNTK_MWAIT = 0x02000000;
  145 enum uint MNTK_SUSPEND = 0x08000000;
  146 enum uint MNTK_SUSPEND2 = 0x04000000;
  147 enum uint MNTK_SUSPENDED = 0x10000000;
  148 enum uint MNTK_NULL_NOCACHE = 0x20000000;
  149 enum uint MNTK_LOOKUP_SHARED = 0x40000000;
  150 enum uint MNTK_NOKNOTE = 0x80000000;
  151 
  152 enum VFS_VFSCONF = 0;
  153 enum VFS_GENERIC = 0;
  154 
  155 enum VFS_MAXTYPENUM = 1;
  156 enum VFS_CONF       = 2;
  157 
  158 enum MNT_WAIT    = 1;
  159 enum MNT_NOWAIT  = 2;
  160 enum MNT_LAZY    = 3;
  161 enum MNT_SUSPEND = 4;
  162 
  163 struct fhandle_t
  164 {
  165     fsid_t fh_fsid;
  166     fid fh_fid;
  167 }
  168 
  169 // TODO - requires declarations from elsewhere that we don't currently have bindings for.
  170 /+
  171 struct oexport_args
  172 {
  173     int ex_flags;
  174     uid_t ex_root;
  175     xucred ex_anon;
  176     sockaddr* ex_addr;
  177     ubyte ex_addrlen;
  178     sockaddr* ex_mask;
  179     ubyte ex_masklen;
  180     char* ex_indexfile;
  181 }
  182 
  183 enum MAXSECFLAVORS = 5;
  184 
  185 struct export_args
  186 {
  187     int ex_flags;
  188     uid_t ex_root;
  189     xucred ex_anon;
  190     sockaddr* ex_addr;
  191     ubyte ex_addrlen;
  192     sockaddr* ex_mask;
  193     ubyte ex_masklen;
  194     char* ex_indexfile;
  195     int ex_numsecflavors;
  196     int[MAXSECFLAVORS] ex_secflavors;
  197 }
  198 
  199 struct nfs_public
  200 {
  201     int np_valid;
  202     fhandle_t np_handle;
  203     mount_t* np_mount;
  204     char* np_index;
  205 }
  206 
  207 struct vfsconf
  208 {
  209     uint vfc_version;
  210     char[MFSNAMELEN] vfc_name = 0;
  211     vfsops* vfc_vfsops;
  212     int vfc_typenum;
  213     int vfc_refcount;
  214     int vfc_flags;
  215     vfsoptdecl* vfc_opts;
  216     TAILQ_ENTRY(vfsconf) vfc_list;
  217 }
  218 
  219 struct xvfsconf
  220 {
  221     vfsops* vfc_vfsops;
  222     char[MFSNAMELEN] vfc_name = 0;
  223     int vfc_typenum;
  224     int vfc_refcount;
  225     int vfc_flags;
  226     vfsconf* vfc_next;
  227 }
  228 +/
  229 
  230 struct ovfsconf
  231 {
  232     void* vfc_vfsops;
  233     char[32] vfc_name = 0;
  234     int vfc_index;
  235     int vfc_refcount;
  236     int vfc_flags;
  237 }
  238 
  239 enum uint VFCF_STATIC = 0x00010000;
  240 enum uint VFCF_NETWORK = 0x00020000;
  241 enum uint VFCF_READONLY = 0x00040000;
  242 enum uint VFCF_SYNTHETIC = 0x00080000;
  243 enum uint VFCF_LOOPBACK = 0x00100000;
  244 enum uint VFCF_UNICODE = 0x00200000;
  245 enum uint VFCF_JAIL = 0x00400000;
  246 enum uint VFCF_DELEGADMIN = 0x00800000;
  247 enum uint VFCF_SBDRY = 0x01000000;
  248 
  249 alias fsctlop_t = uint;
  250 
  251 struct vfsidctl
  252 {
  253     int vc_vers;
  254     fsid_t vc_fsid;
  255     char[MFSNAMELEN] vc_fstypename = 0;
  256     fsctlop_t vc_op;
  257     void* vc_ptr;
  258     size_t vc_len;
  259     uint[12] vc_spare;
  260 }
  261 
  262 enum uint VFS_CTL_VERS1 = 0x01;
  263 
  264 enum uint VFS_CTL_QUERY   = 0x00010001;
  265 enum uint VFS_CTL_TIMEO   = 0x00010002;
  266 enum uint VFS_CTL_NOLOCKS = 0x00010003;
  267 
  268 struct vfsquery
  269 {
  270     uint vq_flags;
  271     uint[31] vq_spare;
  272 }
  273 
  274 enum uint VQ_NOTRESP  = 0x0001;
  275 enum uint VQ_NEEDAUTH = 0x0002;
  276 enum uint VQ_LOWDISK  = 0x0004;
  277 enum uint VQ_MOUNT    = 0x0008;
  278 enum uint VQ_UNMOUNT  = 0x0010;
  279 enum uint VQ_DEAD     = 0x0020;
  280 enum uint VQ_ASSIST   = 0x0040;
  281 enum uint VQ_NOTRESPLOCK = 0x0080;
  282 enum uint VQ_FLAG0100 = 0x0100;
  283 enum uint VQ_FLAG0200 = 0x0200;
  284 enum uint VQ_FLAG0400 = 0x0400;
  285 enum uint VQ_FLAG0800 = 0x0800;
  286 enum uint VQ_FLAG1000 = 0x1000;
  287 enum uint VQ_FLAG2000 = 0x2000;
  288 enum uint VQ_FLAG4000 = 0x4000;
  289 enum uint VQ_FLAG8000 = 0x8000;
  290 
  291 pragma(mangle, "fhopen@@FBSD_1.0")    int fhopen(const fhandle_t*, int);
  292 pragma(mangle, "fhstat@FBSD_1.0")     int fhstat(const fhandle_t*, stat_t*);
  293 pragma(mangle, "fhstatfs@FBSD_1.0")   int fhstatfs(const fhandle_t*, statfs_t*);
  294 pragma(mangle, "fstatfs@FBSD_1.0")    int fstatfs(int, statfs_t*);
  295 pragma(mangle, "getfh@@FBSD_1.0")     int getfh(const char*, fhandle_t*);
  296 pragma(mangle, "getfsstat@FBSD_1.0")  int getfsstat(statfs_t*, c_long, int);
  297 pragma(mangle, "getmntinfo@FBSD_1.0") int getmntinfo(statfs_t**, int);
  298 pragma(mangle, "lgetfh@@FBSD_1.0")    int lgetfh(const char*, fhandle_t*);
  299 pragma(mangle, "mount@@FBSD_1.0")     int mount(const char*, const char*, int, void*);
  300 //int nmount(iovec*, uint, int);
  301 pragma(mangle, "statfs@FBSD_1.0")     int statfs(const char*, statfs_t*);
  302 pragma(mangle, "unmount@@FBSD_1.0")   int unmount(const char*, int);
  303 
  304 //int getvfsbyname(const char*, xvfsconf*);