This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __cygwin_environ, __imp_environ, _cur_environ, where is 'environ' symbol?


ok, it seems that newlib/libc/stdlib/environ.c has not made its way
into cygwin1.dll and/or libcygwin.a; shouldn't that be included?
________________________________
From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
To: cygwin at cygwin dot com
Date: Wed, 12 Jun 2013 11:53:15 +0200
Subject: Re: __cygwin_environ, __imp_environ, _cur_environ, where is
'environ' symbol?
References: <CAHYyVz6bkXx89HZsWrt8ojgUVw02W_qG1s6bd7Ev2XAW3wcRog at
mail dot gmail dot com>
Reply-to: cygwin at cygwin dot com

________________________________

environ is the exported symbol referencing the internal __cygwin_environ
variable on x86_64.  Linking against and accessing it works for me:

  $ uname -a
  CYGWIN_NT-6.2 VMBERT864 1.7.21(0.266/5/3) 2013-06-11 21:43 x86_64 Cygwin
  $ cat > envtest.c <<EOF
  #include <stdio.h>

  int
  main ()
  {
    extern char **environ;

    printf ("environ: %p first entry: <%s>\n", &environ, environ[0]);
    return 0;
  }
  EOF
  $ gcc -o envtest envtest.c
  $ ./envtest
  environ: 0x1802a4778 first entry: <ALLUSERSPROFILE=C:\ProgramData>


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
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

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]