public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Download source for cygwin.dll?
@ 2020-08-22 20:43 The Tick
  2020-08-22 20:52 ` The Tick
  0 siblings, 1 reply; 4+ messages in thread
From: The Tick @ 2020-08-22 20:43 UTC (permalink / raw)
  To: cygwin

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

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.

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Download source for cygwin.dll?
  2020-08-22 20:43 Download source for cygwin.dll? The Tick
@ 2020-08-22 20:52 ` The Tick
  2020-08-22 21:31   ` Brian Inglis
  0 siblings, 1 reply; 4+ messages in thread
From: The Tick @ 2020-08-22 20:52 UTC (permalink / raw)
  To: cygwin

On 8/22/2020 3:43 PM, The Tick wrote:
> This leads me to believe that the guts of the lstat() for windows is
> implemented in the cygwin.dll.
Sorry, I meant readlink()

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Download source for cygwin.dll?
  2020-08-22 20:52 ` The Tick
@ 2020-08-22 21:31   ` Brian Inglis
  2020-08-23 23:26     ` Brian Inglis
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Inglis @ 2020-08-22 21:31 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Download source for cygwin.dll?
  2020-08-22 21:31   ` Brian Inglis
@ 2020-08-23 23:26     ` Brian Inglis
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2020-08-23 23:26 UTC (permalink / raw)
  To: cygwin

On 2020-08-22 15:31, Brian Inglis wrote:
> 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

Sorry wrong path.cc and readlink function link^, correct link:

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-23 23:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 20:43 Download source for cygwin.dll? The Tick
2020-08-22 20:52 ` The Tick
2020-08-22 21:31   ` Brian Inglis
2020-08-23 23:26     ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).