#define EXECF_EXEC 1
#define EXECF_TRUEEXEC 2
#define EXECF_SPAWN_NOWAIT 3
+#define EXECF_SPAWN_BYFLAG 4
/* const char* const ptypes[] = { "FS", "DOS", "VIO", "PM", "DETACH" }; */
rc = spawnvp(trueflag | P_OVERLAY,tmps,PL_Argv);
else if (execf == EXECF_SPAWN_NOWAIT)
rc = spawnvp(flag,tmps,PL_Argv);
- else /* EXECF_SPAWN */
+ else /* EXECF_SPAWN, EXECF_SPAWN_BYFLAG */
rc = result(trueflag,
spawnvp(flag,tmps,PL_Argv));
#endif
return rc;
}
-/* Array spawn. */
-int
-do_aspawn(really,mark,sp)
-SV *really;
-register SV **mark;
-register SV **sp;
-{
- dTHR;
- register char **a;
- char *tmps = NULL;
- int rc;
- int flag = P_WAIT, trueflag, err, secondtry = 0;
- STRLEN n_a;
-
- if (sp > mark) {
- New(1301,PL_Argv, sp - mark + 3, char*);
- a = PL_Argv;
-
- if (mark < sp && SvNIOKp(*(mark+1)) && !SvPOKp(*(mark+1))) {
- ++mark;
- flag = SvIVx(*mark);
- }
-
- while (++mark <= sp) {
- if (*mark)
- *a++ = SvPVx(*mark, n_a);
- else
- *a++ = "";
- }
- *a = Nullch;
-
- rc = do_spawn_ve(really, flag, EXECF_SPAWN, NULL, 0);
- } else
- rc = -1;
- do_execfree();
- return rc;
-}
-
/* Try converting 1-arg form to (usually shell-less) multi-arg form. */
int
-do_spawn2(cmd, execf)
-char *cmd;
-int execf;
+do_spawn3(char *cmd, int execf, int flag)
{
register char **a;
register char *s;
rc = spawnl(P_OVERLAY,shell,shell,copt,cmd,(char*)0);
else if (execf == EXECF_SPAWN_NOWAIT)
rc = spawnl(P_NOWAIT,shell,shell,copt,cmd,(char*)0);
+ else if (execf == EXECF_SPAWN_BYFLAG)
+ rc = spawnl(flag,shell,shell,copt,cmd,(char*)0);
else {
/* In the ak code internal P_NOWAIT is P_WAIT ??? */
rc = result(P_WAIT,
}
*a = Nullch;
if (PL_Argv[0])
- rc = do_spawn_ve(NULL, 0, execf, cmd, mergestderr);
+ rc = do_spawn_ve(NULL, flag, execf, cmd, mergestderr);
else
rc = -1;
if (news)
return rc;
}
+/* Array spawn. */
+int
+do_aspawn(really,mark,sp)
+SV *really;
+register SV **mark;
+register SV **sp;
+{
+ dTHR;
+ register char **a;
+ int rc;
+ int flag = P_WAIT, flag_set = 0;
+ STRLEN n_a;
+
+ if (sp > mark) {
+ New(1301,PL_Argv, sp - mark + 3, char*);
+ a = PL_Argv;
+
+ if (mark < sp && SvNIOKp(*(mark+1)) && !SvPOKp(*(mark+1))) {
+ ++mark;
+ flag = SvIVx(*mark);
+ flag_set = 1;
+
+ }
+
+ while (++mark <= sp) {
+ if (*mark)
+ *a++ = SvPVx(*mark, n_a);
+ else
+ *a++ = "";
+ }
+ *a = Nullch;
+
+ if (flag_set && (a == PL_Argv + 1)) { /* One arg? */
+ rc = do_spawn3(a[-1], EXECF_SPAWN_BYFLAG, flag);
+ } else
+ rc = do_spawn_ve(really, flag, EXECF_SPAWN, NULL, 0);
+ } else
+ rc = -1;
+ do_execfree();
+ return rc;
+}
+
int
do_spawn(cmd)
char *cmd;
{
- return do_spawn2(cmd, EXECF_SPAWN);
+ return do_spawn3(cmd, EXECF_SPAWN, 0);
}
int
do_spawn_nowait(cmd)
char *cmd;
{
- return do_spawn2(cmd, EXECF_SPAWN_NOWAIT);
+ return do_spawn3(cmd, EXECF_SPAWN_NOWAIT,0);
}
bool
do_exec(cmd)
char *cmd;
{
- do_spawn2(cmd, EXECF_EXEC);
+ do_spawn3(cmd, EXECF_EXEC, 0);
return FALSE;
}
os2exec(cmd)
char *cmd;
{
- return do_spawn2(cmd, EXECF_TRUEEXEC);
+ return do_spawn3(cmd, EXECF_TRUEEXEC, 0);
}
PerlIO *
-1.35:-1:-1.3
-0.006:-1:0
-0.006:-2:0
--0.0065:-3:-0.006
--0.0065:-4:-0.0065
--0.0065:-5:-0.0065
+-0.0065:-3:/-0\.006|-6e-03
+-0.0065:-4:/-0\.0065|-6\.5e-03
+-0.0065:-5:/-0\.0065|-6\.5e-03
$Math::BigFloat::rnd_mode = 'zero'
+2.23:-1:2.2
-2.23:-1:-2.2
+2.35:-1:2.3
-2.35:-1:-2.3
-0.0065:-1:0
--0.0065:-2:-0.01
--0.0065:-3:-0.006
--0.0065:-4:-0.0065
--0.0065:-5:-0.0065
+-0.0065:-2:/-0\.01|-1e-02
+-0.0065:-3:/-0\.006|-6e-03
+-0.0065:-4:/-0\.0065|-6\.5e-03
+-0.0065:-5:/-0\.0065|-6\.5e-03
$Math::BigFloat::rnd_mode = '+inf'
+3.23:-1:3.2
-3.23:-1:-3.2
+3.35:-1:3.4
-3.35:-1:-3.3
-0.0065:-1:0
--0.0065:-2:-0.01
--0.0065:-3:-0.006
--0.0065:-4:-0.0065
--0.0065:-5:-0.0065
+-0.0065:-2:/-0\.01|-1e-02
+-0.0065:-3:/-0\.006|-6e-03
+-0.0065:-4:/-0\.0065|-6\.5e-03
+-0.0065:-5:/-0\.0065|-6\.5e-03
$Math::BigFloat::rnd_mode = '-inf'
+4.23:-1:4.2
-4.23:-1:-4.2
+4.35:-1:4.3
-4.35:-1:-4.4
-0.0065:-1:0
--0.0065:-2:-0.01
--0.0065:-3:-0.007
--0.0065:-4:-0.0065
--0.0065:-5:-0.0065
+-0.0065:-2:/-0\.01|-1e-02
+-0.0065:-3:/-0\.007|-7e-03
+-0.0065:-4:/-0\.0065|-6\.5e-03
+-0.0065:-5:/-0\.0065|-6\.5e-03
$Math::BigFloat::rnd_mode = 'odd'
+5.23:-1:5.2
-5.23:-1:-5.2
+5.35:-1:5.3
-5.35:-1:-5.3
-0.0065:-1:0
--0.0065:-2:-0.01
--0.0065:-3:-0.007
--0.0065:-4:-0.0065
--0.0065:-5:-0.0065
+-0.0065:-2:/-0\.01|-1e-02
+-0.0065:-3:/-0\.007|-7e-03
+-0.0065:-4:/-0\.0065|-6\.5e-03
+-0.0065:-5:/-0\.0065|-6\.5e-03
$Math::BigFloat::rnd_mode = 'even'
+6.23:-1:6.2
-6.23:-1:-6.2
+6.35:-1:6.4
-6.35:-1:-6.4
-0.0065:-1:0
--0.0065:-2:-0.01
--0.0065:-3:-0.006
--0.0065:-4:-0.0065
--0.0065:-5:-0.0065
+-0.0065:-2:/-0\.01|-1e-02
+-0.0065:-3:/-0\.006|-6e-03
+-0.0065:-4:/-0\.0065|-6\.5e-03
+-0.0065:-5:/-0\.0065|-6\.5e-03
&fcmp
abc:abc:
abc:+0:
elsif ($Config{'extensions'} !~ /\bIO\b/) {
$reason = 'IO extension unavailable';
}
+ elsif ($^O eq 'os2') {
+ use IO::Socket;
+
+ eval {IO::Socket::pack_sockaddr_un('/tmp/foo') || 1}
+ or $@ !~ /not implemented/ or
+ $reason = 'compiled without TCP/IP stack v4';
+ }
undef $reason if $^O eq 'VMS' and $Config{d_socket};
if ($reason) {
print "1..0 # Skip: $reason\n";
quit();
}
+unless (eval { getgrgid(0); 1 }) {
+ print "1..0 # Skip: getgrgid() not implemented\n";
+ exit 0;
+}
+
# Remember that group names can contain whitespace, '-', et cetera.
# That is: do not \w, do not \S.
if ($groups =~ /groups=(.+)( [ug]id=|$)/) {
$DEV = `ls -l /dev` unless $Is_Dosish;
unlink "Op.stat.tmp";
-open(FOO, ">Op.stat.tmp");
-
-# hack to make Apollo update link count:
-$junk = `ls Op.stat.tmp` unless ($Is_MSWin32 || $Is_Dos);
-
-($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
- $blksize,$blocks) = stat(FOO);
-if ($nlink == 1) {print "ok 1\n";} else {print "not ok 1\n";}
-if ($Is_MSWin32 || ($mtime && $mtime == $ctime)) {print "ok 2\n";}
-else {print "# |$mtime| vs |$ctime|\nnot ok 2\n";}
-
-print FOO "Now is the time for all good men to come to.\n";
-close(FOO);
-
-sleep 2;
+if (open(FOO, ">Op.stat.tmp")) {
+ # hack to make Apollo update link count:
+ $junk = `ls Op.stat.tmp` unless ($Is_MSWin32 || $Is_Dos);
+
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat(FOO);
+ if ($nlink == 1) {
+ print "ok 1\n";
+ }
+ else {
+ print "# res=$res, nlink=$nlink.\nnot ok 1\n";
+ }
+ if ($Is_MSWin32 || ($mtime && $mtime == $ctime)) {
+ print "ok 2\n";
+ }
+ else {
+ print "# |$mtime| vs |$ctime|\nnot ok 2\n";
+ }
+
+ print FOO "Now is the time for all good men to come to.\n";
+ close(FOO);
+
+ sleep 2;
+} else {
+ print "# open failed: $!\nnot ok 1\nnot ok 2\n";
+}
-if ($Is_Dosish) { unlink "Op.stat.tmp2" }
+if ($Is_Dosish) { unlink "Op.stat.tmp2"}
else {
`rm -f Op.stat.tmp2;ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`;
}
}
print "#4 :$mtime: should != :$ctime:\n";
-unlink "Op.stat.tmp";
+unlink "Op.stat.tmp" or print "# unlink failed: $!\n";
if ($Is_MSWin32) { open F, '>Op.stat.tmp' and close F }
else { `touch Op.stat.tmp` }
if (! -z 'Op.stat.tmp') {print "ok 7\n";} else {print "not ok 7\n";}
if (-s 'Op.stat.tmp') {print "ok 8\n";} else {print "not ok 8\n";}
-unlink 'Op.stat.tmp';
+unlink 'Op.stat.tmp' or print "# unlink failed: $!\n";
$olduid = $>; # can't test -r if uid == 0
$Is_MSWin32 ? `cmd /c echo hi > Op.stat.tmp` : `echo hi >Op.stat.tmp`;
chmod 0,'Op.stat.tmp';
# in ms windows, Op.stat.tmp inherits owner uid from directory
# not sure about os/2, but chown is harmless anyway
-chown $>,'Op.stat.tmp';
+eval { chown $>,'Op.stat.tmp'; 1 } or print "# $@" ;
chmod 0700,'Op.stat.tmp';
if (-r 'Op.stat.tmp') {print "ok 18\n";} else {print "not ok 18\n";}
if (-w 'Op.stat.tmp') {print "ok 19\n";} else {print "not ok 19\n";}
if (-f) {print "ok 57\n";} else {print "not ok 57\n";}
if (-f()) {print "ok 58\n";} else {print "not ok 58\n";}
-unlink 'Op.stat.tmp';
+unlink 'Op.stat.tmp' or print "# unlink failed: $!\n";
PerlLIO_dup2(p[THIS], *mode == 'r');
PerlLIO_close(p[THIS]);
}
+#ifndef OS2
if (doexec) {
#if !defined(HAS_FCNTL) || !defined(F_SETFD)
int fd;
do_exec3(cmd,pp[1],did_pipes); /* may or may not use the shell */
PerlProc__exit(1);
}
+#endif /* defined OS2 */
/*SUPPRESS 560*/
if (tmpgv = gv_fetchpv("$",TRUE, SVt_PV))
sv_setiv(GvSV(tmpgv), (IV)getpid());