X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7EF5F393C897
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
 header.from=SystematicSw.ab.ca
Authentication-Results: sourceware.org;
 spf=none smtp.mailfrom=brian.inglis@systematicsw.ab.ca
X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0
 a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17
 a=IkcTkHD0fZMA:10 a=w_pzkKWiAAAA:8 a=1KZzFjuz9rJhbySsomMA:9 a=QEXdDO2ut3YA:10
 a=Lz48L_9qCwoA:10 a=sRI3_1zDfAgwuvI8zelB:22
Subject: Re: Download source for cygwin.dll?
To: cygwin@cygwin.com
References: <c86f8d76-f7ab-b102-600b-4e20fdd902b1@gmx.com>
 <125d59e1-6bb1-756c-fd4b-4894127d2f3f@gmx.com>
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Autocrypt: addr=Brian.Inglis@SystematicSw.ab.ca; prefer-encrypt=mutual;
 keydata=
 mDMEXopx8xYJKwYBBAHaRw8BAQdAnCK0qv/xwUCCZQoA9BHRYpstERrspfT0NkUWQVuoePa0
 LkJyaWFuIEluZ2xpcyA8QnJpYW4uSW5nbGlzQFN5c3RlbWF0aWNTdy5hYi5jYT6IlgQTFggA
 PhYhBMM5/lbU970GBS2bZB62lxu92I8YBQJeinHzAhsDBQkJZgGABQsJCAcCBhUKCQgLAgQW
 AgMBAh4BAheAAAoJEB62lxu92I8Y0ioBAI8xrggNxziAVmr+Xm6nnyjoujMqWcq3oEhlYGAO
 WacZAQDFtdDx2koSVSoOmfaOyRTbIWSf9/Cjai29060fsmdsDLg4BF6KcfMSCisGAQQBl1UB
 BQEBB0Awv8kHI2PaEgViDqzbnoe8B9KMHoBZLS92HdC7ZPh8HQMBCAeIfgQYFggAJhYhBMM5
 /lbU970GBS2bZB62lxu92I8YBQJeinHzAhsMBQkJZgGAAAoJEB62lxu92I8YZwUBAJw/74rF
 IyaSsGI7ewCdCy88Lce/kdwX7zGwid+f8NZ3AQC/ezTFFi5obXnyMxZJN464nPXiggtT9gN5
 RSyTY8X+AQ==
Organization: Systematic Software
Message-ID: <311fbf20-4642-e0d9-d104-e470d714b6e4@SystematicSw.ab.ca>
Date: Sat, 22 Aug 2020 15:31:24 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
 Thunderbird/68.11.0
MIME-Version: 1.0
In-Reply-To: <125d59e1-6bb1-756c-fd4b-4894127d2f3f@gmx.com>
Content-Language: en-CA
X-CMAE-Envelope: MS4wfARrWZ26j+NK35Pd+4XnGEE9Kk0+ic/RswXN59vrhLxFfPjyJvYBag2w50WaMbh0loguF361g2Hw0TKIvwhJI2f2rwFGsNPycP6KmlGFf35EpI45/x5s
 5sEQpylsryr2gSFxkK59+gduV5pJh8H8ILFi4rpyOsWjo8ec3KBS3fFiWB5fhX5YmkYe7YfQVkJOGw==
X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,
 SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Reply-To: cygwin@cygwin.com
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

On 2020-08-22 14:52, The Tick wrote:
> On 8/22/2020 3:43 PM, The Tick wrote:
>> I've been trying to find out how 'ls -l' returns the target of a symlink
>> on windows:
>> 
>> $ ls -l
>> lrwxrwxrwx 1 user None     1 Aug 22 15:16 a -> b
>> lrwxrwxrwx 1 user None     5 Aug 22 15:16 b -> final
>> -rw-r--r-- 1 user None    29 Aug 22 15:16 final

First, read the docs, padawan, to understand the concepts and use, then the
sources:

https://cygwin.com/cygwin-ug-net/using.html#pathnames-symlinks

>> My google searches have pointed me to the windows
>> GetFinalPathNameByHandle() function but that does get me the
>> intermediate links -- just the final path (which, of course, is what is
>> implied by the name of the library call).
>> 
>> I'm running Msys2 on win7x64. I've looked thru the coreutils for msys2
>> and cannot find how it is done. That lead me to cygwin coreutils and,
>> again, there does not seem to be anything specific there. Both rely on a
>> working lstat().
>> 
>> This leads me to believe that the guts of the lstat() for windows is
>> implemented in the cygwin.dll.

> Sorry, I meant readlink()

>> I'm sure this is a no-brainer for those in the know, but could someone
>> point me to where I could download the source for the cygwin dll so I
>> could examine it? Thank you.

Check on the Cygwin home page left nav bar Contributing page link and the links
under those.

All Windows interfaces are implemented in the DLL, which also includes those
parts of libc which use Windows interfaces, but the non-Windows and libc
interfaces are mainly in newlib; all available online via git:

https://cygwin.com/git?p=newlib-cygwin.git;a=blob;f=winsup/utils/path.cc#l184

and the git clone URLs are on the summary page:

https://cygwin.com/git/?p=newlib-cygwin.git;a=summary

All the core Cygwin components, apps, docs, and the web site itself, are also
available under that git subsite.

You can also run the Cygwin Setup program (see home page) to download the cygwin
source package by checking the Src [X] checkbox beside the cygwin package name.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]
--
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
