2 * Copyright (c) 1999 Olaf Flebbe o.flebbe@gmx.de
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Artistic License, as specified in the README file.
12 #include <sys/unistd.h>
21 do_spawn( char *cmd) {
27 do_aspawn ( void *vreally, void **vmark, void **vsp) {
31 SV *really = (SV*)vreally;
32 SV **mark = (SV**)vmark;
47 ptr = argv =(char**) malloc ((sp-mark+3)*sizeof (char*));
49 while (++mark <= sp) {
50 if (*mark && (str = SvPV_nolen(*mark)))
57 cmd = strdup((const char*)(really ? SvPV_nolen(really) : argv[0]));
59 rc = spawnvp( P_WAIT, cmd, argv);
67 XS(epoc_getcwd) /* more or less stolen from win32.c */
70 /* Make the host for current directory */
75 buffer = (char *) malloc( buflen);
79 while ((NULL == ( ptr = getcwd( buffer, buflen))) && (errno == ERANGE)) {
81 if (NULL == realloc( buffer, buflen)) {
89 * then it worked, set PV valid,
94 SV *sv = sv_newmortal();
97 for (tptr = ptr; *tptr != '\0'; tptr++) {
108 #ifndef INCOMPLETE_TAINTS
119 Perl_init_os_extras(void)
122 char *file = __FILE__;
123 newXS("EPOC::getcwd", epoc_getcwd, file);