From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60824 invoked by alias); 14 Aug 2015 15:44:16 -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 60815 invoked by uid 89); 14 Aug 2015 15:44:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Aug 2015 15:44:10 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 712A7A808FE; Fri, 14 Aug 2015 17:44:08 +0200 (CEST) Date: Fri, 14 Aug 2015 15:44:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Cygwin version detection at run time Message-ID: <20150814154408.GJ28349@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <55CDF6F5.6030202@cs.umass.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YrlhzR9YrZtruaFS" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-08/txt/msg00215.txt.bz2 --YrlhzR9YrZtruaFS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1390 On Aug 14 17:08, V=C3=A1clav Haisman wrote: > 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 ... >=20 > 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. cygwin_internal(CW_GETVERSIONINFO) is an API for non-Cygwin tools like cygcheck, not for general consumption. For a Cygwin executable, better use uname(2) instead. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --YrlhzR9YrZtruaFS Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVzgzIAAoJEPU2Bp2uRE+gdPYP/R3eO+16nVPlbRAXAR0F8uTz p2MheStzS7WwKA+n90EsrJ7FbHtnSpWsAF0Sm+b/6O3x03G+Eb2GVjyOnVcfWHjv q5E7wIR5INGZU0PaRrLrIJKlCxI5yyebTGxQlzg6gu5pHY4t840Gnt286Z7BKuWn 4kZo8vZCalKbUhMIM1WRYdlLCwROaH1LFP0rN4Z035eoB2Ry+CxaaZgP2GF0LEqv GQ0Gb0BWsAa6E67ziKqUmEqadtoVUb11vtK+mgEAWSlFp8LfL+TSffad6jN3edCy MEyMio6dRIJo0KzqO2d+ZrJwUEtSOulrFLOpRCLGTX7evdhPmkmjftxIwv34aYSK BPhX9M2qtNN6T+hc/9+5JrRKhVezDwVxA+t6Sfp+ZVgXJWglfrz7BntmMoAJ+3FP 9rwkqsqhbF43pTNxxf9Fypy7OgktsEO31MA34FLK7OsN+NCZ2mF7FXv24JPrEISB M17HcBY9d0YCPR5GZpMqpArzAW32NFSGYLtolyE7IvMulPHC2gPS2uUIWcgr+T2Y f+Mtq4og5rZvc27maudW7ixHb81+ObyQ3lf02g4O6iH6sHP2y9vlI6Ru+m6GWqQL JjsCZ3Tk8CCgHw8rBm7MSzqApQ1oE6t8wLNV/GoAVib5AQNUd3g2+I2dK/OR766Q D3r4ADE5ifqm/jIcHPiB =5CW6 -----END PGP SIGNATURE----- --YrlhzR9YrZtruaFS--