vboxvfs_mount.c revision 34d1c9a81582b1acc9831732458231fcd8ddf2a5
78a072e1b56619e3230735ae073668311232ec94vboxsync * VirtualBox File System Mount Helper, Solaris host.
78a072e1b56619e3230735ae073668311232ec94vboxsync * Userspace mount wrapper that parses mount (or user-specified) options
78a072e1b56619e3230735ae073668311232ec94vboxsync * and passes it to mount(2) syscall
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync * available from http://www.virtualbox.org. This file is free software;
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync * you can redistribute it and/or modify it under the terms of the GNU
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync * General Public License (GPL) as published by the Free Software
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
78a072e1b56619e3230735ae073668311232ec94vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
78a072e1b56619e3230735ae073668311232ec94vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
772269936494ffaddd0750ba9e28e805ba81398cvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
78a072e1b56619e3230735ae073668311232ec94vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
78a072e1b56619e3230735ae073668311232ec94vboxsync * additional information or have any questions.
78a072e1b56619e3230735ae073668311232ec94vboxsync/*******************************************************************************
78a072e1b56619e3230735ae073668311232ec94vboxsync* Header Files *
78a072e1b56619e3230735ae073668311232ec94vboxsync*******************************************************************************/
78a072e1b56619e3230735ae073668311232ec94vboxsync/*******************************************************************************
dc5cd2ea4ab36898ba3231203f52460a39189263vboxsync* Global Variables *
dc5cd2ea4ab36898ba3231203f52460a39189263vboxsync*******************************************************************************/
dc5cd2ea4ab36898ba3231203f52460a39189263vboxsyncstatic char g_achOptBuf[MAX_MNTOPT_STR] = { '\0', };
78a072e1b56619e3230735ae073668311232ec94vboxsyncstatic int g_cbOptBuf = 0;
78a072e1b56619e3230735ae073668311232ec94vboxsyncstatic const int g_RetOK = 0;
bbc0a3fc49446bf8fa1fcfe669c10875701692bcvboxsync fprintf(stderr, "Usage: %s [OPTIONS] NAME MOUNTPOINT\n"
bbc0a3fc49446bf8fa1fcfe669c10875701692bcvboxsync "Mount the VirtualBox shared folder NAME from the host system to MOUNTPOINT.\n"
78a072e1b56619e3230735ae073668311232ec94vboxsync " -w mount the shared folder writably (the default)\n"
78a072e1b56619e3230735ae073668311232ec94vboxsync " -r mount the shared folder read-only\n"
bbc0a3fc49446bf8fa1fcfe669c10875701692bcvboxsync " -o OPTION[,OPTION...] use the mount options specified\n"
78a072e1b56619e3230735ae073668311232ec94vboxsync " rw mount writably (the default)\n"
78a072e1b56619e3230735ae073668311232ec94vboxsync " ro mount read only\n"
772269936494ffaddd0750ba9e28e805ba81398cvboxsync " uid=UID set the default file owner user id to UID\n"
78a072e1b56619e3230735ae073668311232ec94vboxsync " gid=GID set the default file owner group id to GID\n"
int parseError = 0;
int mntFlags = 0;
int quietFlag = 0;
return g_RetMagic;
|| parseError)
if (!pszOptBufCpy)
return g_RetMagic;
rc = mount(pszSpecial, pszMount, mntFlags | MS_OPTIONSTR, DEVICE_NAME, NULL, 0, g_achOptBuf, MAX_MNTOPT_STR);
if (rc)
return g_RetErr;
return g_RetOK;