delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/22/17:13:54

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4C9A7185.2060804@redhat.com>
Date: Wed, 22 Sep 2010 15:13:41 -0600
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.3
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [bulk] - R: /dev/ttys* under cygwin problem
References: <8CCC8F85C5F2784387A32FAD835FB4E602F21573F3 AT server03> <358785 DOT 53873 DOT qm AT web25505 DOT mail DOT ukl DOT yahoo DOT com> <8CCC8F85C5F2784387A32FAD835FB4E602F21573F7 AT server03> <0105D5C1E0353146B1B222348B0411A2094D31E89D AT NIHMLBX02 DOT nih DOT gov> <4C9A3CFA DOT 9090507 AT fgm DOT com> <4C9A4207 DOT 9080405 AT cygwin DOT com> <4C9A6EDD DOT 3040406 AT fgm DOT com>
In-Reply-To: <4C9A6EDD.3040406@fgm.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 AT redhat DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019