delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/08/14/11:08:27

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:date
:message-id:subject:from:to:content-type
:content-transfer-encoding; q=dns; s=default; b=lQaHOT9DX/Y0HiRi
GLfWYoNydOfArPHOZjHqCgkAtrwP4gJ8Z7+j9tpWEel0o5kAvSWHXC/V9KbXWjXa
diKhaHkmmoIfnaF7YTlKl1XSrPoPinS20NksC5WnIZLtUtQsA9S5IEjAgGGfM9Po
BMKhyeGAC/XDGfKD7vxQoU1RXhg=
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:date
:message-id:subject:from:to:content-type
:content-transfer-encoding; s=default; bh=1jYyHqcDi+cvSpvirbxh5E
bOxA8=; b=Yyi5XuutQ8QC895DuJrJkOTdHbTGgTuSzzrx6k0xzA+cr850ULaHfE
tcTi1nuzJyUI2nuW3TbNy3ZFhYNgjWfNhulVHKs3Bbzp1Qkp2YlAzX1lNletXFil
eyZotFu1pr0x3hn6Uy5Wjx5Hm/eLvhFBen1CzRIIG2WDC4KcmPdg0=
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.2 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-la0-f43.google.com
MIME-Version: 1.0
X-Received: by 10.112.151.178 with SMTP id ur18mr44902791lbb.59.1439564887833; Fri, 14 Aug 2015 08:08:07 -0700 (PDT)
In-Reply-To: <55CDF6F5.6030202@cs.umass.edu>
References: <CAKw7uVjccyLMYEQcxmZ6qHeAkGoowBB+-6VG-eu59_o4h6RKNQ AT mail DOT gmail DOT com> <55CDF6F5 DOT 6030202 AT cs DOT umass DOT edu>
Date: Fri, 14 Aug 2015 17:08:07 +0200
Message-ID: <CAKw7uVjVdOFi4MJayZ485Sm=S7NvwCYwg_2qU-eT_pWLkSEX0Q@mail.gmail.com>
Subject: Re: Cygwin version detection at run time
From: =?UTF-8?Q?V=C3=A1clav_Haisman?= <vhaisman AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t7EF8LKS013434

On 14 August 2015 at 16:11, Eliot Moss <moss AT cs DOT umass DOT edu> wrote:
> On 8/14/2015 9:56 AM, Václav Haisman wrote:
>>
>> Hi.
>>
>> I am trying to find out Cygwin version at run time.
>>
>> I have noticed that there is `cygwin_internal (CW_GETVERSIONINFO)` API
>> for this. However, it seems that the `cygwin_version_info` structure
>> this call is supposed to fill in is not publicly available and is only
>> declared internally in `winsup/cygwin/cygwin_version.h`.
>>
>> Am I right that my only option is either to copy the internal
>> declaration of the structure or to use `/proc/version` and parse the
>> version string out of that?
>
>
> There's uname, whose options allow getting various parts of what
> /proc/version gives you.  uname is also somewhat portable across
> different flavors of linux ...

Never mind, I have figured it out. The  `cygwin_internal
(CW_GETVERSIONINFO)`  actually returns a pointer to string which can
be parsed reliably. I have used it.

-- 
VH

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