aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/mount.cc
diff options
context:
space:
mode:
authorChristian Franke <christian.franke@t-online.de>2023-11-05 15:54:23 +0100
committerCorinna Vinschen <corinna@vinschen.de>2023-11-05 17:01:43 +0100
commitc8cf1933ba04edf40181545b4c258be059d66f87 (patch)
tree90be43517bc9e85deadf593fe4b406ff90c3ddef /winsup/cygwin/mount.cc
parent12e3bac3ce562007e83c3c67243c85fcb5ee70a4 (diff)
downloadnewlib-c8cf1933ba04edf40181545b4c258be059d66f87.zip
newlib-c8cf1933ba04edf40181545b4c258be059d66f87.tar.gz
newlib-c8cf1933ba04edf40181545b4c258be059d66f87.tar.bz2
Cygwin: Add /dev/disk/by-id symlinks
The new directory '/dev/disk/by-id' provides symlinks for each disk and its partitions: 'BUSTYPE-[VENDOR_]PRODUCT_SERIAL[-partN]' -> '../../sdX[N]'. This is based on strings provided by STORAGE_DEVICE_DESCRIPTOR. If this information is too short, a 128-bit hash of the STORAGE_DEVICE_UNIQUE_IDENTIFIER raw data is added. Administrator privileges are not required. Signed-off-by: Christian Franke <christian.franke@t-online.de>
Diffstat (limited to 'winsup/cygwin/mount.cc')
-rw-r--r--winsup/cygwin/mount.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 36ab042..13ace62 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -35,6 +35,9 @@ details. */
(path[mount_table->cygdrive_len + 1] == '/' || \
!path[mount_table->cygdrive_len + 1]))
+#define isdev_disk(path) \
+ (path_prefix_p (dev_disk, (path), dev_disk_len, false))
+
#define isproc(path) \
(path_prefix_p (proc, (path), proc_len, false))
@@ -685,6 +688,13 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
/* Go through chroot check */
goto out;
}
+ if (isdev_disk (src_path))
+ {
+ dev = *dev_disk_dev;
+ *flags = 0;
+ strcpy (dst, src_path);
+ goto out;
+ }
if (isproc (src_path))
{
dev = *proc_dev;