From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5038 invoked by alias); 14 Aug 2015 15:08:13 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 5005 invoked by uid 89); 14 Aug 2015 15:08:12 -0000 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 Received: from mail-la0-f43.google.com (HELO mail-la0-f43.google.com) (209.85.215.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 14 Aug 2015 15:08:11 +0000 Received: by labd1 with SMTP id d1so45851377lab.1 for ; Fri, 14 Aug 2015 08:08:07 -0700 (PDT) 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) Received: by 10.25.215.99 with HTTP; Fri, 14 Aug 2015 08:08:07 -0700 (PDT) In-Reply-To: <55CDF6F5.6030202@cs.umass.edu> References: <55CDF6F5.6030202@cs.umass.edu> Date: Fri, 14 Aug 2015 15:08:00 -0000 Message-ID: Subject: Re: Cygwin version detection at run time From: =?UTF-8?Q?V=C3=A1clav_Haisman?= To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00214.txt.bz2 On 14 August 2015 at 16:11, Eliot Moss wrote: > On 8/14/2015 9:56 AM, V=C3=A1clav 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. --=20 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