diff --git a/kernel/CFuncs.st b/kernel/CFuncs.st index 72b7ca2..f9ca606 100644 --- a/kernel/CFuncs.st +++ b/kernel/CFuncs.st @@ -127,6 +127,12 @@ SystemDictionary extend [ ] + environ [ + + + + ] + putenv: aString [ diff --git a/libgst/cint.c b/libgst/cint.c index 061a829..44c5369 100644 --- a/libgst/cint.c +++ b/libgst/cint.c @@ -195,6 +195,7 @@ static int my_lstat (const char *name, OOP out); #endif static int my_putenv (const char *str); +static char **get_environ (void); static int my_chdir (const char *str); static int my_chown (const char *file, const char *owner, const char *group); static int my_symlink (const char* oldpath, const char* newpath); @@ -392,6 +393,12 @@ my_putenv (const char *str) return (putenv (clone)); } +static char ** +get_environ (void) +{ + return environ; +} + int my_chdir (const char *dir) @@ -592,6 +599,7 @@ _gst_init_cfuncs (void) /* Access to C library */ _gst_define_cfunc ("system", system); _gst_define_cfunc ("getenv", getenv); + _gst_define_cfunc ("environ", get_environ); _gst_define_cfunc ("putenv", my_putenv); _gst_define_cfunc ("printf", printf);