Change 11875 by jhi@alpha on 2001/09/05 11:48:14
NetWare updates from Ananth Kesari.
Affected files ...
... //depot/perl/NetWare/config.wc#9 edit
... //depot/perl/NetWare/netware.h#3 edit
... //depot/perl/NetWare/nw5.c#4 edit
... //depot/perl/NetWare/nw5thread.h#3 edit
Differences ...
==== //depot/perl/NetWare/config.wc#9 (text) ====
Index: perl/NetWare/config.wc
--- perl/NetWare/config.wc.~1~ Wed Sep 5 06:00:05 2001
+++ perl/NetWare/config.wc Wed Sep 5 06:00:05 2001
@@ -201,7 +201,7 @@
d_isascii='define'
d_isfinite='undef'
d_isinf='undef'
-d_isnan='define'
+d_isnan='undef'
d_isnanl='undef'
d_killpg='undef'
d_lchown='undef'
==== //depot/perl/NetWare/netware.h#3 (text) ====
Index: perl/NetWare/netware.h
--- perl/NetWare/netware.h.~1~ Wed Sep 5 06:00:05 2001
+++ perl/NetWare/netware.h Wed Sep 5 06:00:05 2001
@@ -48,6 +48,7 @@
#define HAVE_INTERP_INTERN
struct interp_intern {
void * internal_host;
+ long perlshell_items; // For system() ; Ananth, 3 Sept 2001
};
/*
@@ -66,6 +67,7 @@
#endif
#define nw_internal_host (PL_sys_intern.internal_host)
+#define nw_perlshell_items (PL_sys_intern.perlshell_items) // For
+system() ; Ananth, 3 Sept 2001
EXTERN_C void Perl_nw5_init(int *argcp, char ***argvp);
==== //depot/perl/NetWare/nw5.c#4 (text) ====
Index: perl/NetWare/nw5.c
--- perl/NetWare/nw5.c.~1~ Wed Sep 5 06:00:05 2001
+++ perl/NetWare/nw5.c Wed Sep 5 06:00:05 2001
@@ -879,7 +879,70 @@
// This feature needs to be implemented.
// _asm is commented out since it goes into the internal debugger.
// _asm {int 3};
- return(0);
+//// return(0);
+
+
+ // This below code is required for system() call.
+ // Otherwise system() does not work on NetWare.
+ // Ananth, 3 Sept 2001
+
+ dTHX;
+ SV *really = (SV*)vreally;
+ SV **mark = (SV**)vmark;
+ SV **sp = (SV**)vsp;
+ char **argv;
+ char *str;
+ int status;
+ int flag = P_WAIT;
+ int index = 0;
+
+
+ if (sp <= mark)
+ return -1;
+
+ nw_perlshell_items = 0; // No Shell
+ New(1306, argv, (sp - mark) + nw_perlshell_items + 3, char*);
+
+ if (SvNIOKp(*(mark+1)) && !SvPOKp(*(mark+1))) {
+ ++mark;
+ flag = SvIVx(*mark);
+ }
+
+ while (++mark <= sp) {
+ if (*mark && (str = (char *)SvPV_nolen(*mark)))
+ {
+ argv[index] = str;
+ index++;
+ }
+ else
+ {
+ argv[index] = "";
+// argv[index] = '\0';
+ index++;
+ }
+ }
+ argv[index] = '\0';
+ index++;
+
+ status = nw_spawnvp(flag,
+ (char*)(really ? SvPV_nolen(really) : argv[0]),
+ (char**)argv);
+
+
+ if (flag != P_NOWAIT) {
+ if (status < 0) {
+ dTHR;
+ if (ckWARN(WARN_EXEC))
+ Perl_warner(aTHX_ WARN_EXEC, "Can't spawn \"%s\": %s", argv[0],
+strerror(errno));
+ status = 255 * 256;
+ }
+ else
+ status *= 256;
+ PL_statusvalue = status;
+ }
+
+ Safefree(argv);
+ return (status);
}
int
==== //depot/perl/NetWare/nw5thread.h#3 (text) ====
Index: perl/NetWare/nw5thread.h
--- perl/NetWare/nw5thread.h.~1~ Wed Sep 5 06:00:05 2001
+++ perl/NetWare/nw5thread.h Wed Sep 5 06:00:05 2001
@@ -27,6 +27,11 @@
typedef long perl_key;
+// The line below is just a definition to avoid compilation error.
+// It is not being used anywhere.
+// Ananth, 3 Sept 2001
+typedef struct nw_cond { long waiters; unsigned int sem; } perl_cond;
+
#if (defined (USE_ITHREADS) || defined (USE_5005THREADS)) && defined(MPK_ON)
#ifdef __cplusplus
extern "C"
End of Patch.