From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88884 invoked by alias); 14 Aug 2015 14:11:07 -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 88873 invoked by uid 89); 14 Aug 2015 14:11:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: csmail.cs.umass.edu Received: from mdc1.cs.umass.edu (HELO csmail.cs.umass.edu) (128.119.240.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Aug 2015 14:11:05 +0000 Received: from [192.168.1.5] (cpe-108-183-175-0.maine.res.rr.com [108.183.175.0]) by csmail.cs.umass.edu (Postfix) with ESMTPSA id 8064B200002E87773F; Fri, 14 Aug 2015 10:11:03 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: Cygwin version detection at run time References: To: cygwin@cygwin.com From: Eliot Moss Message-ID: <55CDF6F5.6030202@cs.umass.edu> Date: Fri, 14 Aug 2015 14:11:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00213.txt.bz2 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 ... Eliot Moss -- 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