DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5189J4xJ3226582 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 5189J4xJ3226582 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=X/z9EaPA X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B84953857729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1739006342; bh=zes+TDXcDqBP15Gkrc+Pchm7OphIdwgZkrM9nDRCkmo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=X/z9EaPAavj0QY8buEHkRrohXyhmbvyMZVcCY041u4Defc7XW/EC5hb7FfxQPKJ8e T2s7sTr/pIUDH2oGs9qsajuWmSKCWV7PLyOIdgYN2i/WbUPQjL4JMvhvLWevsMAMwT AivffNDCS5ODA02hkD/jtUgJQUyMpzwsd3rFSSuE= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 730B23857836 Date: Sat, 8 Feb 2025 10:18:04 +0100 To: cygwin AT cygwin DOT com Subject: Re: exposing Windows mountpoints in Cygwin Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <09960367-4427-2929-9b12-17cc2a15f5c3 AT jdrake DOT com> <474a8899-2c92-ad8a-09c5-f86314213e94 AT jdrake DOT com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <474a8899-2c92-ad8a-09c5-f86314213e94@jdrake.com> X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Feb 7 11:19, Jeremy Drake via Cygwin wrote: > On Fri, 7 Feb 2025, Corinna Vinschen via Cygwin wrote: > > > On Feb 6 13:31, Jeremy Drake via Cygwin wrote: > > > Now that my patch to escape characters in /proc/mounts has been applied, > > > I'll get back to what I was thinking about back in June. I would like to > > > have a way to list Windows volume roots in Cygwin, and it seems to make > > > sense to me to expose them via getmntent, /proc/mounts, etc. The way I > > > see this working is probably to replace the available_drives mechanism for > > > enumerating mounts in favor of using FindFirst/NextVolumeW and > > > GetVolumePathNamesForVolumeNameW to enumerate cygdrive mount points. > > > > Been there, done that, but that was more than 10 years ago, so things > > might have changed. At the time, the volume manager was incredibly > > slow. Enumerating and converting volume paths from one style into the > > other just took too much time. And, as you know, Cygwin already is > > slow... > > > > Still, if you want to do that, it should not be part of the standard > > mount points becasue this is another level of implementation. These are > > the POSIX mount points handled by Cygwin. That should be part of the > > cygdrive handling. Sounds like you were mulling over this anyway. > > Right, the cygdrive_getmntent function in mount.cc. > > > But it's not quite clear what the expected output should be. > > > So what is the expected output in the cygdrive dir? > > > > What I could imagine is something like this. Assuming two drives, one > > of them mounted into a dir: > > > > C: \Device\HarddiskVolume1 > > C:\foo \Device\HarddiskVolume2 > > > > $ ls -gG /cygdrive > > d---r-x---+ 1 0 Feb 7 03:38 c > > drwxrwxr-x 1 0 Jan 8 11:02 c_foo -> /mnt/c/foo > > I'm thinking much simpler than that. I'm just thinking about enumerating > directory mounts in the cygdrive_getmntent function. So /cygdrive looks > the same as it does now, just the roots of drives, but for instance mount > would show something like > > C: on /cygdrive/c type ntfs (binary,noacl,posix=0,user,noumount,auto) > C:/foo on /cygdrive/c/foo type ntfs (binary,noacl,posix=0,user,noumount,auto) > > Presumably this would also make df privy to them. Go for it. There's already matching logic in fhandler/proc.cc, function format_proc_partitions() for the "win-mounts" column of /proc/partitions. Probably this can be reused. Corinna -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple