Mount interaction with /dev & /proc entries

Conrad Scott Conrad.Scott@dsl.pipex.com
Fri Jun 14 15:29:00 GMT 2002


Chris, on the cygwin mailing list recently, you discussed using mount
to change the default binmode/textmode for opening devices. In
particular, as an example you suggested using:

> mount -t -s \dev\piper /dev/piper

I was just looking at mount_info::conv_to_win32_path() and (AFAICS)
this won't work. At path.cc:1443, the code that catches device paths,
short-circuits all the mount point checking (and thus the
binmode/textmode stuff too) by a goto out_no_chroot_check.

Looking at this code I noticed that the /proc handling is different,
that is, it does perform mount point and chroot checking. I would have
thought that it probably doesn't want to be doing chroot checking
(otherwise /proc will always disappear). Also the win32 paths that the
code generates for /proc entries are a bit bogus, e.g.
C:\cygwin\proc\uptime.

I've attached a patch to make /proc more like /dev, i.e. skip the
chroot and mount point checking, and set the path to binary (again,
just as per devices).

This probably isn't exactly right (tho' it may be righter than what's
there now), since you might well want /dev to do mount point checking
(as you suggest). But until there is the ability to mount virtual
filesystems as and where needed (your other suggestion: approx.
mount --type dev /dev), you probably don't want either /dev or /proc
to do chroot checking. So, this patch is halfway there and a little
more consistent. Assuming I haven't missed anything of course.

Cheers,

// Conrad

2002-06-14  Conrad Scott  <conrad.scott@dsl.pipex.com>

 * path.cc (mount_info::conv_to_win32_path): Skip mount point and
 chroot checking for /proc entries and default them to binary mode:
 all as per /dev entries.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: path.cc.patch
Type: application/octet-stream
Size: 1049 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020614/94693317/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ChangeLog.txt
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020614/94693317/attachment.txt>


More information about the Cygwin-patches mailing list