diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-05 11:48:14 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-05 11:48:14 +0000 |
commit | fa03377f212c69c47ab6514076e52611d288ed57 (patch) | |
tree | bdee922cf57e22732b601ace28dea31779cf043f /NetWare | |
parent | 53305cf15fa20bba9e66475dfc049c6ed9d96c55 (diff) | |
download | perl-fa03377f212c69c47ab6514076e52611d288ed57.tar.gz |
NetWare updates from Ananth Kesari.
p4raw-id: //depot/perl@11875
Diffstat (limited to 'NetWare')
-rw-r--r-- | NetWare/config.wc | 2 | ||||
-rw-r--r-- | NetWare/netware.h | 2 | ||||
-rw-r--r-- | NetWare/nw5.c | 65 | ||||
-rw-r--r-- | NetWare/nw5thread.h | 5 |
4 files changed, 72 insertions, 2 deletions
diff --git a/NetWare/config.wc b/NetWare/config.wc index 1d4d1945ea..9997483e69 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 f9ae1bf2c7..6f65560cbd 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 44bb853802..5dd8927649 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 58e1596c3c..930273b932 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" |