public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Václav Haisman" <vhaisman@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin version detection at run time
Date: Fri, 14 Aug 2015 15:08:00 -0000	[thread overview]
Message-ID: <CAKw7uVjVdOFi4MJayZ485Sm=S7NvwCYwg_2qU-eT_pWLkSEX0Q@mail.gmail.com> (raw)
In-Reply-To: <55CDF6F5.6030202@cs.umass.edu>

On 14 August 2015 at 16:11, Eliot Moss <moss@cs.umass.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

  reply	other threads:[~2015-08-14 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14 13:56 Václav Haisman
2015-08-14 14:11 ` Eliot Moss
2015-08-14 15:08   ` Václav Haisman [this message]
2015-08-14 15:44     ` Corinna Vinschen
2015-08-17 10:20       ` Václav Haisman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKw7uVjVdOFi4MJayZ485Sm=S7NvwCYwg_2qU-eT_pWLkSEX0Q@mail.gmail.com' \
    --to=vhaisman@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).