This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Mount interaction with /dev & /proc entries


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.

Attachment: path.cc.patch
Description: Binary data

Attachment: ChangeLog.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]