summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include/sys
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2015-12-01 15:02:14 +0100
committerCorinna Vinschen <corinna@vinschen.de>2015-12-07 17:37:44 +0100
commitfb71716d2c248de22ecd86dd8e3a1f4185eb8e87 (patch)
treee86a1fed507c62251bcfe17b7832c8d8fcde3dc1 /winsup/cygwin/include/sys
parent5644f71428ba571b733db255e31dc39aba13ad8a (diff)
downloadcygnal-fb71716d2c248de22ecd86dd8e3a1f4185eb8e87.tar.gz
cygnal-fb71716d2c248de22ecd86dd8e3a1f4185eb8e87.tar.bz2
cygnal-fb71716d2c248de22ecd86dd8e3a1f4185eb8e87.zip
Introduce the 'usertemp' filesystem type
* mount.cc (mount_info::from_fstab_line): Support mounting the current user's temp folder as /tmp/. This is particularly useful a feature when Cygwin's own files are write-protected. * pathnames.xml: document the new usertemp file system type Detailed explanation: In the context of Windows, there is a per-user directory for temporary files, by default specified via the environment variable %TEMP%. Let's allow to use that directory for our /tmp/ directory. With this patch, we introduce the special filesystem type "usertemp": By specifying none /tmp usertemp binary,posix=0 0 0 in /etc/fstab, the /tmp/ directory gets auto-mounted to the directory specified by the %TEMP% variable. This feature comes handy in particularly in scenarios where the administrator might want to write-protect the entire Cygwin directory yet still needs to allow users to write into the /tmp/ directory. This is the case in the context of Git for Windows, where the Cygwin (MSys2) root directory lives inside C:\Program Files and hence /tmp/ would not be writable otherwise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'winsup/cygwin/include/sys')
-rw-r--r--winsup/cygwin/include/sys/mount.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/include/sys/mount.h b/winsup/cygwin/include/sys/mount.h
index 458cf801f..ec927945b 100644
--- a/winsup/cygwin/include/sys/mount.h
+++ b/winsup/cygwin/include/sys/mount.h
@@ -44,7 +44,8 @@ enum
MOUNT_DOS = 0x40000, /* convert leading spaces and trailing
dots and spaces to private use area */
MOUNT_IHASH = 0x80000, /* Enforce hash values for inode numbers */
- MOUNT_BIND = 0x100000 /* Allows bind syntax in fstab file. */
+ MOUNT_BIND = 0x100000, /* Allows bind syntax in fstab file. */
+ MOUNT_USER_TEMP = 0x200000 /* Mount the user's $TMP. */
};
int mount (const char *, const char *, unsigned __flags);