This is the mail archive of the cygwin 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]

Re: [bulk] - R: /dev/ttys* under cygwin problem


On 09/22/2010 03:02 PM, Daniel Barclay wrote:
They are implemented in a virtual file system. It is not necessary that
there be placeholders in the file system for them to work.

But if they were emulated/simulated _consistently_, one could see which devices were available by simply listing /dev instead of having to re-find the documentation.

http://cygwin.com/acronyms/#PTC


Again, why does Cygwin's (virtual) file system _not_ include those
devices (when listing /dev)? (Why doesn't it do it more like Linux's
/proc, etc., which gives a consistent view and which tells you what's
available without your having to look elsewhere?)

Because no one has taken the time to write the code. Also, unlike Linux, where the kernel knows what devices are present, a cygwin implementation would have to make a lot of syscalls querying whether each potential device is available. One other drawback - cygwin would like things like /dev/stdin to work as a symlink to /proc/self/0, but that is a normal symlink in today's cygwin implementation, and not an entry in the virtual file system. Therefore, part of the implementation battle is figuring out how to merge an existing directory containing user-added symlinks or device names, in parallel with the virtual devices supported by the virtual FS magic compiled into cygwin.


Actually, is your last sentence above actually true? Looking at the
device-creation script you pointed me to, I wonder: How do you (e.g.,
a script) determine which devices of a given type exist (e.g., sda1,
sda2, sda3, ...)? (Do you have to try to open each possible device and
check whether there's an error?)

The script creates every known name, whether or not it actually exists as a device at the current moment, which is in itself a bit misleading. But it has to, because of devices which can be added and removed on the fly, whereas the script creating the placeholder files is only run once.


--
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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