summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.epoc6
-rw-r--r--epoc/epoc.c5
-rw-r--r--epoc/epocish.h20
-rw-r--r--util.c4
4 files changed, 22 insertions, 13 deletions
diff --git a/README.epoc b/README.epoc
index a235f0137e..8ce93fe3e4 100644
--- a/README.epoc
+++ b/README.epoc
@@ -68,6 +68,12 @@ EPOC:
=over 4
+=item *
+
+socket IO is only implemented poorly. You can only use sysread and
+syswrite on them. The commands read, write, print, <> do not work for
+sockets. This may change iff epocemx supports sockets.
+
=item *
kill, alarm and signals. Do not try to use them. This may be
diff --git a/epoc/epoc.c b/epoc/epoc.c
index 61c8d28cf5..6a463c6887 100644
--- a/epoc/epoc.c
+++ b/epoc/epoc.c
@@ -124,8 +124,3 @@ Perl_init_os_extras(void)
newXS("EPOC::getcwd", epoc_getcwd, file);
}
-void
-Perl_my_setenv(pTHX_ char *nam,char *val) {
-
- setenv( nam, val, 1);
-}
diff --git a/epoc/epocish.h b/epoc/epocish.h
index a98faa0415..b9556753cd 100644
--- a/epoc/epocish.h
+++ b/epoc/epocish.h
@@ -105,9 +105,10 @@
#define Fflush(fp) fflush(fp)
#define Mkdir(path,mode) mkdir((path),(mode))
-/* these should be set in a hint file, not here */
+
+/* epocemx setenv bug workaround */
#ifndef PERL_SYS_INIT
-# define PERL_SYS_INIT(c,v) MALLOC_INIT
+# define PERL_SYS_INIT(c,v) putenv(".dummy=foo"); putenv(".dummy"); MALLOC_INIT
#endif
#ifndef PERL_SYS_TERM
@@ -122,11 +123,15 @@
#define BOGUS_GETNAME_RETURN 8
/*
- read() on a socket blocks until buf is filled completly,
- recv() returns each massage
+ read() on a socket is unimplemented in current epocemx
+ use recv() instead
*/
+
#define PERL_SOCK_SYSREAD_IS_RECV
+/* write ditto, use send */
+#define PERL_SOCK_SYSWRITE_IS_SEND
+
/* No /dev/random available*/
#define PERL_NO_DEV_RANDOM
@@ -140,9 +145,12 @@
#define init_os_extras Perl_init_os_extras
-#define NO_ENVIRON_ARRAY
-
#define ARG_MAX 4096
#define ECONNABORTED 0xdead
+/* For environ */
+#include <emx.h>
+#define PERL_USE_SAFE_PUTENV
+
+
diff --git a/util.c b/util.c
index d4a775b424..4642031adb 100644
--- a/util.c
+++ b/util.c
@@ -1584,7 +1584,7 @@ Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args)
*(s+(nlen+1+vlen)) = '\0'
#ifdef USE_ENVIRON_ARRAY
- /* VMS' and EPOC's my_setenv() is in vms.c and epoc.c */
+ /* VMS' my_setenv() is in vms.c */
#if !defined(WIN32) && !defined(NETWARE)
void
Perl_my_setenv(pTHX_ char *nam, char *val)
@@ -1632,7 +1632,7 @@ Perl_my_setenv(pTHX_ char *nam, char *val)
my_setenv_format(environ[i], nam, nlen, val, vlen);
#else /* PERL_USE_SAFE_PUTENV */
-# if defined(__CYGWIN__)
+# if defined(__CYGWIN__) || defined( EPOC)
setenv(nam, val, 1);
# else
char *new_env;