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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=RxDjsAXPfo5qT2ydfEOztieh75RAzIYHkp6UIA39LVScMcjU2WmPO K3DllNAdGuCPb3JtkuwCcnl2/gD1Ybuwo6DPN4wVe53M3QZ2mRXMhmct/dZCNvEM LyIbC3oH3Khuu3j/7o/wkfixIFM+Da4nfoP4EMHTpSyNXSg2ulsvsY= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=5VeLO7Bs+i54gvLfryyHPp7/IAo=; b=aVBKp9fQp8ItQoobGlOkeoTu3UJa F53m75MK9inA6E4U/3srbVYfD2Bl1UkMzRi/ZC3NRFO0nzO19i9k5x0v964404MQ ARmau8sJzbPevZrIDEtKHgK/7bpR9WaXZgwXjCTfuhwagFlix2mf3pn3ZBF70gi6 oFE4HwDbd7B0SbE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Date: Fri, 14 Aug 2015 17:44:08 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Cygwin version detection at run time Message-ID: <20150814154408.GJ28349@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <55CDF6F5 DOT 6030202 AT cs DOT umass DOT 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) --YrlhzR9YrZtruaFS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 -----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--