summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@engin.umich.edu>1997-04-05 23:31:11 -0500
committerChip Salzenberg <chip@atlantic.net>1997-04-04 00:00:00 +0000
commitdcb2879abe1a588042098f71cb130a72def08afb (patch)
treec07f969dda8b0f17c99a9ca1aa22548927abb147
parent5b54f415353cb889898fb25391f5dff73990f3f2 (diff)
downloadperl-dcb2879abe1a588042098f71cb130a72def08afb.tar.gz
perlwin-97a_4: win32 environ fix
private-msgid: 199704060431.XAA23400@aatma.engin.umich.edu
-rw-r--r--win32/win32.c6
-rw-r--r--win32/win32io.c7
-rw-r--r--win32/win32io.h1
-rw-r--r--win32/win32iop.h3
4 files changed, 17 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 7bb003d169..ed24251ba6 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -756,6 +756,12 @@ win32_errno(void)
return (pIOSubSystem->pfnerrno());
}
+DllExport char ***
+win32_environ(void)
+{
+ return (pIOSubSystem->pfnenviron());
+}
+
/* the rest are the remapped stdio routines */
DllExport FILE *
win32_stderr(void)
diff --git a/win32/win32io.c b/win32/win32io.c
index b4f58242cf..c9cc8e24e2 100644
--- a/win32/win32io.c
+++ b/win32/win32io.c
@@ -31,6 +31,12 @@ dummy_errno(void)
return (&(errno));
}
+static char ***
+dummy_environ(void)
+{
+ return (&(_environ));
+}
+
/* the rest are the remapped stdio routines */
static FILE *
dummy_stderr(void)
@@ -184,6 +190,7 @@ __declspec(dllexport)
WIN32_IOSUBSYSTEM win32stdio = {
12345678L, /* begin of structure; */
dummy_errno, /* (*pfunc_errno)(void); */
+ dummy_environ, /* (*pfunc_environ)(void); */
dummy_stdin, /* (*pfunc_stdin)(void); */
dummy_stdout, /* (*pfunc_stdout)(void); */
dummy_stderr, /* (*pfunc_stderr)(void); */
diff --git a/win32/win32io.h b/win32/win32io.h
index f73eea1322..4955973564 100644
--- a/win32/win32io.h
+++ b/win32/win32io.h
@@ -4,6 +4,7 @@
typedef struct {
int signature_begin;
int * (*pfnerrno)(void);
+char ***(*pfnenviron)(void);
FILE* (*pfnstdin)(void);
FILE* (*pfnstdout)(void);
FILE* (*pfnstderr)(void);
diff --git a/win32/win32iop.h b/win32/win32iop.h
index d699e03ab6..eadc08f812 100644
--- a/win32/win32iop.h
+++ b/win32/win32iop.h
@@ -10,6 +10,7 @@
* function prototypes for our own win32io layer
*/
EXT int * win32_errno();
+EXT char *** win32_environ();
EXT FILE* win32_stdin(void);
EXT FILE* win32_stdout(void);
EXT FILE* win32_stderr(void);
@@ -77,6 +78,7 @@ void * SetIOSubSystem(void *piosubsystem);
*/
#ifndef WIN32IO_IS_STDIO
#undef errno
+#undef environ
#undef stderr
#undef stdin
#undef stdout
@@ -89,6 +91,7 @@ void * SetIOSubSystem(void *piosubsystem);
#define feof(f) win32_feof(f)
#define ferror(f) win32_ferror(f)
#define errno (*win32_errno())
+#define environ (*win32_environ())
#define strerror win32_strerror
/*