/* $Id$ */
/** @file
* vbsfmount - Commonly used code to mount shared folders on Linux-based
* systems. Currently used by mount.vboxsf and VBoxService.
*/
/*
* Copyright (C) 2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "vbsfmount.h"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <ctype.h>
#include <mntent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/** @todo Use defines for return values! */
{
FILE *f, *m;
char *buf;
struct mntent e;
int rc = 0;
if (!m)
return 1; /* Could not update mount table (failed to create memstream). */
else
fclose(m);
if (size > 0)
else
buf = "defaults";
if (!f)
{
}
else
{
e.mnt_fsname = (char*)host_name;
e.mnt_dir = (char*)mount_point;
e.mnt_type = "vboxsf";
e.mnt_freq = 0;
e.mnt_passno = 0;
if (addmntent(f, &e))
endmntent(f);
}
if (size > 0)
{
}
return rc;
}