#define HAVE_INTERP_INTERN
struct interp_intern {
void * internal_host;
+ long perlshell_items; // For system() ; Ananth, 3 Sept 2001
};
/*
#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);
// 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
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"