bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isatty: make it return true in Cygwin consoles on native Windows


From: LRN
Subject: Re: isatty: make it return true in Cygwin consoles on native Windows
Date: Fri, 15 Mar 2019 23:16:30 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3

On 15.03.2019 22:42, Bruno Haible wrote:
> Gisle Vanem asked:
>>> I prefer to avoid the ntdll.dll API when possible.
>>
>> Okay, what's wrong with that?
> 
> 1) It's a violation of abstraction.
> 
> 2) The code you pointed to uses the function NtQueryObject. However, the
>    Microsoft documentation
>    
> <https://docs.microsoft.com/en-us/windows/desktop/api/winternl/nf-winternl-ntqueryobject>
>    states "This function may be changed or removed from Windows without
>    further notice."
> 
> 3) Probably code will run better on ReactOS or WINE if they don't use the
>    lower layers.
> 
Advanced functionality sometimes requires the use of kernel API in cases where
Microsoft decided not to expose some NT kernel functions to applications in
Win32 API. These situations happen from time to time when dealing with 
portability.

You can lessen the impact by configure-time-testing the kernel APIs to ensure
that they are available and behave as expected. In some sense this is kind of
like using very Linux-specific functions. If the functions vanish, you'll
notice. Also ReactOS and WINE won't use that code, if they have no functions
and thus fail the configure-tests.

Either way, some things cannot be implemented in a clear and/or performant way
without these.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]