From: Jarkko Hietaniemi Date: Wed, 5 Sep 2001 11:48:14 +0000 (+0000) Subject: NetWare updates from Ananth Kesari. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa03377f212c69c47ab6514076e52611d288ed57;p=p5sagit%2Fp5-mst-13.2.git NetWare updates from Ananth Kesari. p4raw-id: //depot/perl@11875 --- diff --git a/NetWare/config.wc b/NetWare/config.wc index 1d4d194..9997483 100644 --- a/NetWare/config.wc +++ b/NetWare/config.wc @@ -201,7 +201,7 @@ d_int64_t='undef' d_isascii='define' d_isfinite='undef' d_isinf='undef' -d_isnan='define' +d_isnan='undef' d_isnanl='undef' d_killpg='undef' d_lchown='undef' diff --git a/NetWare/netware.h b/NetWare/netware.h index f9ae1bf..6f65560 100644 --- a/NetWare/netware.h +++ b/NetWare/netware.h @@ -48,6 +48,7 @@ struct tms { #define HAVE_INTERP_INTERN struct interp_intern { void * internal_host; + long perlshell_items; // For system() ; Ananth, 3 Sept 2001 }; /* @@ -66,6 +67,7 @@ typedef u_int SOCKET; #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); diff --git a/NetWare/nw5.c b/NetWare/nw5.c index 44bb853..5dd8927 100644 --- a/NetWare/nw5.c +++ b/NetWare/nw5.c @@ -879,7 +879,70 @@ do_aspawn(void *vreally, void **vmark, void **vsp) // 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 diff --git a/NetWare/nw5thread.h b/NetWare/nw5thread.h index 58e1596..930273b 100644 --- a/NetWare/nw5thread.h +++ b/NetWare/nw5thread.h @@ -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"