* mount.cc (NT_MAX_PATH): Define.

(longopts): Rename mount-commands option to mount-entries.
	(opts): Remove removed options.
	(struct opt): Move up in file to allow using it in usage.
	(usage): Change text for --mount-entries option.  Remove
	-X option.  Add valid options output.
	(main): Remove handling -b option.
	(convert_spaces): New static function to convert spaces to "\040"
	string.
	(mount_entries): Renamed from mount_commands.  Rewrite to emit
	/etc/fstab compatible output.
	(show_cygdrive_info): Print "nouser" rather than "system".
	* umount.cc (longopts): Remove remove-all-mounts,
	remove-cygdrive-prefix, remove-system-mounts, system and user options.
	(opts): Remove A, c, s, S, u options.
	(usage): Remove text for all removed options.
	(main): Remove handling for all removed options.
	(remove_all_mounts): Remove.
	(remove_all_system_mounts): Remove.
	(remove_cygdrive_prefix): Remove.
	* utils.sgml: Fix mount and umount documentation.  Move description
	of (cyg,not)exec options to mount table section.
This commit is contained in:
Corinna Vinschen 2008-08-13 16:35:04 +00:00
parent 04a6c4efd7
commit 56d8179570
4 changed files with 166 additions and 278 deletions

View File

@ -1,3 +1,28 @@
2008-08-13 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (NT_MAX_PATH): Define.
(longopts): Rename mount-commands option to mount-entries.
(opts): Remove removed options.
(struct opt): Move up in file to allow using it in usage.
(usage): Change text for --mount-entries option. Remove
-X option. Add valid options output.
(main): Remove handling -b option.
(convert_spaces): New static function to convert spaces to "\040"
string.
(mount_entries): Renamed from mount_commands. Rewrite to emit
/etc/fstab compatible output.
(show_cygdrive_info): Print "nouser" rather than "system".
* umount.cc (longopts): Remove remove-all-mounts,
remove-cygdrive-prefix, remove-system-mounts, system and user options.
(opts): Remove A, c, s, S, u options.
(usage): Remove text for all removed options.
(main): Remove handling for all removed options.
(remove_all_mounts): Remove.
(remove_all_system_mounts): Remove.
(remove_cygdrive_prefix): Remove.
* utils.sgml: Fix mount and umount documentation. Move description
of (cyg,not)exec options to mount table section.
2008-08-04 Christopher Faylor <me+cygwin@cgf.cx> 2008-08-04 Christopher Faylor <me+cygwin@cgf.cx>
* cygcheck.cc (load_cygwin): Duplicate argv list since it disappears * cygcheck.cc (load_cygwin): Duplicate argv list since it disappears

View File

@ -24,9 +24,11 @@ details. */
#endif #endif
#include <errno.h> #include <errno.h>
#define NT_MAX_PATH 32768
#define EXEC_FLAGS (MOUNT_EXEC | MOUNT_NOTEXEC | MOUNT_CYGWIN_EXEC) #define EXEC_FLAGS (MOUNT_EXEC | MOUNT_NOTEXEC | MOUNT_CYGWIN_EXEC)
static void mount_commands (void); static void mount_entries (void);
static void show_mounts (void); static void show_mounts (void);
static void show_cygdrive_info (void); static void show_cygdrive_info (void);
static void change_cygdrive_prefix (const char *new_prefix, int flags); static void change_cygdrive_prefix (const char *new_prefix, int flags);
@ -114,14 +116,33 @@ static struct option longopts[] =
{"change-cygdrive-prefix", no_argument, NULL, 'c'}, {"change-cygdrive-prefix", no_argument, NULL, 'c'},
{"force", no_argument, NULL, 'f'}, {"force", no_argument, NULL, 'f'},
{"help", no_argument, NULL, 'h' }, {"help", no_argument, NULL, 'h' },
{"mount-commands", no_argument, NULL, 'm'}, {"mount-entries", no_argument, NULL, 'm'},
{"options", required_argument, NULL, 'o'}, {"options", required_argument, NULL, 'o'},
{"show-cygdrive-prefix", no_argument, NULL, 'p'}, {"show-cygdrive-prefix", no_argument, NULL, 'p'},
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
static char opts[] = "bcfhmpstuvxEXo:"; static char opts[] = "cfhmpvo:";
struct opt
{
const char *name;
unsigned val;
bool clear;
} oopts[] =
{
{"binary", MOUNT_BINARY, false},
{"text", MOUNT_BINARY, true},
{"exec", MOUNT_EXEC, false},
{"notexec", MOUNT_NOTEXEC, false},
{"cygexec", MOUNT_CYGWIN_EXEC, false},
{"nosuid", 0, 0},
{"acl", MOUNT_NOACL, true},
{"noacl", MOUNT_NOACL, false},
{"posix=1", MOUNT_NOPOSIX, true},
{"posix=0", MOUNT_NOPOSIX, false},
};
static void static void
usage (FILE *where = stderr) usage (FILE *where = stderr)
@ -133,34 +154,19 @@ Display information about mounted filesystems, or mount a filesystem\n\
-f, --force force mount, don't warn about missing mount\n\ -f, --force force mount, don't warn about missing mount\n\
point directories\n\ point directories\n\
-h, --help output usage information and exit\n\ -h, --help output usage information and exit\n\
-m, --mount-commands write mount commands to replicate user and\n\ -m, --mount-entries write fstab entries to replicate mount points\n\
system mount points and cygdrive prefixes\n\ and cygdrive prefixes\n\
-o, --options X[,X...] specify mount options\n\ -o, --options X[,X...] specify mount options\n\
-p, --show-cygdrive-prefix show user and/or system cygdrive path prefix\n\ -p, --show-cygdrive-prefix show user and/or system cygdrive path prefix\n\
-v, --version output version information and exit\n\ -v, --version output version information and exit\n\
-X, --cygwin-executable treat all files under mount point as cygwin\n\ \n\
executables\n\ Valid options are:\n\n ", progname);
", progname); for (opt *o = oopts; o < (oopts + (sizeof (oopts) / sizeof (oopts[0]))); o++)
fprintf (where, "%s%s", o == oopts ? "" : ",", o->name);
fputs ("\n\n", where);
exit (where == stderr ? 1 : 0); exit (where == stderr ? 1 : 0);
} }
struct opt
{
const char *name;
unsigned val;
bool clear;
} oopts[] =
{
{"user", MOUNT_SYSTEM, true},
{"system", MOUNT_SYSTEM, false},
{"binary", MOUNT_BINARY, false},
{"text", MOUNT_BINARY, true},
{"exec", MOUNT_EXEC, false},
{"notexec", MOUNT_NOTEXEC, false},
{"cygexec", MOUNT_CYGWIN_EXEC, false},
{"nosuid", 0, 0}
};
static void static void
print_version () print_version ()
{ {
@ -223,9 +229,6 @@ main (int argc, char **argv)
while ((i = getopt_long (argc, argv, opts, longopts, NULL)) != EOF) while ((i = getopt_long (argc, argv, opts, longopts, NULL)) != EOF)
switch (i) switch (i)
{ {
case 'b':
flags |= MOUNT_BINARY;
break;
case 'c': case 'c':
if (do_what == nada) if (do_what == nada)
do_what = saw_change_cygdrive_prefix; do_what = saw_change_cygdrive_prefix;
@ -312,7 +315,7 @@ main (int argc, char **argv)
case saw_mount_commands: case saw_mount_commands:
if (optind <= argc) if (optind <= argc)
usage (); usage ();
mount_commands (); mount_entries ();
break; break;
default: default:
if (optind != (argc - 1)) if (optind != (argc - 1))
@ -336,65 +339,62 @@ main (int argc, char **argv)
return 0; return 0;
} }
static char *
convert_spaces (char *tgt, const char *src)
{
char *tp, *spacep;
const char *sp;
tp = tgt;
for (sp = src; (spacep = strchr (sp, ' ')); sp = spacep + 1)
{
tp = stpncpy (tp, sp, spacep - sp);
tp = stpcpy (tp, "\\040");
}
stpcpy (tp, sp);
return tgt;
}
static void static void
mount_commands (void) mount_entries (void)
{ {
FILE *m = setmntent ("/-not-used-", "r"); FILE *m = setmntent ("/-not-used-", "r");
struct mntent *p; struct mntent *p;
char *c; const char *format_mnt = "%s %s %s %s 0 0\n";
const char *format_mnt = "mount%s \"%s\" \"%s\"\n"; const char *format_cyg = "none %s cygdrive %s 0 0\n";
const char *format_cyg = "mount%s --change-cygdrive-prefix \"%s\"\n";
char opts[MAX_PATH];
char user[MAX_PATH];
char system[MAX_PATH];
char user_flags[MAX_PATH];
char system_flags[MAX_PATH];
// write mount commands for user and system mount points // write fstab entries for normal mount points
while ((p = getmntent (m)) != NULL) while ((p = getmntent (m)) != NULL)
// Only list non-cygdrives // Only list non-cygdrives
if (!strstr (p->mnt_opts, ",noumount")) if (!strstr (p->mnt_opts, ",noumount"))
{ {
strcpy(opts, " -f"); char fsname[NT_MAX_PATH], dirname[NT_MAX_PATH];
if (p->mnt_opts[0] == 'b') printf (format_mnt, convert_spaces (fsname, p->mnt_fsname),
strcat (opts, " -b"); convert_spaces (dirname, p->mnt_dir),
else if (p->mnt_opts[0] == 't') p->mnt_type, p->mnt_opts);
strcat (opts, " -t");
if (strstr (p->mnt_opts, ",exec"))
strcat (opts, " -x");
if (strstr (p->mnt_opts, ",noexec"))
strcat (opts, " -E");
if (strstr (p->mnt_opts, ",cygexec"))
strcat (opts, " -X");
while ((c = strchr (p->mnt_fsname, '\\')) != NULL)
*c = '/';
printf (format_mnt, opts, p->mnt_fsname, p->mnt_dir);
} }
endmntent (m); endmntent (m);
// write mount commands for cygdrive prefixes // write fstab entry for cygdrive prefix
cygwin_internal (CW_GET_CYGDRIVE_INFO, user, system, user_flags, m = setmntent ("/-not-used-", "r");
system_flags); while ((p = getmntent (m)) != NULL)
if (strlen (user) > 0)
{ {
strcpy (opts, " -u"); char *noumount;
if (user_flags[0] == 'b') if ((noumount = strstr (p->mnt_opts, ",noumount")))
strcat (opts, " -b"); {
else if (user_flags[0] == 't') char dirname[NT_MAX_PATH];
strcat (opts, " -t"); char opts[strlen (p->mnt_opts) + 1];
printf (format_cyg, opts, user);
}
if (strlen (system) > 0) convert_spaces (dirname, p->mnt_dir);
{ char *ls = strrchr (dirname, '/');
strcpy (opts, " -s"); if (ls && ls > dirname)
if (system_flags[0] == 'b') *ls = '\0';
strcat (opts, " -b"); *stpncpy (opts, p->mnt_opts, noumount - p->mnt_opts) = '\0';
else if (system_flags[0] == 't') printf (format_cyg, dirname, opts);
strcat (opts, " -t"); break;
printf (format_cyg, opts, system); }
} }
endmntent (m);
exit(0); exit(0);
} }
@ -493,7 +493,7 @@ show_cygdrive_info ()
if (strlen (user) > 0) if (strlen (user) > 0)
printf (format, user, "user", user_flags); printf (format, user, "user", user_flags);
if (strlen (system) > 0) if (strlen (system) > 0)
printf (format, system, "system", system_flags); printf (format, system, "nouser", system_flags);
exit (0); exit (0);
} }

View File

@ -1,6 +1,6 @@
/* umount.cc /* umount.cc
Copyright 1996, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2008 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -16,10 +16,7 @@ details. */
#include <errno.h> #include <errno.h>
#include <getopt.h> #include <getopt.h>
static void remove_all_mounts ();
static void remove_all_user_mounts (); static void remove_all_user_mounts ();
static void remove_all_system_mounts ();
static void remove_cygdrive_prefix (int flags);
static const char version[] = "$Revision$"; static const char version[] = "$Revision$";
static const char *progname; static const char *progname;
@ -27,17 +24,12 @@ static const char *progname;
struct option longopts[] = struct option longopts[] =
{ {
{"help", no_argument, NULL, 'h' }, {"help", no_argument, NULL, 'h' },
{"remove-all-mounts", no_argument, NULL, 'A'},
{"remove-cygdrive-prefix", no_argument, NULL, 'c'},
{"remove-system-mounts", no_argument, NULL, 'S'},
{"remove-user-mounts", no_argument, NULL, 'U'}, {"remove-user-mounts", no_argument, NULL, 'U'},
{"system", no_argument, NULL, 's'},
{"user", no_argument, NULL, 'u'},
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
char opts[] = "AchsSuUv"; char opts[] = "hUv";
static void static void
usage (FILE *where = stderr) usage (FILE *where = stderr)
@ -46,12 +38,7 @@ usage (FILE *where = stderr)
Usage: %s [OPTION] [<posixpath>]\n\ Usage: %s [OPTION] [<posixpath>]\n\
Unmount filesystems\n\ Unmount filesystems\n\
\n\ \n\
-A, --remove-all-mounts remove all mounts\n\
-c, --remove-cygdrive-prefix remove cygdrive prefix\n\
-h, --help output usage information and exit\n\ -h, --help output usage information and exit\n\
-s, --system remove system mount (default)\n\
-S, --remove-system-mounts remove all system mounts\n\
-u, --user remove user mount\n\
-U, --remove-user-mounts remove all user mounts\n\ -U, --remove-user-mounts remove all user mounts\n\
-v, --version output version information and exit\n\ -v, --version output version information and exit\n\
", progname); ", progname);
@ -97,9 +84,6 @@ main (int argc, char **argv)
enum do_what enum do_what
{ {
nada, nada,
saw_remove_all_mounts,
saw_remove_cygdrive_prefix,
saw_remove_all_system_mounts,
saw_remove_all_user_mounts saw_remove_all_user_mounts
} do_what = nada; } do_what = nada;
@ -117,30 +101,8 @@ main (int argc, char **argv)
while ((i = getopt_long (argc, argv, opts, longopts, NULL)) != EOF) while ((i = getopt_long (argc, argv, opts, longopts, NULL)) != EOF)
switch (i) switch (i)
{ {
case 'A':
if (do_what != nada)
usage ();
do_what = saw_remove_all_mounts;
break;
case 'c':
if (do_what != nada)
usage ();
do_what = saw_remove_cygdrive_prefix;
break;
case 'h': case 'h':
usage (stdout); usage (stdout);
case 's':
flags |= MOUNT_SYSTEM;
break;
case 'S':
if (do_what != nada)
usage ();
do_what = saw_remove_all_system_mounts;
break;
case 'u':
flags &= ~MOUNT_SYSTEM;
default_flag = 0;
break;
case 'U': case 'U':
if (do_what != nada) if (do_what != nada)
usage (); usage ();
@ -155,21 +117,6 @@ main (int argc, char **argv)
switch (do_what) switch (do_what)
{ {
case saw_remove_all_mounts:
if (optind != argc)
usage ();
remove_all_mounts ();
break;
case saw_remove_cygdrive_prefix:
if (optind != argc)
usage ();
remove_cygdrive_prefix (flags | default_flag);
break;
case saw_remove_all_system_mounts:
if (optind != argc)
usage ();
remove_all_system_mounts ();
break;
case saw_remove_all_user_mounts: case saw_remove_all_user_mounts:
if (optind != argc) if (optind != argc)
usage (); usage ();
@ -185,14 +132,6 @@ main (int argc, char **argv)
return 0; return 0;
} }
/* remove_all_mounts: Unmount all mounts. */
static void
remove_all_mounts ()
{
remove_all_user_mounts ();
remove_all_system_mounts ();
}
/* remove_all_user_mounts: Unmount all user mounts. */ /* remove_all_user_mounts: Unmount all user mounts. */
static void static void
remove_all_user_mounts () remove_all_user_mounts ()
@ -217,38 +156,3 @@ remove_all_user_mounts ()
endmntent (m); endmntent (m);
} }
/* remove_all_system_mounts: Unmount all system mounts. */
static void
remove_all_system_mounts ()
{
FILE *m = setmntent ("/-not-used-", "r");
struct mntent *p;
while ((p = getmntent (m)) != NULL)
{
/* Remove the mount if it's a system mount. */
if (strncmp (p->mnt_type, "system", 6) == 0 &&
strstr (p->mnt_opts, "noumount") == NULL)
{
if (cygwin_umount (p->mnt_dir, MOUNT_SYSTEM))
error (p->mnt_dir);
/* We've modified the table so we need to start over. */
endmntent (m);
m = setmntent ("/-not-used-", "r");
}
}
endmntent (m);
}
/* remove_cygdrive_prefix: Remove cygdrive user or system path prefix. */
static void
remove_cygdrive_prefix (int flags)
{
int res = cygwin_umount (NULL, flags | MOUNT_CYGDRIVE);
if (res)
error ("remove_cygdrive_prefix");
exit (0);
}

View File

@ -702,33 +702,26 @@ up as file owners in <command>ls -l</command> output.
Usage: mount [OPTION] [&lt;win32path&gt; &lt;posixpath&gt;] Usage: mount [OPTION] [&lt;win32path&gt; &lt;posixpath&gt;]
Display information about mounted filesystems, or mount a filesystem Display information about mounted filesystems, or mount a filesystem
-b, --binary (default) text files are equivalent to binary files
(newline = \n)
-c, --change-cygdrive-prefix change the cygdrive path prefix to &lt;posixpath&gt; -c, --change-cygdrive-prefix change the cygdrive path prefix to &lt;posixpath&gt;
-f, --force force mount, don't warn about missing mount -f, --force force mount, don't warn about missing mount
point directories point directories
-h, --help output usage information and exit -h, --help output usage information and exit
-m, --mount-commands write mount commands to replicate user and -m, --mount-entries write fstab entries to replicate mount points
system mount points and cygdrive prefixes and cygdrive prefixes
-o, --options X[,X...] specify mount options -o, --options X[,X...] specify mount options
-p, --show-cygdrive-prefix show user and/or system cygdrive path prefix -p, --show-cygdrive-prefix show user and/or system cygdrive path prefix
-s, --system (default) add system-wide mount point
-t, --text text files get \r\n line endings
-u, --user add user-only mount point
-v, --version output version information and exit -v, --version output version information and exit
-x, --executable treat all files under mount point as executables
-E, --no-executable treat all files under mount point as
non-executables
-X, --cygwin-executable treat all files under mount point as cygwin
executables
</screen> </screen>
<para>The <command>mount</command> program is used to map your drives <para>The <command>mount</command> program is used to map your drives
and shares onto Cygwin's simulated POSIX directory tree, much like as is and shares onto Cygwin's simulated POSIX directory tree, much like as is
done by mount commands on typical UNIX systems. Please see done by mount commands on typical UNIX systems. However, in contrast to
<xref linkend="mount-table"></xref> for more information on the concepts mount points given in <filename>/etc/fstab</filename>, mount points
behind the Cygwin POSIX file system and strategies for using created or changed with <command>mount</command> are not persistent. They
mounts. To remove mounts, use <command>umount</command></para> disappear immediately after the last process of the current user exited.
Please see <xref linkend="mount-table"></xref> for more information on the
concepts behind the Cygwin POSIX file system and strategies for using
mounts. To remove mounts temporarily, use <command>umount</command></para>
<sect3 id="utils-mount"><title>Using mount</title> <sect3 id="utils-mount"><title>Using mount</title>
@ -739,11 +732,11 @@ will display the current mount table for you.</para>
<title>Displaying the current set of mount points</title> <title>Displaying the current set of mount points</title>
<screen> <screen>
<prompt>c:\cygwin\&gt;</prompt> <userinput>mount</userinput> <prompt>c:\cygwin\&gt;</prompt> <userinput>mount</userinput>
c:\cygwin\bin on /usr/bin type system (binmode) c:\cygwin\bin on /usr/bin type ntfs (binary)
c:\cygwin\lib on /usr/lib type system (binmode) c:\cygwin\lib on /usr/lib type ntfs (binary)
c:\cygwin on / type system (binmode) c:\cygwin on / type ntfs (binary)
c: on /c type user (binmode,noumount) c: on /c type ntfs (binary,user,noumount)
d: on /d type user (binmode,noumount) d: on /d type fat (binary,user,noumount)
</screen> </screen>
</example> </example>
@ -756,7 +749,8 @@ to the current user.</para>
<para>The <command>mount</command> utility is also the mechanism for <para>The <command>mount</command> utility is also the mechanism for
adding new mounts to the mount table. The following example adding new mounts to the mount table. The following example
demonstrates how to mount the directory demonstrates how to mount the directory
<filename>\\pollux\home\joe\data</filename> to <filename>/data</filename>. <filename>\\pollux\home\joe\data</filename> to <filename>/data</filename>
for the duration of the current session.
</para> </para>
<example id="utils-mount-add-ex"> <example id="utils-mount-add-ex">
@ -764,65 +758,25 @@ demonstrates how to mount the directory
<screen> <screen>
<prompt>c:\cygwin\&gt;</prompt> <userinput>ls /data</userinput> <prompt>c:\cygwin\&gt;</prompt> <userinput>ls /data</userinput>
ls: /data: No such file or directory ls: /data: No such file or directory
<prompt>c:\cygwin\&gt;</prompt> <userinput>mount \\pollux\home\joe\data /data</userinput> <prompt>c:\cygwin\&gt;</prompt> <userinput>mount //pollux/home/joe/data /data</userinput>
mount: warning - /data does not exist! mount: warning - /data does not exist!
<prompt>c:\cygwin\&gt;</prompt> <userinput>mount</userinput> <prompt>c:\cygwin\&gt;</prompt> <userinput>mount</userinput>
\\pollux\home\joe\data on /data type sytem (binmode) \\pollux\home\joe\data on /data type smbfs (binary)
c:\cygwin\bin on /usr/bin type system (binmode) c:\cygwin\bin on /usr/bin type ntfs (binary)
c:\cygwin\lib on /usr/lib type system (binmode) c:\cygwin\lib on /usr/lib type ntfs (binary)
c:\cygwin on / type system (binmode) c:\cygwin on / type ntfs (binary)
c: on /c type user (binmode,noumount) c: on /c type ntfs (binary,user,noumount)
d: on /d type user (binmode,noumount) d: on /d type fat (binary,user,noumount)
</screen> </screen>
</example> </example>
<para>Note that <command>mount</command> was invoked from the Windows <para>A given POSIX path may only exist once in the mount table. Attempts to
command shell in the previous example. In many Unix shells, including replace the mount will fail with a busy error. The <literal>-f</literal>
bash, it is legal and convenient to use the forward "/" in Win32 (force) option causes the old mount to be silently replaced with the new one,
pathnames since the "\" is the shell's escape character. </para> provided the old mount point was a user mount point. It's not valid to
replace system-wide mount points. Additionally, the <literal>-f</literal>
<para>The <literal>-s</literal> flag to <command>mount</command> is used to add a mount option will silence warnings about the non-existence of directories at the
in the system-wide mount table used by all Cygwin users on the system, Win32 path location.</para>
instead of the user-specific one. System-wide mounts are displayed
by <command>mount</command> as being of the "system" type, as is the
case for the <filename>/</filename> partition in the last example.
Under Windows NT, only those users with Administrator priviledges are
permitted to modify the system-wide mount table.</para>
<para>Note that a given POSIX path may only exist once in the user
table and once in the global, system-wide table. Attempts to replace
the mount will fail with a busy error. The <literal>-f</literal> (force) flag causes
the old mount to be silently replaced with the new one. It will also
silence warnings about the non-existence of directories at the Win32
path location.</para>
<para>The <literal>-b</literal> flag is used to instruct Cygwin to treat binary and
text files in the same manner by default. Binary mode mounts are
marked as "binmode" in the Flags column of <command>mount</command>
output. By default, mounts are in text mode ("textmode" in the Flags
column).</para>
<para>Normally, files ending in certain extensions (.exe, .com, .bat, .cmd)
are assumed to be executable. Files whose first two characters begin with
'#!' are also considered to be executable.
The <literal>-x</literal> flag is used to instruct Cygwin that the
mounted file is "executable". If the <literal>-x</literal> flag is used
with a directory then all files in the directory are executable.
This option allows other files to be marked as executable and avoids the
overhead of opening each file to check for a '#!'. The <literal>-X</literal>
option is very similar to <literal>-x</literal>, but also prevents Cygwin
from setting up commands and environment variables for a normal Windows
program, adding another small performance gain. The opposite of these
flags is the <literal>-E</literal> flag, which means that no files should be
marked as executable. </para>
<para>
The <literal>-m</literal> option causes the <command>mount</command> utility
to output a series of commands that could recreate both user and system mount
points. You can save this output as a backup when experimenting with the
mount table. It also makes moving your settings to a different machine
much easier.
</para>
<para> <para>
The <literal>-o</literal> option is the method via which various options about The <literal>-o</literal> option is the method via which various options about
@ -830,17 +784,35 @@ the mount point may be recorded. The following options are available (note that
most of the options are duplicates of other mount flags):</para> most of the options are duplicates of other mount flags):</para>
<screen> <screen>
user - mount lives user-specific mount acl - Use the filesystem's access control lists (ACLs) to
system - mount lives in system table (default) implement real POSIX permissions (default).
binary - files default to binary mode (default) noacl - Ignore ACLs and fake POSIX permissions.
text - files default to CRLF text mode line endings binary - Files default to binary mode (default).
exec - files below mount point are all executable text - Files default to CRLF text mode line endings.
notexec - files below mount point are not executable exec - Treat all files below mount point as executable.
cygexec - files below mount point are all cygwin executables notexec - Treat all files below mount point as not executable.
nosuid - no suid files are allowed (currently unimplemented) cygexec - Treat all files below mount point as cygwin executables.
managed - directory is managed by cygwin. Mixed case and special nosuid - No suid files are allowed (currently unimplemented)
characters in filenames are allowed. posix=0 - Switch off case sensitivity for paths under this mount point.
posix=1 - Switch on case sensitivity for paths under this mount point
(default).
</screen> </screen>
<para>For a more complete description of the mount options and the
<filename>/etc/fstab</filename> file, see
<xref linkend="mount-table"></xref>.</para>
<para>Note that all mount points added with <command>mount</command> are
user mount points. System mount points can only be specified in
the <filename>/etc/fstab</filename> file.</para>
<para>
The <literal>-m</literal> option causes the <command>mount</command> utility
to output the current mount table in a series of fstab entries. This allows
You can save this output as a backup when experimenting with the mount table.
Copy the output to <filename>/etc/fstab</filename> to restore the old state.
It also makes moving your settings to a different machine much easier.</para>
</sect3> </sect3>
<sect3 id="utils-cygdrive"><title>Cygdrive mount points</title> <sect3 id="utils-cygdrive"><title>Cygdrive mount points</title>
@ -1645,32 +1617,19 @@ This program is mainly useful for debugging the Cygwin DLL itself.</para>
Usage: umount.exe [OPTION] [&lt;posixpath&gt;] Usage: umount.exe [OPTION] [&lt;posixpath&gt;]
Unmount filesystems Unmount filesystems
-A, --remove-all-mounts remove all mounts
-c, --remove-cygdrive-prefix remove cygdrive prefix
-h, --help output usage information and exit -h, --help output usage information and exit
-s, --system remove system mount (default)
-S, --remove-system-mounts remove all system mounts
-u, --user remove user mount
-U, --remove-user-mounts remove all user mounts -U, --remove-user-mounts remove all user mounts
-v, --version output version information and exit -v, --version output version information and exit
</screen> </screen>
<para>The <command>umount</command> program removes mounts from the <para>The <command>umount</command> program removes mounts from the
mount table. If you specify a POSIX path that corresponds to a mount table in the current session. If you specify a POSIX path that
current mount point, <command>umount</command> will remove it from the corresponds to a current mount point, <command>umount</command> will
system registry area. (Administrator priviledges are required). remove it from the current mount table. Note that you can only remove
The <literal>-u</literal> flag may be used to specify removing the mount user mount points. The <literal>-U</literal> flag may be used to
from the user-specific registry area instead.</para> specify removing all user mount points from the current user session.</para>
<para>The <command>umount</command> utility may also be used to remove <para>See <xref linkend="mount-table"></xref> for more information on the mount
all mounts of a particular type. With the extended options it is
possible to remove all mounts (<literal>-A</literal>), all
cygdrive automatically-mounted mounts (<literal>-c</literal>), all
mounts in the current user's registry area (<literal>-U</literal>),
or all mounts in the system-wide registry area (<literal>-S</literal>)
(with Administrator privileges).</para>
<para>See <xref linkend="mount"></xref> for more information on the mount
table.</para> table.</para>
</sect2> </sect2>