Download source for cygwin.dll?

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Sat Aug 22 21:31:24 GMT 2020


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.]


More information about the Cygwin mailing list