delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/01/30/03:56:01

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=yVNtRni
Ajl3FzYogRlfNmL13FFpaX3+w7JW5lAorzjV2J+myCXD8NwgL4CBk6KOnyu5E4mf
N+fel/YZ5YgFX+PPEP392nlr/IG4gPWDbIrm45OwIPSUWkCYp8yak4wEDyv70IIj
5xKgqwBUeaNIV9Gws0fLjvRqu6DdJxciKxKo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; s=default; bh=MP9xG1KgbCSOB
Kmd44TZ3iXZfkw=; b=MR4gO4nGHVCeF4WG3BLrBU/nLeBDh0CygoauXxS8ju66L
eBjciW1mRJOqEc4JJi7nYsrlYv9RsESduQRX407Bv1v94w9a60RRDZbQsO6MuWxa
cVjP7DzA8QGpoxsXIS4ewPKlyi+RT9NJF8bc2URVV7NMKX4GWEcTQEOZVM6XwA=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Wolff, wolff, boots, csaba
X-HELO: mail-wm0-f47.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=8rR/XouWZfHbvIUE7Ai9VsBo53hD/lTjGvY6itr1dhw=; b=E0VRMxosrUcjV7yrHIV9UYvvHVbWzIwPdiZu8eiZrTlsZnaGb+FmNjWj4D+OY3tgV4 mxCrkGG3DbxwBoDrIGdLUMkLcWYC0OTcw9e3qbZnwytuAzFjyXa2Q+8GEDCNcffWaZrn VLv5wkc4Hn6LLnUa825B0ei6zv8AZMNQY0BCFPsOf5j0zUjMBhp6yyKoyK7FvnFl80qL F+ZTLml9TmBaY5cFYRLrZW8G3wYvIi2aaHlCSK2ri53tdH3j3TiApZUC2XFutaavdWHf TFFHSykSc4EbBzj7s/pOaC9EHHpl+uGZKQaLxQwDwiqyf2n308jYRAjqeSpc9riimrqG 6UDA==
X-Gm-Message-State: AIkVDXJCMkbSYiLZIpQa/nosbK8G+ofH7bXvS5TIVLx0Os6ccw6syBR/4lvMkr2ujGqvhWkyS12BHYKSXySz8w==
X-Received: by 10.28.0.2 with SMTP id 2mr13259374wma.141.1485766534116; Mon, 30 Jan 2017 00:55:34 -0800 (PST)
MIME-Version: 1.0
In-Reply-To: <7eda901b-2a0e-f04a-5b37-00e6df852465@towo.net>
References: <b431ce093f2949901c68c3c93fe0693c AT xs4all DOT nl> <639803f1-432c-005d-98c2-db982618c0e2 AT t-online DOT de> <34cdfeceeb1885c645ff52b2c244cab5 AT xs4all DOT nl> <7eda901b-2a0e-f04a-5b37-00e6df852465 AT towo DOT net>
From: Csaba Raduly <rcsaba AT gmail DOT com>
Date: Mon, 30 Jan 2017 09:55:33 +0100
Message-ID: <CAEhDDbBbxnGkr1N1Wd8G9r3bp9gvH2LH0-VYP0OO=gNBoxEP=g@mail.gmail.com>
Subject: Re: dirent.d_type is not working on Cygwin symbolic links.
To: cygwin list <cygwin AT cygwin DOT com>

On Sun, Jan 29, 2017 at 8:34 PM, Thomas Wolff  wrote:
> Am 29.01.2017 um 20:17 schrieb waterlan:
>>
>> Christian Franke schreef op 2017-01-29 12:15:
>>>
>>> waterlan wrote:
>>>>
>>>> The dirent.d_type value for Cygwin symbolic links is 0 (DT_UNKNOWN). The
>>>> value is 10 (DT_LNK) for Windows native symbolic links. I think d_type
>>>> should be 10 for Cygwin symbolic links too.
>>>>
>>>
>>> Sorry, no.
>>>
>>> The actual type should only be returned in dirent.d_type if the info
>>> is available at very low cost. This is not the case for Cygwin
>>> symbolic links.
>>>
>>> If DT_UNKNOWN is returned, lstat() must be called if type info is
>>> required.
>>>
>>> Quote from Linux man page readdir(3):
>>> "All applications must properly handle a return of DT_UNKNOWN."
>>> (https://linux.die.net/man/3/readdir)
>>>
>>> See also thread starting at:
>>> https://sourceware.org/ml/cygwin-patches/2008-q4/msg00000.html
>>
>>
>> In this case I do not agree with this. Cygwin symbolic links are there to
>> emulate Linux symlinks. Therefore I expect the same behaviour.
>>
>> ``Cygwin is
>> * a large collection of GNU and Open Source tools which provide
>> functionality similar to a Linux distribution on Windows.''
>> (https://cygwin.com/)

similar != identical

>
> As you're quoting from the cygwin home page, you chose the wrong bullet.
> It's about tools while the functionality you are commenting about is
> provided by
>>
>> * a DLL (cygwin1.dll) which provides substantial POSIX API functionality.
>
> So the reference here is POSIX, not Linux, if we're getting picky. And as
> Christian Franke had already quoted, the field in question is not mandatory
> at all by POSIX. So you'll have to do what other people also do: defensive
> programming, not expecting too much but taking all cases into account.

In other words, "all the world is not Linux".

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

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