/* vi:set shiftwidth=2 cindent tabstop=2: */ /* * vxtools - Tools for accessing Veritas Journaled FileSystem (VxFS) * Copyright (c) 1999 Martin Hinner * * vxmount.c: Mount a VxFS filesystem * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id$ */ #include #include #include #include char *usage = "Usage: %s [-dh] [-p subpart] [special]\n" "\n" "Report bugs to \n"; int main (int argc, char **argv) { int ch; char *argv0 = argv[0]; int subpart; vxverboseon (); subpart = 0; while ((ch = getopt (argc, argv, "dhp:")) != -1) { switch (ch) { case 'd': vxdebugon (); break; case 'p': subpart = atoi (optarg); break; case 'h': fprintf (stderr, usage, argv0); exit (0); default: fprintf (stderr, usage, argv0); exit (1); } } argc -= optind; argv += optind; if (argc != 1) { fprintf (stderr, usage, argv0); exit (1); } if (vx_open (argv[0], subpart) < 0) { fprintf (stderr, "%s: Can't mount VxFS %s\n", argv0, argv[0]); exit (1); } vxsavecwd (argv[0], subpart, "/"); return 0; }