delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/05/02/11:57:28

X-Spam-Check-By: sourceware.org
Date: Tue, 2 May 2006 11:57:21 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Truncated Environment Variables? - using Cygwin + GetEnvironmentStrings() WIN32 API
Message-ID: <20060502155721.GB982@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <44576A04 DOT 3090409 AT arkasoft DOT com> <001201c66df5$46bca0e0$a501a8c0 AT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
In-Reply-To: <001201c66df5$46bca0e0$a501a8c0@CAM.ARTIMI.COM>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Tue, May 02, 2006 at 03:32:44PM +0100, Dave Korn wrote:
>On 02 May 2006 15:18, Kaveh Goudarzi wrote:
>>I call cygwin_internal ( CW_SYNC_WINENV ) prior to the call to
>>GetEnvironmentStrings ...  the strange thing is the value that comes
>>back ...  looking at the code (cygwin/src/winsup/cygwin/external.cc) I
>>expected zero but I get another value (4294967295 ...  uninitialized
>>return?)
>
>Return values are ints, not unsigneds.  That one is -1.  Which means
>'error'!
>
>>Any ideas?
>
>Check errno for more information?

That's usually a good idea but I just noticed that cygwin-internal doesn't
set errno.  There is no reason why it would have to, really, since the
interface is entirely local to cygwin and we can decide to do what we
want.  However, I have changed it now so that it returns ENOSYS when it
is returning -1.

That won't help this particular case especially since I suspect that the
problem is that the OP is not using a snapshot.

>>Also I noticed that the address of environ seems always to be at
>>0x460090 ...  is it safe to assume this to always be the case?
>
>No, absolutely not.

What he said.  It's hard to believe that question would even be
seriously asked.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019